@unlikeotherai/unloved 0.3.1 → 0.3.3

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.
@@ -0,0 +1,222 @@
1
+ var ng=e=>{throw TypeError(e)};var lg=(e,i,n)=>i.has(e)||ng("Cannot "+n);var ol=(e,i,n)=>(lg(e,i,"read from private field"),n?n.call(e):i.get(e)),ag=(e,i,n)=>i.has(e)?ng("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,n),og=(e,i,n,l)=>(lg(e,i,"write to private field"),l?l.call(e,n):i.set(e,n),n);(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const h of o)if(h.type==="childList")for(const d of h.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function n(o){const h={};return o.integrity&&(h.integrity=o.integrity),o.referrerPolicy&&(h.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?h.credentials="include":o.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function l(o){if(o.ep)return;o.ep=!0;const h=n(o);fetch(o.href,h)}})();function Ty(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hh={exports:{}},cl={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var cg;function Ay(){if(cg)return cl;cg=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function n(l,o,h){var d=null;if(h!==void 0&&(d=""+h),o.key!==void 0&&(d=""+o.key),"key"in o){h={};for(var _ in o)_!=="key"&&(h[_]=o[_])}else h=o;return o=h.ref,{$$typeof:e,type:l,key:d,ref:o!==void 0?o:null,props:h}}return cl.Fragment=i,cl.jsx=n,cl.jsxs=n,cl}var hg;function By(){return hg||(hg=1,Hh.exports=Ay()),Hh.exports}var R=By(),Uh={exports:{}},hl={},Ph={exports:{}},jh={};/**
10
+ * @license React
11
+ * scheduler.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var ug;function zy(){return ug||(ug=1,(function(e){function i(M,q){var j=M.length;M.push(q);e:for(;0<j;){var ce=j-1>>>1,w=M[ce];if(0<o(w,q))M[ce]=q,M[j]=w,j=ce;else break e}}function n(M){return M.length===0?null:M[0]}function l(M){if(M.length===0)return null;var q=M[0],j=M.pop();if(j!==q){M[0]=j;e:for(var ce=0,w=M.length,Y=w>>>1;ce<Y;){var J=2*(ce+1)-1,Z=M[J],se=J+1,ve=M[se];if(0>o(Z,j))se<w&&0>o(ve,Z)?(M[ce]=ve,M[se]=j,ce=se):(M[ce]=Z,M[J]=j,ce=J);else if(se<w&&0>o(ve,j))M[ce]=ve,M[se]=j,ce=se;else break e}}return q}function o(M,q){var j=M.sortIndex-q.sortIndex;return j!==0?j:M.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;e.unstable_now=function(){return h.now()}}else{var d=Date,_=d.now();e.unstable_now=function(){return d.now()-_}}var v=[],f=[],p=1,S=null,y=3,E=!1,C=!1,x=!1,z=!1,T=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function P(M){for(var q=n(f);q!==null;){if(q.callback===null)l(f);else if(q.startTime<=M)l(f),q.sortIndex=q.expirationTime,i(v,q);else break;q=n(f)}}function H(M){if(x=!1,P(M),!C)if(n(v)!==null)C=!0,ee||(ee=!0,$());else{var q=n(f);q!==null&&F(H,q.startTime-M)}}var ee=!1,ae=-1,_e=5,Te=-1;function Je(){return z?!0:!(e.unstable_now()-Te<_e)}function ie(){if(z=!1,ee){var M=e.unstable_now();Te=M;var q=!0;try{e:{C=!1,x&&(x=!1,L(ae),ae=-1),E=!0;var j=y;try{t:{for(P(M),S=n(v);S!==null&&!(S.expirationTime>M&&Je());){var ce=S.callback;if(typeof ce=="function"){S.callback=null,y=S.priorityLevel;var w=ce(S.expirationTime<=M);if(M=e.unstable_now(),typeof w=="function"){S.callback=w,P(M),q=!0;break t}S===n(v)&&l(v),P(M)}else l(v);S=n(v)}if(S!==null)q=!0;else{var Y=n(f);Y!==null&&F(H,Y.startTime-M),q=!1}}break e}finally{S=null,y=j,E=!1}q=void 0}}finally{q?$():ee=!1}}}var $;if(typeof V=="function")$=function(){V(ie)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,I=U.port2;U.port1.onmessage=ie,$=function(){I.postMessage(null)}}else $=function(){T(ie,0)};function F(M,q){ae=T(function(){M(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_e=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(M){switch(y){case 1:case 2:case 3:var q=3;break;default:q=y}var j=y;y=q;try{return M()}finally{y=j}},e.unstable_requestPaint=function(){z=!0},e.unstable_runWithPriority=function(M,q){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var j=y;y=M;try{return q()}finally{y=j}},e.unstable_scheduleCallback=function(M,q,j){var ce=e.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0<j?ce+j:ce):j=ce,M){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=j+w,M={id:p++,callback:q,priorityLevel:M,startTime:j,expirationTime:w,sortIndex:-1},j>ce?(M.sortIndex=j,i(f,M),n(v)===null&&M===n(f)&&(x?(L(ae),ae=-1):x=!0,F(H,j-ce))):(M.sortIndex=w,i(v,M),C||E||(C=!0,ee||(ee=!0,$()))),M},e.unstable_shouldYield=Je,e.unstable_wrapCallback=function(M){var q=y;return function(){var j=y;y=q;try{return M.apply(this,arguments)}finally{y=j}}}})(jh)),jh}var dg;function Oy(){return dg||(dg=1,Ph.exports=zy()),Ph.exports}var qh={exports:{}},ge={};/**
18
+ * @license React
19
+ * react.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var fg;function Ly(){if(fg)return ge;fg=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),d=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),S=Symbol.iterator;function y(w){return w===null||typeof w!="object"?null:(w=S&&w[S]||w["@@iterator"],typeof w=="function"?w:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,x={};function z(w,Y,J){this.props=w,this.context=Y,this.refs=x,this.updater=J||E}z.prototype.isReactComponent={},z.prototype.setState=function(w,Y){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,Y,"setState")},z.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function T(){}T.prototype=z.prototype;function L(w,Y,J){this.props=w,this.context=Y,this.refs=x,this.updater=J||E}var V=L.prototype=new T;V.constructor=L,C(V,z.prototype),V.isPureReactComponent=!0;var P=Array.isArray,H={H:null,A:null,T:null,S:null,V:null},ee=Object.prototype.hasOwnProperty;function ae(w,Y,J,Z,se,ve){return J=ve.ref,{$$typeof:e,type:w,key:Y,ref:J!==void 0?J:null,props:ve}}function _e(w,Y){return ae(w.type,Y,void 0,void 0,void 0,w.props)}function Te(w){return typeof w=="object"&&w!==null&&w.$$typeof===e}function Je(w){var Y={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(J){return Y[J]})}var ie=/\/+/g;function $(w,Y){return typeof w=="object"&&w!==null&&w.key!=null?Je(""+w.key):Y.toString(36)}function U(){}function I(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(U,U):(w.status="pending",w.then(function(Y){w.status==="pending"&&(w.status="fulfilled",w.value=Y)},function(Y){w.status==="pending"&&(w.status="rejected",w.reason=Y)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function F(w,Y,J,Z,se){var ve=typeof w;(ve==="undefined"||ve==="boolean")&&(w=null);var re=!1;if(w===null)re=!0;else switch(ve){case"bigint":case"string":case"number":re=!0;break;case"object":switch(w.$$typeof){case e:case i:re=!0;break;case p:return re=w._init,F(re(w._payload),Y,J,Z,se)}}if(re)return se=se(w),re=Z===""?"."+$(w,0):Z,P(se)?(J="",re!=null&&(J=re.replace(ie,"$&/")+"/"),F(se,Y,J,"",function(nt){return nt})):se!=null&&(Te(se)&&(se=_e(se,J+(se.key==null||w&&w.key===se.key?"":(""+se.key).replace(ie,"$&/")+"/")+re)),Y.push(se)),1;re=0;var Ue=Z===""?".":Z+":";if(P(w))for(var Me=0;Me<w.length;Me++)Z=w[Me],ve=Ue+$(Z,Me),re+=F(Z,Y,J,ve,se);else if(Me=y(w),typeof Me=="function")for(w=Me.call(w),Me=0;!(Z=w.next()).done;)Z=Z.value,ve=Ue+$(Z,Me++),re+=F(Z,Y,J,ve,se);else if(ve==="object"){if(typeof w.then=="function")return F(I(w),Y,J,Z,se);throw Y=String(w),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return re}function M(w,Y,J){if(w==null)return w;var Z=[],se=0;return F(w,Z,"","",function(ve){return Y.call(J,ve,se++)}),Z}function q(w){if(w._status===-1){var Y=w._result;Y=Y(),Y.then(function(J){(w._status===0||w._status===-1)&&(w._status=1,w._result=J)},function(J){(w._status===0||w._status===-1)&&(w._status=2,w._result=J)}),w._status===-1&&(w._status=0,w._result=Y)}if(w._status===1)return w._result.default;throw w._result}var j=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)};function ce(){}return ge.Children={map:M,forEach:function(w,Y,J){M(w,function(){Y.apply(this,arguments)},J)},count:function(w){var Y=0;return M(w,function(){Y++}),Y},toArray:function(w){return M(w,function(Y){return Y})||[]},only:function(w){if(!Te(w))throw Error("React.Children.only expected to receive a single React element child.");return w}},ge.Component=z,ge.Fragment=n,ge.Profiler=o,ge.PureComponent=L,ge.StrictMode=l,ge.Suspense=v,ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,ge.__COMPILER_RUNTIME={__proto__:null,c:function(w){return H.H.useMemoCache(w)}},ge.cache=function(w){return function(){return w.apply(null,arguments)}},ge.cloneElement=function(w,Y,J){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var Z=C({},w.props),se=w.key,ve=void 0;if(Y!=null)for(re in Y.ref!==void 0&&(ve=void 0),Y.key!==void 0&&(se=""+Y.key),Y)!ee.call(Y,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&Y.ref===void 0||(Z[re]=Y[re]);var re=arguments.length-2;if(re===1)Z.children=J;else if(1<re){for(var Ue=Array(re),Me=0;Me<re;Me++)Ue[Me]=arguments[Me+2];Z.children=Ue}return ae(w.type,se,void 0,void 0,ve,Z)},ge.createContext=function(w){return w={$$typeof:d,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:h,_context:w},w},ge.createElement=function(w,Y,J){var Z,se={},ve=null;if(Y!=null)for(Z in Y.key!==void 0&&(ve=""+Y.key),Y)ee.call(Y,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(se[Z]=Y[Z]);var re=arguments.length-2;if(re===1)se.children=J;else if(1<re){for(var Ue=Array(re),Me=0;Me<re;Me++)Ue[Me]=arguments[Me+2];se.children=Ue}if(w&&w.defaultProps)for(Z in re=w.defaultProps,re)se[Z]===void 0&&(se[Z]=re[Z]);return ae(w,ve,void 0,void 0,null,se)},ge.createRef=function(){return{current:null}},ge.forwardRef=function(w){return{$$typeof:_,render:w}},ge.isValidElement=Te,ge.lazy=function(w){return{$$typeof:p,_payload:{_status:-1,_result:w},_init:q}},ge.memo=function(w,Y){return{$$typeof:f,type:w,compare:Y===void 0?null:Y}},ge.startTransition=function(w){var Y=H.T,J={};H.T=J;try{var Z=w(),se=H.S;se!==null&&se(J,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(ce,j)}catch(ve){j(ve)}finally{H.T=Y}},ge.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},ge.use=function(w){return H.H.use(w)},ge.useActionState=function(w,Y,J){return H.H.useActionState(w,Y,J)},ge.useCallback=function(w,Y){return H.H.useCallback(w,Y)},ge.useContext=function(w){return H.H.useContext(w)},ge.useDebugValue=function(){},ge.useDeferredValue=function(w,Y){return H.H.useDeferredValue(w,Y)},ge.useEffect=function(w,Y,J){var Z=H.H;if(typeof J=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return Z.useEffect(w,Y)},ge.useId=function(){return H.H.useId()},ge.useImperativeHandle=function(w,Y,J){return H.H.useImperativeHandle(w,Y,J)},ge.useInsertionEffect=function(w,Y){return H.H.useInsertionEffect(w,Y)},ge.useLayoutEffect=function(w,Y){return H.H.useLayoutEffect(w,Y)},ge.useMemo=function(w,Y){return H.H.useMemo(w,Y)},ge.useOptimistic=function(w,Y){return H.H.useOptimistic(w,Y)},ge.useReducer=function(w,Y,J){return H.H.useReducer(w,Y,J)},ge.useRef=function(w){return H.H.useRef(w)},ge.useState=function(w){return H.H.useState(w)},ge.useSyncExternalStore=function(w,Y,J){return H.H.useSyncExternalStore(w,Y,J)},ge.useTransition=function(){return H.H.useTransition()},ge.version="19.1.0",ge}var _g;function Gu(){return _g||(_g=1,qh.exports=Ly()),qh.exports}var Wh={exports:{}},Mt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var vg;function Ny(){if(vg)return Mt;vg=1;var e=Gu();function i(v){var f="https://react.dev/errors/"+v;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+v+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var l={d:{f:n,r:function(){throw Error(i(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function h(v,f,p){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:S==null?null:""+S,children:v,containerInfo:f,implementation:p}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function _(v,f){if(v==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Mt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Mt.createPortal=function(v,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(i(299));return h(v,f,null,p)},Mt.flushSync=function(v){var f=d.T,p=l.p;try{if(d.T=null,l.p=2,v)return v()}finally{d.T=f,l.p=p,l.d.f()}},Mt.preconnect=function(v,f){typeof v=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,l.d.C(v,f))},Mt.prefetchDNS=function(v){typeof v=="string"&&l.d.D(v)},Mt.preinit=function(v,f){if(typeof v=="string"&&f&&typeof f.as=="string"){var p=f.as,S=_(p,f.crossOrigin),y=typeof f.integrity=="string"?f.integrity:void 0,E=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?l.d.S(v,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:S,integrity:y,fetchPriority:E}):p==="script"&&l.d.X(v,{crossOrigin:S,integrity:y,fetchPriority:E,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Mt.preinitModule=function(v,f){if(typeof v=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=_(f.as,f.crossOrigin);l.d.M(v,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&l.d.M(v)},Mt.preload=function(v,f){if(typeof v=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,S=_(p,f.crossOrigin);l.d.L(v,p,{crossOrigin:S,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Mt.preloadModule=function(v,f){if(typeof v=="string")if(f){var p=_(f.as,f.crossOrigin);l.d.m(v,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else l.d.m(v)},Mt.requestFormReset=function(v){l.d.r(v)},Mt.unstable_batchedUpdates=function(v,f){return v(f)},Mt.useFormState=function(v,f,p){return d.H.useFormState(v,f,p)},Mt.useFormStatus=function(){return d.H.useHostTransitionStatus()},Mt.version="19.1.0",Mt}var gg;function $p(){if(gg)return Wh.exports;gg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Wh.exports=Ny(),Wh.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var pg;function Hy(){if(pg)return hl;pg=1;var e=Oy(),i=Gu(),n=$p();function l(t){var s="https://react.dev/errors/"+t;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)s+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+t+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function h(t){var s=t,r=t;if(t.alternate)for(;s.return;)s=s.return;else{t=s;do s=t,(s.flags&4098)!==0&&(r=s.return),t=s.return;while(t)}return s.tag===3?r:null}function d(t){if(t.tag===13){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function _(t){if(h(t)!==t)throw Error(l(188))}function v(t){var s=t.alternate;if(!s){if(s=h(t),s===null)throw Error(l(188));return s!==t?null:t}for(var r=t,a=s;;){var c=r.return;if(c===null)break;var u=c.alternate;if(u===null){if(a=c.return,a!==null){r=a;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===r)return _(c),t;if(u===a)return _(c),s;u=u.sibling}throw Error(l(188))}if(r.return!==a.return)r=c,a=u;else{for(var g=!1,m=c.child;m;){if(m===r){g=!0,r=c,a=u;break}if(m===a){g=!0,a=c,r=u;break}m=m.sibling}if(!g){for(m=u.child;m;){if(m===r){g=!0,r=u,a=c;break}if(m===a){g=!0,a=u,r=c;break}m=m.sibling}if(!g)throw Error(l(189))}}if(r.alternate!==a)throw Error(l(190))}if(r.tag!==3)throw Error(l(188));return r.stateNode.current===r?t:s}function f(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t;for(t=t.child;t!==null;){if(s=f(t),s!==null)return s;t=t.sibling}return null}var p=Object.assign,S=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),L=Symbol.for("react.consumer"),V=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),ae=Symbol.for("react.memo"),_e=Symbol.for("react.lazy"),Te=Symbol.for("react.activity"),Je=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function $(t){return t===null||typeof t!="object"?null:(t=ie&&t[ie]||t["@@iterator"],typeof t=="function"?t:null)}var U=Symbol.for("react.client.reference");function I(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===U?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case C:return"Fragment";case z:return"Profiler";case x:return"StrictMode";case H:return"Suspense";case ee:return"SuspenseList";case Te:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case V:return(t.displayName||"Context")+".Provider";case L:return(t._context.displayName||"Context")+".Consumer";case P:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ae:return s=t.displayName||null,s!==null?s:I(t.type)||"Memo";case _e:s=t._payload,t=t._init;try{return I(t(s))}catch{}}return null}var F=Array.isArray,M=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j={pending:!1,data:null,method:null,action:null},ce=[],w=-1;function Y(t){return{current:t}}function J(t){0>w||(t.current=ce[w],ce[w]=null,w--)}function Z(t,s){w++,ce[w]=t.current,t.current=s}var se=Y(null),ve=Y(null),re=Y(null),Ue=Y(null);function Me(t,s){switch(Z(re,s),Z(ve,t),Z(se,null),s.nodeType){case 9:case 11:t=(t=s.documentElement)&&(t=t.namespaceURI)?zv(t):0;break;default:if(t=s.tagName,s=s.namespaceURI)s=zv(s),t=Ov(s,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}J(se),Z(se,t)}function nt(){J(se),J(ve),J(re)}function es(t){t.memoizedState!==null&&Z(Ue,t);var s=se.current,r=Ov(s,t.type);s!==r&&(Z(ve,t),Z(se,r))}function mi(t){ve.current===t&&(J(se),J(ve)),Ue.current===t&&(J(Ue),sl._currentValue=j)}var ei=Object.prototype.hasOwnProperty,xe=e.unstable_scheduleCallback,zs=e.unstable_cancelCallback,o0=e.unstable_shouldYield,c0=e.unstable_requestPaint,Si=e.unstable_now,h0=e.unstable_getCurrentPriorityLevel,dd=e.unstable_ImmediatePriority,fd=e.unstable_UserBlockingPriority,zl=e.unstable_NormalPriority,u0=e.unstable_LowPriority,_d=e.unstable_IdlePriority,d0=e.log,f0=e.unstable_setDisableYieldValue,un=null,Yt=null;function ts(t){if(typeof d0=="function"&&f0(t),Yt&&typeof Yt.setStrictMode=="function")try{Yt.setStrictMode(un,t)}catch{}}var Kt=Math.clz32?Math.clz32:g0,_0=Math.log,v0=Math.LN2;function g0(t){return t>>>=0,t===0?32:31-(_0(t)/v0|0)|0}var Ol=256,Ll=4194304;function Os(t){var s=t&42;if(s!==0)return s;switch(t&-t){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:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Nl(t,s,r){var a=t.pendingLanes;if(a===0)return 0;var c=0,u=t.suspendedLanes,g=t.pingedLanes;t=t.warmLanes;var m=a&134217727;return m!==0?(a=m&~u,a!==0?c=Os(a):(g&=m,g!==0?c=Os(g):r||(r=m&~t,r!==0&&(c=Os(r))))):(m=a&~u,m!==0?c=Os(m):g!==0?c=Os(g):r||(r=a&~t,r!==0&&(c=Os(r)))),c===0?0:s!==0&&s!==c&&(s&u)===0&&(u=c&-c,r=s&-s,u>=r||u===32&&(r&4194048)!==0)?s:c}function dn(t,s){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&s)===0}function p0(t,s){switch(t){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 vd(){var t=Ol;return Ol<<=1,(Ol&4194048)===0&&(Ol=256),t}function gd(){var t=Ll;return Ll<<=1,(Ll&62914560)===0&&(Ll=4194304),t}function ko(t){for(var s=[],r=0;31>r;r++)s.push(t);return s}function fn(t,s){t.pendingLanes|=s,s!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function m0(t,s,r,a,c,u){var g=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var m=t.entanglements,b=t.expirationTimes,B=t.hiddenUpdates;for(r=g&~r;0<r;){var W=31-Kt(r),G=1<<W;m[W]=0,b[W]=-1;var O=B[W];if(O!==null)for(B[W]=null,W=0;W<O.length;W++){var N=O[W];N!==null&&(N.lane&=-536870913)}r&=~G}a!==0&&pd(t,a,0),u!==0&&c===0&&t.tag!==0&&(t.suspendedLanes|=u&~(g&~s))}function pd(t,s,r){t.pendingLanes|=s,t.suspendedLanes&=~s;var a=31-Kt(s);t.entangledLanes|=s,t.entanglements[a]=t.entanglements[a]|1073741824|r&4194090}function md(t,s){var r=t.entangledLanes|=s;for(t=t.entanglements;r;){var a=31-Kt(r),c=1<<a;c&s|t[a]&s&&(t[a]|=s),r&=~c}}function Mo(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Do(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Sd(){var t=q.p;return t!==0?t:(t=window.event,t===void 0?32:Jv(t.type))}function S0(t,s){var r=q.p;try{return q.p=t,s()}finally{q.p=r}}var is=Math.random().toString(36).slice(2),Et="__reactFiber$"+is,Nt="__reactProps$"+is,dr="__reactContainer$"+is,Ro="__reactEvents$"+is,y0="__reactListeners$"+is,b0="__reactHandles$"+is,yd="__reactResources$"+is,_n="__reactMarker$"+is;function To(t){delete t[Et],delete t[Nt],delete t[Ro],delete t[y0],delete t[b0]}function fr(t){var s=t[Et];if(s)return s;for(var r=t.parentNode;r;){if(s=r[dr]||r[Et]){if(r=s.alternate,s.child!==null||r!==null&&r.child!==null)for(t=Uv(t);t!==null;){if(r=t[Et])return r;t=Uv(t)}return s}t=r,r=t.parentNode}return null}function _r(t){if(t=t[Et]||t[dr]){var s=t.tag;if(s===5||s===6||s===13||s===26||s===27||s===3)return t}return null}function vn(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t.stateNode;throw Error(l(33))}function vr(t){var s=t[yd];return s||(s=t[yd]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function ut(t){t[_n]=!0}var bd=new Set,wd={};function Ls(t,s){gr(t,s),gr(t+"Capture",s)}function gr(t,s){for(wd[t]=s,t=0;t<s.length;t++)bd.add(s[t])}var w0=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]*$"),Cd={},xd={};function C0(t){return ei.call(xd,t)?!0:ei.call(Cd,t)?!1:w0.test(t)?xd[t]=!0:(Cd[t]=!0,!1)}function Hl(t,s,r){if(C0(s))if(r===null)t.removeAttribute(s);else{switch(typeof r){case"undefined":case"function":case"symbol":t.removeAttribute(s);return;case"boolean":var a=s.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){t.removeAttribute(s);return}}t.setAttribute(s,""+r)}}function Ul(t,s,r){if(r===null)t.removeAttribute(s);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttribute(s,""+r)}}function zi(t,s,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttributeNS(s,r,""+a)}}var Ao,Ed;function pr(t){if(Ao===void 0)try{throw Error()}catch(r){var s=r.stack.trim().match(/\n( *(at )?)/);Ao=s&&s[1]||"",Ed=-1<r.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Ao+t+Ed}var Bo=!1;function zo(t,s){if(!t||Bo)return"";Bo=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(s){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(N){var O=N}Reflect.construct(t,[],G)}else{try{G.call()}catch(N){O=N}t.call(G.prototype)}}else{try{throw Error()}catch(N){O=N}(G=t())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(N){if(N&&O&&typeof N.stack=="string")return[N.stack,O.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),g=u[0],m=u[1];if(g&&m){var b=g.split(`
44
+ `),B=m.split(`
45
+ `);for(c=a=0;a<b.length&&!b[a].includes("DetermineComponentFrameRoot");)a++;for(;c<B.length&&!B[c].includes("DetermineComponentFrameRoot");)c++;if(a===b.length||c===B.length)for(a=b.length-1,c=B.length-1;1<=a&&0<=c&&b[a]!==B[c];)c--;for(;1<=a&&0<=c;a--,c--)if(b[a]!==B[c]){if(a!==1||c!==1)do if(a--,c--,0>c||b[a]!==B[c]){var W=`
46
+ `+b[a].replace(" at new "," at ");return t.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",t.displayName)),W}while(1<=a&&0<=c);break}}}finally{Bo=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?pr(r):""}function x0(t){switch(t.tag){case 26:case 27:case 5:return pr(t.type);case 16:return pr("Lazy");case 13:return pr("Suspense");case 19:return pr("SuspenseList");case 0:case 15:return zo(t.type,!1);case 11:return zo(t.type.render,!1);case 1:return zo(t.type,!0);case 31:return pr("Activity");default:return""}}function kd(t){try{var s="";do s+=x0(t),t=t.return;while(t);return s}catch(r){return`
47
+ Error generating stack: `+r.message+`
48
+ `+r.stack}}function ti(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Md(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function E0(t){var s=Md(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,s),a=""+t[s];if(!t.hasOwnProperty(s)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,u=r.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return c.call(this)},set:function(g){a=""+g,u.call(this,g)}}),Object.defineProperty(t,s,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(g){a=""+g},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function Pl(t){t._valueTracker||(t._valueTracker=E0(t))}function Dd(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var r=s.getValue(),a="";return t&&(a=Md(t)?t.checked?"true":"false":t.value),t=a,t!==r?(s.setValue(t),!0):!1}function jl(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var k0=/[\n"\\]/g;function ii(t){return t.replace(k0,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Oo(t,s,r,a,c,u,g,m){t.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?t.type=g:t.removeAttribute("type"),s!=null?g==="number"?(s===0&&t.value===""||t.value!=s)&&(t.value=""+ti(s)):t.value!==""+ti(s)&&(t.value=""+ti(s)):g!=="submit"&&g!=="reset"||t.removeAttribute("value"),s!=null?Lo(t,g,ti(s)):r!=null?Lo(t,g,ti(r)):a!=null&&t.removeAttribute("value"),c==null&&u!=null&&(t.defaultChecked=!!u),c!=null&&(t.checked=c&&typeof c!="function"&&typeof c!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?t.name=""+ti(m):t.removeAttribute("name")}function Rd(t,s,r,a,c,u,g,m){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(t.type=u),s!=null||r!=null){if(!(u!=="submit"&&u!=="reset"||s!=null))return;r=r!=null?""+ti(r):"",s=s!=null?""+ti(s):r,m||s===t.value||(t.value=s),t.defaultValue=s}a=a??c,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=m?t.checked:!!a,t.defaultChecked=!!a,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.name=g)}function Lo(t,s,r){s==="number"&&jl(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function mr(t,s,r,a){if(t=t.options,s){s={};for(var c=0;c<r.length;c++)s["$"+r[c]]=!0;for(r=0;r<t.length;r++)c=s.hasOwnProperty("$"+t[r].value),t[r].selected!==c&&(t[r].selected=c),c&&a&&(t[r].defaultSelected=!0)}else{for(r=""+ti(r),s=null,c=0;c<t.length;c++){if(t[c].value===r){t[c].selected=!0,a&&(t[c].defaultSelected=!0);return}s!==null||t[c].disabled||(s=t[c])}s!==null&&(s.selected=!0)}}function Td(t,s,r){if(s!=null&&(s=""+ti(s),s!==t.value&&(t.value=s),r==null)){t.defaultValue!==s&&(t.defaultValue=s);return}t.defaultValue=r!=null?""+ti(r):""}function Ad(t,s,r,a){if(s==null){if(a!=null){if(r!=null)throw Error(l(92));if(F(a)){if(1<a.length)throw Error(l(93));a=a[0]}r=a}r==null&&(r=""),s=r}r=ti(s),t.defaultValue=r,a=t.textContent,a===r&&a!==""&&a!==null&&(t.value=a)}function Sr(t,s){if(s){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=s;return}}t.textContent=s}var M0=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 Bd(t,s,r){var a=s.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?a?t.setProperty(s,""):s==="float"?t.cssFloat="":t[s]="":a?t.setProperty(s,r):typeof r!="number"||r===0||M0.has(s)?s==="float"?t.cssFloat=r:t[s]=(""+r).trim():t[s]=r+"px"}function zd(t,s,r){if(s!=null&&typeof s!="object")throw Error(l(62));if(t=t.style,r!=null){for(var a in r)!r.hasOwnProperty(a)||s!=null&&s.hasOwnProperty(a)||(a.indexOf("--")===0?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="");for(var c in s)a=s[c],s.hasOwnProperty(c)&&r[c]!==a&&Bd(t,c,a)}else for(var u in s)s.hasOwnProperty(u)&&Bd(t,u,s[u])}function No(t){if(t.indexOf("-")===-1)return!1;switch(t){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 D0=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"]]),R0=/^[\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 ql(t){return R0.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var Ho=null;function Uo(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var yr=null,br=null;function Od(t){var s=_r(t);if(s&&(t=s.stateNode)){var r=t[Nt]||null;e:switch(t=s.stateNode,s.type){case"input":if(Oo(t,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),s=r.name,r.type==="radio"&&s!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+ii(""+s)+'"][type="radio"]'),s=0;s<r.length;s++){var a=r[s];if(a!==t&&a.form===t.form){var c=a[Nt]||null;if(!c)throw Error(l(90));Oo(a,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(s=0;s<r.length;s++)a=r[s],a.form===t.form&&Dd(a)}break e;case"textarea":Td(t,r.value,r.defaultValue);break e;case"select":s=r.value,s!=null&&mr(t,!!r.multiple,s,!1)}}}var Po=!1;function Ld(t,s,r){if(Po)return t(s,r);Po=!0;try{var a=t(s);return a}finally{if(Po=!1,(yr!==null||br!==null)&&(ka(),yr&&(s=yr,t=br,br=yr=null,Od(s),t)))for(s=0;s<t.length;s++)Od(t[s])}}function gn(t,s){var r=t.stateNode;if(r===null)return null;var a=r[Nt]||null;if(a===null)return null;r=a[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(t=t.type,a=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!a;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(l(231,s,typeof r));return r}var Oi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jo=!1;if(Oi)try{var pn={};Object.defineProperty(pn,"passive",{get:function(){jo=!0}}),window.addEventListener("test",pn,pn),window.removeEventListener("test",pn,pn)}catch{jo=!1}var ss=null,qo=null,Wl=null;function Nd(){if(Wl)return Wl;var t,s=qo,r=s.length,a,c="value"in ss?ss.value:ss.textContent,u=c.length;for(t=0;t<r&&s[t]===c[t];t++);var g=r-t;for(a=1;a<=g&&s[r-a]===c[u-a];a++);return Wl=c.slice(t,1<a?1-a:void 0)}function Yl(t){var s=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&s===13&&(t=13)):t=s,t===10&&(t=13),32<=t||t===13?t:0}function Kl(){return!0}function Hd(){return!1}function Ht(t){function s(r,a,c,u,g){this._reactName=r,this._targetInst=c,this.type=a,this.nativeEvent=u,this.target=g,this.currentTarget=null;for(var m in t)t.hasOwnProperty(m)&&(r=t[m],this[m]=r?r(u):u[m]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Kl:Hd,this.isPropagationStopped=Hd,this}return p(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Kl)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Kl)},persist:function(){},isPersistent:Kl}),s}var Ns={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vl=Ht(Ns),mn=p({},Ns,{view:0,detail:0}),T0=Ht(mn),Wo,Yo,Sn,Xl=p({},mn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vo,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Sn&&(Sn&&t.type==="mousemove"?(Wo=t.screenX-Sn.screenX,Yo=t.screenY-Sn.screenY):Yo=Wo=0,Sn=t),Wo)},movementY:function(t){return"movementY"in t?t.movementY:Yo}}),Ud=Ht(Xl),A0=p({},Xl,{dataTransfer:0}),B0=Ht(A0),z0=p({},mn,{relatedTarget:0}),Ko=Ht(z0),O0=p({},Ns,{animationName:0,elapsedTime:0,pseudoElement:0}),L0=Ht(O0),N0=p({},Ns,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),H0=Ht(N0),U0=p({},Ns,{data:0}),Pd=Ht(U0),P0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},j0={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"},q0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function W0(t){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(t):(t=q0[t])?!!s[t]:!1}function Vo(){return W0}var Y0=p({},mn,{key:function(t){if(t.key){var s=P0[t.key]||t.key;if(s!=="Unidentified")return s}return t.type==="keypress"?(t=Yl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?j0[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vo,charCode:function(t){return t.type==="keypress"?Yl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Yl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),K0=Ht(Y0),V0=p({},Xl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jd=Ht(V0),X0=p({},mn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vo}),G0=Ht(X0),$0=p({},Ns,{propertyName:0,elapsedTime:0,pseudoElement:0}),F0=Ht($0),I0=p({},Xl,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Z0=Ht(I0),Q0=p({},Ns,{newState:0,oldState:0}),J0=Ht(Q0),eS=[9,13,27,32],Xo=Oi&&"CompositionEvent"in window,yn=null;Oi&&"documentMode"in document&&(yn=document.documentMode);var tS=Oi&&"TextEvent"in window&&!yn,qd=Oi&&(!Xo||yn&&8<yn&&11>=yn),Wd=" ",Yd=!1;function Kd(t,s){switch(t){case"keyup":return eS.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vd(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var wr=!1;function iS(t,s){switch(t){case"compositionend":return Vd(s);case"keypress":return s.which!==32?null:(Yd=!0,Wd);case"textInput":return t=s.data,t===Wd&&Yd?null:t;default:return null}}function sS(t,s){if(wr)return t==="compositionend"||!Xo&&Kd(t,s)?(t=Nd(),Wl=qo=ss=null,wr=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return qd&&s.locale!=="ko"?null:s.data;default:return null}}var rS={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 Xd(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s==="input"?!!rS[t.type]:s==="textarea"}function Gd(t,s,r,a){yr?br?br.push(a):br=[a]:yr=a,s=Ba(s,"onChange"),0<s.length&&(r=new Vl("onChange","change",null,r,a),t.push({event:r,listeners:s}))}var bn=null,wn=null;function nS(t){Dv(t,0)}function Gl(t){var s=vn(t);if(Dd(s))return t}function $d(t,s){if(t==="change")return s}var Fd=!1;if(Oi){var Go;if(Oi){var $o="oninput"in document;if(!$o){var Id=document.createElement("div");Id.setAttribute("oninput","return;"),$o=typeof Id.oninput=="function"}Go=$o}else Go=!1;Fd=Go&&(!document.documentMode||9<document.documentMode)}function Zd(){bn&&(bn.detachEvent("onpropertychange",Qd),wn=bn=null)}function Qd(t){if(t.propertyName==="value"&&Gl(wn)){var s=[];Gd(s,wn,t,Uo(t)),Ld(nS,s)}}function lS(t,s,r){t==="focusin"?(Zd(),bn=s,wn=r,bn.attachEvent("onpropertychange",Qd)):t==="focusout"&&Zd()}function aS(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Gl(wn)}function oS(t,s){if(t==="click")return Gl(s)}function cS(t,s){if(t==="input"||t==="change")return Gl(s)}function hS(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var Vt=typeof Object.is=="function"?Object.is:hS;function Cn(t,s){if(Vt(t,s))return!0;if(typeof t!="object"||t===null||typeof s!="object"||s===null)return!1;var r=Object.keys(t),a=Object.keys(s);if(r.length!==a.length)return!1;for(a=0;a<r.length;a++){var c=r[a];if(!ei.call(s,c)||!Vt(t[c],s[c]))return!1}return!0}function Jd(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function ef(t,s){var r=Jd(t);t=0;for(var a;r;){if(r.nodeType===3){if(a=t+r.textContent.length,t<=s&&a>=s)return{node:r,offset:s-t};t=a}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Jd(r)}}function tf(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?tf(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function sf(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var s=jl(t.document);s instanceof t.HTMLIFrameElement;){try{var r=typeof s.contentWindow.location.href=="string"}catch{r=!1}if(r)t=s.contentWindow;else break;s=jl(t.document)}return s}function Fo(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s&&(s==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||s==="textarea"||t.contentEditable==="true")}var uS=Oi&&"documentMode"in document&&11>=document.documentMode,Cr=null,Io=null,xn=null,Zo=!1;function rf(t,s,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Zo||Cr==null||Cr!==jl(a)||(a=Cr,"selectionStart"in a&&Fo(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),xn&&Cn(xn,a)||(xn=a,a=Ba(Io,"onSelect"),0<a.length&&(s=new Vl("onSelect","select",null,s,r),t.push({event:s,listeners:a}),s.target=Cr)))}function Hs(t,s){var r={};return r[t.toLowerCase()]=s.toLowerCase(),r["Webkit"+t]="webkit"+s,r["Moz"+t]="moz"+s,r}var xr={animationend:Hs("Animation","AnimationEnd"),animationiteration:Hs("Animation","AnimationIteration"),animationstart:Hs("Animation","AnimationStart"),transitionrun:Hs("Transition","TransitionRun"),transitionstart:Hs("Transition","TransitionStart"),transitioncancel:Hs("Transition","TransitionCancel"),transitionend:Hs("Transition","TransitionEnd")},Qo={},nf={};Oi&&(nf=document.createElement("div").style,"AnimationEvent"in window||(delete xr.animationend.animation,delete xr.animationiteration.animation,delete xr.animationstart.animation),"TransitionEvent"in window||delete xr.transitionend.transition);function Us(t){if(Qo[t])return Qo[t];if(!xr[t])return t;var s=xr[t],r;for(r in s)if(s.hasOwnProperty(r)&&r in nf)return Qo[t]=s[r];return t}var lf=Us("animationend"),af=Us("animationiteration"),of=Us("animationstart"),dS=Us("transitionrun"),fS=Us("transitionstart"),_S=Us("transitioncancel"),cf=Us("transitionend"),hf=new Map,Jo="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(" ");Jo.push("scrollEnd");function _i(t,s){hf.set(t,s),Ls(s,[t])}var uf=new WeakMap;function si(t,s){if(typeof t=="object"&&t!==null){var r=uf.get(t);return r!==void 0?r:(s={value:t,source:s,stack:kd(s)},uf.set(t,s),s)}return{value:t,source:s,stack:kd(s)}}var ri=[],Er=0,ec=0;function $l(){for(var t=Er,s=ec=Er=0;s<t;){var r=ri[s];ri[s++]=null;var a=ri[s];ri[s++]=null;var c=ri[s];ri[s++]=null;var u=ri[s];if(ri[s++]=null,a!==null&&c!==null){var g=a.pending;g===null?c.next=c:(c.next=g.next,g.next=c),a.pending=c}u!==0&&df(r,c,u)}}function Fl(t,s,r,a){ri[Er++]=t,ri[Er++]=s,ri[Er++]=r,ri[Er++]=a,ec|=a,t.lanes|=a,t=t.alternate,t!==null&&(t.lanes|=a)}function tc(t,s,r,a){return Fl(t,s,r,a),Il(t)}function kr(t,s){return Fl(t,null,null,s),Il(t)}function df(t,s,r){t.lanes|=r;var a=t.alternate;a!==null&&(a.lanes|=r);for(var c=!1,u=t.return;u!==null;)u.childLanes|=r,a=u.alternate,a!==null&&(a.childLanes|=r),u.tag===22&&(t=u.stateNode,t===null||t._visibility&1||(c=!0)),t=u,u=u.return;return t.tag===3?(u=t.stateNode,c&&s!==null&&(c=31-Kt(r),t=u.hiddenUpdates,a=t[c],a===null?t[c]=[s]:a.push(s),s.lane=r|536870912),u):null}function Il(t){if(50<Fn)throw Fn=0,ah=null,Error(l(185));for(var s=t.return;s!==null;)t=s,s=t.return;return t.tag===3?t.stateNode:null}var Mr={};function vS(t,s,r,a){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xt(t,s,r,a){return new vS(t,s,r,a)}function ic(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Li(t,s){var r=t.alternate;return r===null?(r=Xt(t.tag,s,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=s,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&65011712,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,s=t.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r.refCleanup=t.refCleanup,r}function ff(t,s){t.flags&=65011714;var r=t.alternate;return r===null?(t.childLanes=0,t.lanes=s,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=r.childLanes,t.lanes=r.lanes,t.child=r.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=r.memoizedProps,t.memoizedState=r.memoizedState,t.updateQueue=r.updateQueue,t.type=r.type,s=r.dependencies,t.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),t}function Zl(t,s,r,a,c,u){var g=0;if(a=t,typeof t=="function")ic(t)&&(g=1);else if(typeof t=="string")g=py(t,r,se.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Te:return t=Xt(31,r,s,c),t.elementType=Te,t.lanes=u,t;case C:return Ps(r.children,c,u,s);case x:g=8,c|=24;break;case z:return t=Xt(12,r,s,c|2),t.elementType=z,t.lanes=u,t;case H:return t=Xt(13,r,s,c),t.elementType=H,t.lanes=u,t;case ee:return t=Xt(19,r,s,c),t.elementType=ee,t.lanes=u,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case T:case V:g=10;break e;case L:g=9;break e;case P:g=11;break e;case ae:g=14;break e;case _e:g=16,a=null;break e}g=29,r=Error(l(130,t===null?"null":typeof t,"")),a=null}return s=Xt(g,r,s,c),s.elementType=t,s.type=a,s.lanes=u,s}function Ps(t,s,r,a){return t=Xt(7,t,a,s),t.lanes=r,t}function sc(t,s,r){return t=Xt(6,t,null,s),t.lanes=r,t}function rc(t,s,r){return s=Xt(4,t.children!==null?t.children:[],t.key,s),s.lanes=r,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}var Dr=[],Rr=0,Ql=null,Jl=0,ni=[],li=0,js=null,Ni=1,Hi="";function qs(t,s){Dr[Rr++]=Jl,Dr[Rr++]=Ql,Ql=t,Jl=s}function _f(t,s,r){ni[li++]=Ni,ni[li++]=Hi,ni[li++]=js,js=t;var a=Ni;t=Hi;var c=32-Kt(a)-1;a&=~(1<<c),r+=1;var u=32-Kt(s)+c;if(30<u){var g=c-c%5;u=(a&(1<<g)-1).toString(32),a>>=g,c-=g,Ni=1<<32-Kt(s)+c|r<<c|a,Hi=u+t}else Ni=1<<u|r<<c|a,Hi=t}function nc(t){t.return!==null&&(qs(t,1),_f(t,1,0))}function lc(t){for(;t===Ql;)Ql=Dr[--Rr],Dr[Rr]=null,Jl=Dr[--Rr],Dr[Rr]=null;for(;t===js;)js=ni[--li],ni[li]=null,Hi=ni[--li],ni[li]=null,Ni=ni[--li],ni[li]=null}var Tt=null,Ve=null,ke=!1,Ws=null,yi=!1,ac=Error(l(519));function Ys(t){var s=Error(l(418,""));throw Mn(si(s,t)),ac}function vf(t){var s=t.stateNode,r=t.type,a=t.memoizedProps;switch(s[Et]=t,s[Nt]=a,r){case"dialog":we("cancel",s),we("close",s);break;case"iframe":case"object":case"embed":we("load",s);break;case"video":case"audio":for(r=0;r<Zn.length;r++)we(Zn[r],s);break;case"source":we("error",s);break;case"img":case"image":case"link":we("error",s),we("load",s);break;case"details":we("toggle",s);break;case"input":we("invalid",s),Rd(s,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0),Pl(s);break;case"select":we("invalid",s);break;case"textarea":we("invalid",s),Ad(s,a.value,a.defaultValue,a.children),Pl(s)}r=a.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||s.textContent===""+r||a.suppressHydrationWarning===!0||Bv(s.textContent,r)?(a.popover!=null&&(we("beforetoggle",s),we("toggle",s)),a.onScroll!=null&&we("scroll",s),a.onScrollEnd!=null&&we("scrollend",s),a.onClick!=null&&(s.onclick=za),s=!0):s=!1,s||Ys(t)}function gf(t){for(Tt=t.return;Tt;)switch(Tt.tag){case 5:case 13:yi=!1;return;case 27:case 3:yi=!0;return;default:Tt=Tt.return}}function En(t){if(t!==Tt)return!1;if(!ke)return gf(t),ke=!0,!1;var s=t.tag,r;if((r=s!==3&&s!==27)&&((r=s===5)&&(r=t.type,r=!(r!=="form"&&r!=="button")||Ch(t.type,t.memoizedProps)),r=!r),r&&Ve&&Ys(t),gf(t),s===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));e:{for(t=t.nextSibling,s=0;t;){if(t.nodeType===8)if(r=t.data,r==="/$"){if(s===0){Ve=gi(t.nextSibling);break e}s--}else r!=="$"&&r!=="$!"&&r!=="$?"||s++;t=t.nextSibling}Ve=null}}else s===27?(s=Ve,Ss(t.type)?(t=Mh,Mh=null,Ve=t):Ve=s):Ve=Tt?gi(t.stateNode.nextSibling):null;return!0}function kn(){Ve=Tt=null,ke=!1}function pf(){var t=Ws;return t!==null&&(jt===null?jt=t:jt.push.apply(jt,t),Ws=null),t}function Mn(t){Ws===null?Ws=[t]:Ws.push(t)}var oc=Y(null),Ks=null,Ui=null;function rs(t,s,r){Z(oc,s._currentValue),s._currentValue=r}function Pi(t){t._currentValue=oc.current,J(oc)}function cc(t,s,r){for(;t!==null;){var a=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,a!==null&&(a.childLanes|=s)):a!==null&&(a.childLanes&s)!==s&&(a.childLanes|=s),t===r)break;t=t.return}}function hc(t,s,r,a){var c=t.child;for(c!==null&&(c.return=t);c!==null;){var u=c.dependencies;if(u!==null){var g=c.child;u=u.firstContext;e:for(;u!==null;){var m=u;u=c;for(var b=0;b<s.length;b++)if(m.context===s[b]){u.lanes|=r,m=u.alternate,m!==null&&(m.lanes|=r),cc(u.return,r,t),a||(g=null);break e}u=m.next}}else if(c.tag===18){if(g=c.return,g===null)throw Error(l(341));g.lanes|=r,u=g.alternate,u!==null&&(u.lanes|=r),cc(g,r,t),g=null}else g=c.child;if(g!==null)g.return=c;else for(g=c;g!==null;){if(g===t){g=null;break}if(c=g.sibling,c!==null){c.return=g.return,g=c;break}g=g.return}c=g}}function Dn(t,s,r,a){t=null;for(var c=s,u=!1;c!==null;){if(!u){if((c.flags&524288)!==0)u=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var g=c.alternate;if(g===null)throw Error(l(387));if(g=g.memoizedProps,g!==null){var m=c.type;Vt(c.pendingProps.value,g.value)||(t!==null?t.push(m):t=[m])}}else if(c===Ue.current){if(g=c.alternate,g===null)throw Error(l(387));g.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(t!==null?t.push(sl):t=[sl])}c=c.return}t!==null&&hc(s,t,r,a),s.flags|=262144}function ea(t){for(t=t.firstContext;t!==null;){if(!Vt(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Vs(t){Ks=t,Ui=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function kt(t){return mf(Ks,t)}function ta(t,s){return Ks===null&&Vs(t),mf(t,s)}function mf(t,s){var r=s._currentValue;if(s={context:s,memoizedValue:r,next:null},Ui===null){if(t===null)throw Error(l(308));Ui=s,t.dependencies={lanes:0,firstContext:s},t.flags|=524288}else Ui=Ui.next=s;return r}var gS=typeof AbortController<"u"?AbortController:function(){var t=[],s=this.signal={aborted:!1,addEventListener:function(r,a){t.push(a)}};this.abort=function(){s.aborted=!0,t.forEach(function(r){return r()})}},pS=e.unstable_scheduleCallback,mS=e.unstable_NormalPriority,lt={$$typeof:V,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function uc(){return{controller:new gS,data:new Map,refCount:0}}function Rn(t){t.refCount--,t.refCount===0&&pS(mS,function(){t.controller.abort()})}var Tn=null,dc=0,Tr=0,Ar=null;function SS(t,s){if(Tn===null){var r=Tn=[];dc=0,Tr=_h(),Ar={status:"pending",value:void 0,then:function(a){r.push(a)}}}return dc++,s.then(Sf,Sf),s}function Sf(){if(--dc===0&&Tn!==null){Ar!==null&&(Ar.status="fulfilled");var t=Tn;Tn=null,Tr=0,Ar=null;for(var s=0;s<t.length;s++)(0,t[s])()}}function yS(t,s){var r=[],a={status:"pending",value:null,reason:null,then:function(c){r.push(c)}};return t.then(function(){a.status="fulfilled",a.value=s;for(var c=0;c<r.length;c++)(0,r[c])(s)},function(c){for(a.status="rejected",a.reason=c,c=0;c<r.length;c++)(0,r[c])(void 0)}),a}var yf=M.S;M.S=function(t,s){typeof s=="object"&&s!==null&&typeof s.then=="function"&&SS(t,s),yf!==null&&yf(t,s)};var Xs=Y(null);function fc(){var t=Xs.current;return t!==null?t:He.pooledCache}function ia(t,s){s===null?Z(Xs,Xs.current):Z(Xs,s.pool)}function bf(){var t=fc();return t===null?null:{parent:lt._currentValue,pool:t}}var An=Error(l(460)),wf=Error(l(474)),sa=Error(l(542)),_c={then:function(){}};function Cf(t){return t=t.status,t==="fulfilled"||t==="rejected"}function ra(){}function xf(t,s,r){switch(r=t[r],r===void 0?t.push(s):r!==s&&(s.then(ra,ra),s=r),s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,kf(t),t;default:if(typeof s.status=="string")s.then(ra,ra);else{if(t=He,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=s,t.status="pending",t.then(function(a){if(s.status==="pending"){var c=s;c.status="fulfilled",c.value=a}},function(a){if(s.status==="pending"){var c=s;c.status="rejected",c.reason=a}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,kf(t),t}throw Bn=s,An}}var Bn=null;function Ef(){if(Bn===null)throw Error(l(459));var t=Bn;return Bn=null,t}function kf(t){if(t===An||t===sa)throw Error(l(483))}var ns=!1;function vc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gc(t,s){t=t.updateQueue,s.updateQueue===t&&(s.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ls(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function as(t,s,r){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(De&2)!==0){var c=a.pending;return c===null?s.next=s:(s.next=c.next,c.next=s),a.pending=s,s=Il(t),df(t,null,r),s}return Fl(t,a,s,r),Il(t)}function zn(t,s,r){if(s=s.updateQueue,s!==null&&(s=s.shared,(r&4194048)!==0)){var a=s.lanes;a&=t.pendingLanes,r|=a,s.lanes=r,md(t,r)}}function pc(t,s){var r=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,r===a)){var c=null,u=null;if(r=r.firstBaseUpdate,r!==null){do{var g={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};u===null?c=u=g:u=u.next=g,r=r.next}while(r!==null);u===null?c=u=s:u=u.next=s}else c=u=s;r={baseState:a.baseState,firstBaseUpdate:c,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=s:t.next=s,r.lastBaseUpdate=s}var mc=!1;function On(){if(mc){var t=Ar;if(t!==null)throw t}}function Ln(t,s,r,a){mc=!1;var c=t.updateQueue;ns=!1;var u=c.firstBaseUpdate,g=c.lastBaseUpdate,m=c.shared.pending;if(m!==null){c.shared.pending=null;var b=m,B=b.next;b.next=null,g===null?u=B:g.next=B,g=b;var W=t.alternate;W!==null&&(W=W.updateQueue,m=W.lastBaseUpdate,m!==g&&(m===null?W.firstBaseUpdate=B:m.next=B,W.lastBaseUpdate=b))}if(u!==null){var G=c.baseState;g=0,W=B=b=null,m=u;do{var O=m.lane&-536870913,N=O!==m.lane;if(N?(Ce&O)===O:(a&O)===O){O!==0&&O===Tr&&(mc=!0),W!==null&&(W=W.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});e:{var de=t,he=m;O=s;var ze=r;switch(he.tag){case 1:if(de=he.payload,typeof de=="function"){G=de.call(ze,G,O);break e}G=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=he.payload,O=typeof de=="function"?de.call(ze,G,O):de,O==null)break e;G=p({},G,O);break e;case 2:ns=!0}}O=m.callback,O!==null&&(t.flags|=64,N&&(t.flags|=8192),N=c.callbacks,N===null?c.callbacks=[O]:N.push(O))}else N={lane:O,tag:m.tag,payload:m.payload,callback:m.callback,next:null},W===null?(B=W=N,b=G):W=W.next=N,g|=O;if(m=m.next,m===null){if(m=c.shared.pending,m===null)break;N=m,m=N.next,N.next=null,c.lastBaseUpdate=N,c.shared.pending=null}}while(!0);W===null&&(b=G),c.baseState=b,c.firstBaseUpdate=B,c.lastBaseUpdate=W,u===null&&(c.shared.lanes=0),vs|=g,t.lanes=g,t.memoizedState=G}}function Mf(t,s){if(typeof t!="function")throw Error(l(191,t));t.call(s)}function Df(t,s){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;t<r.length;t++)Mf(r[t],s)}var Br=Y(null),na=Y(0);function Rf(t,s){t=Xi,Z(na,t),Z(Br,s),Xi=t|s.baseLanes}function Sc(){Z(na,Xi),Z(Br,Br.current)}function yc(){Xi=na.current,J(Br),J(na)}var os=0,pe=null,Ae=null,et=null,la=!1,zr=!1,Gs=!1,aa=0,Nn=0,Or=null,bS=0;function Fe(){throw Error(l(321))}function bc(t,s){if(s===null)return!1;for(var r=0;r<s.length&&r<t.length;r++)if(!Vt(t[r],s[r]))return!1;return!0}function wc(t,s,r,a,c,u){return os=u,pe=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,M.H=t===null||t.memoizedState===null?d_:f_,Gs=!1,u=r(a,c),Gs=!1,zr&&(u=Af(s,r,a,c)),Tf(t),u}function Tf(t){M.H=fa;var s=Ae!==null&&Ae.next!==null;if(os=0,et=Ae=pe=null,la=!1,Nn=0,Or=null,s)throw Error(l(300));t===null||dt||(t=t.dependencies,t!==null&&ea(t)&&(dt=!0))}function Af(t,s,r,a){pe=t;var c=0;do{if(zr&&(Or=null),Nn=0,zr=!1,25<=c)throw Error(l(301));if(c+=1,et=Ae=null,t.updateQueue!=null){var u=t.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}M.H=DS,u=s(r,a)}while(zr);return u}function wS(){var t=M.H,s=t.useState()[0];return s=typeof s.then=="function"?Hn(s):s,t=t.useState()[0],(Ae!==null?Ae.memoizedState:null)!==t&&(pe.flags|=1024),s}function Cc(){var t=aa!==0;return aa=0,t}function xc(t,s,r){s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~r}function Ec(t){if(la){for(t=t.memoizedState;t!==null;){var s=t.queue;s!==null&&(s.pending=null),t=t.next}la=!1}os=0,et=Ae=pe=null,zr=!1,Nn=aa=0,Or=null}function Ut(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?pe.memoizedState=et=t:et=et.next=t,et}function tt(){if(Ae===null){var t=pe.alternate;t=t!==null?t.memoizedState:null}else t=Ae.next;var s=et===null?pe.memoizedState:et.next;if(s!==null)et=s,Ae=t;else{if(t===null)throw pe.alternate===null?Error(l(467)):Error(l(310));Ae=t,t={memoizedState:Ae.memoizedState,baseState:Ae.baseState,baseQueue:Ae.baseQueue,queue:Ae.queue,next:null},et===null?pe.memoizedState=et=t:et=et.next=t}return et}function kc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hn(t){var s=Nn;return Nn+=1,Or===null&&(Or=[]),t=xf(Or,t,s),s=pe,(et===null?s.memoizedState:et.next)===null&&(s=s.alternate,M.H=s===null||s.memoizedState===null?d_:f_),t}function oa(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Hn(t);if(t.$$typeof===V)return kt(t)}throw Error(l(438,String(t)))}function Mc(t){var s=null,r=pe.updateQueue;if(r!==null&&(s=r.memoCache),s==null){var a=pe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(s={data:a.data.map(function(c){return c.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),r===null&&(r=kc(),pe.updateQueue=r),r.memoCache=s,r=s.data[s.index],r===void 0)for(r=s.data[s.index]=Array(t),a=0;a<t;a++)r[a]=Je;return s.index++,r}function ji(t,s){return typeof s=="function"?s(t):s}function ca(t){var s=tt();return Dc(s,Ae,t)}function Dc(t,s,r){var a=t.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=r;var c=t.baseQueue,u=a.pending;if(u!==null){if(c!==null){var g=c.next;c.next=u.next,u.next=g}s.baseQueue=c=u,a.pending=null}if(u=t.baseState,c===null)t.memoizedState=u;else{s=c.next;var m=g=null,b=null,B=s,W=!1;do{var G=B.lane&-536870913;if(G!==B.lane?(Ce&G)===G:(os&G)===G){var O=B.revertLane;if(O===0)b!==null&&(b=b.next={lane:0,revertLane:0,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),G===Tr&&(W=!0);else if((os&O)===O){B=B.next,O===Tr&&(W=!0);continue}else G={lane:0,revertLane:B.revertLane,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},b===null?(m=b=G,g=u):b=b.next=G,pe.lanes|=O,vs|=O;G=B.action,Gs&&r(u,G),u=B.hasEagerState?B.eagerState:r(u,G)}else O={lane:G,revertLane:B.revertLane,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},b===null?(m=b=O,g=u):b=b.next=O,pe.lanes|=G,vs|=G;B=B.next}while(B!==null&&B!==s);if(b===null?g=u:b.next=m,!Vt(u,t.memoizedState)&&(dt=!0,W&&(r=Ar,r!==null)))throw r;t.memoizedState=u,t.baseState=g,t.baseQueue=b,a.lastRenderedState=u}return c===null&&(a.lanes=0),[t.memoizedState,a.dispatch]}function Rc(t){var s=tt(),r=s.queue;if(r===null)throw Error(l(311));r.lastRenderedReducer=t;var a=r.dispatch,c=r.pending,u=s.memoizedState;if(c!==null){r.pending=null;var g=c=c.next;do u=t(u,g.action),g=g.next;while(g!==c);Vt(u,s.memoizedState)||(dt=!0),s.memoizedState=u,s.baseQueue===null&&(s.baseState=u),r.lastRenderedState=u}return[u,a]}function Bf(t,s,r){var a=pe,c=tt(),u=ke;if(u){if(r===void 0)throw Error(l(407));r=r()}else r=s();var g=!Vt((Ae||c).memoizedState,r);g&&(c.memoizedState=r,dt=!0),c=c.queue;var m=Lf.bind(null,a,c,t);if(Un(2048,8,m,[t]),c.getSnapshot!==s||g||et!==null&&et.memoizedState.tag&1){if(a.flags|=2048,Lr(9,ha(),Of.bind(null,a,c,r,s),null),He===null)throw Error(l(349));u||(os&124)!==0||zf(a,s,r)}return r}function zf(t,s,r){t.flags|=16384,t={getSnapshot:s,value:r},s=pe.updateQueue,s===null?(s=kc(),pe.updateQueue=s,s.stores=[t]):(r=s.stores,r===null?s.stores=[t]:r.push(t))}function Of(t,s,r,a){s.value=r,s.getSnapshot=a,Nf(s)&&Hf(t)}function Lf(t,s,r){return r(function(){Nf(s)&&Hf(t)})}function Nf(t){var s=t.getSnapshot;t=t.value;try{var r=s();return!Vt(t,r)}catch{return!0}}function Hf(t){var s=kr(t,2);s!==null&&Zt(s,t,2)}function Tc(t){var s=Ut();if(typeof t=="function"){var r=t;if(t=r(),Gs){ts(!0);try{r()}finally{ts(!1)}}}return s.memoizedState=s.baseState=t,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:t},s}function Uf(t,s,r,a){return t.baseState=r,Dc(t,Ae,typeof a=="function"?a:ji)}function CS(t,s,r,a,c){if(da(t))throw Error(l(485));if(t=s.action,t!==null){var u={payload:c,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){u.listeners.push(g)}};M.T!==null?r(!0):u.isTransition=!1,a(u),r=s.pending,r===null?(u.next=s.pending=u,Pf(s,u)):(u.next=r.next,s.pending=r.next=u)}}function Pf(t,s){var r=s.action,a=s.payload,c=t.state;if(s.isTransition){var u=M.T,g={};M.T=g;try{var m=r(c,a),b=M.S;b!==null&&b(g,m),jf(t,s,m)}catch(B){Ac(t,s,B)}finally{M.T=u}}else try{u=r(c,a),jf(t,s,u)}catch(B){Ac(t,s,B)}}function jf(t,s,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(a){qf(t,s,a)},function(a){return Ac(t,s,a)}):qf(t,s,r)}function qf(t,s,r){s.status="fulfilled",s.value=r,Wf(s),t.state=r,s=t.pending,s!==null&&(r=s.next,r===s?t.pending=null:(r=r.next,s.next=r,Pf(t,r)))}function Ac(t,s,r){var a=t.pending;if(t.pending=null,a!==null){a=a.next;do s.status="rejected",s.reason=r,Wf(s),s=s.next;while(s!==a)}t.action=null}function Wf(t){t=t.listeners;for(var s=0;s<t.length;s++)(0,t[s])()}function Yf(t,s){return s}function Kf(t,s){if(ke){var r=He.formState;if(r!==null){e:{var a=pe;if(ke){if(Ve){t:{for(var c=Ve,u=yi;c.nodeType!==8;){if(!u){c=null;break t}if(c=gi(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){Ve=gi(c.nextSibling),a=c.data==="F!";break e}}Ys(a)}a=!1}a&&(s=r[0])}}return r=Ut(),r.memoizedState=r.baseState=s,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yf,lastRenderedState:s},r.queue=a,r=c_.bind(null,pe,a),a.dispatch=r,a=Tc(!1),u=Nc.bind(null,pe,!1,a.queue),a=Ut(),c={state:s,dispatch:null,action:t,pending:null},a.queue=c,r=CS.bind(null,pe,c,u,r),c.dispatch=r,a.memoizedState=t,[s,r,!1]}function Vf(t){var s=tt();return Xf(s,Ae,t)}function Xf(t,s,r){if(s=Dc(t,s,Yf)[0],t=ca(ji)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var a=Hn(s)}catch(g){throw g===An?sa:g}else a=s;s=tt();var c=s.queue,u=c.dispatch;return r!==s.memoizedState&&(pe.flags|=2048,Lr(9,ha(),xS.bind(null,c,r),null)),[a,u,t]}function xS(t,s){t.action=s}function Gf(t){var s=tt(),r=Ae;if(r!==null)return Xf(s,r,t);tt(),s=s.memoizedState,r=tt();var a=r.queue.dispatch;return r.memoizedState=t,[s,a,!1]}function Lr(t,s,r,a){return t={tag:t,create:r,deps:a,inst:s,next:null},s=pe.updateQueue,s===null&&(s=kc(),pe.updateQueue=s),r=s.lastEffect,r===null?s.lastEffect=t.next=t:(a=r.next,r.next=t,t.next=a,s.lastEffect=t),t}function ha(){return{destroy:void 0,resource:void 0}}function $f(){return tt().memoizedState}function ua(t,s,r,a){var c=Ut();a=a===void 0?null:a,pe.flags|=t,c.memoizedState=Lr(1|s,ha(),r,a)}function Un(t,s,r,a){var c=tt();a=a===void 0?null:a;var u=c.memoizedState.inst;Ae!==null&&a!==null&&bc(a,Ae.memoizedState.deps)?c.memoizedState=Lr(s,u,r,a):(pe.flags|=t,c.memoizedState=Lr(1|s,u,r,a))}function Ff(t,s){ua(8390656,8,t,s)}function If(t,s){Un(2048,8,t,s)}function Zf(t,s){return Un(4,2,t,s)}function Qf(t,s){return Un(4,4,t,s)}function Jf(t,s){if(typeof s=="function"){t=t();var r=s(t);return function(){typeof r=="function"?r():s(null)}}if(s!=null)return t=t(),s.current=t,function(){s.current=null}}function e_(t,s,r){r=r!=null?r.concat([t]):null,Un(4,4,Jf.bind(null,s,t),r)}function Bc(){}function t_(t,s){var r=tt();s=s===void 0?null:s;var a=r.memoizedState;return s!==null&&bc(s,a[1])?a[0]:(r.memoizedState=[t,s],t)}function i_(t,s){var r=tt();s=s===void 0?null:s;var a=r.memoizedState;if(s!==null&&bc(s,a[1]))return a[0];if(a=t(),Gs){ts(!0);try{t()}finally{ts(!1)}}return r.memoizedState=[a,s],a}function zc(t,s,r){return r===void 0||(os&1073741824)!==0?t.memoizedState=s:(t.memoizedState=r,t=nv(),pe.lanes|=t,vs|=t,r)}function s_(t,s,r,a){return Vt(r,s)?r:Br.current!==null?(t=zc(t,r,a),Vt(t,s)||(dt=!0),t):(os&42)===0?(dt=!0,t.memoizedState=r):(t=nv(),pe.lanes|=t,vs|=t,s)}function r_(t,s,r,a,c){var u=q.p;q.p=u!==0&&8>u?u:8;var g=M.T,m={};M.T=m,Nc(t,!1,s,r);try{var b=c(),B=M.S;if(B!==null&&B(m,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var W=yS(b,a);Pn(t,s,W,It(t))}else Pn(t,s,a,It(t))}catch(G){Pn(t,s,{then:function(){},status:"rejected",reason:G},It())}finally{q.p=u,M.T=g}}function ES(){}function Oc(t,s,r,a){if(t.tag!==5)throw Error(l(476));var c=n_(t).queue;r_(t,c,s,j,r===null?ES:function(){return l_(t),r(a)})}function n_(t){var s=t.memoizedState;if(s!==null)return s;s={memoizedState:j,baseState:j,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:j},next:null};var r={};return s.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:r},next:null},t.memoizedState=s,t=t.alternate,t!==null&&(t.memoizedState=s),s}function l_(t){var s=n_(t).next.queue;Pn(t,s,{},It())}function Lc(){return kt(sl)}function a_(){return tt().memoizedState}function o_(){return tt().memoizedState}function kS(t){for(var s=t.return;s!==null;){switch(s.tag){case 24:case 3:var r=It();t=ls(r);var a=as(s,t,r);a!==null&&(Zt(a,s,r),zn(a,s,r)),s={cache:uc()},t.payload=s;return}s=s.return}}function MS(t,s,r){var a=It();r={lane:a,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null},da(t)?h_(s,r):(r=tc(t,s,r,a),r!==null&&(Zt(r,t,a),u_(r,s,a)))}function c_(t,s,r){var a=It();Pn(t,s,r,a)}function Pn(t,s,r,a){var c={lane:a,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null};if(da(t))h_(s,c);else{var u=t.alternate;if(t.lanes===0&&(u===null||u.lanes===0)&&(u=s.lastRenderedReducer,u!==null))try{var g=s.lastRenderedState,m=u(g,r);if(c.hasEagerState=!0,c.eagerState=m,Vt(m,g))return Fl(t,s,c,0),He===null&&$l(),!1}catch{}finally{}if(r=tc(t,s,c,a),r!==null)return Zt(r,t,a),u_(r,s,a),!0}return!1}function Nc(t,s,r,a){if(a={lane:2,revertLane:_h(),action:a,hasEagerState:!1,eagerState:null,next:null},da(t)){if(s)throw Error(l(479))}else s=tc(t,r,a,2),s!==null&&Zt(s,t,2)}function da(t){var s=t.alternate;return t===pe||s!==null&&s===pe}function h_(t,s){zr=la=!0;var r=t.pending;r===null?s.next=s:(s.next=r.next,r.next=s),t.pending=s}function u_(t,s,r){if((r&4194048)!==0){var a=s.lanes;a&=t.pendingLanes,r|=a,s.lanes=r,md(t,r)}}var fa={readContext:kt,use:oa,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useLayoutEffect:Fe,useInsertionEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useSyncExternalStore:Fe,useId:Fe,useHostTransitionStatus:Fe,useFormState:Fe,useActionState:Fe,useOptimistic:Fe,useMemoCache:Fe,useCacheRefresh:Fe},d_={readContext:kt,use:oa,useCallback:function(t,s){return Ut().memoizedState=[t,s===void 0?null:s],t},useContext:kt,useEffect:Ff,useImperativeHandle:function(t,s,r){r=r!=null?r.concat([t]):null,ua(4194308,4,Jf.bind(null,s,t),r)},useLayoutEffect:function(t,s){return ua(4194308,4,t,s)},useInsertionEffect:function(t,s){ua(4,2,t,s)},useMemo:function(t,s){var r=Ut();s=s===void 0?null:s;var a=t();if(Gs){ts(!0);try{t()}finally{ts(!1)}}return r.memoizedState=[a,s],a},useReducer:function(t,s,r){var a=Ut();if(r!==void 0){var c=r(s);if(Gs){ts(!0);try{r(s)}finally{ts(!1)}}}else c=s;return a.memoizedState=a.baseState=c,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:c},a.queue=t,t=t.dispatch=MS.bind(null,pe,t),[a.memoizedState,t]},useRef:function(t){var s=Ut();return t={current:t},s.memoizedState=t},useState:function(t){t=Tc(t);var s=t.queue,r=c_.bind(null,pe,s);return s.dispatch=r,[t.memoizedState,r]},useDebugValue:Bc,useDeferredValue:function(t,s){var r=Ut();return zc(r,t,s)},useTransition:function(){var t=Tc(!1);return t=r_.bind(null,pe,t.queue,!0,!1),Ut().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,s,r){var a=pe,c=Ut();if(ke){if(r===void 0)throw Error(l(407));r=r()}else{if(r=s(),He===null)throw Error(l(349));(Ce&124)!==0||zf(a,s,r)}c.memoizedState=r;var u={value:r,getSnapshot:s};return c.queue=u,Ff(Lf.bind(null,a,u,t),[t]),a.flags|=2048,Lr(9,ha(),Of.bind(null,a,u,r,s),null),r},useId:function(){var t=Ut(),s=He.identifierPrefix;if(ke){var r=Hi,a=Ni;r=(a&~(1<<32-Kt(a)-1)).toString(32)+r,s="«"+s+"R"+r,r=aa++,0<r&&(s+="H"+r.toString(32)),s+="»"}else r=bS++,s="«"+s+"r"+r.toString(32)+"»";return t.memoizedState=s},useHostTransitionStatus:Lc,useFormState:Kf,useActionState:Kf,useOptimistic:function(t){var s=Ut();s.memoizedState=s.baseState=t;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=r,s=Nc.bind(null,pe,!0,r),r.dispatch=s,[t,s]},useMemoCache:Mc,useCacheRefresh:function(){return Ut().memoizedState=kS.bind(null,pe)}},f_={readContext:kt,use:oa,useCallback:t_,useContext:kt,useEffect:If,useImperativeHandle:e_,useInsertionEffect:Zf,useLayoutEffect:Qf,useMemo:i_,useReducer:ca,useRef:$f,useState:function(){return ca(ji)},useDebugValue:Bc,useDeferredValue:function(t,s){var r=tt();return s_(r,Ae.memoizedState,t,s)},useTransition:function(){var t=ca(ji)[0],s=tt().memoizedState;return[typeof t=="boolean"?t:Hn(t),s]},useSyncExternalStore:Bf,useId:a_,useHostTransitionStatus:Lc,useFormState:Vf,useActionState:Vf,useOptimistic:function(t,s){var r=tt();return Uf(r,Ae,t,s)},useMemoCache:Mc,useCacheRefresh:o_},DS={readContext:kt,use:oa,useCallback:t_,useContext:kt,useEffect:If,useImperativeHandle:e_,useInsertionEffect:Zf,useLayoutEffect:Qf,useMemo:i_,useReducer:Rc,useRef:$f,useState:function(){return Rc(ji)},useDebugValue:Bc,useDeferredValue:function(t,s){var r=tt();return Ae===null?zc(r,t,s):s_(r,Ae.memoizedState,t,s)},useTransition:function(){var t=Rc(ji)[0],s=tt().memoizedState;return[typeof t=="boolean"?t:Hn(t),s]},useSyncExternalStore:Bf,useId:a_,useHostTransitionStatus:Lc,useFormState:Gf,useActionState:Gf,useOptimistic:function(t,s){var r=tt();return Ae!==null?Uf(r,Ae,t,s):(r.baseState=t,[t,r.queue.dispatch])},useMemoCache:Mc,useCacheRefresh:o_},Nr=null,jn=0;function _a(t){var s=jn;return jn+=1,Nr===null&&(Nr=[]),xf(Nr,t,s)}function qn(t,s){s=s.props.ref,t.ref=s!==void 0?s:null}function va(t,s){throw s.$$typeof===S?Error(l(525)):(t=Object.prototype.toString.call(s),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":t)))}function __(t){var s=t._init;return s(t._payload)}function v_(t){function s(D,k){if(t){var A=D.deletions;A===null?(D.deletions=[k],D.flags|=16):A.push(k)}}function r(D,k){if(!t)return null;for(;k!==null;)s(D,k),k=k.sibling;return null}function a(D){for(var k=new Map;D!==null;)D.key!==null?k.set(D.key,D):k.set(D.index,D),D=D.sibling;return k}function c(D,k){return D=Li(D,k),D.index=0,D.sibling=null,D}function u(D,k,A){return D.index=A,t?(A=D.alternate,A!==null?(A=A.index,A<k?(D.flags|=67108866,k):A):(D.flags|=67108866,k)):(D.flags|=1048576,k)}function g(D){return t&&D.alternate===null&&(D.flags|=67108866),D}function m(D,k,A,K){return k===null||k.tag!==6?(k=sc(A,D.mode,K),k.return=D,k):(k=c(k,A),k.return=D,k)}function b(D,k,A,K){var ne=A.type;return ne===C?W(D,k,A.props.children,K,A.key):k!==null&&(k.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===_e&&__(ne)===k.type)?(k=c(k,A.props),qn(k,A),k.return=D,k):(k=Zl(A.type,A.key,A.props,null,D.mode,K),qn(k,A),k.return=D,k)}function B(D,k,A,K){return k===null||k.tag!==4||k.stateNode.containerInfo!==A.containerInfo||k.stateNode.implementation!==A.implementation?(k=rc(A,D.mode,K),k.return=D,k):(k=c(k,A.children||[]),k.return=D,k)}function W(D,k,A,K,ne){return k===null||k.tag!==7?(k=Ps(A,D.mode,K,ne),k.return=D,k):(k=c(k,A),k.return=D,k)}function G(D,k,A){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=sc(""+k,D.mode,A),k.return=D,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case y:return A=Zl(k.type,k.key,k.props,null,D.mode,A),qn(A,k),A.return=D,A;case E:return k=rc(k,D.mode,A),k.return=D,k;case _e:var K=k._init;return k=K(k._payload),G(D,k,A)}if(F(k)||$(k))return k=Ps(k,D.mode,A,null),k.return=D,k;if(typeof k.then=="function")return G(D,_a(k),A);if(k.$$typeof===V)return G(D,ta(D,k),A);va(D,k)}return null}function O(D,k,A,K){var ne=k!==null?k.key:null;if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return ne!==null?null:m(D,k,""+A,K);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case y:return A.key===ne?b(D,k,A,K):null;case E:return A.key===ne?B(D,k,A,K):null;case _e:return ne=A._init,A=ne(A._payload),O(D,k,A,K)}if(F(A)||$(A))return ne!==null?null:W(D,k,A,K,null);if(typeof A.then=="function")return O(D,k,_a(A),K);if(A.$$typeof===V)return O(D,k,ta(D,A),K);va(D,A)}return null}function N(D,k,A,K,ne){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return D=D.get(A)||null,m(k,D,""+K,ne);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case y:return D=D.get(K.key===null?A:K.key)||null,b(k,D,K,ne);case E:return D=D.get(K.key===null?A:K.key)||null,B(k,D,K,ne);case _e:var ye=K._init;return K=ye(K._payload),N(D,k,A,K,ne)}if(F(K)||$(K))return D=D.get(A)||null,W(k,D,K,ne,null);if(typeof K.then=="function")return N(D,k,A,_a(K),ne);if(K.$$typeof===V)return N(D,k,A,ta(k,K),ne);va(k,K)}return null}function de(D,k,A,K){for(var ne=null,ye=null,oe=k,ue=k=0,_t=null;oe!==null&&ue<A.length;ue++){oe.index>ue?(_t=oe,oe=null):_t=oe.sibling;var Ee=O(D,oe,A[ue],K);if(Ee===null){oe===null&&(oe=_t);break}t&&oe&&Ee.alternate===null&&s(D,oe),k=u(Ee,k,ue),ye===null?ne=Ee:ye.sibling=Ee,ye=Ee,oe=_t}if(ue===A.length)return r(D,oe),ke&&qs(D,ue),ne;if(oe===null){for(;ue<A.length;ue++)oe=G(D,A[ue],K),oe!==null&&(k=u(oe,k,ue),ye===null?ne=oe:ye.sibling=oe,ye=oe);return ke&&qs(D,ue),ne}for(oe=a(oe);ue<A.length;ue++)_t=N(oe,D,ue,A[ue],K),_t!==null&&(t&&_t.alternate!==null&&oe.delete(_t.key===null?ue:_t.key),k=u(_t,k,ue),ye===null?ne=_t:ye.sibling=_t,ye=_t);return t&&oe.forEach(function(xs){return s(D,xs)}),ke&&qs(D,ue),ne}function he(D,k,A,K){if(A==null)throw Error(l(151));for(var ne=null,ye=null,oe=k,ue=k=0,_t=null,Ee=A.next();oe!==null&&!Ee.done;ue++,Ee=A.next()){oe.index>ue?(_t=oe,oe=null):_t=oe.sibling;var xs=O(D,oe,Ee.value,K);if(xs===null){oe===null&&(oe=_t);break}t&&oe&&xs.alternate===null&&s(D,oe),k=u(xs,k,ue),ye===null?ne=xs:ye.sibling=xs,ye=xs,oe=_t}if(Ee.done)return r(D,oe),ke&&qs(D,ue),ne;if(oe===null){for(;!Ee.done;ue++,Ee=A.next())Ee=G(D,Ee.value,K),Ee!==null&&(k=u(Ee,k,ue),ye===null?ne=Ee:ye.sibling=Ee,ye=Ee);return ke&&qs(D,ue),ne}for(oe=a(oe);!Ee.done;ue++,Ee=A.next())Ee=N(oe,D,ue,Ee.value,K),Ee!==null&&(t&&Ee.alternate!==null&&oe.delete(Ee.key===null?ue:Ee.key),k=u(Ee,k,ue),ye===null?ne=Ee:ye.sibling=Ee,ye=Ee);return t&&oe.forEach(function(Ry){return s(D,Ry)}),ke&&qs(D,ue),ne}function ze(D,k,A,K){if(typeof A=="object"&&A!==null&&A.type===C&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case y:e:{for(var ne=A.key;k!==null;){if(k.key===ne){if(ne=A.type,ne===C){if(k.tag===7){r(D,k.sibling),K=c(k,A.props.children),K.return=D,D=K;break e}}else if(k.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===_e&&__(ne)===k.type){r(D,k.sibling),K=c(k,A.props),qn(K,A),K.return=D,D=K;break e}r(D,k);break}else s(D,k);k=k.sibling}A.type===C?(K=Ps(A.props.children,D.mode,K,A.key),K.return=D,D=K):(K=Zl(A.type,A.key,A.props,null,D.mode,K),qn(K,A),K.return=D,D=K)}return g(D);case E:e:{for(ne=A.key;k!==null;){if(k.key===ne)if(k.tag===4&&k.stateNode.containerInfo===A.containerInfo&&k.stateNode.implementation===A.implementation){r(D,k.sibling),K=c(k,A.children||[]),K.return=D,D=K;break e}else{r(D,k);break}else s(D,k);k=k.sibling}K=rc(A,D.mode,K),K.return=D,D=K}return g(D);case _e:return ne=A._init,A=ne(A._payload),ze(D,k,A,K)}if(F(A))return de(D,k,A,K);if($(A)){if(ne=$(A),typeof ne!="function")throw Error(l(150));return A=ne.call(A),he(D,k,A,K)}if(typeof A.then=="function")return ze(D,k,_a(A),K);if(A.$$typeof===V)return ze(D,k,ta(D,A),K);va(D,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,k!==null&&k.tag===6?(r(D,k.sibling),K=c(k,A),K.return=D,D=K):(r(D,k),K=sc(A,D.mode,K),K.return=D,D=K),g(D)):r(D,k)}return function(D,k,A,K){try{jn=0;var ne=ze(D,k,A,K);return Nr=null,ne}catch(oe){if(oe===An||oe===sa)throw oe;var ye=Xt(29,oe,null,D.mode);return ye.lanes=K,ye.return=D,ye}finally{}}}var Hr=v_(!0),g_=v_(!1),ai=Y(null),bi=null;function cs(t){var s=t.alternate;Z(at,at.current&1),Z(ai,t),bi===null&&(s===null||Br.current!==null||s.memoizedState!==null)&&(bi=t)}function p_(t){if(t.tag===22){if(Z(at,at.current),Z(ai,t),bi===null){var s=t.alternate;s!==null&&s.memoizedState!==null&&(bi=t)}}else hs()}function hs(){Z(at,at.current),Z(ai,ai.current)}function qi(t){J(ai),bi===t&&(bi=null),J(at)}var at=Y(0);function ga(t){for(var s=t;s!==null;){if(s.tag===13){var r=s.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||kh(r)))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}function Hc(t,s,r,a){s=t.memoizedState,r=r(a,s),r=r==null?s:p({},s,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var Uc={enqueueSetState:function(t,s,r){t=t._reactInternals;var a=It(),c=ls(a);c.payload=s,r!=null&&(c.callback=r),s=as(t,c,a),s!==null&&(Zt(s,t,a),zn(s,t,a))},enqueueReplaceState:function(t,s,r){t=t._reactInternals;var a=It(),c=ls(a);c.tag=1,c.payload=s,r!=null&&(c.callback=r),s=as(t,c,a),s!==null&&(Zt(s,t,a),zn(s,t,a))},enqueueForceUpdate:function(t,s){t=t._reactInternals;var r=It(),a=ls(r);a.tag=2,s!=null&&(a.callback=s),s=as(t,a,r),s!==null&&(Zt(s,t,r),zn(s,t,r))}};function m_(t,s,r,a,c,u,g){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(a,u,g):s.prototype&&s.prototype.isPureReactComponent?!Cn(r,a)||!Cn(c,u):!0}function S_(t,s,r,a){t=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(r,a),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(r,a),s.state!==t&&Uc.enqueueReplaceState(s,s.state,null)}function $s(t,s){var r=s;if("ref"in s){r={};for(var a in s)a!=="ref"&&(r[a]=s[a])}if(t=t.defaultProps){r===s&&(r=p({},r));for(var c in t)r[c]===void 0&&(r[c]=t[c])}return r}var pa=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function y_(t){pa(t)}function b_(t){console.error(t)}function w_(t){pa(t)}function ma(t,s){try{var r=t.onUncaughtError;r(s.value,{componentStack:s.stack})}catch(a){setTimeout(function(){throw a})}}function C_(t,s,r){try{var a=t.onCaughtError;a(r.value,{componentStack:r.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Pc(t,s,r){return r=ls(r),r.tag=3,r.payload={element:null},r.callback=function(){ma(t,s)},r}function x_(t){return t=ls(t),t.tag=3,t}function E_(t,s,r,a){var c=r.type.getDerivedStateFromError;if(typeof c=="function"){var u=a.value;t.payload=function(){return c(u)},t.callback=function(){C_(s,r,a)}}var g=r.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(t.callback=function(){C_(s,r,a),typeof c!="function"&&(gs===null?gs=new Set([this]):gs.add(this));var m=a.stack;this.componentDidCatch(a.value,{componentStack:m!==null?m:""})})}function RS(t,s,r,a,c){if(r.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(s=r.alternate,s!==null&&Dn(s,r,c,!0),r=ai.current,r!==null){switch(r.tag){case 13:return bi===null?ch():r.alternate===null&&Xe===0&&(Xe=3),r.flags&=-257,r.flags|=65536,r.lanes=c,a===_c?r.flags|=16384:(s=r.updateQueue,s===null?r.updateQueue=new Set([a]):s.add(a),uh(t,a,c)),!1;case 22:return r.flags|=65536,a===_c?r.flags|=16384:(s=r.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([a])},r.updateQueue=s):(r=s.retryQueue,r===null?s.retryQueue=new Set([a]):r.add(a)),uh(t,a,c)),!1}throw Error(l(435,r.tag))}return uh(t,a,c),ch(),!1}if(ke)return s=ai.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=c,a!==ac&&(t=Error(l(422),{cause:a}),Mn(si(t,r)))):(a!==ac&&(s=Error(l(423),{cause:a}),Mn(si(s,r))),t=t.current.alternate,t.flags|=65536,c&=-c,t.lanes|=c,a=si(a,r),c=Pc(t.stateNode,a,c),pc(t,c),Xe!==4&&(Xe=2)),!1;var u=Error(l(520),{cause:a});if(u=si(u,r),$n===null?$n=[u]:$n.push(u),Xe!==4&&(Xe=2),s===null)return!0;a=si(a,r),r=s;do{switch(r.tag){case 3:return r.flags|=65536,t=c&-c,r.lanes|=t,t=Pc(r.stateNode,a,t),pc(r,t),!1;case 1:if(s=r.type,u=r.stateNode,(r.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(gs===null||!gs.has(u))))return r.flags|=65536,c&=-c,r.lanes|=c,c=x_(c),E_(c,t,r,a),pc(r,c),!1}r=r.return}while(r!==null);return!1}var k_=Error(l(461)),dt=!1;function yt(t,s,r,a){s.child=t===null?g_(s,null,r,a):Hr(s,t.child,r,a)}function M_(t,s,r,a,c){r=r.render;var u=s.ref;if("ref"in a){var g={};for(var m in a)m!=="ref"&&(g[m]=a[m])}else g=a;return Vs(s),a=wc(t,s,r,g,u,c),m=Cc(),t!==null&&!dt?(xc(t,s,c),Wi(t,s,c)):(ke&&m&&nc(s),s.flags|=1,yt(t,s,a,c),s.child)}function D_(t,s,r,a,c){if(t===null){var u=r.type;return typeof u=="function"&&!ic(u)&&u.defaultProps===void 0&&r.compare===null?(s.tag=15,s.type=u,R_(t,s,u,a,c)):(t=Zl(r.type,null,a,s,s.mode,c),t.ref=s.ref,t.return=s,s.child=t)}if(u=t.child,!Gc(t,c)){var g=u.memoizedProps;if(r=r.compare,r=r!==null?r:Cn,r(g,a)&&t.ref===s.ref)return Wi(t,s,c)}return s.flags|=1,t=Li(u,a),t.ref=s.ref,t.return=s,s.child=t}function R_(t,s,r,a,c){if(t!==null){var u=t.memoizedProps;if(Cn(u,a)&&t.ref===s.ref)if(dt=!1,s.pendingProps=a=u,Gc(t,c))(t.flags&131072)!==0&&(dt=!0);else return s.lanes=t.lanes,Wi(t,s,c)}return jc(t,s,r,a,c)}function T_(t,s,r){var a=s.pendingProps,c=a.children,u=t!==null?t.memoizedState:null;if(a.mode==="hidden"){if((s.flags&128)!==0){if(a=u!==null?u.baseLanes|r:r,t!==null){for(c=s.child=t.child,u=0;c!==null;)u=u|c.lanes|c.childLanes,c=c.sibling;s.childLanes=u&~a}else s.childLanes=0,s.child=null;return A_(t,s,a,r)}if((r&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},t!==null&&ia(s,u!==null?u.cachePool:null),u!==null?Rf(s,u):Sc(),p_(s);else return s.lanes=s.childLanes=536870912,A_(t,s,u!==null?u.baseLanes|r:r,r)}else u!==null?(ia(s,u.cachePool),Rf(s,u),hs(),s.memoizedState=null):(t!==null&&ia(s,null),Sc(),hs());return yt(t,s,c,r),s.child}function A_(t,s,r,a){var c=fc();return c=c===null?null:{parent:lt._currentValue,pool:c},s.memoizedState={baseLanes:r,cachePool:c},t!==null&&ia(s,null),Sc(),p_(s),t!==null&&Dn(t,s,a,!0),null}function Sa(t,s){var r=s.ref;if(r===null)t!==null&&t.ref!==null&&(s.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(l(284));(t===null||t.ref!==r)&&(s.flags|=4194816)}}function jc(t,s,r,a,c){return Vs(s),r=wc(t,s,r,a,void 0,c),a=Cc(),t!==null&&!dt?(xc(t,s,c),Wi(t,s,c)):(ke&&a&&nc(s),s.flags|=1,yt(t,s,r,c),s.child)}function B_(t,s,r,a,c,u){return Vs(s),s.updateQueue=null,r=Af(s,a,r,c),Tf(t),a=Cc(),t!==null&&!dt?(xc(t,s,u),Wi(t,s,u)):(ke&&a&&nc(s),s.flags|=1,yt(t,s,r,u),s.child)}function z_(t,s,r,a,c){if(Vs(s),s.stateNode===null){var u=Mr,g=r.contextType;typeof g=="object"&&g!==null&&(u=kt(g)),u=new r(a,u),s.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Uc,s.stateNode=u,u._reactInternals=s,u=s.stateNode,u.props=a,u.state=s.memoizedState,u.refs={},vc(s),g=r.contextType,u.context=typeof g=="object"&&g!==null?kt(g):Mr,u.state=s.memoizedState,g=r.getDerivedStateFromProps,typeof g=="function"&&(Hc(s,r,g,a),u.state=s.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(g=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),g!==u.state&&Uc.enqueueReplaceState(u,u.state,null),Ln(s,a,u,c),On(),u.state=s.memoizedState),typeof u.componentDidMount=="function"&&(s.flags|=4194308),a=!0}else if(t===null){u=s.stateNode;var m=s.memoizedProps,b=$s(r,m);u.props=b;var B=u.context,W=r.contextType;g=Mr,typeof W=="object"&&W!==null&&(g=kt(W));var G=r.getDerivedStateFromProps;W=typeof G=="function"||typeof u.getSnapshotBeforeUpdate=="function",m=s.pendingProps!==m,W||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(m||B!==g)&&S_(s,u,a,g),ns=!1;var O=s.memoizedState;u.state=O,Ln(s,a,u,c),On(),B=s.memoizedState,m||O!==B||ns?(typeof G=="function"&&(Hc(s,r,G,a),B=s.memoizedState),(b=ns||m_(s,r,b,a,O,B,g))?(W||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(s.flags|=4194308)):(typeof u.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=a,s.memoizedState=B),u.props=a,u.state=B,u.context=g,a=b):(typeof u.componentDidMount=="function"&&(s.flags|=4194308),a=!1)}else{u=s.stateNode,gc(t,s),g=s.memoizedProps,W=$s(r,g),u.props=W,G=s.pendingProps,O=u.context,B=r.contextType,b=Mr,typeof B=="object"&&B!==null&&(b=kt(B)),m=r.getDerivedStateFromProps,(B=typeof m=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g!==G||O!==b)&&S_(s,u,a,b),ns=!1,O=s.memoizedState,u.state=O,Ln(s,a,u,c),On();var N=s.memoizedState;g!==G||O!==N||ns||t!==null&&t.dependencies!==null&&ea(t.dependencies)?(typeof m=="function"&&(Hc(s,r,m,a),N=s.memoizedState),(W=ns||m_(s,r,W,a,O,N,b)||t!==null&&t.dependencies!==null&&ea(t.dependencies))?(B||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,N,b),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,N,b)),typeof u.componentDidUpdate=="function"&&(s.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof u.componentDidUpdate!="function"||g===t.memoizedProps&&O===t.memoizedState||(s.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===t.memoizedProps&&O===t.memoizedState||(s.flags|=1024),s.memoizedProps=a,s.memoizedState=N),u.props=a,u.state=N,u.context=b,a=W):(typeof u.componentDidUpdate!="function"||g===t.memoizedProps&&O===t.memoizedState||(s.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===t.memoizedProps&&O===t.memoizedState||(s.flags|=1024),a=!1)}return u=a,Sa(t,s),a=(s.flags&128)!==0,u||a?(u=s.stateNode,r=a&&typeof r.getDerivedStateFromError!="function"?null:u.render(),s.flags|=1,t!==null&&a?(s.child=Hr(s,t.child,null,c),s.child=Hr(s,null,r,c)):yt(t,s,r,c),s.memoizedState=u.state,t=s.child):t=Wi(t,s,c),t}function O_(t,s,r,a){return kn(),s.flags|=256,yt(t,s,r,a),s.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wc(t){return{baseLanes:t,cachePool:bf()}}function Yc(t,s,r){return t=t!==null?t.childLanes&~r:0,s&&(t|=oi),t}function L_(t,s,r){var a=s.pendingProps,c=!1,u=(s.flags&128)!==0,g;if((g=u)||(g=t!==null&&t.memoizedState===null?!1:(at.current&2)!==0),g&&(c=!0,s.flags&=-129),g=(s.flags&32)!==0,s.flags&=-33,t===null){if(ke){if(c?cs(s):hs(),ke){var m=Ve,b;if(b=m){e:{for(b=m,m=yi;b.nodeType!==8;){if(!m){m=null;break e}if(b=gi(b.nextSibling),b===null){m=null;break e}}m=b}m!==null?(s.memoizedState={dehydrated:m,treeContext:js!==null?{id:Ni,overflow:Hi}:null,retryLane:536870912,hydrationErrors:null},b=Xt(18,null,null,0),b.stateNode=m,b.return=s,s.child=b,Tt=s,Ve=null,b=!0):b=!1}b||Ys(s)}if(m=s.memoizedState,m!==null&&(m=m.dehydrated,m!==null))return kh(m)?s.lanes=32:s.lanes=536870912,null;qi(s)}return m=a.children,a=a.fallback,c?(hs(),c=s.mode,m=ya({mode:"hidden",children:m},c),a=Ps(a,c,r,null),m.return=s,a.return=s,m.sibling=a,s.child=m,c=s.child,c.memoizedState=Wc(r),c.childLanes=Yc(t,g,r),s.memoizedState=qc,a):(cs(s),Kc(s,m))}if(b=t.memoizedState,b!==null&&(m=b.dehydrated,m!==null)){if(u)s.flags&256?(cs(s),s.flags&=-257,s=Vc(t,s,r)):s.memoizedState!==null?(hs(),s.child=t.child,s.flags|=128,s=null):(hs(),c=a.fallback,m=s.mode,a=ya({mode:"visible",children:a.children},m),c=Ps(c,m,r,null),c.flags|=2,a.return=s,c.return=s,a.sibling=c,s.child=a,Hr(s,t.child,null,r),a=s.child,a.memoizedState=Wc(r),a.childLanes=Yc(t,g,r),s.memoizedState=qc,s=c);else if(cs(s),kh(m)){if(g=m.nextSibling&&m.nextSibling.dataset,g)var B=g.dgst;g=B,a=Error(l(419)),a.stack="",a.digest=g,Mn({value:a,source:null,stack:null}),s=Vc(t,s,r)}else if(dt||Dn(t,s,r,!1),g=(r&t.childLanes)!==0,dt||g){if(g=He,g!==null&&(a=r&-r,a=(a&42)!==0?1:Mo(a),a=(a&(g.suspendedLanes|r))!==0?0:a,a!==0&&a!==b.retryLane))throw b.retryLane=a,kr(t,a),Zt(g,t,a),k_;m.data==="$?"||ch(),s=Vc(t,s,r)}else m.data==="$?"?(s.flags|=192,s.child=t.child,s=null):(t=b.treeContext,Ve=gi(m.nextSibling),Tt=s,ke=!0,Ws=null,yi=!1,t!==null&&(ni[li++]=Ni,ni[li++]=Hi,ni[li++]=js,Ni=t.id,Hi=t.overflow,js=s),s=Kc(s,a.children),s.flags|=4096);return s}return c?(hs(),c=a.fallback,m=s.mode,b=t.child,B=b.sibling,a=Li(b,{mode:"hidden",children:a.children}),a.subtreeFlags=b.subtreeFlags&65011712,B!==null?c=Li(B,c):(c=Ps(c,m,r,null),c.flags|=2),c.return=s,a.return=s,a.sibling=c,s.child=a,a=c,c=s.child,m=t.child.memoizedState,m===null?m=Wc(r):(b=m.cachePool,b!==null?(B=lt._currentValue,b=b.parent!==B?{parent:B,pool:B}:b):b=bf(),m={baseLanes:m.baseLanes|r,cachePool:b}),c.memoizedState=m,c.childLanes=Yc(t,g,r),s.memoizedState=qc,a):(cs(s),r=t.child,t=r.sibling,r=Li(r,{mode:"visible",children:a.children}),r.return=s,r.sibling=null,t!==null&&(g=s.deletions,g===null?(s.deletions=[t],s.flags|=16):g.push(t)),s.child=r,s.memoizedState=null,r)}function Kc(t,s){return s=ya({mode:"visible",children:s},t.mode),s.return=t,t.child=s}function ya(t,s){return t=Xt(22,t,null,s),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function Vc(t,s,r){return Hr(s,t.child,null,r),t=Kc(s,s.pendingProps.children),t.flags|=2,s.memoizedState=null,t}function N_(t,s,r){t.lanes|=s;var a=t.alternate;a!==null&&(a.lanes|=s),cc(t.return,s,r)}function Xc(t,s,r,a,c){var u=t.memoizedState;u===null?t.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:a,tail:r,tailMode:c}:(u.isBackwards=s,u.rendering=null,u.renderingStartTime=0,u.last=a,u.tail=r,u.tailMode=c)}function H_(t,s,r){var a=s.pendingProps,c=a.revealOrder,u=a.tail;if(yt(t,s,a.children,r),a=at.current,(a&2)!==0)a=a&1|2,s.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=s.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&N_(t,r,s);else if(t.tag===19)N_(t,r,s);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===s)break e;for(;t.sibling===null;){if(t.return===null||t.return===s)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}a&=1}switch(Z(at,a),c){case"forwards":for(r=s.child,c=null;r!==null;)t=r.alternate,t!==null&&ga(t)===null&&(c=r),r=r.sibling;r=c,r===null?(c=s.child,s.child=null):(c=r.sibling,r.sibling=null),Xc(s,!1,c,r,u);break;case"backwards":for(r=null,c=s.child,s.child=null;c!==null;){if(t=c.alternate,t!==null&&ga(t)===null){s.child=c;break}t=c.sibling,c.sibling=r,r=c,c=t}Xc(s,!0,r,null,u);break;case"together":Xc(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Wi(t,s,r){if(t!==null&&(s.dependencies=t.dependencies),vs|=s.lanes,(r&s.childLanes)===0)if(t!==null){if(Dn(t,s,r,!1),(r&s.childLanes)===0)return null}else return null;if(t!==null&&s.child!==t.child)throw Error(l(153));if(s.child!==null){for(t=s.child,r=Li(t,t.pendingProps),s.child=r,r.return=s;t.sibling!==null;)t=t.sibling,r=r.sibling=Li(t,t.pendingProps),r.return=s;r.sibling=null}return s.child}function Gc(t,s){return(t.lanes&s)!==0?!0:(t=t.dependencies,!!(t!==null&&ea(t)))}function TS(t,s,r){switch(s.tag){case 3:Me(s,s.stateNode.containerInfo),rs(s,lt,t.memoizedState.cache),kn();break;case 27:case 5:es(s);break;case 4:Me(s,s.stateNode.containerInfo);break;case 10:rs(s,s.type,s.memoizedProps.value);break;case 13:var a=s.memoizedState;if(a!==null)return a.dehydrated!==null?(cs(s),s.flags|=128,null):(r&s.child.childLanes)!==0?L_(t,s,r):(cs(s),t=Wi(t,s,r),t!==null?t.sibling:null);cs(s);break;case 19:var c=(t.flags&128)!==0;if(a=(r&s.childLanes)!==0,a||(Dn(t,s,r,!1),a=(r&s.childLanes)!==0),c){if(a)return H_(t,s,r);s.flags|=128}if(c=s.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Z(at,at.current),a)break;return null;case 22:case 23:return s.lanes=0,T_(t,s,r);case 24:rs(s,lt,t.memoizedState.cache)}return Wi(t,s,r)}function U_(t,s,r){if(t!==null)if(t.memoizedProps!==s.pendingProps)dt=!0;else{if(!Gc(t,r)&&(s.flags&128)===0)return dt=!1,TS(t,s,r);dt=(t.flags&131072)!==0}else dt=!1,ke&&(s.flags&1048576)!==0&&_f(s,Jl,s.index);switch(s.lanes=0,s.tag){case 16:e:{t=s.pendingProps;var a=s.elementType,c=a._init;if(a=c(a._payload),s.type=a,typeof a=="function")ic(a)?(t=$s(a,t),s.tag=1,s=z_(null,s,a,t,r)):(s.tag=0,s=jc(null,s,a,t,r));else{if(a!=null){if(c=a.$$typeof,c===P){s.tag=11,s=M_(null,s,a,t,r);break e}else if(c===ae){s.tag=14,s=D_(null,s,a,t,r);break e}}throw s=I(a)||a,Error(l(306,s,""))}}return s;case 0:return jc(t,s,s.type,s.pendingProps,r);case 1:return a=s.type,c=$s(a,s.pendingProps),z_(t,s,a,c,r);case 3:e:{if(Me(s,s.stateNode.containerInfo),t===null)throw Error(l(387));a=s.pendingProps;var u=s.memoizedState;c=u.element,gc(t,s),Ln(s,a,null,r);var g=s.memoizedState;if(a=g.cache,rs(s,lt,a),a!==u.cache&&hc(s,[lt],r,!0),On(),a=g.element,u.isDehydrated)if(u={element:a,isDehydrated:!1,cache:g.cache},s.updateQueue.baseState=u,s.memoizedState=u,s.flags&256){s=O_(t,s,a,r);break e}else if(a!==c){c=si(Error(l(424)),s),Mn(c),s=O_(t,s,a,r);break e}else{switch(t=s.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Ve=gi(t.firstChild),Tt=s,ke=!0,Ws=null,yi=!0,r=g_(s,null,a,r),s.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(kn(),a===c){s=Wi(t,s,r);break e}yt(t,s,a,r)}s=s.child}return s;case 26:return Sa(t,s),t===null?(r=Wv(s.type,null,s.pendingProps,null))?s.memoizedState=r:ke||(r=s.type,t=s.pendingProps,a=Oa(re.current).createElement(r),a[Et]=s,a[Nt]=t,wt(a,r,t),ut(a),s.stateNode=a):s.memoizedState=Wv(s.type,t.memoizedProps,s.pendingProps,t.memoizedState),null;case 27:return es(s),t===null&&ke&&(a=s.stateNode=Pv(s.type,s.pendingProps,re.current),Tt=s,yi=!0,c=Ve,Ss(s.type)?(Mh=c,Ve=gi(a.firstChild)):Ve=c),yt(t,s,s.pendingProps.children,r),Sa(t,s),t===null&&(s.flags|=4194304),s.child;case 5:return t===null&&ke&&((c=a=Ve)&&(a=ry(a,s.type,s.pendingProps,yi),a!==null?(s.stateNode=a,Tt=s,Ve=gi(a.firstChild),yi=!1,c=!0):c=!1),c||Ys(s)),es(s),c=s.type,u=s.pendingProps,g=t!==null?t.memoizedProps:null,a=u.children,Ch(c,u)?a=null:g!==null&&Ch(c,g)&&(s.flags|=32),s.memoizedState!==null&&(c=wc(t,s,wS,null,null,r),sl._currentValue=c),Sa(t,s),yt(t,s,a,r),s.child;case 6:return t===null&&ke&&((t=r=Ve)&&(r=ny(r,s.pendingProps,yi),r!==null?(s.stateNode=r,Tt=s,Ve=null,t=!0):t=!1),t||Ys(s)),null;case 13:return L_(t,s,r);case 4:return Me(s,s.stateNode.containerInfo),a=s.pendingProps,t===null?s.child=Hr(s,null,a,r):yt(t,s,a,r),s.child;case 11:return M_(t,s,s.type,s.pendingProps,r);case 7:return yt(t,s,s.pendingProps,r),s.child;case 8:return yt(t,s,s.pendingProps.children,r),s.child;case 12:return yt(t,s,s.pendingProps.children,r),s.child;case 10:return a=s.pendingProps,rs(s,s.type,a.value),yt(t,s,a.children,r),s.child;case 9:return c=s.type._context,a=s.pendingProps.children,Vs(s),c=kt(c),a=a(c),s.flags|=1,yt(t,s,a,r),s.child;case 14:return D_(t,s,s.type,s.pendingProps,r);case 15:return R_(t,s,s.type,s.pendingProps,r);case 19:return H_(t,s,r);case 31:return a=s.pendingProps,r=s.mode,a={mode:a.mode,children:a.children},t===null?(r=ya(a,r),r.ref=s.ref,s.child=r,r.return=s,s=r):(r=Li(t.child,a),r.ref=s.ref,s.child=r,r.return=s,s=r),s;case 22:return T_(t,s,r);case 24:return Vs(s),a=kt(lt),t===null?(c=fc(),c===null&&(c=He,u=uc(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=r),c=u),s.memoizedState={parent:a,cache:c},vc(s),rs(s,lt,c)):((t.lanes&r)!==0&&(gc(t,s),Ln(s,null,null,r),On()),c=t.memoizedState,u=s.memoizedState,c.parent!==a?(c={parent:a,cache:a},s.memoizedState=c,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=c),rs(s,lt,a)):(a=u.cache,rs(s,lt,a),a!==c.cache&&hc(s,[lt],r,!0))),yt(t,s,s.pendingProps.children,r),s.child;case 29:throw s.pendingProps}throw Error(l(156,s.tag))}function Yi(t){t.flags|=4}function P_(t,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Gv(s)){if(s=ai.current,s!==null&&((Ce&4194048)===Ce?bi!==null:(Ce&62914560)!==Ce&&(Ce&536870912)===0||s!==bi))throw Bn=_c,wf;t.flags|=8192}}function ba(t,s){s!==null&&(t.flags|=4),t.flags&16384&&(s=t.tag!==22?gd():536870912,t.lanes|=s,qr|=s)}function Wn(t,s){if(!ke)switch(t.tailMode){case"hidden":s=t.tail;for(var r=null;s!==null;)s.alternate!==null&&(r=s),s=s.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?s||t.tail===null?t.tail=null:t.tail.sibling=null:a.sibling=null}}function We(t){var s=t.alternate!==null&&t.alternate.child===t.child,r=0,a=0;if(s)for(var c=t.child;c!==null;)r|=c.lanes|c.childLanes,a|=c.subtreeFlags&65011712,a|=c.flags&65011712,c.return=t,c=c.sibling;else for(c=t.child;c!==null;)r|=c.lanes|c.childLanes,a|=c.subtreeFlags,a|=c.flags,c.return=t,c=c.sibling;return t.subtreeFlags|=a,t.childLanes=r,s}function AS(t,s,r){var a=s.pendingProps;switch(lc(s),s.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(s),null;case 1:return We(s),null;case 3:return r=s.stateNode,a=null,t!==null&&(a=t.memoizedState.cache),s.memoizedState.cache!==a&&(s.flags|=2048),Pi(lt),nt(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(En(s)?Yi(s):t===null||t.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,pf())),We(s),null;case 26:return r=s.memoizedState,t===null?(Yi(s),r!==null?(We(s),P_(s,r)):(We(s),s.flags&=-16777217)):r?r!==t.memoizedState?(Yi(s),We(s),P_(s,r)):(We(s),s.flags&=-16777217):(t.memoizedProps!==a&&Yi(s),We(s),s.flags&=-16777217),null;case 27:mi(s),r=re.current;var c=s.type;if(t!==null&&s.stateNode!=null)t.memoizedProps!==a&&Yi(s);else{if(!a){if(s.stateNode===null)throw Error(l(166));return We(s),null}t=se.current,En(s)?vf(s):(t=Pv(c,a,r),s.stateNode=t,Yi(s))}return We(s),null;case 5:if(mi(s),r=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==a&&Yi(s);else{if(!a){if(s.stateNode===null)throw Error(l(166));return We(s),null}if(t=se.current,En(s))vf(s);else{switch(c=Oa(re.current),t){case 1:t=c.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:t=c.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":t=c.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":t=c.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":t=c.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?t.multiple=!0:a.size&&(t.size=a.size);break;default:t=typeof a.is=="string"?c.createElement(r,{is:a.is}):c.createElement(r)}}t[Et]=s,t[Nt]=a;e:for(c=s.child;c!==null;){if(c.tag===5||c.tag===6)t.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break e;for(;c.sibling===null;){if(c.return===null||c.return===s)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}s.stateNode=t;e:switch(wt(t,r,a),r){case"button":case"input":case"select":case"textarea":t=!!a.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&Yi(s)}}return We(s),s.flags&=-16777217,null;case 6:if(t&&s.stateNode!=null)t.memoizedProps!==a&&Yi(s);else{if(typeof a!="string"&&s.stateNode===null)throw Error(l(166));if(t=re.current,En(s)){if(t=s.stateNode,r=s.memoizedProps,a=null,c=Tt,c!==null)switch(c.tag){case 27:case 5:a=c.memoizedProps}t[Et]=s,t=!!(t.nodeValue===r||a!==null&&a.suppressHydrationWarning===!0||Bv(t.nodeValue,r)),t||Ys(s)}else t=Oa(t).createTextNode(a),t[Et]=s,s.stateNode=t}return We(s),null;case 13:if(a=s.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(c=En(s),a!==null&&a.dehydrated!==null){if(t===null){if(!c)throw Error(l(318));if(c=s.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(l(317));c[Et]=s}else kn(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;We(s),c=!1}else c=pf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=c),c=!0;if(!c)return s.flags&256?(qi(s),s):(qi(s),null)}if(qi(s),(s.flags&128)!==0)return s.lanes=r,s;if(r=a!==null,t=t!==null&&t.memoizedState!==null,r){a=s.child,c=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(c=a.alternate.memoizedState.cachePool.pool);var u=null;a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==c&&(a.flags|=2048)}return r!==t&&r&&(s.child.flags|=8192),ba(s,s.updateQueue),We(s),null;case 4:return nt(),t===null&&mh(s.stateNode.containerInfo),We(s),null;case 10:return Pi(s.type),We(s),null;case 19:if(J(at),c=s.memoizedState,c===null)return We(s),null;if(a=(s.flags&128)!==0,u=c.rendering,u===null)if(a)Wn(c,!1);else{if(Xe!==0||t!==null&&(t.flags&128)!==0)for(t=s.child;t!==null;){if(u=ga(t),u!==null){for(s.flags|=128,Wn(c,!1),t=u.updateQueue,s.updateQueue=t,ba(s,t),s.subtreeFlags=0,t=r,r=s.child;r!==null;)ff(r,t),r=r.sibling;return Z(at,at.current&1|2),s.child}t=t.sibling}c.tail!==null&&Si()>xa&&(s.flags|=128,a=!0,Wn(c,!1),s.lanes=4194304)}else{if(!a)if(t=ga(u),t!==null){if(s.flags|=128,a=!0,t=t.updateQueue,s.updateQueue=t,ba(s,t),Wn(c,!0),c.tail===null&&c.tailMode==="hidden"&&!u.alternate&&!ke)return We(s),null}else 2*Si()-c.renderingStartTime>xa&&r!==536870912&&(s.flags|=128,a=!0,Wn(c,!1),s.lanes=4194304);c.isBackwards?(u.sibling=s.child,s.child=u):(t=c.last,t!==null?t.sibling=u:s.child=u,c.last=u)}return c.tail!==null?(s=c.tail,c.rendering=s,c.tail=s.sibling,c.renderingStartTime=Si(),s.sibling=null,t=at.current,Z(at,a?t&1|2:t&1),s):(We(s),null);case 22:case 23:return qi(s),yc(),a=s.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(s.flags|=8192):a&&(s.flags|=8192),a?(r&536870912)!==0&&(s.flags&128)===0&&(We(s),s.subtreeFlags&6&&(s.flags|=8192)):We(s),r=s.updateQueue,r!==null&&ba(s,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==r&&(s.flags|=2048),t!==null&&J(Xs),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),s.memoizedState.cache!==r&&(s.flags|=2048),Pi(lt),We(s),null;case 25:return null;case 30:return null}throw Error(l(156,s.tag))}function BS(t,s){switch(lc(s),s.tag){case 1:return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return Pi(lt),nt(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 26:case 27:case 5:return mi(s),null;case 13:if(qi(s),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(l(340));kn()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return J(at),null;case 4:return nt(),null;case 10:return Pi(s.type),null;case 22:case 23:return qi(s),yc(),t!==null&&J(Xs),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 24:return Pi(lt),null;case 25:return null;default:return null}}function j_(t,s){switch(lc(s),s.tag){case 3:Pi(lt),nt();break;case 26:case 27:case 5:mi(s);break;case 4:nt();break;case 13:qi(s);break;case 19:J(at);break;case 10:Pi(s.type);break;case 22:case 23:qi(s),yc(),t!==null&&J(Xs);break;case 24:Pi(lt)}}function Yn(t,s){try{var r=s.updateQueue,a=r!==null?r.lastEffect:null;if(a!==null){var c=a.next;r=c;do{if((r.tag&t)===t){a=void 0;var u=r.create,g=r.inst;a=u(),g.destroy=a}r=r.next}while(r!==c)}}catch(m){Ne(s,s.return,m)}}function us(t,s,r){try{var a=s.updateQueue,c=a!==null?a.lastEffect:null;if(c!==null){var u=c.next;a=u;do{if((a.tag&t)===t){var g=a.inst,m=g.destroy;if(m!==void 0){g.destroy=void 0,c=s;var b=r,B=m;try{B()}catch(W){Ne(c,b,W)}}}a=a.next}while(a!==u)}}catch(W){Ne(s,s.return,W)}}function q_(t){var s=t.updateQueue;if(s!==null){var r=t.stateNode;try{Df(s,r)}catch(a){Ne(t,t.return,a)}}}function W_(t,s,r){r.props=$s(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(a){Ne(t,s,a)}}function Kn(t,s){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof r=="function"?t.refCleanup=r(a):r.current=a}}catch(c){Ne(t,s,c)}}function wi(t,s){var r=t.ref,a=t.refCleanup;if(r!==null)if(typeof a=="function")try{a()}catch(c){Ne(t,s,c)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(c){Ne(t,s,c)}else r.current=null}function Y_(t){var s=t.type,r=t.memoizedProps,a=t.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":r.autoFocus&&a.focus();break e;case"img":r.src?a.src=r.src:r.srcSet&&(a.srcset=r.srcSet)}}catch(c){Ne(t,t.return,c)}}function $c(t,s,r){try{var a=t.stateNode;JS(a,t.type,r,s),a[Nt]=s}catch(c){Ne(t,t.return,c)}}function K_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ss(t.type)||t.tag===4}function Fc(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||K_(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Ss(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ic(t,s,r){var a=t.tag;if(a===5||a===6)t=t.stateNode,s?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,s):(s=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.appendChild(t),r=r._reactRootContainer,r!=null||s.onclick!==null||(s.onclick=za));else if(a!==4&&(a===27&&Ss(t.type)&&(r=t.stateNode,s=null),t=t.child,t!==null))for(Ic(t,s,r),t=t.sibling;t!==null;)Ic(t,s,r),t=t.sibling}function wa(t,s,r){var a=t.tag;if(a===5||a===6)t=t.stateNode,s?r.insertBefore(t,s):r.appendChild(t);else if(a!==4&&(a===27&&Ss(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(wa(t,s,r),t=t.sibling;t!==null;)wa(t,s,r),t=t.sibling}function V_(t){var s=t.stateNode,r=t.memoizedProps;try{for(var a=t.type,c=s.attributes;c.length;)s.removeAttributeNode(c[0]);wt(s,a,r),s[Et]=t,s[Nt]=r}catch(u){Ne(t,t.return,u)}}var Ki=!1,Ie=!1,Zc=!1,X_=typeof WeakSet=="function"?WeakSet:Set,ft=null;function zS(t,s){if(t=t.containerInfo,bh=ja,t=sf(t),Fo(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var a=r.getSelection&&r.getSelection();if(a&&a.rangeCount!==0){r=a.anchorNode;var c=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{r.nodeType,u.nodeType}catch{r=null;break e}var g=0,m=-1,b=-1,B=0,W=0,G=t,O=null;t:for(;;){for(var N;G!==r||c!==0&&G.nodeType!==3||(m=g+c),G!==u||a!==0&&G.nodeType!==3||(b=g+a),G.nodeType===3&&(g+=G.nodeValue.length),(N=G.firstChild)!==null;)O=G,G=N;for(;;){if(G===t)break t;if(O===r&&++B===c&&(m=g),O===u&&++W===a&&(b=g),(N=G.nextSibling)!==null)break;G=O,O=G.parentNode}G=N}r=m===-1||b===-1?null:{start:m,end:b}}else r=null}r=r||{start:0,end:0}}else r=null;for(wh={focusedElem:t,selectionRange:r},ja=!1,ft=s;ft!==null;)if(s=ft,t=s.child,(s.subtreeFlags&1024)!==0&&t!==null)t.return=s,ft=t;else for(;ft!==null;){switch(s=ft,u=s.alternate,t=s.flags,s.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&u!==null){t=void 0,r=s,c=u.memoizedProps,u=u.memoizedState,a=r.stateNode;try{var de=$s(r.type,c,r.elementType===r.type);t=a.getSnapshotBeforeUpdate(de,u),a.__reactInternalSnapshotBeforeUpdate=t}catch(he){Ne(r,r.return,he)}}break;case 3:if((t&1024)!==0){if(t=s.stateNode.containerInfo,r=t.nodeType,r===9)Eh(t);else if(r===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Eh(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(l(163))}if(t=s.sibling,t!==null){t.return=s.return,ft=t;break}ft=s.return}}function G_(t,s,r){var a=r.flags;switch(r.tag){case 0:case 11:case 15:ds(t,r),a&4&&Yn(5,r);break;case 1:if(ds(t,r),a&4)if(t=r.stateNode,s===null)try{t.componentDidMount()}catch(g){Ne(r,r.return,g)}else{var c=$s(r.type,s.memoizedProps);s=s.memoizedState;try{t.componentDidUpdate(c,s,t.__reactInternalSnapshotBeforeUpdate)}catch(g){Ne(r,r.return,g)}}a&64&&q_(r),a&512&&Kn(r,r.return);break;case 3:if(ds(t,r),a&64&&(t=r.updateQueue,t!==null)){if(s=null,r.child!==null)switch(r.child.tag){case 27:case 5:s=r.child.stateNode;break;case 1:s=r.child.stateNode}try{Df(t,s)}catch(g){Ne(r,r.return,g)}}break;case 27:s===null&&a&4&&V_(r);case 26:case 5:ds(t,r),s===null&&a&4&&Y_(r),a&512&&Kn(r,r.return);break;case 12:ds(t,r);break;case 13:ds(t,r),a&4&&I_(t,r),a&64&&(t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(r=WS.bind(null,r),ly(t,r))));break;case 22:if(a=r.memoizedState!==null||Ki,!a){s=s!==null&&s.memoizedState!==null||Ie,c=Ki;var u=Ie;Ki=a,(Ie=s)&&!u?fs(t,r,(r.subtreeFlags&8772)!==0):ds(t,r),Ki=c,Ie=u}break;case 30:break;default:ds(t,r)}}function $_(t){var s=t.alternate;s!==null&&(t.alternate=null,$_(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&To(s)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var je=null,Pt=!1;function Vi(t,s,r){for(r=r.child;r!==null;)F_(t,s,r),r=r.sibling}function F_(t,s,r){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(un,r)}catch{}switch(r.tag){case 26:Ie||wi(r,s),Vi(t,s,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Ie||wi(r,s);var a=je,c=Pt;Ss(r.type)&&(je=r.stateNode,Pt=!1),Vi(t,s,r),Jn(r.stateNode),je=a,Pt=c;break;case 5:Ie||wi(r,s);case 6:if(a=je,c=Pt,je=null,Vi(t,s,r),je=a,Pt=c,je!==null)if(Pt)try{(je.nodeType===9?je.body:je.nodeName==="HTML"?je.ownerDocument.body:je).removeChild(r.stateNode)}catch(u){Ne(r,s,u)}else try{je.removeChild(r.stateNode)}catch(u){Ne(r,s,u)}break;case 18:je!==null&&(Pt?(t=je,Hv(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,r.stateNode),al(t)):Hv(je,r.stateNode));break;case 4:a=je,c=Pt,je=r.stateNode.containerInfo,Pt=!0,Vi(t,s,r),je=a,Pt=c;break;case 0:case 11:case 14:case 15:Ie||us(2,r,s),Ie||us(4,r,s),Vi(t,s,r);break;case 1:Ie||(wi(r,s),a=r.stateNode,typeof a.componentWillUnmount=="function"&&W_(r,s,a)),Vi(t,s,r);break;case 21:Vi(t,s,r);break;case 22:Ie=(a=Ie)||r.memoizedState!==null,Vi(t,s,r),Ie=a;break;default:Vi(t,s,r)}}function I_(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{al(t)}catch(r){Ne(s,s.return,r)}}function OS(t){switch(t.tag){case 13:case 19:var s=t.stateNode;return s===null&&(s=t.stateNode=new X_),s;case 22:return t=t.stateNode,s=t._retryCache,s===null&&(s=t._retryCache=new X_),s;default:throw Error(l(435,t.tag))}}function Qc(t,s){var r=OS(t);s.forEach(function(a){var c=YS.bind(null,t,a);r.has(a)||(r.add(a),a.then(c,c))})}function Gt(t,s){var r=s.deletions;if(r!==null)for(var a=0;a<r.length;a++){var c=r[a],u=t,g=s,m=g;e:for(;m!==null;){switch(m.tag){case 27:if(Ss(m.type)){je=m.stateNode,Pt=!1;break e}break;case 5:je=m.stateNode,Pt=!1;break e;case 3:case 4:je=m.stateNode.containerInfo,Pt=!0;break e}m=m.return}if(je===null)throw Error(l(160));F_(u,g,c),je=null,Pt=!1,u=c.alternate,u!==null&&(u.return=null),c.return=null}if(s.subtreeFlags&13878)for(s=s.child;s!==null;)Z_(s,t),s=s.sibling}var vi=null;function Z_(t,s){var r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Gt(s,t),$t(t),a&4&&(us(3,t,t.return),Yn(3,t),us(5,t,t.return));break;case 1:Gt(s,t),$t(t),a&512&&(Ie||r===null||wi(r,r.return)),a&64&&Ki&&(t=t.updateQueue,t!==null&&(a=t.callbacks,a!==null&&(r=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=r===null?a:r.concat(a))));break;case 26:var c=vi;if(Gt(s,t),$t(t),a&512&&(Ie||r===null||wi(r,r.return)),a&4){var u=r!==null?r.memoizedState:null;if(a=t.memoizedState,r===null)if(a===null)if(t.stateNode===null){e:{a=t.type,r=t.memoizedProps,c=c.ownerDocument||c;t:switch(a){case"title":u=c.getElementsByTagName("title")[0],(!u||u[_n]||u[Et]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=c.createElement(a),c.head.insertBefore(u,c.querySelector("head > title"))),wt(u,a,r),u[Et]=t,ut(u),a=u;break e;case"link":var g=Vv("link","href",c).get(a+(r.href||""));if(g){for(var m=0;m<g.length;m++)if(u=g[m],u.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&u.getAttribute("rel")===(r.rel==null?null:r.rel)&&u.getAttribute("title")===(r.title==null?null:r.title)&&u.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){g.splice(m,1);break t}}u=c.createElement(a),wt(u,a,r),c.head.appendChild(u);break;case"meta":if(g=Vv("meta","content",c).get(a+(r.content||""))){for(m=0;m<g.length;m++)if(u=g[m],u.getAttribute("content")===(r.content==null?null:""+r.content)&&u.getAttribute("name")===(r.name==null?null:r.name)&&u.getAttribute("property")===(r.property==null?null:r.property)&&u.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&u.getAttribute("charset")===(r.charSet==null?null:r.charSet)){g.splice(m,1);break t}}u=c.createElement(a),wt(u,a,r),c.head.appendChild(u);break;default:throw Error(l(468,a))}u[Et]=t,ut(u),a=u}t.stateNode=a}else Xv(c,t.type,t.stateNode);else t.stateNode=Kv(c,a,t.memoizedProps);else u!==a?(u===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):u.count--,a===null?Xv(c,t.type,t.stateNode):Kv(c,a,t.memoizedProps)):a===null&&t.stateNode!==null&&$c(t,t.memoizedProps,r.memoizedProps)}break;case 27:Gt(s,t),$t(t),a&512&&(Ie||r===null||wi(r,r.return)),r!==null&&a&4&&$c(t,t.memoizedProps,r.memoizedProps);break;case 5:if(Gt(s,t),$t(t),a&512&&(Ie||r===null||wi(r,r.return)),t.flags&32){c=t.stateNode;try{Sr(c,"")}catch(N){Ne(t,t.return,N)}}a&4&&t.stateNode!=null&&(c=t.memoizedProps,$c(t,c,r!==null?r.memoizedProps:c)),a&1024&&(Zc=!0);break;case 6:if(Gt(s,t),$t(t),a&4){if(t.stateNode===null)throw Error(l(162));a=t.memoizedProps,r=t.stateNode;try{r.nodeValue=a}catch(N){Ne(t,t.return,N)}}break;case 3:if(Ha=null,c=vi,vi=La(s.containerInfo),Gt(s,t),vi=c,$t(t),a&4&&r!==null&&r.memoizedState.isDehydrated)try{al(s.containerInfo)}catch(N){Ne(t,t.return,N)}Zc&&(Zc=!1,Q_(t));break;case 4:a=vi,vi=La(t.stateNode.containerInfo),Gt(s,t),$t(t),vi=a;break;case 12:Gt(s,t),$t(t);break;case 13:Gt(s,t),$t(t),t.child.flags&8192&&t.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(rh=Si()),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,Qc(t,a)));break;case 22:c=t.memoizedState!==null;var b=r!==null&&r.memoizedState!==null,B=Ki,W=Ie;if(Ki=B||c,Ie=W||b,Gt(s,t),Ie=W,Ki=B,$t(t),a&8192)e:for(s=t.stateNode,s._visibility=c?s._visibility&-2:s._visibility|1,c&&(r===null||b||Ki||Ie||Fs(t)),r=null,s=t;;){if(s.tag===5||s.tag===26){if(r===null){b=r=s;try{if(u=b.stateNode,c)g=u.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{m=b.stateNode;var G=b.memoizedProps.style,O=G!=null&&G.hasOwnProperty("display")?G.display:null;m.style.display=O==null||typeof O=="boolean"?"":(""+O).trim()}}catch(N){Ne(b,b.return,N)}}}else if(s.tag===6){if(r===null){b=s;try{b.stateNode.nodeValue=c?"":b.memoizedProps}catch(N){Ne(b,b.return,N)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===t)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;r===s&&(r=null),s=s.return}r===s&&(r=null),s.sibling.return=s.return,s=s.sibling}a&4&&(a=t.updateQueue,a!==null&&(r=a.retryQueue,r!==null&&(a.retryQueue=null,Qc(t,r))));break;case 19:Gt(s,t),$t(t),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,Qc(t,a)));break;case 30:break;case 21:break;default:Gt(s,t),$t(t)}}function $t(t){var s=t.flags;if(s&2){try{for(var r,a=t.return;a!==null;){if(K_(a)){r=a;break}a=a.return}if(r==null)throw Error(l(160));switch(r.tag){case 27:var c=r.stateNode,u=Fc(t);wa(t,u,c);break;case 5:var g=r.stateNode;r.flags&32&&(Sr(g,""),r.flags&=-33);var m=Fc(t);wa(t,m,g);break;case 3:case 4:var b=r.stateNode.containerInfo,B=Fc(t);Ic(t,B,b);break;default:throw Error(l(161))}}catch(W){Ne(t,t.return,W)}t.flags&=-3}s&4096&&(t.flags&=-4097)}function Q_(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var s=t;Q_(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),t=t.sibling}}function ds(t,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)G_(t,s.alternate,s),s=s.sibling}function Fs(t){for(t=t.child;t!==null;){var s=t;switch(s.tag){case 0:case 11:case 14:case 15:us(4,s,s.return),Fs(s);break;case 1:wi(s,s.return);var r=s.stateNode;typeof r.componentWillUnmount=="function"&&W_(s,s.return,r),Fs(s);break;case 27:Jn(s.stateNode);case 26:case 5:wi(s,s.return),Fs(s);break;case 22:s.memoizedState===null&&Fs(s);break;case 30:Fs(s);break;default:Fs(s)}t=t.sibling}}function fs(t,s,r){for(r=r&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var a=s.alternate,c=t,u=s,g=u.flags;switch(u.tag){case 0:case 11:case 15:fs(c,u,r),Yn(4,u);break;case 1:if(fs(c,u,r),a=u,c=a.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(B){Ne(a,a.return,B)}if(a=u,c=a.updateQueue,c!==null){var m=a.stateNode;try{var b=c.shared.hiddenCallbacks;if(b!==null)for(c.shared.hiddenCallbacks=null,c=0;c<b.length;c++)Mf(b[c],m)}catch(B){Ne(a,a.return,B)}}r&&g&64&&q_(u),Kn(u,u.return);break;case 27:V_(u);case 26:case 5:fs(c,u,r),r&&a===null&&g&4&&Y_(u),Kn(u,u.return);break;case 12:fs(c,u,r);break;case 13:fs(c,u,r),r&&g&4&&I_(c,u);break;case 22:u.memoizedState===null&&fs(c,u,r),Kn(u,u.return);break;case 30:break;default:fs(c,u,r)}s=s.sibling}}function Jc(t,s){var r=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),t=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(t=s.memoizedState.cachePool.pool),t!==r&&(t!=null&&t.refCount++,r!=null&&Rn(r))}function eh(t,s){t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&Rn(t))}function Ci(t,s,r,a){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)J_(t,s,r,a),s=s.sibling}function J_(t,s,r,a){var c=s.flags;switch(s.tag){case 0:case 11:case 15:Ci(t,s,r,a),c&2048&&Yn(9,s);break;case 1:Ci(t,s,r,a);break;case 3:Ci(t,s,r,a),c&2048&&(t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&Rn(t)));break;case 12:if(c&2048){Ci(t,s,r,a),t=s.stateNode;try{var u=s.memoizedProps,g=u.id,m=u.onPostCommit;typeof m=="function"&&m(g,s.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(b){Ne(s,s.return,b)}}else Ci(t,s,r,a);break;case 13:Ci(t,s,r,a);break;case 23:break;case 22:u=s.stateNode,g=s.alternate,s.memoizedState!==null?u._visibility&2?Ci(t,s,r,a):Vn(t,s):u._visibility&2?Ci(t,s,r,a):(u._visibility|=2,Ur(t,s,r,a,(s.subtreeFlags&10256)!==0)),c&2048&&Jc(g,s);break;case 24:Ci(t,s,r,a),c&2048&&eh(s.alternate,s);break;default:Ci(t,s,r,a)}}function Ur(t,s,r,a,c){for(c=c&&(s.subtreeFlags&10256)!==0,s=s.child;s!==null;){var u=t,g=s,m=r,b=a,B=g.flags;switch(g.tag){case 0:case 11:case 15:Ur(u,g,m,b,c),Yn(8,g);break;case 23:break;case 22:var W=g.stateNode;g.memoizedState!==null?W._visibility&2?Ur(u,g,m,b,c):Vn(u,g):(W._visibility|=2,Ur(u,g,m,b,c)),c&&B&2048&&Jc(g.alternate,g);break;case 24:Ur(u,g,m,b,c),c&&B&2048&&eh(g.alternate,g);break;default:Ur(u,g,m,b,c)}s=s.sibling}}function Vn(t,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var r=t,a=s,c=a.flags;switch(a.tag){case 22:Vn(r,a),c&2048&&Jc(a.alternate,a);break;case 24:Vn(r,a),c&2048&&eh(a.alternate,a);break;default:Vn(r,a)}s=s.sibling}}var Xn=8192;function Pr(t){if(t.subtreeFlags&Xn)for(t=t.child;t!==null;)ev(t),t=t.sibling}function ev(t){switch(t.tag){case 26:Pr(t),t.flags&Xn&&t.memoizedState!==null&&Sy(vi,t.memoizedState,t.memoizedProps);break;case 5:Pr(t);break;case 3:case 4:var s=vi;vi=La(t.stateNode.containerInfo),Pr(t),vi=s;break;case 22:t.memoizedState===null&&(s=t.alternate,s!==null&&s.memoizedState!==null?(s=Xn,Xn=16777216,Pr(t),Xn=s):Pr(t));break;default:Pr(t)}}function tv(t){var s=t.alternate;if(s!==null&&(t=s.child,t!==null)){s.child=null;do s=t.sibling,t.sibling=null,t=s;while(t!==null)}}function Gn(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var r=0;r<s.length;r++){var a=s[r];ft=a,sv(a,t)}tv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)iv(t),t=t.sibling}function iv(t){switch(t.tag){case 0:case 11:case 15:Gn(t),t.flags&2048&&us(9,t,t.return);break;case 3:Gn(t);break;case 12:Gn(t);break;case 22:var s=t.stateNode;t.memoizedState!==null&&s._visibility&2&&(t.return===null||t.return.tag!==13)?(s._visibility&=-3,Ca(t)):Gn(t);break;default:Gn(t)}}function Ca(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var r=0;r<s.length;r++){var a=s[r];ft=a,sv(a,t)}tv(t)}for(t=t.child;t!==null;){switch(s=t,s.tag){case 0:case 11:case 15:us(8,s,s.return),Ca(s);break;case 22:r=s.stateNode,r._visibility&2&&(r._visibility&=-3,Ca(s));break;default:Ca(s)}t=t.sibling}}function sv(t,s){for(;ft!==null;){var r=ft;switch(r.tag){case 0:case 11:case 15:us(8,r,s);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var a=r.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Rn(r.memoizedState.cache)}if(a=r.child,a!==null)a.return=r,ft=a;else e:for(r=t;ft!==null;){a=ft;var c=a.sibling,u=a.return;if($_(a),a===r){ft=null;break e}if(c!==null){c.return=u,ft=c;break e}ft=u}}}var LS={getCacheForType:function(t){var s=kt(lt),r=s.data.get(t);return r===void 0&&(r=t(),s.data.set(t,r)),r}},NS=typeof WeakMap=="function"?WeakMap:Map,De=0,He=null,be=null,Ce=0,Re=0,Ft=null,_s=!1,jr=!1,th=!1,Xi=0,Xe=0,vs=0,Is=0,ih=0,oi=0,qr=0,$n=null,jt=null,sh=!1,rh=0,xa=1/0,Ea=null,gs=null,bt=0,ps=null,Wr=null,Yr=0,nh=0,lh=null,rv=null,Fn=0,ah=null;function It(){if((De&2)!==0&&Ce!==0)return Ce&-Ce;if(M.T!==null){var t=Tr;return t!==0?t:_h()}return Sd()}function nv(){oi===0&&(oi=(Ce&536870912)===0||ke?vd():536870912);var t=ai.current;return t!==null&&(t.flags|=32),oi}function Zt(t,s,r){(t===He&&(Re===2||Re===9)||t.cancelPendingCommit!==null)&&(Kr(t,0),ms(t,Ce,oi,!1)),fn(t,r),((De&2)===0||t!==He)&&(t===He&&((De&2)===0&&(Is|=r),Xe===4&&ms(t,Ce,oi,!1)),xi(t))}function lv(t,s,r){if((De&6)!==0)throw Error(l(327));var a=!r&&(s&124)===0&&(s&t.expiredLanes)===0||dn(t,s),c=a?PS(t,s):hh(t,s,!0),u=a;do{if(c===0){jr&&!a&&ms(t,s,0,!1);break}else{if(r=t.current.alternate,u&&!HS(r)){c=hh(t,s,!1),u=!1;continue}if(c===2){if(u=s,t.errorRecoveryDisabledLanes&u)var g=0;else g=t.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){s=g;e:{var m=t;c=$n;var b=m.current.memoizedState.isDehydrated;if(b&&(Kr(m,g).flags|=256),g=hh(m,g,!1),g!==2){if(th&&!b){m.errorRecoveryDisabledLanes|=u,Is|=u,c=4;break e}u=jt,jt=c,u!==null&&(jt===null?jt=u:jt.push.apply(jt,u))}c=g}if(u=!1,c!==2)continue}}if(c===1){Kr(t,0),ms(t,s,0,!0);break}e:{switch(a=t,u=c,u){case 0:case 1:throw Error(l(345));case 4:if((s&4194048)!==s)break;case 6:ms(a,s,oi,!_s);break e;case 2:jt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((s&62914560)===s&&(c=rh+300-Si(),10<c)){if(ms(a,s,oi,!_s),Nl(a,0,!0)!==0)break e;a.timeoutHandle=Lv(av.bind(null,a,r,jt,Ea,sh,s,oi,Is,qr,_s,u,2,-0,0),c);break e}av(a,r,jt,Ea,sh,s,oi,Is,qr,_s,u,0,-0,0)}}break}while(!0);xi(t)}function av(t,s,r,a,c,u,g,m,b,B,W,G,O,N){if(t.timeoutHandle=-1,G=s.subtreeFlags,(G&8192||(G&16785408)===16785408)&&(il={stylesheets:null,count:0,unsuspend:my},ev(s),G=yy(),G!==null)){t.cancelPendingCommit=G(_v.bind(null,t,s,u,r,a,c,g,m,b,W,1,O,N)),ms(t,u,g,!B);return}_v(t,s,u,r,a,c,g,m,b)}function HS(t){for(var s=t;;){var r=s.tag;if((r===0||r===11||r===15)&&s.flags&16384&&(r=s.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var a=0;a<r.length;a++){var c=r[a],u=c.getSnapshot;c=c.value;try{if(!Vt(u(),c))return!1}catch{return!1}}if(r=s.child,s.subtreeFlags&16384&&r!==null)r.return=s,s=r;else{if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function ms(t,s,r,a){s&=~ih,s&=~Is,t.suspendedLanes|=s,t.pingedLanes&=~s,a&&(t.warmLanes|=s),a=t.expirationTimes;for(var c=s;0<c;){var u=31-Kt(c),g=1<<u;a[u]=-1,c&=~g}r!==0&&pd(t,r,s)}function ka(){return(De&6)===0?(In(0),!1):!0}function oh(){if(be!==null){if(Re===0)var t=be.return;else t=be,Ui=Ks=null,Ec(t),Nr=null,jn=0,t=be;for(;t!==null;)j_(t.alternate,t),t=t.return;be=null}}function Kr(t,s){var r=t.timeoutHandle;r!==-1&&(t.timeoutHandle=-1,ty(r)),r=t.cancelPendingCommit,r!==null&&(t.cancelPendingCommit=null,r()),oh(),He=t,be=r=Li(t.current,null),Ce=s,Re=0,Ft=null,_s=!1,jr=dn(t,s),th=!1,qr=oi=ih=Is=vs=Xe=0,jt=$n=null,sh=!1,(s&8)!==0&&(s|=s&32);var a=t.entangledLanes;if(a!==0)for(t=t.entanglements,a&=s;0<a;){var c=31-Kt(a),u=1<<c;s|=t[c],a&=~u}return Xi=s,$l(),r}function ov(t,s){pe=null,M.H=fa,s===An||s===sa?(s=Ef(),Re=3):s===wf?(s=Ef(),Re=4):Re=s===k_?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Ft=s,be===null&&(Xe=1,ma(t,si(s,t.current)))}function cv(){var t=M.H;return M.H=fa,t===null?fa:t}function hv(){var t=M.A;return M.A=LS,t}function ch(){Xe=4,_s||(Ce&4194048)!==Ce&&ai.current!==null||(jr=!0),(vs&134217727)===0&&(Is&134217727)===0||He===null||ms(He,Ce,oi,!1)}function hh(t,s,r){var a=De;De|=2;var c=cv(),u=hv();(He!==t||Ce!==s)&&(Ea=null,Kr(t,s)),s=!1;var g=Xe;e:do try{if(Re!==0&&be!==null){var m=be,b=Ft;switch(Re){case 8:oh(),g=6;break e;case 3:case 2:case 9:case 6:ai.current===null&&(s=!0);var B=Re;if(Re=0,Ft=null,Vr(t,m,b,B),r&&jr){g=0;break e}break;default:B=Re,Re=0,Ft=null,Vr(t,m,b,B)}}US(),g=Xe;break}catch(W){ov(t,W)}while(!0);return s&&t.shellSuspendCounter++,Ui=Ks=null,De=a,M.H=c,M.A=u,be===null&&(He=null,Ce=0,$l()),g}function US(){for(;be!==null;)uv(be)}function PS(t,s){var r=De;De|=2;var a=cv(),c=hv();He!==t||Ce!==s?(Ea=null,xa=Si()+500,Kr(t,s)):jr=dn(t,s);e:do try{if(Re!==0&&be!==null){s=be;var u=Ft;t:switch(Re){case 1:Re=0,Ft=null,Vr(t,s,u,1);break;case 2:case 9:if(Cf(u)){Re=0,Ft=null,dv(s);break}s=function(){Re!==2&&Re!==9||He!==t||(Re=7),xi(t)},u.then(s,s);break e;case 3:Re=7;break e;case 4:Re=5;break e;case 7:Cf(u)?(Re=0,Ft=null,dv(s)):(Re=0,Ft=null,Vr(t,s,u,7));break;case 5:var g=null;switch(be.tag){case 26:g=be.memoizedState;case 5:case 27:var m=be;if(!g||Gv(g)){Re=0,Ft=null;var b=m.sibling;if(b!==null)be=b;else{var B=m.return;B!==null?(be=B,Ma(B)):be=null}break t}}Re=0,Ft=null,Vr(t,s,u,5);break;case 6:Re=0,Ft=null,Vr(t,s,u,6);break;case 8:oh(),Xe=6;break e;default:throw Error(l(462))}}jS();break}catch(W){ov(t,W)}while(!0);return Ui=Ks=null,M.H=a,M.A=c,De=r,be!==null?0:(He=null,Ce=0,$l(),Xe)}function jS(){for(;be!==null&&!o0();)uv(be)}function uv(t){var s=U_(t.alternate,t,Xi);t.memoizedProps=t.pendingProps,s===null?Ma(t):be=s}function dv(t){var s=t,r=s.alternate;switch(s.tag){case 15:case 0:s=B_(r,s,s.pendingProps,s.type,void 0,Ce);break;case 11:s=B_(r,s,s.pendingProps,s.type.render,s.ref,Ce);break;case 5:Ec(s);default:j_(r,s),s=be=ff(s,Xi),s=U_(r,s,Xi)}t.memoizedProps=t.pendingProps,s===null?Ma(t):be=s}function Vr(t,s,r,a){Ui=Ks=null,Ec(s),Nr=null,jn=0;var c=s.return;try{if(RS(t,c,s,r,Ce)){Xe=1,ma(t,si(r,t.current)),be=null;return}}catch(u){if(c!==null)throw be=c,u;Xe=1,ma(t,si(r,t.current)),be=null;return}s.flags&32768?(ke||a===1?t=!0:jr||(Ce&536870912)!==0?t=!1:(_s=t=!0,(a===2||a===9||a===3||a===6)&&(a=ai.current,a!==null&&a.tag===13&&(a.flags|=16384))),fv(s,t)):Ma(s)}function Ma(t){var s=t;do{if((s.flags&32768)!==0){fv(s,_s);return}t=s.return;var r=AS(s.alternate,s,Xi);if(r!==null){be=r;return}if(s=s.sibling,s!==null){be=s;return}be=s=t}while(s!==null);Xe===0&&(Xe=5)}function fv(t,s){do{var r=BS(t.alternate,t);if(r!==null){r.flags&=32767,be=r;return}if(r=t.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!s&&(t=t.sibling,t!==null)){be=t;return}be=t=r}while(t!==null);Xe=6,be=null}function _v(t,s,r,a,c,u,g,m,b){t.cancelPendingCommit=null;do Da();while(bt!==0);if((De&6)!==0)throw Error(l(327));if(s!==null){if(s===t.current)throw Error(l(177));if(u=s.lanes|s.childLanes,u|=ec,m0(t,r,u,g,m,b),t===He&&(be=He=null,Ce=0),Wr=s,ps=t,Yr=r,nh=u,lh=c,rv=a,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,KS(zl,function(){return Sv(),null})):(t.callbackNode=null,t.callbackPriority=0),a=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||a){a=M.T,M.T=null,c=q.p,q.p=2,g=De,De|=4;try{zS(t,s,r)}finally{De=g,q.p=c,M.T=a}}bt=1,vv(),gv(),pv()}}function vv(){if(bt===1){bt=0;var t=ps,s=Wr,r=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||r){r=M.T,M.T=null;var a=q.p;q.p=2;var c=De;De|=4;try{Z_(s,t);var u=wh,g=sf(t.containerInfo),m=u.focusedElem,b=u.selectionRange;if(g!==m&&m&&m.ownerDocument&&tf(m.ownerDocument.documentElement,m)){if(b!==null&&Fo(m)){var B=b.start,W=b.end;if(W===void 0&&(W=B),"selectionStart"in m)m.selectionStart=B,m.selectionEnd=Math.min(W,m.value.length);else{var G=m.ownerDocument||document,O=G&&G.defaultView||window;if(O.getSelection){var N=O.getSelection(),de=m.textContent.length,he=Math.min(b.start,de),ze=b.end===void 0?he:Math.min(b.end,de);!N.extend&&he>ze&&(g=ze,ze=he,he=g);var D=ef(m,he),k=ef(m,ze);if(D&&k&&(N.rangeCount!==1||N.anchorNode!==D.node||N.anchorOffset!==D.offset||N.focusNode!==k.node||N.focusOffset!==k.offset)){var A=G.createRange();A.setStart(D.node,D.offset),N.removeAllRanges(),he>ze?(N.addRange(A),N.extend(k.node,k.offset)):(A.setEnd(k.node,k.offset),N.addRange(A))}}}}for(G=[],N=m;N=N.parentNode;)N.nodeType===1&&G.push({element:N,left:N.scrollLeft,top:N.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<G.length;m++){var K=G[m];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}ja=!!bh,wh=bh=null}finally{De=c,q.p=a,M.T=r}}t.current=s,bt=2}}function gv(){if(bt===2){bt=0;var t=ps,s=Wr,r=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||r){r=M.T,M.T=null;var a=q.p;q.p=2;var c=De;De|=4;try{G_(t,s.alternate,s)}finally{De=c,q.p=a,M.T=r}}bt=3}}function pv(){if(bt===4||bt===3){bt=0,c0();var t=ps,s=Wr,r=Yr,a=rv;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?bt=5:(bt=0,Wr=ps=null,mv(t,t.pendingLanes));var c=t.pendingLanes;if(c===0&&(gs=null),Do(r),s=s.stateNode,Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(un,s,void 0,(s.current.flags&128)===128)}catch{}if(a!==null){s=M.T,c=q.p,q.p=2,M.T=null;try{for(var u=t.onRecoverableError,g=0;g<a.length;g++){var m=a[g];u(m.value,{componentStack:m.stack})}}finally{M.T=s,q.p=c}}(Yr&3)!==0&&Da(),xi(t),c=t.pendingLanes,(r&4194090)!==0&&(c&42)!==0?t===ah?Fn++:(Fn=0,ah=t):Fn=0,In(0)}}function mv(t,s){(t.pooledCacheLanes&=s)===0&&(s=t.pooledCache,s!=null&&(t.pooledCache=null,Rn(s)))}function Da(t){return vv(),gv(),pv(),Sv()}function Sv(){if(bt!==5)return!1;var t=ps,s=nh;nh=0;var r=Do(Yr),a=M.T,c=q.p;try{q.p=32>r?32:r,M.T=null,r=lh,lh=null;var u=ps,g=Yr;if(bt=0,Wr=ps=null,Yr=0,(De&6)!==0)throw Error(l(331));var m=De;if(De|=4,iv(u.current),J_(u,u.current,g,r),De=m,In(0,!1),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(un,u)}catch{}return!0}finally{q.p=c,M.T=a,mv(t,s)}}function yv(t,s,r){s=si(r,s),s=Pc(t.stateNode,s,2),t=as(t,s,2),t!==null&&(fn(t,2),xi(t))}function Ne(t,s,r){if(t.tag===3)yv(t,t,r);else for(;s!==null;){if(s.tag===3){yv(s,t,r);break}else if(s.tag===1){var a=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(gs===null||!gs.has(a))){t=si(r,t),r=x_(2),a=as(s,r,2),a!==null&&(E_(r,a,s,t),fn(a,2),xi(a));break}}s=s.return}}function uh(t,s,r){var a=t.pingCache;if(a===null){a=t.pingCache=new NS;var c=new Set;a.set(s,c)}else c=a.get(s),c===void 0&&(c=new Set,a.set(s,c));c.has(r)||(th=!0,c.add(r),t=qS.bind(null,t,s,r),s.then(t,t))}function qS(t,s,r){var a=t.pingCache;a!==null&&a.delete(s),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,He===t&&(Ce&r)===r&&(Xe===4||Xe===3&&(Ce&62914560)===Ce&&300>Si()-rh?(De&2)===0&&Kr(t,0):ih|=r,qr===Ce&&(qr=0)),xi(t)}function bv(t,s){s===0&&(s=gd()),t=kr(t,s),t!==null&&(fn(t,s),xi(t))}function WS(t){var s=t.memoizedState,r=0;s!==null&&(r=s.retryLane),bv(t,r)}function YS(t,s){var r=0;switch(t.tag){case 13:var a=t.stateNode,c=t.memoizedState;c!==null&&(r=c.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(l(314))}a!==null&&a.delete(s),bv(t,r)}function KS(t,s){return xe(t,s)}var Ra=null,Xr=null,dh=!1,Ta=!1,fh=!1,Zs=0;function xi(t){t!==Xr&&t.next===null&&(Xr===null?Ra=Xr=t:Xr=Xr.next=t),Ta=!0,dh||(dh=!0,XS())}function In(t,s){if(!fh&&Ta){fh=!0;do for(var r=!1,a=Ra;a!==null;){if(t!==0){var c=a.pendingLanes;if(c===0)var u=0;else{var g=a.suspendedLanes,m=a.pingedLanes;u=(1<<31-Kt(42|t)+1)-1,u&=c&~(g&~m),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(r=!0,Ev(a,u))}else u=Ce,u=Nl(a,a===He?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||dn(a,u)||(r=!0,Ev(a,u));a=a.next}while(r);fh=!1}}function VS(){wv()}function wv(){Ta=dh=!1;var t=0;Zs!==0&&(ey()&&(t=Zs),Zs=0);for(var s=Si(),r=null,a=Ra;a!==null;){var c=a.next,u=Cv(a,s);u===0?(a.next=null,r===null?Ra=c:r.next=c,c===null&&(Xr=r)):(r=a,(t!==0||(u&3)!==0)&&(Ta=!0)),a=c}In(t)}function Cv(t,s){for(var r=t.suspendedLanes,a=t.pingedLanes,c=t.expirationTimes,u=t.pendingLanes&-62914561;0<u;){var g=31-Kt(u),m=1<<g,b=c[g];b===-1?((m&r)===0||(m&a)!==0)&&(c[g]=p0(m,s)):b<=s&&(t.expiredLanes|=m),u&=~m}if(s=He,r=Ce,r=Nl(t,t===s?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a=t.callbackNode,r===0||t===s&&(Re===2||Re===9)||t.cancelPendingCommit!==null)return a!==null&&a!==null&&zs(a),t.callbackNode=null,t.callbackPriority=0;if((r&3)===0||dn(t,r)){if(s=r&-r,s===t.callbackPriority)return s;switch(a!==null&&zs(a),Do(r)){case 2:case 8:r=fd;break;case 32:r=zl;break;case 268435456:r=_d;break;default:r=zl}return a=xv.bind(null,t),r=xe(r,a),t.callbackPriority=s,t.callbackNode=r,s}return a!==null&&a!==null&&zs(a),t.callbackPriority=2,t.callbackNode=null,2}function xv(t,s){if(bt!==0&&bt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var r=t.callbackNode;if(Da()&&t.callbackNode!==r)return null;var a=Ce;return a=Nl(t,t===He?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a===0?null:(lv(t,a,s),Cv(t,Si()),t.callbackNode!=null&&t.callbackNode===r?xv.bind(null,t):null)}function Ev(t,s){if(Da())return null;lv(t,s,!0)}function XS(){iy(function(){(De&6)!==0?xe(dd,VS):wv()})}function _h(){return Zs===0&&(Zs=vd()),Zs}function kv(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ql(""+t)}function Mv(t,s){var r=s.ownerDocument.createElement("input");return r.name=s.name,r.value=s.value,t.id&&r.setAttribute("form",t.id),s.parentNode.insertBefore(r,s),t=new FormData(t),r.parentNode.removeChild(r),t}function GS(t,s,r,a,c){if(s==="submit"&&r&&r.stateNode===c){var u=kv((c[Nt]||null).action),g=a.submitter;g&&(s=(s=g[Nt]||null)?kv(s.formAction):g.getAttribute("formAction"),s!==null&&(u=s,g=null));var m=new Vl("action","action",null,a,c);t.push({event:m,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Zs!==0){var b=g?Mv(c,g):new FormData(c);Oc(r,{pending:!0,data:b,method:c.method,action:u},null,b)}}else typeof u=="function"&&(m.preventDefault(),b=g?Mv(c,g):new FormData(c),Oc(r,{pending:!0,data:b,method:c.method,action:u},u,b))},currentTarget:c}]})}}for(var vh=0;vh<Jo.length;vh++){var gh=Jo[vh],$S=gh.toLowerCase(),FS=gh[0].toUpperCase()+gh.slice(1);_i($S,"on"+FS)}_i(lf,"onAnimationEnd"),_i(af,"onAnimationIteration"),_i(of,"onAnimationStart"),_i("dblclick","onDoubleClick"),_i("focusin","onFocus"),_i("focusout","onBlur"),_i(dS,"onTransitionRun"),_i(fS,"onTransitionStart"),_i(_S,"onTransitionCancel"),_i(cf,"onTransitionEnd"),gr("onMouseEnter",["mouseout","mouseover"]),gr("onMouseLeave",["mouseout","mouseover"]),gr("onPointerEnter",["pointerout","pointerover"]),gr("onPointerLeave",["pointerout","pointerover"]),Ls("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ls("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ls("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ls("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ls("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ls("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zn="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(" "),IS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zn));function Dv(t,s){s=(s&4)!==0;for(var r=0;r<t.length;r++){var a=t[r],c=a.event;a=a.listeners;e:{var u=void 0;if(s)for(var g=a.length-1;0<=g;g--){var m=a[g],b=m.instance,B=m.currentTarget;if(m=m.listener,b!==u&&c.isPropagationStopped())break e;u=m,c.currentTarget=B;try{u(c)}catch(W){pa(W)}c.currentTarget=null,u=b}else for(g=0;g<a.length;g++){if(m=a[g],b=m.instance,B=m.currentTarget,m=m.listener,b!==u&&c.isPropagationStopped())break e;u=m,c.currentTarget=B;try{u(c)}catch(W){pa(W)}c.currentTarget=null,u=b}}}}function we(t,s){var r=s[Ro];r===void 0&&(r=s[Ro]=new Set);var a=t+"__bubble";r.has(a)||(Rv(s,t,2,!1),r.add(a))}function ph(t,s,r){var a=0;s&&(a|=4),Rv(r,t,a,s)}var Aa="_reactListening"+Math.random().toString(36).slice(2);function mh(t){if(!t[Aa]){t[Aa]=!0,bd.forEach(function(r){r!=="selectionchange"&&(IS.has(r)||ph(r,!1,t),ph(r,!0,t))});var s=t.nodeType===9?t:t.ownerDocument;s===null||s[Aa]||(s[Aa]=!0,ph("selectionchange",!1,s))}}function Rv(t,s,r,a){switch(Jv(s)){case 2:var c=Cy;break;case 8:c=xy;break;default:c=Bh}r=c.bind(null,s,r,t),c=void 0,!jo||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(c=!0),a?c!==void 0?t.addEventListener(s,r,{capture:!0,passive:c}):t.addEventListener(s,r,!0):c!==void 0?t.addEventListener(s,r,{passive:c}):t.addEventListener(s,r,!1)}function Sh(t,s,r,a,c){var u=a;if((s&1)===0&&(s&2)===0&&a!==null)e:for(;;){if(a===null)return;var g=a.tag;if(g===3||g===4){var m=a.stateNode.containerInfo;if(m===c)break;if(g===4)for(g=a.return;g!==null;){var b=g.tag;if((b===3||b===4)&&g.stateNode.containerInfo===c)return;g=g.return}for(;m!==null;){if(g=fr(m),g===null)return;if(b=g.tag,b===5||b===6||b===26||b===27){a=u=g;continue e}m=m.parentNode}}a=a.return}Ld(function(){var B=u,W=Uo(r),G=[];e:{var O=hf.get(t);if(O!==void 0){var N=Vl,de=t;switch(t){case"keypress":if(Yl(r)===0)break e;case"keydown":case"keyup":N=K0;break;case"focusin":de="focus",N=Ko;break;case"focusout":de="blur",N=Ko;break;case"beforeblur":case"afterblur":N=Ko;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":N=Ud;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":N=B0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":N=G0;break;case lf:case af:case of:N=L0;break;case cf:N=F0;break;case"scroll":case"scrollend":N=T0;break;case"wheel":N=Z0;break;case"copy":case"cut":case"paste":N=H0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":N=jd;break;case"toggle":case"beforetoggle":N=J0}var he=(s&4)!==0,ze=!he&&(t==="scroll"||t==="scrollend"),D=he?O!==null?O+"Capture":null:O;he=[];for(var k=B,A;k!==null;){var K=k;if(A=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||A===null||D===null||(K=gn(k,D),K!=null&&he.push(Qn(k,K,A))),ze)break;k=k.return}0<he.length&&(O=new N(O,de,null,r,W),G.push({event:O,listeners:he}))}}if((s&7)===0){e:{if(O=t==="mouseover"||t==="pointerover",N=t==="mouseout"||t==="pointerout",O&&r!==Ho&&(de=r.relatedTarget||r.fromElement)&&(fr(de)||de[dr]))break e;if((N||O)&&(O=W.window===W?W:(O=W.ownerDocument)?O.defaultView||O.parentWindow:window,N?(de=r.relatedTarget||r.toElement,N=B,de=de?fr(de):null,de!==null&&(ze=h(de),he=de.tag,de!==ze||he!==5&&he!==27&&he!==6)&&(de=null)):(N=null,de=B),N!==de)){if(he=Ud,K="onMouseLeave",D="onMouseEnter",k="mouse",(t==="pointerout"||t==="pointerover")&&(he=jd,K="onPointerLeave",D="onPointerEnter",k="pointer"),ze=N==null?O:vn(N),A=de==null?O:vn(de),O=new he(K,k+"leave",N,r,W),O.target=ze,O.relatedTarget=A,K=null,fr(W)===B&&(he=new he(D,k+"enter",de,r,W),he.target=A,he.relatedTarget=ze,K=he),ze=K,N&&de)t:{for(he=N,D=de,k=0,A=he;A;A=Gr(A))k++;for(A=0,K=D;K;K=Gr(K))A++;for(;0<k-A;)he=Gr(he),k--;for(;0<A-k;)D=Gr(D),A--;for(;k--;){if(he===D||D!==null&&he===D.alternate)break t;he=Gr(he),D=Gr(D)}he=null}else he=null;N!==null&&Tv(G,O,N,he,!1),de!==null&&ze!==null&&Tv(G,ze,de,he,!0)}}e:{if(O=B?vn(B):window,N=O.nodeName&&O.nodeName.toLowerCase(),N==="select"||N==="input"&&O.type==="file")var ne=$d;else if(Xd(O))if(Fd)ne=cS;else{ne=aS;var ye=lS}else N=O.nodeName,!N||N.toLowerCase()!=="input"||O.type!=="checkbox"&&O.type!=="radio"?B&&No(B.elementType)&&(ne=$d):ne=oS;if(ne&&(ne=ne(t,B))){Gd(G,ne,r,W);break e}ye&&ye(t,O,B),t==="focusout"&&B&&O.type==="number"&&B.memoizedProps.value!=null&&Lo(O,"number",O.value)}switch(ye=B?vn(B):window,t){case"focusin":(Xd(ye)||ye.contentEditable==="true")&&(Cr=ye,Io=B,xn=null);break;case"focusout":xn=Io=Cr=null;break;case"mousedown":Zo=!0;break;case"contextmenu":case"mouseup":case"dragend":Zo=!1,rf(G,r,W);break;case"selectionchange":if(uS)break;case"keydown":case"keyup":rf(G,r,W)}var oe;if(Xo)e:{switch(t){case"compositionstart":var ue="onCompositionStart";break e;case"compositionend":ue="onCompositionEnd";break e;case"compositionupdate":ue="onCompositionUpdate";break e}ue=void 0}else wr?Kd(t,r)&&(ue="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(ue="onCompositionStart");ue&&(qd&&r.locale!=="ko"&&(wr||ue!=="onCompositionStart"?ue==="onCompositionEnd"&&wr&&(oe=Nd()):(ss=W,qo="value"in ss?ss.value:ss.textContent,wr=!0)),ye=Ba(B,ue),0<ye.length&&(ue=new Pd(ue,t,null,r,W),G.push({event:ue,listeners:ye}),oe?ue.data=oe:(oe=Vd(r),oe!==null&&(ue.data=oe)))),(oe=tS?iS(t,r):sS(t,r))&&(ue=Ba(B,"onBeforeInput"),0<ue.length&&(ye=new Pd("onBeforeInput","beforeinput",null,r,W),G.push({event:ye,listeners:ue}),ye.data=oe)),GS(G,t,B,r,W)}Dv(G,s)})}function Qn(t,s,r){return{instance:t,listener:s,currentTarget:r}}function Ba(t,s){for(var r=s+"Capture",a=[];t!==null;){var c=t,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=gn(t,r),c!=null&&a.unshift(Qn(t,c,u)),c=gn(t,s),c!=null&&a.push(Qn(t,c,u))),t.tag===3)return a;t=t.return}return[]}function Gr(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Tv(t,s,r,a,c){for(var u=s._reactName,g=[];r!==null&&r!==a;){var m=r,b=m.alternate,B=m.stateNode;if(m=m.tag,b!==null&&b===a)break;m!==5&&m!==26&&m!==27||B===null||(b=B,c?(B=gn(r,u),B!=null&&g.unshift(Qn(r,B,b))):c||(B=gn(r,u),B!=null&&g.push(Qn(r,B,b)))),r=r.return}g.length!==0&&t.push({event:s,listeners:g})}var ZS=/\r\n?/g,QS=/\u0000|\uFFFD/g;function Av(t){return(typeof t=="string"?t:""+t).replace(ZS,`
49
+ `).replace(QS,"")}function Bv(t,s){return s=Av(s),Av(t)===s}function za(){}function Be(t,s,r,a,c,u){switch(r){case"children":typeof a=="string"?s==="body"||s==="textarea"&&a===""||Sr(t,a):(typeof a=="number"||typeof a=="bigint")&&s!=="body"&&Sr(t,""+a);break;case"className":Ul(t,"class",a);break;case"tabIndex":Ul(t,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Ul(t,r,a);break;case"style":zd(t,a,u);break;case"data":if(s!=="object"){Ul(t,"data",a);break}case"src":case"href":if(a===""&&(s!=="a"||r!=="href")){t.removeAttribute(r);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(r);break}a=ql(""+a),t.setAttribute(r,a);break;case"action":case"formAction":if(typeof a=="function"){t.setAttribute(r,"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 u=="function"&&(r==="formAction"?(s!=="input"&&Be(t,s,"name",c.name,c,null),Be(t,s,"formEncType",c.formEncType,c,null),Be(t,s,"formMethod",c.formMethod,c,null),Be(t,s,"formTarget",c.formTarget,c,null)):(Be(t,s,"encType",c.encType,c,null),Be(t,s,"method",c.method,c,null),Be(t,s,"target",c.target,c,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(r);break}a=ql(""+a),t.setAttribute(r,a);break;case"onClick":a!=null&&(t.onclick=za);break;case"onScroll":a!=null&&we("scroll",t);break;case"onScrollEnd":a!=null&&we("scrollend",t);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(r=a.__html,r!=null){if(c.children!=null)throw Error(l(60));t.innerHTML=r}}break;case"multiple":t.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":t.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){t.removeAttribute("xlink:href");break}r=ql(""+a),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(r,""+a):t.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(r,""):t.removeAttribute(r);break;case"capture":case"download":a===!0?t.setAttribute(r,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(r,a):t.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?t.setAttribute(r,a):t.removeAttribute(r);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?t.removeAttribute(r):t.setAttribute(r,a);break;case"popover":we("beforetoggle",t),we("toggle",t),Hl(t,"popover",a);break;case"xlinkActuate":zi(t,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":zi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":zi(t,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":zi(t,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":zi(t,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":zi(t,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":zi(t,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":zi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":zi(t,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Hl(t,"is",a);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=D0.get(r)||r,Hl(t,r,a))}}function yh(t,s,r,a,c,u){switch(r){case"style":zd(t,a,u);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(r=a.__html,r!=null){if(c.children!=null)throw Error(l(60));t.innerHTML=r}}break;case"children":typeof a=="string"?Sr(t,a):(typeof a=="number"||typeof a=="bigint")&&Sr(t,""+a);break;case"onScroll":a!=null&&we("scroll",t);break;case"onScrollEnd":a!=null&&we("scrollend",t);break;case"onClick":a!=null&&(t.onclick=za);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wd.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(c=r.endsWith("Capture"),s=r.slice(2,c?r.length-7:void 0),u=t[Nt]||null,u=u!=null?u[r]:null,typeof u=="function"&&t.removeEventListener(s,u,c),typeof a=="function")){typeof u!="function"&&u!==null&&(r in t?t[r]=null:t.hasAttribute(r)&&t.removeAttribute(r)),t.addEventListener(s,a,c);break e}r in t?t[r]=a:a===!0?t.setAttribute(r,""):Hl(t,r,a)}}}function wt(t,s,r){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":we("error",t),we("load",t);var a=!1,c=!1,u;for(u in r)if(r.hasOwnProperty(u)){var g=r[u];if(g!=null)switch(u){case"src":a=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,s));default:Be(t,s,u,g,r,null)}}c&&Be(t,s,"srcSet",r.srcSet,r,null),a&&Be(t,s,"src",r.src,r,null);return;case"input":we("invalid",t);var m=u=g=c=null,b=null,B=null;for(a in r)if(r.hasOwnProperty(a)){var W=r[a];if(W!=null)switch(a){case"name":c=W;break;case"type":g=W;break;case"checked":b=W;break;case"defaultChecked":B=W;break;case"value":u=W;break;case"defaultValue":m=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(l(137,s));break;default:Be(t,s,a,W,r,null)}}Rd(t,u,m,b,B,g,c,!1),Pl(t);return;case"select":we("invalid",t),a=g=u=null;for(c in r)if(r.hasOwnProperty(c)&&(m=r[c],m!=null))switch(c){case"value":u=m;break;case"defaultValue":g=m;break;case"multiple":a=m;default:Be(t,s,c,m,r,null)}s=u,r=g,t.multiple=!!a,s!=null?mr(t,!!a,s,!1):r!=null&&mr(t,!!a,r,!0);return;case"textarea":we("invalid",t),u=c=a=null;for(g in r)if(r.hasOwnProperty(g)&&(m=r[g],m!=null))switch(g){case"value":a=m;break;case"defaultValue":c=m;break;case"children":u=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(l(91));break;default:Be(t,s,g,m,r,null)}Ad(t,a,c,u),Pl(t);return;case"option":for(b in r)if(r.hasOwnProperty(b)&&(a=r[b],a!=null))switch(b){case"selected":t.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Be(t,s,b,a,r,null)}return;case"dialog":we("beforetoggle",t),we("toggle",t),we("cancel",t),we("close",t);break;case"iframe":case"object":we("load",t);break;case"video":case"audio":for(a=0;a<Zn.length;a++)we(Zn[a],t);break;case"image":we("error",t),we("load",t);break;case"details":we("toggle",t);break;case"embed":case"source":case"link":we("error",t),we("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(B in r)if(r.hasOwnProperty(B)&&(a=r[B],a!=null))switch(B){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,s));default:Be(t,s,B,a,r,null)}return;default:if(No(s)){for(W in r)r.hasOwnProperty(W)&&(a=r[W],a!==void 0&&yh(t,s,W,a,r,void 0));return}}for(m in r)r.hasOwnProperty(m)&&(a=r[m],a!=null&&Be(t,s,m,a,r,null))}function JS(t,s,r,a){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,u=null,g=null,m=null,b=null,B=null,W=null;for(N in r){var G=r[N];if(r.hasOwnProperty(N)&&G!=null)switch(N){case"checked":break;case"value":break;case"defaultValue":b=G;default:a.hasOwnProperty(N)||Be(t,s,N,null,a,G)}}for(var O in a){var N=a[O];if(G=r[O],a.hasOwnProperty(O)&&(N!=null||G!=null))switch(O){case"type":u=N;break;case"name":c=N;break;case"checked":B=N;break;case"defaultChecked":W=N;break;case"value":g=N;break;case"defaultValue":m=N;break;case"children":case"dangerouslySetInnerHTML":if(N!=null)throw Error(l(137,s));break;default:N!==G&&Be(t,s,O,N,a,G)}}Oo(t,g,m,b,B,W,u,c);return;case"select":N=g=m=O=null;for(u in r)if(b=r[u],r.hasOwnProperty(u)&&b!=null)switch(u){case"value":break;case"multiple":N=b;default:a.hasOwnProperty(u)||Be(t,s,u,null,a,b)}for(c in a)if(u=a[c],b=r[c],a.hasOwnProperty(c)&&(u!=null||b!=null))switch(c){case"value":O=u;break;case"defaultValue":m=u;break;case"multiple":g=u;default:u!==b&&Be(t,s,c,u,a,b)}s=m,r=g,a=N,O!=null?mr(t,!!r,O,!1):!!a!=!!r&&(s!=null?mr(t,!!r,s,!0):mr(t,!!r,r?[]:"",!1));return;case"textarea":N=O=null;for(m in r)if(c=r[m],r.hasOwnProperty(m)&&c!=null&&!a.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:Be(t,s,m,null,a,c)}for(g in a)if(c=a[g],u=r[g],a.hasOwnProperty(g)&&(c!=null||u!=null))switch(g){case"value":O=c;break;case"defaultValue":N=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(l(91));break;default:c!==u&&Be(t,s,g,c,a,u)}Td(t,O,N);return;case"option":for(var de in r)if(O=r[de],r.hasOwnProperty(de)&&O!=null&&!a.hasOwnProperty(de))switch(de){case"selected":t.selected=!1;break;default:Be(t,s,de,null,a,O)}for(b in a)if(O=a[b],N=r[b],a.hasOwnProperty(b)&&O!==N&&(O!=null||N!=null))switch(b){case"selected":t.selected=O&&typeof O!="function"&&typeof O!="symbol";break;default:Be(t,s,b,O,a,N)}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 r)O=r[he],r.hasOwnProperty(he)&&O!=null&&!a.hasOwnProperty(he)&&Be(t,s,he,null,a,O);for(B in a)if(O=a[B],N=r[B],a.hasOwnProperty(B)&&O!==N&&(O!=null||N!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(l(137,s));break;default:Be(t,s,B,O,a,N)}return;default:if(No(s)){for(var ze in r)O=r[ze],r.hasOwnProperty(ze)&&O!==void 0&&!a.hasOwnProperty(ze)&&yh(t,s,ze,void 0,a,O);for(W in a)O=a[W],N=r[W],!a.hasOwnProperty(W)||O===N||O===void 0&&N===void 0||yh(t,s,W,O,a,N);return}}for(var D in r)O=r[D],r.hasOwnProperty(D)&&O!=null&&!a.hasOwnProperty(D)&&Be(t,s,D,null,a,O);for(G in a)O=a[G],N=r[G],!a.hasOwnProperty(G)||O===N||O==null&&N==null||Be(t,s,G,O,a,N)}var bh=null,wh=null;function Oa(t){return t.nodeType===9?t:t.ownerDocument}function zv(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ov(t,s){if(t===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&s==="foreignObject"?0:t}function Ch(t,s){return t==="textarea"||t==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var xh=null;function ey(){var t=window.event;return t&&t.type==="popstate"?t===xh?!1:(xh=t,!0):(xh=null,!1)}var Lv=typeof setTimeout=="function"?setTimeout:void 0,ty=typeof clearTimeout=="function"?clearTimeout:void 0,Nv=typeof Promise=="function"?Promise:void 0,iy=typeof queueMicrotask=="function"?queueMicrotask:typeof Nv<"u"?function(t){return Nv.resolve(null).then(t).catch(sy)}:Lv;function sy(t){setTimeout(function(){throw t})}function Ss(t){return t==="head"}function Hv(t,s){var r=s,a=0,c=0;do{var u=r.nextSibling;if(t.removeChild(r),u&&u.nodeType===8)if(r=u.data,r==="/$"){if(0<a&&8>a){r=a;var g=t.ownerDocument;if(r&1&&Jn(g.documentElement),r&2&&Jn(g.body),r&4)for(r=g.head,Jn(r),g=r.firstChild;g;){var m=g.nextSibling,b=g.nodeName;g[_n]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&g.rel.toLowerCase()==="stylesheet"||r.removeChild(g),g=m}}if(c===0){t.removeChild(u),al(s);return}c--}else r==="$"||r==="$?"||r==="$!"?c++:a=r.charCodeAt(0)-48;else a=0;r=u}while(r);al(s)}function Eh(t){var s=t.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var r=s;switch(s=s.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":Eh(r),To(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}t.removeChild(r)}}function ry(t,s,r,a){for(;t.nodeType===1;){var c=r;if(t.nodeName.toLowerCase()!==s.toLowerCase()){if(!a&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(a){if(!t[_n])switch(s){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(u=t.getAttribute("rel"),u==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(u!==c.rel||t.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||t.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||t.getAttribute("title")!==(c.title==null?null:c.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(u=t.getAttribute("src"),(u!==(c.src==null?null:c.src)||t.getAttribute("type")!==(c.type==null?null:c.type)||t.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&u&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(s==="input"&&t.type==="hidden"){var u=c.name==null?null:""+c.name;if(c.type==="hidden"&&t.getAttribute("name")===u)return t}else return t;if(t=gi(t.nextSibling),t===null)break}return null}function ny(t,s,r){if(s==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=gi(t.nextSibling),t===null))return null;return t}function kh(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function ly(t,s){var r=t.ownerDocument;if(t.data!=="$?"||r.readyState==="complete")s();else{var a=function(){s(),r.removeEventListener("DOMContentLoaded",a)};r.addEventListener("DOMContentLoaded",a),t._reactRetry=a}}function gi(t){for(;t!=null;t=t.nextSibling){var s=t.nodeType;if(s===1||s===3)break;if(s===8){if(s=t.data,s==="$"||s==="$!"||s==="$?"||s==="F!"||s==="F")break;if(s==="/$")return null}}return t}var Mh=null;function Uv(t){t=t.previousSibling;for(var s=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(s===0)return t;s--}else r==="/$"&&s++}t=t.previousSibling}return null}function Pv(t,s,r){switch(s=Oa(r),t){case"html":if(t=s.documentElement,!t)throw Error(l(452));return t;case"head":if(t=s.head,!t)throw Error(l(453));return t;case"body":if(t=s.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function Jn(t){for(var s=t.attributes;s.length;)t.removeAttributeNode(s[0]);To(t)}var ci=new Map,jv=new Set;function La(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Gi=q.d;q.d={f:ay,r:oy,D:cy,C:hy,L:uy,m:dy,X:_y,S:fy,M:vy};function ay(){var t=Gi.f(),s=ka();return t||s}function oy(t){var s=_r(t);s!==null&&s.tag===5&&s.type==="form"?l_(s):Gi.r(t)}var $r=typeof document>"u"?null:document;function qv(t,s,r){var a=$r;if(a&&typeof s=="string"&&s){var c=ii(s);c='link[rel="'+t+'"][href="'+c+'"]',typeof r=="string"&&(c+='[crossorigin="'+r+'"]'),jv.has(c)||(jv.add(c),t={rel:t,crossOrigin:r,href:s},a.querySelector(c)===null&&(s=a.createElement("link"),wt(s,"link",t),ut(s),a.head.appendChild(s)))}}function cy(t){Gi.D(t),qv("dns-prefetch",t,null)}function hy(t,s){Gi.C(t,s),qv("preconnect",t,s)}function uy(t,s,r){Gi.L(t,s,r);var a=$r;if(a&&t&&s){var c='link[rel="preload"][as="'+ii(s)+'"]';s==="image"&&r&&r.imageSrcSet?(c+='[imagesrcset="'+ii(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(c+='[imagesizes="'+ii(r.imageSizes)+'"]')):c+='[href="'+ii(t)+'"]';var u=c;switch(s){case"style":u=Fr(t);break;case"script":u=Ir(t)}ci.has(u)||(t=p({rel:"preload",href:s==="image"&&r&&r.imageSrcSet?void 0:t,as:s},r),ci.set(u,t),a.querySelector(c)!==null||s==="style"&&a.querySelector(el(u))||s==="script"&&a.querySelector(tl(u))||(s=a.createElement("link"),wt(s,"link",t),ut(s),a.head.appendChild(s)))}}function dy(t,s){Gi.m(t,s);var r=$r;if(r&&t){var a=s&&typeof s.as=="string"?s.as:"script",c='link[rel="modulepreload"][as="'+ii(a)+'"][href="'+ii(t)+'"]',u=c;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ir(t)}if(!ci.has(u)&&(t=p({rel:"modulepreload",href:t},s),ci.set(u,t),r.querySelector(c)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(tl(u)))return}a=r.createElement("link"),wt(a,"link",t),ut(a),r.head.appendChild(a)}}}function fy(t,s,r){Gi.S(t,s,r);var a=$r;if(a&&t){var c=vr(a).hoistableStyles,u=Fr(t);s=s||"default";var g=c.get(u);if(!g){var m={loading:0,preload:null};if(g=a.querySelector(el(u)))m.loading=5;else{t=p({rel:"stylesheet",href:t,"data-precedence":s},r),(r=ci.get(u))&&Dh(t,r);var b=g=a.createElement("link");ut(b),wt(b,"link",t),b._p=new Promise(function(B,W){b.onload=B,b.onerror=W}),b.addEventListener("load",function(){m.loading|=1}),b.addEventListener("error",function(){m.loading|=2}),m.loading|=4,Na(g,s,a)}g={type:"stylesheet",instance:g,count:1,state:m},c.set(u,g)}}}function _y(t,s){Gi.X(t,s);var r=$r;if(r&&t){var a=vr(r).hoistableScripts,c=Ir(t),u=a.get(c);u||(u=r.querySelector(tl(c)),u||(t=p({src:t,async:!0},s),(s=ci.get(c))&&Rh(t,s),u=r.createElement("script"),ut(u),wt(u,"link",t),r.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(c,u))}}function vy(t,s){Gi.M(t,s);var r=$r;if(r&&t){var a=vr(r).hoistableScripts,c=Ir(t),u=a.get(c);u||(u=r.querySelector(tl(c)),u||(t=p({src:t,async:!0,type:"module"},s),(s=ci.get(c))&&Rh(t,s),u=r.createElement("script"),ut(u),wt(u,"link",t),r.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(c,u))}}function Wv(t,s,r,a){var c=(c=re.current)?La(c):null;if(!c)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(s=Fr(r.href),r=vr(c).hoistableStyles,a=r.get(s),a||(a={type:"style",instance:null,count:0,state:null},r.set(s,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Fr(r.href);var u=vr(c).hoistableStyles,g=u.get(t);if(g||(c=c.ownerDocument||c,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,g),(u=c.querySelector(el(t)))&&!u._p&&(g.instance=u,g.state.loading=5),ci.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},ci.set(t,r),u||gy(c,t,r,g.state))),s&&a===null)throw Error(l(528,""));return g}if(s&&a!==null)throw Error(l(529,""));return null;case"script":return s=r.async,r=r.src,typeof r=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Ir(r),r=vr(c).hoistableScripts,a=r.get(s),a||(a={type:"script",instance:null,count:0,state:null},r.set(s,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Fr(t){return'href="'+ii(t)+'"'}function el(t){return'link[rel="stylesheet"]['+t+"]"}function Yv(t){return p({},t,{"data-precedence":t.precedence,precedence:null})}function gy(t,s,r,a){t.querySelector('link[rel="preload"][as="style"]['+s+"]")?a.loading=1:(s=t.createElement("link"),a.preload=s,s.addEventListener("load",function(){return a.loading|=1}),s.addEventListener("error",function(){return a.loading|=2}),wt(s,"link",r),ut(s),t.head.appendChild(s))}function Ir(t){return'[src="'+ii(t)+'"]'}function tl(t){return"script[async]"+t}function Kv(t,s,r){if(s.count++,s.instance===null)switch(s.type){case"style":var a=t.querySelector('style[data-href~="'+ii(r.href)+'"]');if(a)return s.instance=a,ut(a),a;var c=p({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),ut(a),wt(a,"style",c),Na(a,r.precedence,t),s.instance=a;case"stylesheet":c=Fr(r.href);var u=t.querySelector(el(c));if(u)return s.state.loading|=4,s.instance=u,ut(u),u;a=Yv(r),(c=ci.get(c))&&Dh(a,c),u=(t.ownerDocument||t).createElement("link"),ut(u);var g=u;return g._p=new Promise(function(m,b){g.onload=m,g.onerror=b}),wt(u,"link",a),s.state.loading|=4,Na(u,r.precedence,t),s.instance=u;case"script":return u=Ir(r.src),(c=t.querySelector(tl(u)))?(s.instance=c,ut(c),c):(a=r,(c=ci.get(u))&&(a=p({},r),Rh(a,c)),t=t.ownerDocument||t,c=t.createElement("script"),ut(c),wt(c,"link",a),t.head.appendChild(c),s.instance=c);case"void":return null;default:throw Error(l(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(a=s.instance,s.state.loading|=4,Na(a,r.precedence,t));return s.instance}function Na(t,s,r){for(var a=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=a.length?a[a.length-1]:null,u=c,g=0;g<a.length;g++){var m=a[g];if(m.dataset.precedence===s)u=m;else if(u!==c)break}u?u.parentNode.insertBefore(t,u.nextSibling):(s=r.nodeType===9?r.head:r,s.insertBefore(t,s.firstChild))}function Dh(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.title==null&&(t.title=s.title)}function Rh(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.integrity==null&&(t.integrity=s.integrity)}var Ha=null;function Vv(t,s,r){if(Ha===null){var a=new Map,c=Ha=new Map;c.set(r,a)}else c=Ha,a=c.get(r),a||(a=new Map,c.set(r,a));if(a.has(t))return a;for(a.set(t,null),r=r.getElementsByTagName(t),c=0;c<r.length;c++){var u=r[c];if(!(u[_n]||u[Et]||t==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var g=u.getAttribute(s)||"";g=t+g;var m=a.get(g);m?m.push(u):a.set(g,[u])}}return a}function Xv(t,s,r){t=t.ownerDocument||t,t.head.insertBefore(r,s==="title"?t.querySelector("head > title"):null)}function py(t,s,r){if(r===1||s.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return t=s.disabled,typeof s.precedence=="string"&&t==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Gv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var il=null;function my(){}function Sy(t,s,r){if(il===null)throw Error(l(475));var a=il;if(s.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var c=Fr(r.href),u=t.querySelector(el(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(a.count++,a=Ua.bind(a),t.then(a,a)),s.state.loading|=4,s.instance=u,ut(u);return}u=t.ownerDocument||t,r=Yv(r),(c=ci.get(c))&&Dh(r,c),u=u.createElement("link"),ut(u);var g=u;g._p=new Promise(function(m,b){g.onload=m,g.onerror=b}),wt(u,"link",r),s.instance=u}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(a.count++,s=Ua.bind(a),t.addEventListener("load",s),t.addEventListener("error",s))}}function yy(){if(il===null)throw Error(l(475));var t=il;return t.stylesheets&&t.count===0&&Th(t,t.stylesheets),0<t.count?function(s){var r=setTimeout(function(){if(t.stylesheets&&Th(t,t.stylesheets),t.unsuspend){var a=t.unsuspend;t.unsuspend=null,a()}},6e4);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(r)}}:null}function Ua(){if(this.count--,this.count===0){if(this.stylesheets)Th(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Pa=null;function Th(t,s){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Pa=new Map,s.forEach(by,t),Pa=null,Ua.call(t))}function by(t,s){if(!(s.state.loading&4)){var r=Pa.get(t);if(r)var a=r.get(null);else{r=new Map,Pa.set(t,r);for(var c=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var g=c[u];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(r.set(g.dataset.precedence,g),a=g)}a&&r.set(null,a)}c=s.instance,g=c.getAttribute("data-precedence"),u=r.get(g)||a,u===a&&r.set(null,c),r.set(g,c),this.count++,a=Ua.bind(this),c.addEventListener("load",a),c.addEventListener("error",a),u?u.parentNode.insertBefore(c,u.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(c,t.firstChild)),s.state.loading|=4}}var sl={$$typeof:V,Provider:null,Consumer:null,_currentValue:j,_currentValue2:j,_threadCount:0};function wy(t,s,r,a,c,u,g,m){this.tag=1,this.containerInfo=t,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=ko(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ko(0),this.hiddenUpdates=ko(null),this.identifierPrefix=a,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=m,this.incompleteTransitions=new Map}function $v(t,s,r,a,c,u,g,m,b,B,W,G){return t=new wy(t,s,r,g,m,b,B,G),s=1,u===!0&&(s|=24),u=Xt(3,null,null,s),t.current=u,u.stateNode=t,s=uc(),s.refCount++,t.pooledCache=s,s.refCount++,u.memoizedState={element:a,isDehydrated:r,cache:s},vc(u),t}function Fv(t){return t?(t=Mr,t):Mr}function Iv(t,s,r,a,c,u){c=Fv(c),a.context===null?a.context=c:a.pendingContext=c,a=ls(s),a.payload={element:r},u=u===void 0?null:u,u!==null&&(a.callback=u),r=as(t,a,s),r!==null&&(Zt(r,t,s),zn(r,t,s))}function Zv(t,s){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<s?r:s}}function Ah(t,s){Zv(t,s),(t=t.alternate)&&Zv(t,s)}function Qv(t){if(t.tag===13){var s=kr(t,67108864);s!==null&&Zt(s,t,67108864),Ah(t,67108864)}}var ja=!0;function Cy(t,s,r,a){var c=M.T;M.T=null;var u=q.p;try{q.p=2,Bh(t,s,r,a)}finally{q.p=u,M.T=c}}function xy(t,s,r,a){var c=M.T;M.T=null;var u=q.p;try{q.p=8,Bh(t,s,r,a)}finally{q.p=u,M.T=c}}function Bh(t,s,r,a){if(ja){var c=zh(a);if(c===null)Sh(t,s,a,qa,r),eg(t,a);else if(ky(c,t,s,r,a))a.stopPropagation();else if(eg(t,a),s&4&&-1<Ey.indexOf(t)){for(;c!==null;){var u=_r(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var g=Os(u.pendingLanes);if(g!==0){var m=u;for(m.pendingLanes|=2,m.entangledLanes|=2;g;){var b=1<<31-Kt(g);m.entanglements[1]|=b,g&=~b}xi(u),(De&6)===0&&(xa=Si()+500,In(0))}}break;case 13:m=kr(u,2),m!==null&&Zt(m,u,2),ka(),Ah(u,2)}if(u=zh(a),u===null&&Sh(t,s,a,qa,r),u===c)break;c=u}c!==null&&a.stopPropagation()}else Sh(t,s,a,null,r)}}function zh(t){return t=Uo(t),Oh(t)}var qa=null;function Oh(t){if(qa=null,t=fr(t),t!==null){var s=h(t);if(s===null)t=null;else{var r=s.tag;if(r===13){if(t=d(s),t!==null)return t;t=null}else if(r===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;t=null}else s!==t&&(t=null)}}return qa=t,null}function Jv(t){switch(t){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(h0()){case dd:return 2;case fd:return 8;case zl:case u0:return 32;case _d:return 268435456;default:return 32}default:return 32}}var Lh=!1,ys=null,bs=null,ws=null,rl=new Map,nl=new Map,Cs=[],Ey="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 eg(t,s){switch(t){case"focusin":case"focusout":ys=null;break;case"dragenter":case"dragleave":bs=null;break;case"mouseover":case"mouseout":ws=null;break;case"pointerover":case"pointerout":rl.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":nl.delete(s.pointerId)}}function ll(t,s,r,a,c,u){return t===null||t.nativeEvent!==u?(t={blockedOn:s,domEventName:r,eventSystemFlags:a,nativeEvent:u,targetContainers:[c]},s!==null&&(s=_r(s),s!==null&&Qv(s)),t):(t.eventSystemFlags|=a,s=t.targetContainers,c!==null&&s.indexOf(c)===-1&&s.push(c),t)}function ky(t,s,r,a,c){switch(s){case"focusin":return ys=ll(ys,t,s,r,a,c),!0;case"dragenter":return bs=ll(bs,t,s,r,a,c),!0;case"mouseover":return ws=ll(ws,t,s,r,a,c),!0;case"pointerover":var u=c.pointerId;return rl.set(u,ll(rl.get(u)||null,t,s,r,a,c)),!0;case"gotpointercapture":return u=c.pointerId,nl.set(u,ll(nl.get(u)||null,t,s,r,a,c)),!0}return!1}function tg(t){var s=fr(t.target);if(s!==null){var r=h(s);if(r!==null){if(s=r.tag,s===13){if(s=d(r),s!==null){t.blockedOn=s,S0(t.priority,function(){if(r.tag===13){var a=It();a=Mo(a);var c=kr(r,a);c!==null&&Zt(c,r,a),Ah(r,a)}});return}}else if(s===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Wa(t){if(t.blockedOn!==null)return!1;for(var s=t.targetContainers;0<s.length;){var r=zh(t.nativeEvent);if(r===null){r=t.nativeEvent;var a=new r.constructor(r.type,r);Ho=a,r.target.dispatchEvent(a),Ho=null}else return s=_r(r),s!==null&&Qv(s),t.blockedOn=r,!1;s.shift()}return!0}function ig(t,s,r){Wa(t)&&r.delete(s)}function My(){Lh=!1,ys!==null&&Wa(ys)&&(ys=null),bs!==null&&Wa(bs)&&(bs=null),ws!==null&&Wa(ws)&&(ws=null),rl.forEach(ig),nl.forEach(ig)}function Ya(t,s){t.blockedOn===s&&(t.blockedOn=null,Lh||(Lh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,My)))}var Ka=null;function sg(t){Ka!==t&&(Ka=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ka===t&&(Ka=null);for(var s=0;s<t.length;s+=3){var r=t[s],a=t[s+1],c=t[s+2];if(typeof a!="function"){if(Oh(a||r)===null)continue;break}var u=_r(r);u!==null&&(t.splice(s,3),s-=3,Oc(u,{pending:!0,data:c,method:r.method,action:a},a,c))}}))}function al(t){function s(b){return Ya(b,t)}ys!==null&&Ya(ys,t),bs!==null&&Ya(bs,t),ws!==null&&Ya(ws,t),rl.forEach(s),nl.forEach(s);for(var r=0;r<Cs.length;r++){var a=Cs[r];a.blockedOn===t&&(a.blockedOn=null)}for(;0<Cs.length&&(r=Cs[0],r.blockedOn===null);)tg(r),r.blockedOn===null&&Cs.shift();if(r=(t.ownerDocument||t).$$reactFormReplay,r!=null)for(a=0;a<r.length;a+=3){var c=r[a],u=r[a+1],g=c[Nt]||null;if(typeof u=="function")g||sg(r);else if(g){var m=null;if(u&&u.hasAttribute("formAction")){if(c=u,g=u[Nt]||null)m=g.formAction;else if(Oh(c)!==null)continue}else m=g.action;typeof m=="function"?r[a+1]=m:(r.splice(a,3),a-=3),sg(r)}}}function Nh(t){this._internalRoot=t}Va.prototype.render=Nh.prototype.render=function(t){var s=this._internalRoot;if(s===null)throw Error(l(409));var r=s.current,a=It();Iv(r,a,t,s,null,null)},Va.prototype.unmount=Nh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var s=t.containerInfo;Iv(t.current,2,null,t,null,null),ka(),s[dr]=null}};function Va(t){this._internalRoot=t}Va.prototype.unstable_scheduleHydration=function(t){if(t){var s=Sd();t={blockedOn:null,target:t,priority:s};for(var r=0;r<Cs.length&&s!==0&&s<Cs[r].priority;r++);Cs.splice(r,0,t),r===0&&tg(t)}};var rg=i.version;if(rg!=="19.1.0")throw Error(l(527,rg,"19.1.0"));q.findDOMNode=function(t){var s=t._reactInternals;if(s===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=v(s),t=t!==null?f(t):null,t=t===null?null:t.stateNode,t};var Dy={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xa.isDisabled&&Xa.supportsFiber)try{un=Xa.inject(Dy),Yt=Xa}catch{}}return hl.createRoot=function(t,s){if(!o(t))throw Error(l(299));var r=!1,a="",c=y_,u=b_,g=w_,m=null;return s!=null&&(s.unstable_strictMode===!0&&(r=!0),s.identifierPrefix!==void 0&&(a=s.identifierPrefix),s.onUncaughtError!==void 0&&(c=s.onUncaughtError),s.onCaughtError!==void 0&&(u=s.onCaughtError),s.onRecoverableError!==void 0&&(g=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(m=s.unstable_transitionCallbacks)),s=$v(t,1,!1,null,null,r,a,c,u,g,m,null),t[dr]=s.current,mh(t),new Nh(s)},hl.hydrateRoot=function(t,s,r){if(!o(t))throw Error(l(299));var a=!1,c="",u=y_,g=b_,m=w_,b=null,B=null;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(u=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(m=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(b=r.unstable_transitionCallbacks),r.formState!==void 0&&(B=r.formState)),s=$v(t,1,!0,s,r??null,a,c,u,g,m,b,B),s.context=Fv(null),r=s.current,a=It(),a=Mo(a),c=ls(a),c.callback=null,as(r,c,a),r=a,s.current.lanes=r,fn(s,r),xi(s),t[dr]=s.current,mh(t),new Va(s)},hl.version="19.1.0",hl}var mg;function Uy(){if(mg)return Uh.exports;mg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Uh.exports=Hy(),Uh.exports}var Py=Uy(),le=Gu();const Ga=Ty(le);/**
50
+ * @license lucide-react v0.511.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */const jy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qy=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,n,l)=>l?l.toUpperCase():n.toLowerCase()),Sg=e=>{const i=qy(e);return i.charAt(0).toUpperCase()+i.slice(1)},Fp=(...e)=>e.filter((i,n,l)=>!!i&&i.trim()!==""&&l.indexOf(i)===n).join(" ").trim(),Wy=e=>{for(const i in e)if(i.startsWith("aria-")||i==="role"||i==="title")return!0};/**
55
+ * @license lucide-react v0.511.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */var Yy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
60
+ * @license lucide-react v0.511.0 - ISC
61
+ *
62
+ * This source code is licensed under the ISC license.
63
+ * See the LICENSE file in the root directory of this source tree.
64
+ */const Ky=le.forwardRef(({color:e="currentColor",size:i=24,strokeWidth:n=2,absoluteStrokeWidth:l,className:o="",children:h,iconNode:d,..._},v)=>le.createElement("svg",{ref:v,...Yy,width:i,height:i,stroke:e,strokeWidth:l?Number(n)*24/Number(i):n,className:Fp("lucide",o),...!h&&!Wy(_)&&{"aria-hidden":"true"},..._},[...d.map(([f,p])=>le.createElement(f,p)),...Array.isArray(h)?h:[h]]));/**
65
+ * @license lucide-react v0.511.0 - ISC
66
+ *
67
+ * This source code is licensed under the ISC license.
68
+ * See the LICENSE file in the root directory of this source tree.
69
+ */const Qe=(e,i)=>{const n=le.forwardRef(({className:l,...o},h)=>le.createElement(Ky,{ref:h,iconNode:i,className:Fp(`lucide-${jy(Sg(e))}`,`lucide-${e}`,l),...o}));return n.displayName=Sg(e),n};/**
70
+ * @license lucide-react v0.511.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */const Vy=[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]],Xy=Qe("app-window",Vy);/**
75
+ * @license lucide-react v0.511.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */const Gy=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],$y=Qe("chevron-left",Gy);/**
80
+ * @license lucide-react v0.511.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */const Fy=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Iy=Qe("chevron-right",Fy);/**
85
+ * @license lucide-react v0.511.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */const Zy=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Qy=Qe("columns-2",Zy);/**
90
+ * @license lucide-react v0.511.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const Jy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Ip=Qe("globe",Jy);/**
95
+ * @license lucide-react v0.511.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */const e1=[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]],Zp=Qe("hammer",e1);/**
100
+ * @license lucide-react v0.511.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const t1=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],Qp=Qe("maximize",t1);/**
105
+ * @license lucide-react v0.511.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const i1=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],s1=Qe("menu",i1);/**
110
+ * @license lucide-react v0.511.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const r1=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Jp=Qe("monitor",r1);/**
115
+ * @license lucide-react v0.511.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const n1=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],l1=Qe("moon",n1);/**
120
+ * @license lucide-react v0.511.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const a1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],o1=Qe("plus",a1);/**
125
+ * @license lucide-react v0.511.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const c1=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],em=Qe("rotate-cw",c1);/**
130
+ * @license lucide-react v0.511.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const h1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]],u1=Qe("rows-2",h1);/**
135
+ * @license lucide-react v0.511.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const d1=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],f1=Qe("settings",d1);/**
140
+ * @license lucide-react v0.511.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const _1=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],fo=Qe("smartphone",_1);/**
145
+ * @license lucide-react v0.511.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const v1=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],g1=Qe("square-terminal",v1);/**
150
+ * @license lucide-react v0.511.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const p1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],m1=Qe("sun",p1);/**
155
+ * @license lucide-react v0.511.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const S1=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]],_o=Qe("tablet",S1);/**
160
+ * @license lucide-react v0.511.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const y1=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],b1=Qe("trash-2",y1);/**
165
+ * @license lucide-react v0.511.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const w1=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],C1=Qe("unplug",w1);/**
170
+ * @license lucide-react v0.511.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const x1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],E1=Qe("x",x1),yg=e=>{let i;const n=new Set,l=(f,p)=>{const S=typeof f=="function"?f(i):f;if(!Object.is(S,i)){const y=i;i=p??(typeof S!="object"||S===null)?S:Object.assign({},i,S),n.forEach(E=>E(i,y))}},o=()=>i,_={setState:l,getState:o,getInitialState:()=>v,subscribe:f=>(n.add(f),()=>n.delete(f))},v=i=e(l,o,_);return _},k1=(e=>e?yg(e):yg),M1=e=>e;function D1(e,i=M1){const n=Ga.useSyncExternalStore(e.subscribe,Ga.useCallback(()=>i(e.getState()),[e,i]),Ga.useCallback(()=>i(e.getInitialState()),[e,i]));return Ga.useDebugValue(n),n}const bg=e=>{const i=k1(e),n=l=>D1(i,l);return Object.assign(n,i),n},bo=(e=>e?bg(e):bg),R1={"mobile-portrait":{w:375,h:812},"mobile-landscape":{w:812,h:375},"tablet-portrait":{w:768,h:1024},"tablet-landscape":{w:1024,h:768},desktop:{w:1280,h:800}},wg="unloved_view_mode",Cg="unloved_preview_viewport",T1=["both","side-by-side","terminal","preview"],A1=["default","mobile-portrait","mobile-landscape","tablet-portrait","tablet-landscape","desktop"];function xg(e,i,n){const l=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`)),o=l==null?void 0:l[1];return o&&i.includes(o)?o:n}function Eg(e,i){document.cookie=`${e}=${i};path=/;max-age=31536000;SameSite=Lax`}const zt=bo(e=>({sidebarOpen:!0,viewMode:xg(wg,T1,"both"),previewViewport:xg(Cg,A1,"default"),toggleSidebar:()=>e(i=>({sidebarOpen:!i.sidebarOpen})),closeSidebar:()=>e({sidebarOpen:!1}),setViewMode:i=>{Eg(wg,i),e({viewMode:i})},setPreviewViewport:i=>{Eg(Cg,i),e({previewViewport:i})}})),B1={primary:"bg-accent text-white hover:bg-accent-hover",secondary:"bg-[#E5E7EB] text-text-primary hover:bg-[#D1D5DB] dark:bg-divider-dark dark:text-text-dark dark:hover:bg-divider-dark",ghost:"bg-transparent text-text-secondary hover:bg-sidebar-hover dark:text-text-dark dark:hover:bg-divider-dark"},z1="h-9 cursor-pointer rounded-button px-3.5 text-sm font-medium transition-colors duration-150";function kg({variant:e="primary",className:i,children:n,type:l="button",...o}){return R.jsx("button",{type:l,className:[z1,B1[e],i].filter(Boolean).join(" "),...o,children:n})}const O1="h-10 w-full rounded-input border border-divider bg-white px-3.5 text-base transition-colors outline-none focus:border-accent focus:ring-3 focus:ring-accent-ring dark:border-divider-dark dark:bg-card-dark dark:text-text-dark";function L1({className:e,...i}){return R.jsx("input",{className:[O1,e].filter(Boolean).join(" "),...i})}const N1={dark:"#0B0F19",light:"#F6F7F9"},Mg=e=>{document.documentElement.classList.toggle("dark",e==="dark");const i=N1[e];document.querySelectorAll('meta[name="theme-color"]').forEach(n=>{n.content=i})},nu=bo((e,i)=>({mode:"dark",setMode:n=>{e({mode:n}),Mg(n),fetch("/api/config",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({theme:n})})},toggle:()=>{const n=i().mode==="dark"?"light":"dark";i().setMode(n)},hydrate:async()=>{try{const n=await fetch("/api/config");if(!n.ok)return;const l=await n.json();e({mode:l.theme}),Mg(l.theme)}catch{}}}));function H1({className:e}){const i=nu(l=>l.mode),n=nu(l=>l.toggle);return R.jsx("button",{type:"button",onClick:n,className:["flex h-8 w-8 cursor-pointer items-center justify-center rounded-full text-text-primary transition-colors duration-150 hover:bg-sidebar-hover dark:text-text-dark dark:hover:bg-divider-dark",e].filter(Boolean).join(" "),"aria-label":"Toggle theme",children:i==="dark"?R.jsx(l1,{size:18,strokeWidth:1.8}):R.jsx(m1,{size:18,strokeWidth:1.8})})}let Zr=null;const st=bo((e,i)=>({sessions:[],activeSessionName:null,sessionMetas:{},error:null,fetchSessions:async()=>{try{const n=await fetch("/api/tmux/sessions");if(!n.ok)return;const l=await n.json();e({sessions:l})}catch{}},setActiveSession:n=>{e({activeSessionName:n,error:null}),i().fetchMeta(n)},clearActiveSession:()=>{e({activeSessionName:null})},createSession:async n=>{e({error:null});try{const l=await fetch("/api/tmux/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n})});if(!l.ok){const o=await l.json();e({error:o.error??"Failed to create session"});return}await i().fetchSessions(),i().setActiveSession(n)}catch{e({error:"Server unreachable"})}},fetchMeta:async n=>{try{const l=await fetch(`/api/sessions/${encodeURIComponent(n)}/meta`);if(!l.ok)return;const o=await l.json();e(h=>({sessionMetas:{...h.sessionMetas,[n]:o}}))}catch{}},killSession:async n=>{try{await fetch(`/api/tmux/sessions/${encodeURIComponent(n)}`,{method:"DELETE"}),e({activeSessionName:null}),await i().fetchSessions()}catch{}},triggerRestart:async n=>{try{await fetch(`/api/sessions/${encodeURIComponent(n)}/restart`,{method:"POST"})}catch{}},startPolling:()=>{Zr&&clearInterval(Zr);const n=()=>{i().fetchSessions();const l=i().activeSessionName;l&&i().fetchMeta(l)};return n(),Zr=setInterval(n,3e3),()=>{Zr&&(clearInterval(Zr),Zr=null)}}}));function U1({name:e,attached:i,active:n,onClick:l}){return R.jsxs("button",{type:"button",onClick:l,className:["flex w-full cursor-pointer items-center gap-2.5 rounded-sidebar px-3 py-2 text-left text-sm transition-colors",n?"bg-sidebar-active font-medium text-text-primary shadow-subtle dark:bg-divider-dark dark:text-text-dark":"text-text-secondary hover:bg-sidebar-hover dark:hover:bg-divider-dark"].join(" "),children:[i&&R.jsx("span",{className:"inline-block h-2 w-2 shrink-0 rounded-full bg-green-500"}),R.jsx("span",{className:"truncate font-mono text-[13px]",children:e})]})}function P1(){const e=st(o=>o.sessions),i=st(o=>o.activeSessionName),n=st(o=>o.setActiveSession),l=zt(o=>o.closeSidebar);return e.length===0?R.jsx("p",{className:"px-3 py-4 text-xs text-text-secondary",children:"No tmux sessions running."}):R.jsx("div",{className:"flex flex-col gap-0.5",children:e.map(o=>R.jsx(U1,{name:o.name,attached:o.attached,active:o.name===i,onClick:()=>{n(o.name),l()}},o.name))})}function j1({onClose:e}){const[i,n]=le.useState(""),l=st(_=>_.createSession),o=st(_=>_.error),h=zt(_=>_.closeSidebar),d=async _=>{_.preventDefault();const v=i.trim();v&&(await l(v),st.getState().error||(e(),h()))};return R.jsxs("form",{onSubmit:d,className:"flex flex-col gap-2 rounded-sidebar bg-sidebar-active p-3 shadow-subtle dark:bg-bg-dark",children:[R.jsx(L1,{value:i,onChange:_=>n(_.target.value),placeholder:"Session name",autoFocus:!0,className:"h-8 text-sm"}),o&&R.jsx("p",{className:"text-xs text-red-500",children:o}),R.jsxs("div",{className:"flex gap-2",children:[R.jsx(kg,{type:"submit",className:"flex-1 h-8 text-xs",children:"Create"}),R.jsx(kg,{variant:"ghost",onClick:e,className:"h-8 text-xs",children:"Cancel"})]})]})}function Dg(){const[e,i]=le.useState(!1);return R.jsxs("aside",{className:"flex h-full min-w-[var(--sidebar-width)] flex-col border-r border-divider bg-sidebar dark:border-divider-dark dark:bg-card-dark",children:[R.jsxs("div",{className:"flex items-center gap-2.5 px-5 py-4",children:[R.jsx("img",{src:"/logo.png",alt:"unloved",className:"h-7 w-7"}),R.jsx("span",{className:"text-sm font-semibold text-text-primary dark:text-text-dark",children:"unloved"})]}),R.jsx("div",{className:"h-px bg-divider dark:bg-divider-dark"}),R.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:R.jsx(P1,{})}),R.jsx("div",{className:"px-3 pb-2",children:e?R.jsx(j1,{onClose:()=>i(!1)}):R.jsxs("button",{type:"button",onClick:()=>i(!0),className:"flex w-full cursor-pointer items-center gap-2 rounded-sidebar px-3 py-2 text-sm text-text-secondary transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark",children:[R.jsx(o1,{size:16}),"New session"]})}),R.jsx("div",{className:"border-t border-divider px-3 py-3 dark:border-divider-dark",children:R.jsx(H1,{className:"static h-8 w-8"})})]})}var q1=$p();function tm({label:e}){const[i,n]=le.useState(!1),l=le.useRef(null),[o,h]=le.useState({top:0,left:0}),d=()=>{if(l.current){const _=l.current.getBoundingClientRect();h({top:_.bottom+6,left:_.left+_.width/2})}n(!0)};return R.jsxs(R.Fragment,{children:[R.jsx("span",{ref:l,className:"absolute inset-0",onMouseEnter:d,onMouseLeave:()=>n(!1)}),i&&q1.createPortal(R.jsx("span",{style:{position:"fixed",top:o.top,left:o.left,transform:"translateX(-50%)"},className:"pointer-events-none z-50 whitespace-nowrap rounded-md bg-text-primary px-2 py-1 text-[11px] font-medium text-white shadow-subtle dark:bg-card-dark dark:text-text-dark",children:e}),document.body)]})}const W1=[{value:"both",icon:u1,label:"Stacked",splitOnly:!0},{value:"side-by-side",icon:Qy,label:"Side by side",splitOnly:!0},{value:"terminal",icon:g1,label:"Chat only"},{value:"preview",icon:Xy,label:"Workspace only"}];function Y1(){const e=zt(n=>n.viewMode),i=zt(n=>n.setViewMode);return R.jsx("div",{className:"flex h-8 items-center overflow-hidden rounded-lg border border-divider bg-sidebar dark:border-divider-dark dark:bg-bg-dark",children:W1.map(({value:n,icon:l,label:o,splitOnly:h})=>R.jsxs("button",{type:"button",onClick:()=>i(n),className:["relative flex h-full cursor-pointer items-center gap-1.5 px-2.5 text-xs transition-colors",h?"hidden md:flex":"",e===n?"bg-accent text-white":"text-text-secondary hover:bg-sidebar-hover dark:hover:bg-divider-dark"].join(" "),"aria-label":o,children:[R.jsx(l,{size:14}),R.jsx(tm,{label:o})]},n))})}const K1=[{value:"mobile-portrait",icon:fo,label:"Mobile portrait"},{value:"mobile-landscape",icon:fo,label:"Mobile landscape",rotate:!0},{value:"tablet-portrait",icon:_o,label:"Tablet portrait"},{value:"tablet-landscape",icon:_o,label:"Tablet landscape",rotate:!0},{value:"desktop",icon:Jp,label:"Desktop (1280px)"},{value:"default",icon:Qp,label:"Full width"}];function V1(){const e=zt(n=>n.previewViewport),i=zt(n=>n.setPreviewViewport);return R.jsx("div",{className:"flex h-8 items-center overflow-hidden rounded-lg border border-divider bg-sidebar dark:border-divider-dark dark:bg-bg-dark",children:K1.map(({value:n,icon:l,label:o,rotate:h})=>R.jsxs("button",{type:"button",onClick:()=>i(n),className:["relative flex h-full cursor-pointer items-center gap-1.5 px-2 text-xs transition-colors",e===n?"bg-accent text-white":"text-text-secondary hover:bg-sidebar-hover dark:hover:bg-divider-dark"].join(" "),"aria-label":o,children:[R.jsx(l,{size:14,style:h?{transform:"rotate(90deg)"}:void 0}),R.jsx(tm,{label:o})]},n))})}const X1=[{value:"mobile-portrait",icon:fo,label:"Mobile portrait"},{value:"mobile-landscape",icon:fo,label:"Mobile landscape",rotate:!0},{value:"tablet-portrait",icon:_o,label:"Tablet portrait"},{value:"tablet-landscape",icon:_o,label:"Tablet landscape",rotate:!0},{value:"desktop",icon:Jp,label:"Desktop"},{value:"default",icon:Qp,label:"Full width"}];function G1(){const[e,i]=le.useState(!1),n=le.useRef(null),l=st(L=>L.activeSessionName),o=st(L=>L.sessionMetas),h=st(L=>L.clearActiveSession),d=st(L=>L.killSession),_=st(L=>L.triggerRestart),v=st(L=>L.fetchMeta),f=zt(L=>L.viewMode),p=zt(L=>L.previewViewport),S=zt(L=>L.setPreviewViewport),y=l?o[l]:null,E=f!=="terminal",C=y==null?void 0:y.previewUrl;le.useEffect(()=>{if(!e)return;function L(V){n.current&&!n.current.contains(V.target)&&i(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[e]);const x="flex w-full cursor-pointer items-center gap-2.5 px-3 py-2.5 text-left text-sm text-text-secondary transition-colors hover:bg-sidebar-hover dark:text-text-dark dark:hover:bg-divider-dark",z="flex w-full cursor-pointer items-center gap-2.5 px-3 py-2.5 text-left text-sm text-accent transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark",T="h-px bg-divider dark:bg-divider-dark";return R.jsxs("div",{ref:n,className:"relative",children:[R.jsx("button",{type:"button",onClick:()=>i(L=>!L),className:"flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-sidebar text-text-secondary transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark","aria-label":"Session settings",children:R.jsx(f1,{size:16})}),R.jsxs("div",{className:["absolute right-0 top-full z-50 mt-1 w-52 origin-top-right overflow-hidden rounded-lg border border-divider bg-sidebar shadow-lg transition-all duration-150 dark:border-divider-dark dark:bg-bg-dark",e?"scale-100 opacity-100":"pointer-events-none scale-95 opacity-0"].join(" "),children:[E&&R.jsxs("div",{className:"md:hidden",children:[R.jsxs("button",{type:"button",onClick:async()=>{l&&(await fetch(`/api/sessions/${encodeURIComponent(l)}/meta`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({previewUrl:""})}),await v(l)),i(!1)},className:x,children:[R.jsx(Ip,{size:14}),"Change preview URL"]}),R.jsx("div",{className:T})]}),E&&R.jsxs("div",{className:"md:hidden",children:[X1.map(({value:L,icon:V,label:P,rotate:H})=>R.jsxs("button",{type:"button",onClick:()=>{S(L),i(!1)},className:p===L?z:x,children:[R.jsx(V,{size:14,style:H?{transform:"rotate(90deg)"}:void 0}),P]},L)),R.jsx("div",{className:T})]}),E&&C&&R.jsxs("div",{className:"md:hidden",children:[R.jsxs("button",{type:"button",onClick:()=>{const L=document.querySelector('iframe[title="Preview"]');if(L){const V=L.src;L.src="about:blank",requestAnimationFrame(()=>{L.src=V})}i(!1)},className:x,children:[R.jsx(em,{size:14}),"Refresh preview"]}),R.jsx("div",{className:T})]}),(y==null?void 0:y.restartCommand)&&R.jsxs("div",{className:"md:hidden",children:[R.jsxs("button",{type:"button",onClick:()=>{l&&_(l),i(!1)},className:x,children:[R.jsx(Zp,{size:14}),"Rebuild"]}),R.jsx("div",{className:T})]}),R.jsxs("button",{type:"button",onClick:()=>{h(),i(!1)},className:x,children:[R.jsx(C1,{size:14}),"Disconnect"]}),R.jsxs("button",{type:"button",onClick:()=>{l&&d(l),i(!1)},className:"flex w-full cursor-pointer items-center gap-2.5 px-3 py-2.5 text-left text-sm text-red-400 transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark",children:[R.jsx(b1,{size:14}),"Kill tmux session"]})]})]})}const im="unloved:url-history",$1=20;function sm(){try{const e=localStorage.getItem(im);return e?JSON.parse(e):[]}catch{return[]}}function F1(e){const i=e.trim();if(!i)return;const n=sm().filter(l=>l!==i);n.unshift(i),localStorage.setItem(im,JSON.stringify(n.slice(0,$1)))}function I1(e){try{return`${new URL(e).origin}/favicon.ico`}catch{return null}}function Rg({url:e,className:i}){const n=I1(e),[l,o]=le.useState(!0);return le.useEffect(()=>{o(!0)},[n]),!n||!l?null:R.jsx("img",{src:n,alt:"",width:14,height:14,className:i??"shrink-0",onError:()=>o(!1)})}function Z1({previewUrl:e,activeSessionName:i}){const n=st(T=>T.fetchMeta),[l,o]=le.useState(e),[h,d]=le.useState(!1),[_,v]=le.useState([]),f=le.useRef(null);le.useEffect(()=>{o(e)},[e]);const p=_.filter(T=>l.trim()?T.toLowerCase().includes(l.toLowerCase()):!0),S=()=>{v(sm()),d(!0)},y=()=>{setTimeout(()=>{var T;(T=f.current)!=null&&T.contains(document.activeElement)||d(!1)},150)},E=async T=>{const L=T.trim();if(!L||L===e){d(!1);return}F1(L),await fetch(`/api/sessions/${encodeURIComponent(i)}/meta`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({previewUrl:L})}),await n(i),d(!1)},C=T=>{T.key==="Enter"&&(T.currentTarget.blur(),E(l)),T.key==="Escape"&&(d(!1),T.currentTarget.blur())},x=()=>{const T=document.querySelector('iframe[title="Preview"]');if(!T)return;const L=T.src;T.src="about:blank",requestAnimationFrame(()=>{T.src=L})},z=T=>{o(T),E(T)};return R.jsxs("div",{ref:f,className:"relative hidden md:block",children:[R.jsxs("div",{className:"flex h-9 w-64 items-center gap-2 rounded-input border border-divider bg-sidebar px-3 dark:border-divider-dark dark:bg-bg-dark",children:[e&&R.jsx(Rg,{url:e,className:"shrink-0 rounded-sm"}),R.jsx("input",{type:"text",value:l,onChange:T=>o(T.target.value),onFocus:S,onBlur:y,onKeyDown:C,placeholder:"Preview URL",className:"flex-1 truncate bg-transparent font-mono text-xs text-text-secondary outline-none dark:text-text-dark","data-testid":"header-url"}),e&&R.jsx("button",{type:"button",onClick:x,className:"flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded text-text-secondary transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark","aria-label":"Refresh preview",children:R.jsx(em,{size:13})})]}),h&&p.length>0&&R.jsx("div",{className:"absolute top-full left-0 z-50 mt-1 w-full overflow-hidden rounded-lg border border-divider/60 bg-white/95 shadow-float backdrop-blur-sm dark:border-divider-dark/60 dark:bg-card-dark/95",children:p.map(T=>R.jsxs("button",{type:"button",onMouseDown:L=>L.preventDefault(),onClick:()=>z(T),className:["flex w-full items-center gap-2 px-3 py-2 text-left font-mono text-xs transition-colors",T===e?"text-accent dark:text-accent-dark":"text-text-secondary hover:bg-sidebar-hover/60 dark:hover:bg-divider-dark/40"].join(" "),children:[R.jsx(Rg,{url:T,className:"shrink-0 rounded-sm"}),R.jsx("span",{className:"truncate",children:T})]},T))})]})}function Q1(){const e=st(L=>L.activeSessionName),i=st(L=>L.sessionMetas),n=st(L=>L.triggerRestart),l=zt(L=>L.toggleSidebar),o=zt(L=>L.viewMode),h=e?i[e]:null,d=(h==null?void 0:h.previewUrl)??"",_=o!=="terminal",[v,f]=le.useState(0),[p,S]=le.useState(1),y=le.useRef(!1),E=le.useRef(!0);le.useEffect(()=>{f(0),S(1),E.current=!0},[d]),le.useEffect(()=>{if(!d||!_)return;let L=null,V=!0;const P=()=>{if(V){if(E.current){E.current=!1;return}if(y.current){y.current=!1;return}f(ee=>{const ae=ee+1;return S(ae+1),ae})}},H=setTimeout(()=>{L=document.querySelector('iframe[title="Preview"]'),L&&L.addEventListener("load",P)},50);return()=>{V=!1,clearTimeout(H),L&&L.removeEventListener("load",P)}},[d,_]);const C=v>0,x=v<p-1,z=()=>{const L=document.querySelector('iframe[title="Preview"]');!(L!=null&&L.contentWindow)||!C||(y.current=!0,f(V=>V-1),L.contentWindow.history.back(),setTimeout(()=>{y.current=!1},500))},T=()=>{const L=document.querySelector('iframe[title="Preview"]');!(L!=null&&L.contentWindow)||!x||(y.current=!0,f(V=>V+1),L.contentWindow.history.forward(),setTimeout(()=>{y.current=!1},500))};return R.jsxs("header",{className:"flex h-[var(--header-height)] shrink-0 items-center gap-3 border-b border-divider px-4 dark:border-divider-dark",children:[R.jsx("button",{type:"button",onClick:l,className:"flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-sidebar text-text-secondary transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark","aria-label":"Toggle sidebar",children:R.jsx(s1,{size:18})}),e?R.jsxs(R.Fragment,{children:[R.jsx("span",{className:"shrink-0 font-mono text-sm font-medium text-text-primary dark:text-text-dark",children:e}),R.jsx("div",{className:"flex-1"}),R.jsx(Y1,{}),_&&R.jsxs("div",{className:"hidden items-center gap-1 md:flex",children:[R.jsx("button",{type:"button",onClick:z,disabled:!C,className:"flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-lg text-text-secondary transition-colors hover:bg-sidebar-hover disabled:cursor-default disabled:opacity-30 dark:hover:bg-divider-dark","aria-label":"Go back",children:R.jsx($y,{size:16})}),R.jsx("button",{type:"button",onClick:T,disabled:!x,className:"flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-lg text-text-secondary transition-colors hover:bg-sidebar-hover disabled:cursor-default disabled:opacity-30 dark:hover:bg-divider-dark","aria-label":"Go forward",children:R.jsx(Iy,{size:16})})]}),_&&e&&R.jsx(Z1,{previewUrl:d,activeSessionName:e}),_&&R.jsx("div",{className:"hidden md:block",children:R.jsx(V1,{})}),(h==null?void 0:h.restartCommand)&&R.jsxs("button",{type:"button",onClick:()=>n(e),className:"hidden h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-button bg-accent px-3 text-xs font-medium text-white transition-colors hover:bg-accent-hover md:flex","aria-label":"Rebuild",children:[R.jsx(Zp,{size:14}),"Rebuild"]}),R.jsx(G1,{})]}):R.jsx("span",{className:"text-sm text-text-secondary",children:"Select a session"})]})}function J1(){return R.jsxs("div",{className:"flex w-full max-w-md flex-col items-center gap-5",children:[R.jsxs("div",{className:"w-full rounded-card bg-card p-8 shadow-card dark:bg-card-dark",children:[R.jsxs("div",{className:"flex flex-col items-center gap-3",children:[R.jsx("img",{src:"/logo.png",alt:"unloved",className:"h-12 w-12"}),R.jsx("h1",{className:"text-[28px] font-semibold text-text-primary dark:text-text-dark",children:"unloved"}),R.jsx("p",{className:"text-sm text-text-secondary",children:"Local AI coding cockpit"})]}),R.jsx("div",{className:"h-6"}),R.jsx("p",{className:"text-center text-sm text-text-secondary",children:"Select a session from the sidebar to get started, or create a new one."})]}),R.jsxs("p",{className:"text-xs text-text-secondary/60",children:["Made with love in Scotland · © 2026"," ",R.jsx("a",{href:"https://www.unlikeotherai.com",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-text-secondary",children:"UnlikeOtherAI"})]})]})}function eb(){return R.jsxs("div",{className:"fixed inset-0 -z-10 overflow-hidden",children:[R.jsx("div",{className:"absolute top-[-140px] left-1/2 h-[400px] w-[400px] -translate-x-1/2 rounded-full bg-gradient-top opacity-70 blur-[120px] dark:bg-gradient-mid dark:opacity-25"}),R.jsx("div",{className:"absolute top-1/2 left-1/2 h-[500px] w-[500px] -translate-x-1/2 -translate-y-1/2 rounded-full bg-gradient-mid opacity-30 blur-[120px] dark:opacity-15"}),R.jsx("div",{className:"absolute right-[-100px] bottom-[-100px] h-[350px] w-[350px] rounded-full bg-linear-to-br from-gradient-pink to-gradient-red opacity-40 blur-[120px] dark:opacity-20"})]})}function tb(e,i){const n=getComputedStyle(e),l=parseFloat(n.fontSize);return i*l}function ib(e,i){const n=getComputedStyle(e.ownerDocument.body),l=parseFloat(n.fontSize);return i*l}function sb(e){return e/100*window.innerHeight}function rb(e){return e/100*window.innerWidth}function nb(e){switch(typeof e){case"number":return[e,"px"];case"string":{const i=parseFloat(e);return e.endsWith("%")?[i,"%"]:e.endsWith("px")?[i,"px"]:e.endsWith("rem")?[i,"rem"]:e.endsWith("em")?[i,"em"]:e.endsWith("vh")?[i,"vh"]:e.endsWith("vw")?[i,"vw"]:[i,"%"]}}}function $a({groupSize:e,panelElement:i,styleProp:n}){let l;const[o,h]=nb(n);switch(h){case"%":{l=o/100*e;break}case"px":{l=o;break}case"rem":{l=ib(i,o);break}case"em":{l=tb(i,o);break}case"vh":{l=sb(o);break}case"vw":{l=rb(o);break}}return l}function Wt(e){return parseFloat(e.toFixed(3))}function an({group:e}){const{orientation:i,panels:n}=e;return n.reduce((l,o)=>(l+=i==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,l),0)}function lu(e){const{panels:i}=e,n=an({group:e});return n===0?i.map(l=>({groupResizeBehavior:l.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:l.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:l.panelConstraints.disabled,minSize:0,maxSize:100,panelId:l.id})):i.map(l=>{const{element:o,panelConstraints:h}=l;let d=0;if(h.collapsedSize!==void 0){const p=$a({groupSize:n,panelElement:o,styleProp:h.collapsedSize});d=Wt(p/n*100)}let _;if(h.defaultSize!==void 0){const p=$a({groupSize:n,panelElement:o,styleProp:h.defaultSize});_=Wt(p/n*100)}let v=0;if(h.minSize!==void 0){const p=$a({groupSize:n,panelElement:o,styleProp:h.minSize});v=Wt(p/n*100)}let f=100;if(h.maxSize!==void 0){const p=$a({groupSize:n,panelElement:o,styleProp:h.maxSize});f=Wt(p/n*100)}return{groupResizeBehavior:h.groupResizeBehavior,collapsedSize:d,collapsible:h.collapsible===!0,defaultSize:_,disabled:h.disabled,minSize:v,maxSize:f,panelId:l.id}})}function Le(e,i="Assertion error"){if(!e)throw Error(i)}function au(e,i){return Array.from(i).sort(e==="horizontal"?lb:ab)}function lb(e,i){const n=e.element.offsetLeft-i.element.offsetLeft;return n!==0?n:e.element.offsetWidth-i.element.offsetWidth}function ab(e,i){const n=e.element.offsetTop-i.element.offsetTop;return n!==0?n:e.element.offsetHeight-i.element.offsetHeight}function rm(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function nm(e,i){return{x:e.x>=i.left&&e.x<=i.right?0:Math.min(Math.abs(e.x-i.left),Math.abs(e.x-i.right)),y:e.y>=i.top&&e.y<=i.bottom?0:Math.min(Math.abs(e.y-i.top),Math.abs(e.y-i.bottom))}}function ob({orientation:e,rects:i,targetRect:n}){const l={x:n.x+n.width/2,y:n.y+n.height/2};let o,h=Number.MAX_VALUE;for(const d of i){const{x:_,y:v}=nm(l,d),f=e==="horizontal"?_:v;f<h&&(h=f,o=d)}return Le(o,"No rect found"),o}let Fa;function cb(){return Fa===void 0&&(typeof matchMedia=="function"?Fa=!!matchMedia("(pointer:coarse)").matches:Fa=!1),Fa}function lm(e){const{element:i,orientation:n,panels:l,separators:o}=e,h=au(n,Array.from(i.children).filter(rm).map(C=>({element:C}))).map(({element:C})=>C),d=[];let _=!1,v=!1,f=-1,p=-1,S=0,y,E=[];{let C=-1;for(const x of h)x.hasAttribute("data-panel")&&(C++,x.ariaDisabled===null&&(S++,f===-1&&(f=C),p=C))}if(S>1){let C=-1;for(const x of h)if(x.hasAttribute("data-panel")){C++;const z=l.find(T=>T.element===x);if(z){if(y){const T=y.element.getBoundingClientRect(),L=x.getBoundingClientRect();let V;if(v){const P=n==="horizontal"?new DOMRect(T.right,T.top,0,T.height):new DOMRect(T.left,T.bottom,T.width,0),H=n==="horizontal"?new DOMRect(L.left,L.top,0,L.height):new DOMRect(L.left,L.top,L.width,0);switch(E.length){case 0:{V=[P,H];break}case 1:{const ee=E[0],ae=ob({orientation:n,rects:[T,L],targetRect:ee.element.getBoundingClientRect()});V=[ee,ae===T?H:P];break}default:{V=E;break}}}else E.length?V=E:V=[n==="horizontal"?new DOMRect(T.right,L.top,L.left-T.right,L.height):new DOMRect(L.left,T.bottom,L.width,L.top-T.bottom)];for(const P of V){let H="width"in P?P:P.element.getBoundingClientRect();const ee=cb()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(H.width<ee){const _e=ee-H.width;H=new DOMRect(H.x-_e/2,H.y,H.width+_e,H.height)}if(H.height<ee){const _e=ee-H.height;H=new DOMRect(H.x,H.y-_e/2,H.width,H.height+_e)}const ae=C<=f||C>p;!_&&!ae&&d.push({group:e,groupSize:an({group:e}),panels:[y,z],separator:"width"in P?void 0:P,rect:H}),_=!1}}v=!1,y=z,E=[]}}else if(x.hasAttribute("data-separator")){x.ariaDisabled!==null&&(_=!0);const z=o.find(T=>T.element===x);z?E.push(z):(y=void 0,E=[])}else v=!0}return d}var Rs,Kp;let am=(Kp=class{constructor(){ag(this,Rs,{})}addListener(i,n){const l=ol(this,Rs)[i];return l===void 0?ol(this,Rs)[i]=[n]:l.includes(n)||l.push(n),()=>{this.removeListener(i,n)}}emit(i,n){const l=ol(this,Rs)[i];if(l!==void 0)if(l.length===1)l[0].call(null,n);else{let o=!1,h=null;const d=Array.from(l);for(let _=0;_<d.length;_++){const v=d[_];try{v.call(null,n)}catch(f){h===null&&(o=!0,h=f)}}if(o)throw h}}removeAllListeners(){og(this,Rs,{})}removeListener(i,n){const l=ol(this,Rs)[i];if(l!==void 0){const o=l.indexOf(n);o>=0&&l.splice(o,1)}}},Rs=new WeakMap,Kp),Ri=new Map;const om=new am;function hb(e){Ri=new Map(Ri),Ri.delete(e)}function Tg(e,i){for(const[n]of Ri)if(n.id===e)return n}function As(e,i){for(const[n,l]of Ri)if(n.id===e)return l;if(i)throw Error(`Could not find data for Group with id ${e}`)}function cr(){return Ri}function $u(e,i){return om.addListener("groupChange",n=>{n.group.id===e&&i(n)})}function Zi(e,i){const n=Ri.get(e);Ri=new Map(Ri),Ri.set(e,i),om.emit("groupChange",{group:e,prev:n,next:i})}function ub(e,i,n){let l,o={x:1/0,y:1/0};for(const h of i){const d=nm(n,h.rect);switch(e){case"horizontal":{d.x<=o.x&&(l=h,o=d);break}case"vertical":{d.y<=o.y&&(l=h,o=d);break}}}return l?{distance:o,hitRegion:l}:void 0}function db(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function fb(e,i){if(e===i)throw new Error("Cannot compare node with itself");const n={a:zg(e),b:zg(i)};let l;for(;n.a.at(-1)===n.b.at(-1);)l=n.a.pop(),n.b.pop();Le(l,"Stacking order can only be calculated for elements with a common ancestor");const o={a:Bg(Ag(n.a)),b:Bg(Ag(n.b))};if(o.a===o.b){const h=l.childNodes,d={a:n.a.at(-1),b:n.b.at(-1)};let _=h.length;for(;_--;){const v=h[_];if(v===d.a)return 1;if(v===d.b)return-1}}return Math.sign(o.a-o.b)}const _b=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function vb(e){const i=getComputedStyle(cm(e)??e).display;return i==="flex"||i==="inline-flex"}function gb(e){const i=getComputedStyle(e);return!!(i.position==="fixed"||i.zIndex!=="auto"&&(i.position!=="static"||vb(e))||+i.opacity<1||"transform"in i&&i.transform!=="none"||"webkitTransform"in i&&i.webkitTransform!=="none"||"mixBlendMode"in i&&i.mixBlendMode!=="normal"||"filter"in i&&i.filter!=="none"||"webkitFilter"in i&&i.webkitFilter!=="none"||"isolation"in i&&i.isolation==="isolate"||_b.test(i.willChange)||i.webkitOverflowScrolling==="touch")}function Ag(e){let i=e.length;for(;i--;){const n=e[i];if(Le(n,"Missing node"),gb(n))return n}return null}function Bg(e){return e&&Number(getComputedStyle(e).zIndex)||0}function zg(e){const i=[];for(;e;)i.push(e),e=cm(e);return i}function cm(e){const{parentNode:i}=e;return db(i)?i.host:i}function pb(e,i){return e.x<i.x+i.width&&e.x+e.width>i.x&&e.y<i.y+i.height&&e.y+e.height>i.y}function mb({groupElement:e,hitRegion:i,pointerEventTarget:n}){if(!rm(n)||n.contains(e)||e.contains(n))return!0;if(fb(n,e)>0){let l=n;for(;l;){if(l.contains(e))return!0;if(pb(l.getBoundingClientRect(),i))return!1;l=l.parentElement}}return!0}function Fu(e,i){const n=[];return i.forEach((l,o)=>{if(o.disabled)return;const h=lm(o),d=ub(o.orientation,h,{x:e.clientX,y:e.clientY});d&&d.distance.x<=0&&d.distance.y<=0&&mb({groupElement:o.element,hitRegion:d.hitRegion.rect,pointerEventTarget:e.target})&&n.push(d.hitRegion)}),n}function Sb(e,i){if(e.length!==i.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=i[n])return!1;return!0}function Bt(e,i,n=0){return Math.abs(Wt(e)-Wt(i))<=n}function Di(e,i){return Bt(e,i)?0:e>i?1:-1}function sn({overrideDisabledPanels:e,panelConstraints:i,prevSize:n,size:l}){const{collapsedSize:o=0,collapsible:h,disabled:d,maxSize:_=100,minSize:v=0}=i;if(d&&!e)return n;if(Di(l,v)<0)if(h){const f=(o+v)/2;Di(l,f)<0?l=o:l=v}else l=v;return l=Math.min(_,l),l=Wt(l),l}function El({delta:e,initialLayout:i,panelConstraints:n,pivotIndices:l,prevLayout:o,trigger:h}){if(Bt(e,0))return i;const d=h==="imperative-api",_=Object.values(i),v=Object.values(o),f=[..._],[p,S]=l;Le(p!=null,"Invalid first pivot index"),Le(S!=null,"Invalid second pivot index");let y=0;switch(h){case"keyboard":{{const x=e<0?S:p,z=n[x];Le(z,`Panel constraints not found for index ${x}`);const{collapsedSize:T=0,collapsible:L,minSize:V=0}=z;if(L){const P=_[x];if(Le(P!=null,`Previous layout not found for panel index ${x}`),Bt(P,T)){const H=V-P;Di(H,Math.abs(e))>0&&(e=e<0?0-H:H)}}}{const x=e<0?p:S,z=n[x];Le(z,`No panel constraints found for index ${x}`);const{collapsedSize:T=0,collapsible:L,minSize:V=0}=z;if(L){const P=_[x];if(Le(P!=null,`Previous layout not found for panel index ${x}`),Bt(P,V)){const H=P-T;Di(H,Math.abs(e))>0&&(e=e<0?0-H:H)}}}break}default:{const x=e<0?S:p,z=n[x];Le(z,`Panel constraints not found for index ${x}`);const T=_[x],{collapsible:L,collapsedSize:V,minSize:P}=z;if(L&&Di(T,P)<0)if(e>0){const H=P-V,ee=H/2,ae=T+e;Di(ae,P)<0&&(e=Di(e,ee)<=0?0:H)}else{const H=P-V,ee=100-H/2,ae=T-e;Di(ae,P)<0&&(e=Di(100+e,ee)>0?0:-H)}break}}{const x=e<0?1:-1;let z=e<0?S:p,T=0;for(;;){const V=_[z];Le(V!=null,`Previous layout not found for panel index ${z}`);const P=sn({overrideDisabledPanels:d,panelConstraints:n[z],prevSize:V,size:100})-V;if(T+=P,z+=x,z<0||z>=n.length)break}const L=Math.min(Math.abs(e),Math.abs(T));e=e<0?0-L:L}{let x=e<0?p:S;for(;x>=0&&x<n.length;){const z=Math.abs(e)-Math.abs(y),T=_[x];Le(T!=null,`Previous layout not found for panel index ${x}`);const L=T-z,V=sn({overrideDisabledPanels:d,panelConstraints:n[x],prevSize:T,size:L});if(!Bt(T,V)&&(y+=T-V,f[x]=V,y.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?x--:x++}}if(Sb(v,f))return o;{const x=e<0?S:p,z=_[x];Le(z!=null,`Previous layout not found for panel index ${x}`);const T=z+y,L=sn({overrideDisabledPanels:d,panelConstraints:n[x],prevSize:z,size:T});if(f[x]=L,!Bt(L,T)){let V=T-L,P=e<0?S:p;for(;P>=0&&P<n.length;){const H=f[P];Le(H!=null,`Previous layout not found for panel index ${P}`);const ee=H+V,ae=sn({overrideDisabledPanels:d,panelConstraints:n[P],prevSize:H,size:ee});if(Bt(H,ae)||(V-=ae-H,f[P]=ae),Bt(V,0))break;e>0?P--:P++}}}const E=Object.values(f).reduce((x,z)=>z+x,0);if(!Bt(E,100,.1))return o;const C=Object.keys(o);return f.reduce((x,z,T)=>(x[C[T]]=z,x),{})}function rr(e,i){if(Object.keys(e).length!==Object.keys(i).length)return!1;for(const n in e)if(i[n]===void 0||Di(e[n],i[n])!==0)return!1;return!0}function nr({layout:e,panelConstraints:i}){const n=Object.values(e),l=[...n],o=l.reduce((_,v)=>_+v,0);if(l.length!==i.length)throw Error(`Invalid ${i.length} panel layout: ${l.map(_=>`${_}%`).join(", ")}`);if(!Bt(o,100)&&l.length>0)for(let _=0;_<i.length;_++){const v=l[_];Le(v!=null,`No layout data found for index ${_}`);const f=100/o*v;l[_]=f}let h=0;for(let _=0;_<i.length;_++){const v=n[_];Le(v!=null,`No layout data found for index ${_}`);const f=l[_];Le(f!=null,`No layout data found for index ${_}`);const p=sn({overrideDisabledPanels:!0,panelConstraints:i[_],prevSize:v,size:f});f!=p&&(h+=f-p,l[_]=p)}if(!Bt(h,0))for(let _=0;_<i.length;_++){const v=l[_];Le(v!=null,`No layout data found for index ${_}`);const f=v+h,p=sn({overrideDisabledPanels:!0,panelConstraints:i[_],prevSize:v,size:f});if(v!==p&&(h-=p-v,l[_]=p,Bt(h,0)))break}const d=Object.keys(e);return l.reduce((_,v,f)=>(_[d[f]]=v,_),{})}function hm({groupId:e,panelId:i}){const n=()=>{const _=cr();for(const[v,{defaultLayoutDeferred:f,derivedPanelConstraints:p,layout:S,groupSize:y,separatorToPanels:E}]of _)if(v.id===e)return{defaultLayoutDeferred:f,derivedPanelConstraints:p,group:v,groupSize:y,layout:S,separatorToPanels:E};throw Error(`Group ${e} not found`)},l=()=>{const _=n().derivedPanelConstraints.find(v=>v.panelId===i);if(_!==void 0)return _;throw Error(`Panel constraints not found for Panel ${i}`)},o=()=>{const _=n().group.panels.find(v=>v.id===i);if(_!==void 0)return _;throw Error(`Layout not found for Panel ${i}`)},h=()=>{const _=n().layout[i];if(_!==void 0)return _;throw Error(`Layout not found for Panel ${i}`)},d=_=>{const v=h();if(_===v)return;const{defaultLayoutDeferred:f,derivedPanelConstraints:p,group:S,groupSize:y,layout:E,separatorToPanels:C}=n(),x=S.panels.findIndex(V=>V.id===i),z=x===S.panels.length-1,T=El({delta:z?v-_:_-v,initialLayout:E,panelConstraints:p,pivotIndices:z?[x-1,x]:[x,x+1],prevLayout:E,trigger:"imperative-api"}),L=nr({layout:T,panelConstraints:p});rr(E,L)||Zi(S,{defaultLayoutDeferred:f,derivedPanelConstraints:p,groupSize:y,layout:L,separatorToPanels:C})};return{collapse:()=>{const{collapsible:_,collapsedSize:v}=l(),{mutableValues:f}=o(),p=h();_&&p!==v&&(f.expandToSize=p,d(v))},expand:()=>{const{collapsible:_,collapsedSize:v,minSize:f}=l(),{mutableValues:p}=o(),S=h();if(_&&S===v){let y=p.expandToSize??f;y===0&&(y=1),d(y)}},getSize:()=>{const{group:_}=n(),v=h(),{element:f}=o(),p=_.orientation==="horizontal"?f.offsetWidth:f.offsetHeight;return{asPercentage:v,inPixels:p}},isCollapsed:()=>{const{collapsible:_,collapsedSize:v}=l(),f=h();return _&&Bt(v,f)},resize:_=>{if(h()!==_){let v;switch(typeof _){case"number":{const{group:f}=n(),p=an({group:f});v=Wt(_/p*100);break}case"string":{v=parseFloat(_);break}}d(v)}}}}function Og(e){if(e.defaultPrevented)return;const i=cr();Fu(e,i).forEach(n=>{if(n.separator){const l=n.panels.find(o=>o.panelConstraints.defaultSize!==void 0);if(l){const o=l.panelConstraints.defaultSize,h=hm({groupId:n.group.id,panelId:l.id});h&&o!==void 0&&(h.resize(o),e.preventDefault())}}})}function ro(e){const i=cr();for(const[n]of i)if(n.separators.some(l=>l.element===e))return n;throw Error("Could not find parent Group for separator element")}function um({groupId:e}){const i=()=>{const n=cr();for(const[l,o]of n)if(l.id===e)return{group:l,...o};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:l}=i();return n?{}:l},setLayout(n){const{defaultLayoutDeferred:l,derivedPanelConstraints:o,group:h,groupSize:d,layout:_,separatorToPanels:v}=i(),f=nr({layout:n,panelConstraints:o});return l?_:(rr(_,f)||Zi(h,{defaultLayoutDeferred:l,derivedPanelConstraints:o,groupSize:d,layout:f,separatorToPanels:v}),f)}}}function Qs(e,i){const n=ro(e),l=As(n.id,!0),o=n.separators.find(p=>p.element===e);Le(o,"Matching separator not found");const h=l.separatorToPanels.get(o);Le(h,"Matching panels not found");const d=h.map(p=>n.panels.indexOf(p)),_=um({groupId:n.id}).getLayout(),v=El({delta:i,initialLayout:_,panelConstraints:l.derivedPanelConstraints,pivotIndices:d,prevLayout:_,trigger:"keyboard"}),f=nr({layout:v,panelConstraints:l.derivedPanelConstraints});rr(_,f)||Zi(n,{defaultLayoutDeferred:l.defaultLayoutDeferred,derivedPanelConstraints:l.derivedPanelConstraints,groupSize:l.groupSize,layout:f,separatorToPanels:l.separatorToPanels})}function Lg(e){if(e.defaultPrevented)return;const i=e.currentTarget,n=ro(i);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Qs(i,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Qs(i,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Qs(i,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Qs(i,-5);break}case"End":{e.preventDefault(),Qs(i,100);break}case"Enter":{e.preventDefault();const l=ro(i),o=As(l.id,!0),{derivedPanelConstraints:h,layout:d,separatorToPanels:_}=o,v=l.separators.find(y=>y.element===i);Le(v,"Matching separator not found");const f=_.get(v);Le(f,"Matching panels not found");const p=f[0],S=h.find(y=>y.panelId===p.id);if(Le(S,"Panel metadata not found"),S.collapsible){const y=d[p.id],E=S.collapsedSize===y?l.mutableState.expandedPanelSizes[p.id]??S.minSize:S.collapsedSize;Qs(i,E-y)}break}case"F6":{e.preventDefault();const l=ro(i).separators.map(d=>d.element),o=Array.from(l).findIndex(d=>d===e.currentTarget);Le(o!==null,"Index not found");const h=e.shiftKey?o>0?o-1:l.length-1:o+1<l.length?o+1:0;l[h].focus();break}case"Home":{e.preventDefault(),Qs(i,-100);break}}}let nn={cursorFlags:0,state:"inactive"};const Iu=new am;function lr(){return nn}function yb(e){return Iu.addListener("change",e)}function bb(e){const i=nn,n={...nn};n.cursorFlags=e,nn=n,Iu.emit("change",{prev:i,next:n})}function ln(e){const i=nn;nn=e,Iu.emit("change",{prev:i,next:e})}function Ng(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const i=cr(),n=Fu(e,i),l=new Map;let o=!1;n.forEach(h=>{h.separator&&(o||(o=!0,h.separator.element.focus()));const d=i.get(h.group);d&&l.set(h.group,d.layout)}),ln({cursorFlags:0,hitRegions:n,initialLayoutMap:l,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const wb=e=>e,Yh=()=>{},dm=1,fm=2,_m=4,vm=8,Hg=3,Ug=12;let Ia;function Pg(){return Ia===void 0&&(Ia=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Ia=!0)),Ia}function Cb({cursorFlags:e,groups:i,state:n}){let l=0,o=0;switch(n){case"active":case"hover":i.forEach(h=>{if(!h.mutableState.disableCursor)switch(h.orientation){case"horizontal":{l++;break}case"vertical":{o++;break}}})}if(!(l===0&&o===0)){switch(n){case"active":{if(e&&Pg()){const h=(e&dm)!==0,d=(e&fm)!==0,_=(e&_m)!==0,v=(e&vm)!==0;if(h)return _?"se-resize":v?"ne-resize":"e-resize";if(d)return _?"sw-resize":v?"nw-resize":"w-resize";if(_)return"s-resize";if(v)return"n-resize"}break}}return Pg()?l>0&&o>0?"move":l>0?"ew-resize":"ns-resize":l>0&&o>0?"grab":l>0?"col-resize":"row-resize"}}const jg=new WeakMap;function Zu(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:i,styleSheet:n}=jg.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));const l=lr();switch(l.state){case"active":case"hover":{const o=Cb({cursorFlags:l.cursorFlags,groups:l.hitRegions.map(d=>d.group),state:l.state}),h=`*, *:hover {cursor: ${o} !important; }`;if(i===h)return;i=h,o?n.cssRules.length===0?n.insertRule(h):n.replaceSync(h):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{i=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}jg.set(e,{prevStyle:i,styleSheet:n})}function gm({document:e,event:i,hitRegions:n,initialLayoutMap:l,mountedGroups:o,pointerDownAtPoint:h,prevCursorFlags:d}){let _=0;n.forEach(f=>{const{group:p,groupSize:S}=f,{orientation:y,panels:E}=p,{disableCursor:C}=p.mutableState;let x=0;h?y==="horizontal"?x=(i.clientX-h.x)/S*100:x=(i.clientY-h.y)/S*100:y==="horizontal"?x=i.clientX<0?-100:100:x=i.clientY<0?-100:100;const z=l.get(p),T=o.get(p);if(!z||!T)return;const{defaultLayoutDeferred:L,derivedPanelConstraints:V,groupSize:P,layout:H,separatorToPanels:ee}=T;if(V&&H&&ee){const ae=El({delta:x,initialLayout:z,panelConstraints:V,pivotIndices:f.panels.map(_e=>E.indexOf(_e)),prevLayout:H,trigger:"mouse-or-touch"});if(rr(ae,H)){if(x!==0&&!C)switch(y){case"horizontal":{_|=x<0?dm:fm;break}case"vertical":{_|=x<0?_m:vm;break}}}else Zi(f.group,{defaultLayoutDeferred:L,derivedPanelConstraints:V,groupSize:P,layout:ae,separatorToPanels:ee})}});let v=0;i.movementX===0?v|=d&Hg:v|=_&Hg,i.movementY===0?v|=d&Ug:v|=_&Ug,bb(v),Zu(e)}function qg(e){const i=cr(),n=lr();switch(n.state){case"active":gm({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:i,prevCursorFlags:n.cursorFlags})}}function Wg(e){if(e.defaultPrevented)return;const i=lr(),n=cr();switch(i.state){case"active":{if(e.buttons===0){ln({cursorFlags:0,state:"inactive"}),i.hitRegions.forEach(l=>{const o=As(l.group.id,!0);Zi(l.group,o)});return}gm({document:e.currentTarget,event:e,hitRegions:i.hitRegions,initialLayoutMap:i.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:i.pointerDownAtPoint,prevCursorFlags:i.cursorFlags});break}default:{const l=Fu(e,n);l.length===0?i.state!=="inactive"&&ln({cursorFlags:0,state:"inactive"}):ln({cursorFlags:0,hitRegions:l,state:"hover"}),Zu(e.currentTarget);break}}}function Yg(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(lr().state){case"hover":ln({cursorFlags:0,state:"inactive"})}}function Kg(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const i=lr();switch(i.state){case"active":ln({cursorFlags:0,state:"inactive"}),i.hitRegions.length>0&&(Zu(e.currentTarget),i.hitRegions.forEach(n=>{const l=As(n.group.id,!0);Zi(n.group,l)}),e.preventDefault())}}function Vg(e){let i=0,n=0;const l={};for(const h of e)if(h.defaultSize!==void 0){i++;const d=Wt(h.defaultSize);n+=d,l[h.panelId]=d}else l[h.panelId]=void 0;const o=e.length-i;if(o!==0){const h=Wt((100-n)/o);for(const d of e)d.defaultSize===void 0&&(l[d.panelId]=h)}return l}function xb(e,i,n){if(!n[0])return;const l=e.panels.find(v=>v.element===i);if(!l||!l.onResize)return;const o=an({group:e}),h=e.orientation==="horizontal"?l.element.offsetWidth:l.element.offsetHeight,d=l.mutableValues.prevSize,_={asPercentage:Wt(h/o*100),inPixels:h};l.mutableValues.prevSize=_,l.onResize(_,l.id,d)}function Eb(e,i){if(Object.keys(e).length!==Object.keys(i).length)return!1;for(const n in e)if(e[n]!==i[n])return!1;return!0}function kb({group:e,nextGroupSize:i,prevGroupSize:n,prevLayout:l}){if(n<=0||i<=0||n===i)return l;let o=0,h=0,d=!1;const _=new Map,v=[];for(const S of e.panels){const y=l[S.id]??0;switch(S.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{d=!0;const E=y/100*n,C=Wt(E/i*100);_.set(S.id,C),o+=C;break}case"preserve-relative-size":default:{v.push(S.id),h+=y;break}}}if(!d||v.length===0)return l;const f=100-o,p={...l};if(_.forEach((S,y)=>{p[y]=S}),h>0)for(const S of v){const y=l[S]??0;p[S]=Wt(y/h*f)}else{const S=Wt(f/v.length);for(const y of v)p[y]=S}return p}function Mb(e,i){const n=e.map(o=>o.id),l=Object.keys(i);if(n.length!==l.length)return!1;for(const o of n)if(!l.includes(o))return!1;return!0}const Qr=new Map;function Db(e){let i=!0;Le(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,l=new Set,o=new Set,h=new n(C=>{for(const x of C){const{borderBoxSize:z,target:T}=x;if(T===e.element){if(i){const L=an({group:e});if(L===0)return;const V=As(e.id);if(!V)return;const P=lu(e),H=V.defaultLayoutDeferred?Vg(P):V.layout,ee=kb({group:e,nextGroupSize:L,prevGroupSize:V.groupSize,prevLayout:H}),ae=nr({layout:ee,panelConstraints:P});if(!V.defaultLayoutDeferred&&rr(V.layout,ae)&&Eb(V.derivedPanelConstraints,P)&&V.groupSize===L)return;Zi(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:P,groupSize:L,layout:ae,separatorToPanels:V.separatorToPanels})}}else xb(e,T,z)}});h.observe(e.element),e.panels.forEach(C=>{Le(!l.has(C.id),`Panel ids must be unique; id "${C.id}" was used more than once`),l.add(C.id),C.onResize&&h.observe(C.element)});const d=an({group:e}),_=lu(e),v=e.panels.map(({id:C})=>C).join(",");let f=e.mutableState.defaultLayout;f&&(Mb(e.panels,f)||(f=void 0));const p=e.mutableState.layouts[v]??f??Vg(_),S=nr({layout:p,panelConstraints:_}),y=e.element.ownerDocument;Qr.set(y,(Qr.get(y)??0)+1);const E=new Map;return lm(e).forEach(C=>{C.separator&&E.set(C.separator,C.panels)}),Zi(e,{defaultLayoutDeferred:d===0,derivedPanelConstraints:_,groupSize:d,layout:S,separatorToPanels:E}),e.separators.forEach(C=>{Le(!o.has(C.id),`Separator ids must be unique; id "${C.id}" was used more than once`),o.add(C.id),C.element.addEventListener("keydown",Lg)}),Qr.get(y)===1&&(y.addEventListener("dblclick",Og,!0),y.addEventListener("pointerdown",Ng,!0),y.addEventListener("pointerleave",qg),y.addEventListener("pointermove",Wg),y.addEventListener("pointerout",Yg),y.addEventListener("pointerup",Kg,!0)),function(){i=!1,Qr.set(y,Math.max(0,(Qr.get(y)??0)-1)),hb(e),e.separators.forEach(C=>{C.element.removeEventListener("keydown",Lg)}),Qr.get(y)||(y.removeEventListener("dblclick",Og,!0),y.removeEventListener("pointerdown",Ng,!0),y.removeEventListener("pointerleave",qg),y.removeEventListener("pointermove",Wg),y.removeEventListener("pointerout",Yg),y.removeEventListener("pointerup",Kg,!0)),h.disconnect()}}function Rb(){const[e,i]=le.useState({}),n=le.useCallback(()=>i({}),[]);return[e,n]}function Qu(e){const i=le.useId();return`${e??i}`}const hr=typeof window<"u"?le.useLayoutEffect:le.useEffect;function Cl(e){const i=le.useRef(e);return hr(()=>{i.current=e},[e]),le.useCallback((...n)=>{var l;return(l=i.current)==null?void 0:l.call(i,...n)},[i])}function Ju(...e){return Cl(i=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(i);break}case"object":{n.current=i;break}}})})}function ed(e){const i=le.useRef({...e});return hr(()=>{for(const n in e)i.current[n]=e[n]},[e]),i.current}const pm=le.createContext(null);function Tb(e,i){const n=le.useRef({getLayout:()=>({}),setLayout:wb});le.useImperativeHandle(i,()=>n.current,[]),hr(()=>{Object.assign(n.current,um({groupId:e}))})}function ou({children:e,className:i,defaultLayout:n,disableCursor:l,disabled:o,elementRef:h,groupRef:d,id:_,onLayoutChange:v,onLayoutChanged:f,orientation:p="horizontal",resizeTargetMinimumSize:S={coarse:20,fine:10},style:y,...E}){const C=le.useRef({onLayoutChange:{},onLayoutChanged:{}}),x=Cl(ie=>{rr(C.current.onLayoutChange,ie)||(C.current.onLayoutChange=ie,v==null||v(ie))}),z=Cl(ie=>{rr(C.current.onLayoutChanged,ie)||(C.current.onLayoutChanged=ie,f==null||f(ie))}),T=Qu(_),L=le.useRef(null),[V,P]=Rb(),H=le.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:S,separators:[]}),ee=Ju(L,h);Tb(T,d);const ae=Cl((ie,$)=>{const U=lr(),I=Tg(ie),F=As(ie);if(F){let M=!1;switch(U.state){case"active":{M=U.hitRegions.some(q=>q.group===I);break}}return{flexGrow:F.layout[$]??1,pointerEvents:M?"none":void 0}}return{flexGrow:(n==null?void 0:n[$])??1}}),_e=ed({defaultLayout:n,disableCursor:l}),Te=le.useMemo(()=>({get disableCursor(){return!!_e.disableCursor},getPanelStyles:ae,id:T,orientation:p,registerPanel:ie=>{const $=H.current;return $.panels=au(p,[...$.panels,ie]),P(),()=>{$.panels=$.panels.filter(U=>U!==ie),P()}},registerSeparator:ie=>{const $=H.current;return $.separators=au(p,[...$.separators,ie]),P(),()=>{$.separators=$.separators.filter(U=>U!==ie),P()}},togglePanelDisabled:(ie,$)=>{const U=H.current.panels.find(M=>M.id===ie);U&&(U.panelConstraints.disabled=$);const I=Tg(T),F=As(T);I&&F&&Zi(I,{...F,derivedPanelConstraints:lu(I)})},toggleSeparatorDisabled:(ie,$)=>{const U=H.current.separators.find(I=>I.id===ie);U&&(U.disabled=$)}}),[ae,T,P,p,_e]),Je=le.useRef(null);return hr(()=>{const ie=L.current;if(ie===null)return;const $=H.current;let U;if(_e.defaultLayout!==void 0&&Object.keys(_e.defaultLayout).length===$.panels.length){U={};for(const w of $.panels){const Y=_e.defaultLayout[w.id];Y!==void 0&&(U[w.id]=Y)}}const I={disabled:!!o,element:ie,id:T,mutableState:{defaultLayout:U,disableCursor:!!_e.disableCursor,expandedPanelSizes:H.current.lastExpandedPanelSizes,layouts:H.current.layouts},orientation:p,panels:$.panels,resizeTargetMinimumSize:$.resizeTargetMinimumSize,separators:$.separators};Je.current=I;const F=Db(I),{defaultLayoutDeferred:M,derivedPanelConstraints:q,layout:j}=As(I.id,!0);!M&&q.length>0&&(x(j),z(j));const ce=$u(T,w=>{const{defaultLayoutDeferred:Y,derivedPanelConstraints:J,layout:Z}=w.next;if(Y||J.length===0)return;const se=I.panels.map(({id:re})=>re).join(",");I.mutableState.layouts[se]=Z,J.forEach(re=>{if(re.collapsible){const{layout:Ue}=w.prev??{};if(Ue){const Me=Bt(re.collapsedSize,Z[re.panelId]),nt=Bt(re.collapsedSize,Ue[re.panelId]);Me&&!nt&&(I.mutableState.expandedPanelSizes[re.panelId]=Ue[re.panelId])}}});const ve=lr().state!=="active";x(Z),ve&&z(Z)});return()=>{Je.current=null,F(),ce()}},[o,T,z,x,p,V,_e]),le.useEffect(()=>{const ie=Je.current;ie&&(ie.mutableState.defaultLayout=n,ie.mutableState.disableCursor=!!l)}),R.jsx(pm.Provider,{value:Te,children:R.jsx("div",{...E,className:i,"data-group":!0,"data-testid":T,id:T,ref:ee,style:{height:"100%",width:"100%",overflow:"hidden",...y,display:"flex",flexDirection:p==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:p==="horizontal"?"pan-y":"pan-x"},children:e})})}ou.displayName="Group";function td(){const e=le.useContext(pm);return Le(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function Ab(e,i){const{id:n}=td(),l=le.useRef({collapse:Yh,expand:Yh,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Yh});le.useImperativeHandle(i,()=>l.current,[]),hr(()=>{Object.assign(l.current,hm({groupId:n,panelId:e}))})}function pl({children:e,className:i,collapsedSize:n="0%",collapsible:l=!1,defaultSize:o,disabled:h,elementRef:d,groupResizeBehavior:_="preserve-relative-size",id:v,maxSize:f="100%",minSize:p="0%",onResize:S,panelRef:y,style:E,...C}){const x=!!v,z=Qu(v),T=ed({disabled:h}),L=le.useRef(null),V=Ju(L,d),{getPanelStyles:P,id:H,orientation:ee,registerPanel:ae,togglePanelDisabled:_e}=td(),Te=S!==null,Je=Cl(($,U,I)=>{S==null||S($,v,I)});hr(()=>{const $=L.current;if($!==null){const U={element:$,id:z,idIsStable:x,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:Te?Je:void 0,panelConstraints:{groupResizeBehavior:_,collapsedSize:n,collapsible:l,defaultSize:o,disabled:T.disabled,maxSize:f,minSize:p}};return ae(U)}},[_,n,l,o,Te,z,x,f,p,Je,ae,T]),le.useEffect(()=>{_e(z,!!h)},[h,z,_e]),Ab(z,y);const ie=le.useSyncExternalStore($=>$u(H,$),()=>JSON.stringify(P(H,z)),()=>JSON.stringify(P(H,z)));return R.jsx("div",{...C,"aria-disabled":h||void 0,"data-panel":!0,"data-testid":z,id:z,ref:V,style:{...Bb,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...JSON.parse(ie)},children:R.jsx("div",{className:i,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...E,touchAction:ee==="horizontal"?"pan-y":"pan-x"},children:e})})}pl.displayName="Panel";const Bb={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function zb({layout:e,panelConstraints:i,panelId:n,panelIndex:l}){let o,h;const d=e[n],_=i.find(v=>v.panelId===n);if(_){const v=_.maxSize,f=_.collapsible?_.collapsedSize:_.minSize,p=[l,l+1];h=nr({layout:El({delta:f-d,initialLayout:e,panelConstraints:i,pivotIndices:p,prevLayout:e}),panelConstraints:i})[n],o=nr({layout:El({delta:v-d,initialLayout:e,panelConstraints:i,pivotIndices:p,prevLayout:e}),panelConstraints:i})[n]}return{valueControls:n,valueMax:o,valueMin:h,valueNow:d}}function cu({children:e,className:i,disabled:n,elementRef:l,id:o,style:h,...d}){const _=Qu(o),v=ed({disabled:n}),[f,p]=le.useState({}),[S,y]=le.useState("inactive"),E=le.useRef(null),C=Ju(E,l),{disableCursor:x,id:z,orientation:T,registerSeparator:L,toggleSeparatorDisabled:V}=td(),P=T==="horizontal"?"vertical":"horizontal";hr(()=>{const ee=E.current;if(ee!==null){const ae={disabled:v.disabled,element:ee,id:_},_e=L(ae),Te=yb(ie=>{y(ie.next.state!=="inactive"&&ie.next.hitRegions.some($=>$.separator===ae)?ie.next.state:"inactive")}),Je=$u(z,ie=>{const{derivedPanelConstraints:$,layout:U,separatorToPanels:I}=ie.next,F=I.get(ae);if(F){const M=F[0],q=F.indexOf(M);p(zb({layout:U,panelConstraints:$,panelId:M.id,panelIndex:q}))}});return()=>{Te(),Je(),_e()}}},[z,_,L,v]),le.useEffect(()=>{V(_,!!n)},[n,_,V]);let H;return n&&!x&&(H="not-allowed"),R.jsx("div",{...d,"aria-controls":f.valueControls,"aria-disabled":n||void 0,"aria-orientation":P,"aria-valuemax":f.valueMax,"aria-valuemin":f.valueMin,"aria-valuenow":f.valueNow,children:e,className:i,"data-separator":n?"disabled":S,"data-testid":_,id:_,ref:C,role:"separator",style:{flexBasis:"auto",cursor:H,...h,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}cu.displayName="Separator";/**
175
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
176
+ * @license MIT
177
+ *
178
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
179
+ * @license MIT
180
+ *
181
+ * Originally forked from (with the author's permission):
182
+ * Fabrice Bellard's javascript vt100 for jslinux:
183
+ * http://bellard.org/jslinux/
184
+ * Copyright (c) 2011 Fabrice Bellard
185
+ */var mm=Object.defineProperty,Ob=Object.getOwnPropertyDescriptor,Lb=(e,i)=>{for(var n in i)mm(e,n,{get:i[n],enumerable:!0})},$e=(e,i,n,l)=>{for(var o=l>1?void 0:l?Ob(i,n):i,h=e.length-1,d;h>=0;h--)(d=e[h])&&(o=(l?d(i,n,o):d(o))||o);return l&&o&&mm(i,n,o),o},te=(e,i)=>(n,l)=>i(n,l,e),Xg="Terminal input",hu={get:()=>Xg,set:e=>Xg=e},Gg="Too much output to announce, navigate to rows manually to read",uu={get:()=>Gg,set:e=>Gg=e};function Nb(e){return e.replace(/\r?\n/g,"\r")}function Hb(e,i){return i?"\x1B[200~"+e+"\x1B[201~":e}function Ub(e,i){e.clipboardData&&e.clipboardData.setData("text/plain",i.selectionText),e.preventDefault()}function Pb(e,i,n,l){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");Sm(o,i,n,l)}}function Sm(e,i,n,l){e=Nb(e),e=Hb(e,n.decPrivateModes.bracketedPasteMode&&l.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),i.value=""}function ym(e,i,n){let l=n.getBoundingClientRect(),o=e.clientX-l.left-10,h=e.clientY-l.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${o}px`,i.style.top=`${h}px`,i.style.zIndex="1000",i.focus()}function $g(e,i,n,l,o){ym(e,i,n),o&&l.rightClickSelect(e),i.value=l.selectionText,i.select()}function Ds(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function wo(e,i=0,n=e.length){let l="";for(let o=i;o<n;++o){let h=e[o];h>65535?(h-=65536,l+=String.fromCharCode((h>>10)+55296)+String.fromCharCode(h%1024+56320)):l+=String.fromCharCode(h)}return l}var jb=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let n=e.length;if(!n)return 0;let l=0,o=0;if(this._interim){let h=e.charCodeAt(o++);56320<=h&&h<=57343?i[l++]=(this._interim-55296)*1024+h-56320+65536:(i[l++]=this._interim,i[l++]=h),this._interim=0}for(let h=o;h<n;++h){let d=e.charCodeAt(h);if(55296<=d&&d<=56319){if(++h>=n)return this._interim=d,l;let _=e.charCodeAt(h);56320<=_&&_<=57343?i[l++]=(d-55296)*1024+_-56320+65536:(i[l++]=d,i[l++]=_);continue}d!==65279&&(i[l++]=d)}return l}},qb=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let n=e.length;if(!n)return 0;let l=0,o,h,d,_,v=0,f=0;if(this.interim[0]){let y=!1,E=this.interim[0];E&=(E&224)===192?31:(E&240)===224?15:7;let C=0,x;for(;(x=this.interim[++C]&63)&&C<4;)E<<=6,E|=x;let z=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,T=z-C;for(;f<T;){if(f>=n)return 0;if(x=e[f++],(x&192)!==128){f--,y=!0;break}else this.interim[C++]=x,E<<=6,E|=x&63}y||(z===2?E<128?f--:i[l++]=E:z===3?E<2048||E>=55296&&E<=57343||E===65279||(i[l++]=E):E<65536||E>1114111||(i[l++]=E)),this.interim.fill(0)}let p=n-4,S=f;for(;S<n;){for(;S<p&&!((o=e[S])&128)&&!((h=e[S+1])&128)&&!((d=e[S+2])&128)&&!((_=e[S+3])&128);)i[l++]=o,i[l++]=h,i[l++]=d,i[l++]=_,S+=4;if(o=e[S++],o<128)i[l++]=o;else if((o&224)===192){if(S>=n)return this.interim[0]=o,l;if(h=e[S++],(h&192)!==128){S--;continue}if(v=(o&31)<<6|h&63,v<128){S--;continue}i[l++]=v}else if((o&240)===224){if(S>=n)return this.interim[0]=o,l;if(h=e[S++],(h&192)!==128){S--;continue}if(S>=n)return this.interim[0]=o,this.interim[1]=h,l;if(d=e[S++],(d&192)!==128){S--;continue}if(v=(o&15)<<12|(h&63)<<6|d&63,v<2048||v>=55296&&v<=57343||v===65279)continue;i[l++]=v}else if((o&248)===240){if(S>=n)return this.interim[0]=o,l;if(h=e[S++],(h&192)!==128){S--;continue}if(S>=n)return this.interim[0]=o,this.interim[1]=h,l;if(d=e[S++],(d&192)!==128){S--;continue}if(S>=n)return this.interim[0]=o,this.interim[1]=h,this.interim[2]=d,l;if(_=e[S++],(_&192)!==128){S--;continue}if(v=(o&7)<<18|(h&63)<<12|(d&63)<<6|_&63,v<65536||v>1114111)continue;i[l++]=v}}return l}},bm="",Ts=" ",Rl=class wm{constructor(){this.fg=0,this.bg=0,this.extended=new vo}static toColorRGB(i){return[i>>>16&255,i>>>8&255,i&255]}static fromColorRGB(i){return(i[0]&255)<<16|(i[1]&255)<<8|i[2]&255}clone(){let i=new wm;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},vo=class Cm{constructor(i=0,n=0){this._ext=0,this._urlId=0,this._ext=i,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(i){this._ext=i}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(i){this._ext&=-469762049,this._ext|=i<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(i){this._ext&=-67108864,this._ext|=i&67108863}get urlId(){return this._urlId}set urlId(i){this._urlId=i}get underlineVariantOffset(){let i=(this._ext&3758096384)>>29;return i<0?i^4294967288:i}set underlineVariantOffset(i){this._ext&=536870911,this._ext|=i<<29&3758096384}clone(){return new Cm(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},fi=class xm extends Rl{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new vo,this.combinedData=""}static fromCharData(i){let n=new xm;return n.setFromCharData(i),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ds(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(i){this.fg=i[0],this.bg=0;let n=!1;if(i[1].length>2)n=!0;else if(i[1].length===2){let l=i[1].charCodeAt(0);if(55296<=l&&l<=56319){let o=i[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(l-55296)*1024+o-56320+65536|i[2]<<22:n=!0}else n=!0}else this.content=i[1].charCodeAt(0)|i[2]<<22;n&&(this.combinedData=i[1],this.content=2097152|i[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Fg="di$target",du="di$dependencies",Kh=new Map;function Wb(e){return e[du]||[]}function St(e){if(Kh.has(e))return Kh.get(e);let i=function(n,l,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Yb(i,n,o)};return i._id=e,Kh.set(e,i),i}function Yb(e,i,n){i[Fg]===i?i[du].push({id:e,index:n}):(i[du]=[{id:e,index:n}],i[Fg]=i)}var Ot=St("BufferService"),Em=St("CoreMouseService"),ur=St("CoreService"),Kb=St("CharsetService"),id=St("InstantiationService"),km=St("LogService"),Lt=St("OptionsService"),Mm=St("OscLinkService"),Vb=St("UnicodeService"),Tl=St("DecorationService"),fu=class{constructor(e,i,n){this._bufferService=e,this._optionsService=i,this._oscLinkService=n}provideLinks(e,i){var p;let n=this._bufferService.buffer.lines.get(e-1);if(!n){i(void 0);return}let l=[],o=this._optionsService.rawOptions.linkHandler,h=new fi,d=n.getTrimmedLength(),_=-1,v=-1,f=!1;for(let S=0;S<d;S++)if(!(v===-1&&!n.hasContent(S))){if(n.loadCell(S,h),h.hasExtendedAttrs()&&h.extended.urlId)if(v===-1){v=S,_=h.extended.urlId;continue}else f=h.extended.urlId!==_;else v!==-1&&(f=!0);if(f||v!==-1&&S===d-1){let y=(p=this._oscLinkService.getLinkData(_))==null?void 0:p.uri;if(y){let E={start:{x:v+1,y:e},end:{x:S+(!f&&S===d-1?1:0),y:e}},C=!1;if(!(o!=null&&o.allowNonHttpProtocols))try{let x=new URL(y);["http:","https:"].includes(x.protocol)||(C=!0)}catch{C=!0}C||l.push({text:y,range:E,activate:(x,z)=>o?o.activate(x,z,E):Xb(x,z),hover:(x,z)=>{var T;return(T=o==null?void 0:o.hover)==null?void 0:T.call(o,x,z,E)},leave:(x,z)=>{var T;return(T=o==null?void 0:o.leave)==null?void 0:T.call(o,x,z,E)}})}f=!1,h.hasExtendedAttrs()&&h.extended.urlId?(v=S,_=h.extended.urlId):(v=-1,_=-1)}}i(l)}};fu=$e([te(0,Ot),te(1,Lt),te(2,Mm)],fu);function Xb(e,i){if(confirm(`Do you want to navigate to ${i}?
186
+
187
+ WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}}var Co=St("CharSizeService"),Qi=St("CoreBrowserService"),sd=St("MouseService"),Ji=St("RenderService"),Gb=St("SelectionService"),Dm=St("CharacterJoinerService"),cn=St("ThemeService"),Rm=St("LinkProviderService"),$b=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Ig.isErrorNoTelemetry(e)?new Ig(e.message+`
188
+
189
+ `+e.stack):new Error(e.message+`
190
+
191
+ `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(i=>{i(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},Fb=new $b;function no(e){Ib(e)||Fb.onUnexpectedError(e)}var _u="Canceled";function Ib(e){return e instanceof Zb?!0:e instanceof Error&&e.name===_u&&e.message===_u}var Zb=class extends Error{constructor(){super(_u),this.name=this.message}};function Qb(e){return new Error(`Illegal argument: ${e}`)}var Ig=class vu extends Error{constructor(i){super(i),this.name="CodeExpectedError"}static fromError(i){if(i instanceof vu)return i;let n=new vu;return n.message=i.message,n.stack=i.stack,n}static isErrorNoTelemetry(i){return i.name==="CodeExpectedError"}},gu=class Tm extends Error{constructor(i){super(i||"An unexpected bug occurred."),Object.setPrototypeOf(this,Tm.prototype)}};function Qt(e,i=0){return e[e.length-(1+i)]}var Jb;(e=>{function i(h){return h<0}e.isLessThan=i;function n(h){return h<=0}e.isLessThanOrEqual=n;function l(h){return h>0}e.isGreaterThan=l;function o(h){return h===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Jb||(Jb={}));function ew(e,i){let n=this,l=!1,o;return function(){return l||(l=!0,i||(o=e.apply(n,arguments))),o}}var Am;(e=>{function i(P){return P&&typeof P=="object"&&typeof P[Symbol.iterator]=="function"}e.is=i;let n=Object.freeze([]);function l(){return n}e.empty=l;function*o(P){yield P}e.single=o;function h(P){return i(P)?P:o(P)}e.wrap=h;function d(P){return P||n}e.from=d;function*_(P){for(let H=P.length-1;H>=0;H--)yield P[H]}e.reverse=_;function v(P){return!P||P[Symbol.iterator]().next().done===!0}e.isEmpty=v;function f(P){return P[Symbol.iterator]().next().value}e.first=f;function p(P,H){let ee=0;for(let ae of P)if(H(ae,ee++))return!0;return!1}e.some=p;function S(P,H){for(let ee of P)if(H(ee))return ee}e.find=S;function*y(P,H){for(let ee of P)H(ee)&&(yield ee)}e.filter=y;function*E(P,H){let ee=0;for(let ae of P)yield H(ae,ee++)}e.map=E;function*C(P,H){let ee=0;for(let ae of P)yield*H(ae,ee++)}e.flatMap=C;function*x(...P){for(let H of P)yield*H}e.concat=x;function z(P,H,ee){let ae=ee;for(let _e of P)ae=H(ae,_e);return ae}e.reduce=z;function*T(P,H,ee=P.length){for(H<0&&(H+=P.length),ee<0?ee+=P.length:ee>P.length&&(ee=P.length);H<ee;H++)yield P[H]}e.slice=T;function L(P,H=Number.POSITIVE_INFINITY){let ee=[];if(H===0)return[ee,P];let ae=P[Symbol.iterator]();for(let _e=0;_e<H;_e++){let Te=ae.next();if(Te.done)return[ee,e.empty()];ee.push(Te.value)}return[ee,{[Symbol.iterator](){return ae}}]}e.consume=L;async function V(P){let H=[];for await(let ee of P)H.push(ee);return Promise.resolve(H)}e.asyncToArray=V})(Am||(Am={}));function ar(e){if(Am.is(e)){let i=[];for(let n of e)if(n)try{n.dispose()}catch(l){i.push(l)}if(i.length===1)throw i[0];if(i.length>1)throw new AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function tw(...e){return qe(()=>ar(e))}function qe(e){return{dispose:ew(()=>{e()})}}var Bm=class zm{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ar(this._toDispose)}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?zm.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(i),i}delete(i){if(i){if(i===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(i),i.dispose()}}deleteAndLeak(i){i&&this._toDispose.has(i)&&(this._toDispose.delete(i),void 0)}};Bm.DISABLE_DISPOSED_WARNING=!1;var Bs=Bm,Se=class{constructor(){this._store=new Bs,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Se.None=Object.freeze({dispose(){}});var on=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var i;this._isDisposed||e===this._value||((i=this._value)==null||i.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},Ii=typeof window=="object"?window:globalThis,pu=class mu{constructor(i){this.element=i,this.next=mu.Undefined,this.prev=mu.Undefined}};pu.Undefined=new pu(void 0);var Ye=pu,Zg=class{constructor(){this._first=Ye.Undefined,this._last=Ye.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ye.Undefined}clear(){let e=this._first;for(;e!==Ye.Undefined;){let i=e.next;e.prev=Ye.Undefined,e.next=Ye.Undefined,e=i}this._first=Ye.Undefined,this._last=Ye.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,i){let n=new Ye(e);if(this._first===Ye.Undefined)this._first=n,this._last=n;else if(i){let o=this._last;this._last=n,n.prev=o,o.next=n}else{let o=this._first;this._first=n,n.next=o,o.prev=n}this._size+=1;let l=!1;return()=>{l||(l=!0,this._remove(n))}}shift(){if(this._first!==Ye.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ye.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ye.Undefined&&e.next!==Ye.Undefined){let i=e.prev;i.next=e.next,e.next.prev=i}else e.prev===Ye.Undefined&&e.next===Ye.Undefined?(this._first=Ye.Undefined,this._last=Ye.Undefined):e.next===Ye.Undefined?(this._last=this._last.prev,this._last.next=Ye.Undefined):e.prev===Ye.Undefined&&(this._first=this._first.next,this._first.prev=Ye.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ye.Undefined;)yield e.element,e=e.next}},iw=globalThis.performance&&typeof globalThis.performance.now=="function",sw=class Om{static create(i){return new Om(i)}constructor(i){this._now=iw&&i===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},xt;(e=>{e.None=()=>Se.None;function i($,U){return S($,()=>{},0,void 0,!0,void 0,U)}e.defer=i;function n($){return(U,I=null,F)=>{let M=!1,q;return q=$(j=>{if(!M)return q?q.dispose():M=!0,U.call(I,j)},null,F),M&&q.dispose(),q}}e.once=n;function l($,U,I){return f((F,M=null,q)=>$(j=>F.call(M,U(j)),null,q),I)}e.map=l;function o($,U,I){return f((F,M=null,q)=>$(j=>{U(j),F.call(M,j)},null,q),I)}e.forEach=o;function h($,U,I){return f((F,M=null,q)=>$(j=>U(j)&&F.call(M,j),null,q),I)}e.filter=h;function d($){return $}e.signal=d;function _(...$){return(U,I=null,F)=>{let M=tw(...$.map(q=>q(j=>U.call(I,j))));return p(M,F)}}e.any=_;function v($,U,I,F){let M=I;return l($,q=>(M=U(M,q),M),F)}e.reduce=v;function f($,U){let I,F={onWillAddFirstListener(){I=$(M.fire,M)},onDidRemoveLastListener(){I==null||I.dispose()}},M=new Q(F);return U==null||U.add(M),M.event}function p($,U){return U instanceof Array?U.push($):U&&U.add($),$}function S($,U,I=100,F=!1,M=!1,q,j){let ce,w,Y,J=0,Z,se={leakWarningThreshold:q,onWillAddFirstListener(){ce=$(re=>{J++,w=U(w,re),F&&!Y&&(ve.fire(w),w=void 0),Z=()=>{let Ue=w;w=void 0,Y=void 0,(!F||J>1)&&ve.fire(Ue),J=0},typeof I=="number"?(clearTimeout(Y),Y=setTimeout(Z,I)):Y===void 0&&(Y=0,queueMicrotask(Z))})},onWillRemoveListener(){M&&J>0&&(Z==null||Z())},onDidRemoveLastListener(){Z=void 0,ce.dispose()}},ve=new Q(se);return j==null||j.add(ve),ve.event}e.debounce=S;function y($,U=0,I){return e.debounce($,(F,M)=>F?(F.push(M),F):[M],U,void 0,!0,void 0,I)}e.accumulate=y;function E($,U=(F,M)=>F===M,I){let F=!0,M;return h($,q=>{let j=F||!U(q,M);return F=!1,M=q,j},I)}e.latch=E;function C($,U,I){return[e.filter($,U,I),e.filter($,F=>!U(F),I)]}e.split=C;function x($,U=!1,I=[],F){let M=I.slice(),q=$(w=>{M?M.push(w):ce.fire(w)});F&&F.add(q);let j=()=>{M==null||M.forEach(w=>ce.fire(w)),M=null},ce=new Q({onWillAddFirstListener(){q||(q=$(w=>ce.fire(w)),F&&F.add(q))},onDidAddFirstListener(){M&&(U?setTimeout(j):j())},onDidRemoveLastListener(){q&&q.dispose(),q=null}});return F&&F.add(ce),ce.event}e.buffer=x;function z($,U){return(I,F,M)=>{let q=U(new L);return $(function(j){let ce=q.evaluate(j);ce!==T&&I.call(F,ce)},void 0,M)}}e.chain=z;let T=Symbol("HaltChainable");class L{constructor(){this.steps=[]}map(U){return this.steps.push(U),this}forEach(U){return this.steps.push(I=>(U(I),I)),this}filter(U){return this.steps.push(I=>U(I)?I:T),this}reduce(U,I){let F=I;return this.steps.push(M=>(F=U(F,M),F)),this}latch(U=(I,F)=>I===F){let I=!0,F;return this.steps.push(M=>{let q=I||!U(M,F);return I=!1,F=M,q?M:T}),this}evaluate(U){for(let I of this.steps)if(U=I(U),U===T)break;return U}}function V($,U,I=F=>F){let F=(...ce)=>j.fire(I(...ce)),M=()=>$.on(U,F),q=()=>$.removeListener(U,F),j=new Q({onWillAddFirstListener:M,onDidRemoveLastListener:q});return j.event}e.fromNodeEventEmitter=V;function P($,U,I=F=>F){let F=(...ce)=>j.fire(I(...ce)),M=()=>$.addEventListener(U,F),q=()=>$.removeEventListener(U,F),j=new Q({onWillAddFirstListener:M,onDidRemoveLastListener:q});return j.event}e.fromDOMEventEmitter=P;function H($){return new Promise(U=>n($)(U))}e.toPromise=H;function ee($){let U=new Q;return $.then(I=>{U.fire(I)},()=>{U.fire(void 0)}).finally(()=>{U.dispose()}),U.event}e.fromPromise=ee;function ae($,U){return $(I=>U.fire(I))}e.forward=ae;function _e($,U,I){return U(I),$(F=>U(F))}e.runAndSubscribe=_e;class Te{constructor(U,I){this._observable=U,this._counter=0,this._hasChanged=!1;let F={onWillAddFirstListener:()=>{U.addObserver(this)},onDidRemoveLastListener:()=>{U.removeObserver(this)}};this.emitter=new Q(F),I&&I.add(this.emitter)}beginUpdate(U){this._counter++}handlePossibleChange(U){}handleChange(U,I){this._hasChanged=!0}endUpdate(U){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Je($,U){return new Te($,U).emitter.event}e.fromObservable=Je;function ie($){return(U,I,F)=>{let M=0,q=!1,j={beginUpdate(){M++},endUpdate(){M--,M===0&&($.reportChanges(),q&&(q=!1,U.call(I)))},handlePossibleChange(){},handleChange(){q=!0}};$.addObserver(j),$.reportChanges();let ce={dispose(){$.removeObserver(j)}};return F instanceof Bs?F.add(ce):Array.isArray(F)&&F.push(ce),ce}}e.fromObservableLight=ie})(xt||(xt={}));var Su=class yu{constructor(i){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${i}_${yu._idPool++}`,yu.all.add(this)}start(i){this._stopWatch=new sw,this.listenerCount=i}stop(){if(this._stopWatch){let i=this._stopWatch.elapsed();this.durations.push(i),this.elapsedOverall+=i,this.invocationCount+=1,this._stopWatch=void 0}}};Su.all=new Set,Su._idPool=0;var rw=Su,nw=-1,Lm=class Nm{constructor(i,n,l=(Nm._idPool++).toString(16).padStart(3,"0")){this._errorHandler=i,this.threshold=n,this.name=l,this._warnCountdown=0}dispose(){var i;(i=this._stacks)==null||i.clear()}check(i,n){let l=this.threshold;if(l<=0||n<l)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(i.value)||0;if(this._stacks.set(i.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=l*.5;let[h,d]=this.getMostFrequentStack(),_=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${d}):`;console.warn(_),console.warn(h);let v=new ow(_,h);this._errorHandler(v)}return()=>{let h=this._stacks.get(i.value)||0;this._stacks.set(i.value,h-1)}}getMostFrequentStack(){if(!this._stacks)return;let i,n=0;for(let[l,o]of this._stacks)(!i||n<o)&&(i=[l,o],n=o);return i}};Lm._idPool=1;var lw=Lm,aw=class Hm{constructor(i){this.value=i}static create(){let i=new Error;return new Hm(i.stack??"")}print(){console.warn(this.value.split(`
192
+ `).slice(2).join(`
193
+ `))}},ow=class extends Error{constructor(e,i){super(e),this.name="ListenerLeakError",this.stack=i}},cw=class extends Error{constructor(e,i){super(e),this.name="ListenerRefusalError",this.stack=i}},hw=0,Vh=class{constructor(e){this.value=e,this.id=hw++}},uw=2,dw,Q=class{constructor(i){var n,l,o,h;this._size=0,this._options=i,this._leakageMon=(n=this._options)!=null&&n.leakWarningThreshold?new lw((i==null?void 0:i.onListenerError)??no,((l=this._options)==null?void 0:l.leakWarningThreshold)??nw):void 0,this._perfMon=(o=this._options)!=null&&o._profName?new rw(this._options._profName):void 0,this._deliveryQueue=(h=this._options)==null?void 0:h.deliveryQueue}dispose(){var i,n,l,o;this._disposed||(this._disposed=!0,((i=this._deliveryQueue)==null?void 0:i.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(l=(n=this._options)==null?void 0:n.onDidRemoveLastListener)==null||l.call(n),(o=this._leakageMon)==null||o.dispose())}get event(){return this._event??(this._event=(i,n,l)=>{var _,v,f,p,S;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let y=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(y);let E=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],C=new cw(`${y}. HINT: Stack shows most frequent listener (${E[1]}-times)`,E[0]);return(((_=this._options)==null?void 0:_.onListenerError)||no)(C),Se.None}if(this._disposed)return Se.None;n&&(i=i.bind(n));let o=new Vh(i),h;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=aw.create(),h=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof Vh?(this._deliveryQueue??(this._deliveryQueue=new fw),this._listeners=[this._listeners,o]):this._listeners.push(o):((f=(v=this._options)==null?void 0:v.onWillAddFirstListener)==null||f.call(v,this),this._listeners=o,(S=(p=this._options)==null?void 0:p.onDidAddFirstListener)==null||S.call(p,this)),this._size++;let d=qe(()=>{h==null||h(),this._removeListener(o)});return l instanceof Bs?l.add(d):Array.isArray(l)&&l.push(d),d}),this._event}_removeListener(i){var h,d,_,v;if((d=(h=this._options)==null?void 0:h.onWillRemoveListener)==null||d.call(h,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(v=(_=this._options)==null?void 0:_.onDidRemoveLastListener)==null||v.call(_,this),this._size=0;return}let n=this._listeners,l=n.indexOf(i);if(l===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[l]=void 0;let o=this._deliveryQueue.current===this;if(this._size*uw<=n.length){let f=0;for(let p=0;p<n.length;p++)n[p]?n[f++]=n[p]:o&&(this._deliveryQueue.end--,f<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=f}}_deliver(i,n){var o;if(!i)return;let l=((o=this._options)==null?void 0:o.onListenerError)||no;if(!l){i.value(n);return}try{i.value(n)}catch(h){l(h)}}_deliverQueue(i){let n=i.current._listeners;for(;i.i<i.end;)this._deliver(n[i.i++],i.value);i.reset()}fire(i){var n,l,o,h;if((n=this._deliveryQueue)!=null&&n.current&&(this._deliverQueue(this._deliveryQueue),(l=this._perfMon)==null||l.stop()),(o=this._perfMon)==null||o.start(this._size),this._listeners)if(this._listeners instanceof Vh)this._deliver(this._listeners,i);else{let d=this._deliveryQueue;d.enqueue(this,i,this._listeners.length),this._deliverQueue(d)}(h=this._perfMon)==null||h.stop()}hasListeners(){return this._size>0}},fw=class{constructor(){this.i=-1,this.end=0}enqueue(e,i,n){this.i=0,this.end=n,this.current=e,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},bu=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Q,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Q,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(i){return this.mapWindowIdToZoomLevel.get(this.getWindowId(i))??0}setZoomLevel(i,n){if(this.getZoomLevel(n)===i)return;let l=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(l,i),this._onDidChangeZoomLevel.fire(l)}getZoomFactor(i){return this.mapWindowIdToZoomFactor.get(this.getWindowId(i))??1}setZoomFactor(i,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),i)}setFullscreen(i,n){if(this.isFullscreen(n)===i)return;let l=this.getWindowId(n);this.mapWindowIdToFullScreen.set(l,i),this._onDidChangeFullscreen.fire(l)}isFullscreen(i){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(i))}getWindowId(i){return i.vscodeWindowId}};bu.INSTANCE=new bu;var rd=bu;function _w(e,i,n){typeof i=="string"&&(i=e.matchMedia(i)),i.addEventListener("change",n)}rd.INSTANCE.onDidChangeZoomLevel;function vw(e){return rd.INSTANCE.getZoomFactor(e)}rd.INSTANCE.onDidChangeFullscreen;var hn=typeof navigator=="object"?navigator.userAgent:"",wu=hn.indexOf("Firefox")>=0,gw=hn.indexOf("AppleWebKit")>=0,nd=hn.indexOf("Chrome")>=0,pw=!nd&&hn.indexOf("Safari")>=0;hn.indexOf("Electron/")>=0;hn.indexOf("Android")>=0;var Xh=!1;if(typeof Ii.matchMedia=="function"){let e=Ii.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),i=Ii.matchMedia("(display-mode: fullscreen)");Xh=e.matches,_w(Ii,e,({matches:n})=>{Xh&&i.matches||(Xh=n)})}var rn="en",Cu=!1,xu=!1,lo=!1,Um=!1,Za,ao=rn,Qg=rn,mw,pi,sr=globalThis,Ct,Vp;typeof sr.vscode<"u"&&typeof sr.vscode.process<"u"?Ct=sr.vscode.process:typeof process<"u"&&typeof((Vp=process==null?void 0:process.versions)==null?void 0:Vp.node)=="string"&&(Ct=process);var Xp,Sw=typeof((Xp=Ct==null?void 0:Ct.versions)==null?void 0:Xp.electron)=="string",yw=Sw&&(Ct==null?void 0:Ct.type)==="renderer",Gp;if(typeof Ct=="object"){Cu=Ct.platform==="win32",xu=Ct.platform==="darwin",lo=Ct.platform==="linux",lo&&Ct.env.SNAP&&Ct.env.SNAP_REVISION,Ct.env.CI||Ct.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Za=rn,ao=rn;let e=Ct.env.VSCODE_NLS_CONFIG;if(e)try{let i=JSON.parse(e);Za=i.userLocale,Qg=i.osLocale,ao=i.resolvedLanguage||rn,mw=(Gp=i.languagePack)==null?void 0:Gp.translationsConfigFile}catch{}Um=!0}else typeof navigator=="object"&&!yw?(pi=navigator.userAgent,Cu=pi.indexOf("Windows")>=0,xu=pi.indexOf("Macintosh")>=0,(pi.indexOf("Macintosh")>=0||pi.indexOf("iPad")>=0||pi.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,lo=pi.indexOf("Linux")>=0,(pi==null?void 0:pi.indexOf("Mobi"))>=0,ao=globalThis._VSCODE_NLS_LANGUAGE||rn,Za=navigator.language.toLowerCase(),Qg=Za):console.error("Unable to resolve platform.");var Pm=Cu,Ai=xu,bw=lo,Jg=Um,Bi=pi,Es=ao,ww;(e=>{function i(){return Es}e.value=i;function n(){return Es.length===2?Es==="en":Es.length>=3?Es[0]==="e"&&Es[1]==="n"&&Es[2]==="-":!1}e.isDefaultVariant=n;function l(){return Es==="en"}e.isDefault=l})(ww||(ww={}));var Cw=typeof sr.postMessage=="function"&&!sr.importScripts;(()=>{if(Cw){let e=[];sr.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let l=0,o=e.length;l<o;l++){let h=e[l];if(h.id===n.data.vscodeScheduleAsyncWork){e.splice(l,1),h.callback();return}}});let i=0;return n=>{let l=++i;e.push({id:l,callback:n}),sr.postMessage({vscodeScheduleAsyncWork:l},"*")}}return e=>setTimeout(e)})();var xw=!!(Bi&&Bi.indexOf("Chrome")>=0);Bi&&Bi.indexOf("Firefox")>=0;!xw&&Bi&&Bi.indexOf("Safari")>=0;Bi&&Bi.indexOf("Edg/")>=0;Bi&&Bi.indexOf("Android")>=0;var Jr=typeof navigator=="object"?navigator:{};Jg||document.queryCommandSupported&&document.queryCommandSupported("copy")||Jr&&Jr.clipboard&&Jr.clipboard.writeText,Jg||Jr&&Jr.clipboard&&Jr.clipboard.readText;var ld=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,i){this._keyCodeToStr[e]=i,this._strToKeyCode[i.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Gh=new ld,ep=new ld,tp=new ld,Ew=new Array(230),jm;(e=>{function i(_){return Gh.keyCodeToStr(_)}e.toString=i;function n(_){return Gh.strToKeyCode(_)}e.fromString=n;function l(_){return ep.keyCodeToStr(_)}e.toUserSettingsUS=l;function o(_){return tp.keyCodeToStr(_)}e.toUserSettingsGeneral=o;function h(_){return ep.strToKeyCode(_)||tp.strToKeyCode(_)}e.fromUserSettings=h;function d(_){if(_>=98&&_<=113)return null;switch(_){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Gh.keyCodeToStr(_)}e.toElectronAccelerator=d})(jm||(jm={}));var kw=class qm{constructor(i,n,l,o,h){this.ctrlKey=i,this.shiftKey=n,this.altKey=l,this.metaKey=o,this.keyCode=h}equals(i){return i instanceof qm&&this.ctrlKey===i.ctrlKey&&this.shiftKey===i.shiftKey&&this.altKey===i.altKey&&this.metaKey===i.metaKey&&this.keyCode===i.keyCode}getHashCode(){let i=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",l=this.altKey?"1":"0",o=this.metaKey?"1":"0";return`K${i}${n}${l}${o}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new Mw([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},Mw=class{constructor(e){if(e.length===0)throw Qb("chords");this.chords=e}getHashCode(){let e="";for(let i=0,n=this.chords.length;i<n;i++)i!==0&&(e+=";"),e+=this.chords[i].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let i=0;i<this.chords.length;i++)if(!this.chords[i].equals(e.chords[i]))return!1;return!0}};function Dw(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return jm.fromString(n)}let i=e.keyCode;if(i===3)return 7;if(wu)switch(i){case 59:return 85;case 60:if(bw)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Ai)return 57;break}else if(gw&&(Ai&&i===93||!Ai&&i===92))return 57;return Ew[i]||0}var Rw=Ai?256:2048,Tw=512,Aw=1024,Bw=Ai?2048:256,ip=class{constructor(e){var n;this._standardKeyboardEventBrand=!0;let i=e;this.browserEvent=i,this.target=i.target,this.ctrlKey=i.ctrlKey,this.shiftKey=i.shiftKey,this.altKey=i.altKey,this.metaKey=i.metaKey,this.altGraphKey=(n=i.getModifierState)==null?void 0:n.call(i,"AltGraph"),this.keyCode=Dw(i),this.code=i.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let i=0;return this.ctrlKey&&(i|=Rw),this.altKey&&(i|=Tw),this.shiftKey&&(i|=Aw),this.metaKey&&(i|=Bw),i|=e,i}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new kw(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},sp=new WeakMap;function zw(e){if(!e.parent||e.parent===e)return null;try{let i=e.location,n=e.parent.location;if(i.origin!=="null"&&n.origin!=="null"&&i.origin!==n.origin)return null}catch{return null}return e.parent}var Ow=class{static getSameOriginWindowChain(e){let i=sp.get(e);if(!i){i=[],sp.set(e,i);let n=e,l;do l=zw(n),l?i.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):i.push({window:new WeakRef(n),iframeElement:null}),n=l;while(n)}return i.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,i){if(!i||e===i)return{top:0,left:0};let n=0,l=0,o=this.getSameOriginWindowChain(e);for(let h of o){let d=h.window.deref();if(n+=(d==null?void 0:d.scrollY)??0,l+=(d==null?void 0:d.scrollX)??0,d===i||!h.iframeElement)break;let _=h.iframeElement.getBoundingClientRect();n+=_.top,l+=_.left}return{top:n,left:l}}},Qa=class{constructor(e,i){this.timestamp=Date.now(),this.browserEvent=i,this.leftButton=i.button===0,this.middleButton=i.button===1,this.rightButton=i.button===2,this.buttons=i.buttons,this.target=i.target,this.detail=i.detail||1,i.type==="dblclick"&&(this.detail=2),this.ctrlKey=i.ctrlKey,this.shiftKey=i.shiftKey,this.altKey=i.altKey,this.metaKey=i.metaKey,typeof i.pageX=="number"?(this.posx=i.pageX,this.posy=i.pageY):(this.posx=i.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=i.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=Ow.getPositionOfChildWindowRelativeToAncestorWindow(e,i.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},rp=class{constructor(e,i=0,n=0){var o;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=i;let l=!1;if(nd){let h=navigator.userAgent.match(/Chrome\/(\d+)/);l=(h?parseInt(h[1]):123)<=122}if(e){let h=e,d=e,_=((o=e.view)==null?void 0:o.devicePixelRatio)||1;if(typeof h.wheelDeltaY<"u")l?this.deltaY=h.wheelDeltaY/(120*_):this.deltaY=h.wheelDeltaY/120;else if(typeof d.VERTICAL_AXIS<"u"&&d.axis===d.VERTICAL_AXIS)this.deltaY=-d.detail/3;else if(e.type==="wheel"){let v=e;v.deltaMode===v.DOM_DELTA_LINE?wu&&!Ai?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof h.wheelDeltaX<"u")pw&&Pm?this.deltaX=-(h.wheelDeltaX/120):l?this.deltaX=h.wheelDeltaX/(120*_):this.deltaX=h.wheelDeltaX/120;else if(typeof d.HORIZONTAL_AXIS<"u"&&d.axis===d.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let v=e;v.deltaMode===v.DOM_DELTA_LINE?wu&&!Ai?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(l?this.deltaY=e.wheelDelta/(120*_):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},Wm=Object.freeze(function(e,i){let n=setTimeout(e.bind(i),0);return{dispose(){clearTimeout(n)}}}),Lw;(e=>{function i(n){return n===e.None||n===e.Cancelled||n instanceof Nw?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=i,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:xt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Wm})})(Lw||(Lw={}));var Nw=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Wm:(this._emitter||(this._emitter=new Q),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},ad=class{constructor(e,i){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof i=="number"&&this.setIfNotSet(e,i)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,i){if(this._isDisposed)throw new gu("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},i)}setIfNotSet(e,i){if(this._isDisposed)throw new gu("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},i))}},Hw=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,i,n=globalThis){if(this.isDisposed)throw new gu("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let l=n.setInterval(()=>{e()},i);this.disposable=qe(()=>{n.clearInterval(l),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Uw;(e=>{async function i(l){let o,h=await Promise.all(l.map(d=>d.then(_=>_,_=>{o||(o=_)})));if(typeof o<"u")throw o;return h}e.settled=i;function n(l){return new Promise(async(o,h)=>{try{await l(o,h)}catch(d){h(d)}})}e.withAsyncBody=n})(Uw||(Uw={}));var np=class ui{static fromArray(i){return new ui(n=>{n.emitMany(i)})}static fromPromise(i){return new ui(async n=>{n.emitMany(await i)})}static fromPromises(i){return new ui(async n=>{await Promise.all(i.map(async l=>n.emitOne(await l)))})}static merge(i){return new ui(async n=>{await Promise.all(i.map(async l=>{for await(let o of l)n.emitOne(o)}))})}constructor(i,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new Q,queueMicrotask(async()=>{let l={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(i(l)),this.resolve()}catch(o){this.reject(o)}finally{l.emitOne=void 0,l.emitMany=void 0,l.reject=void 0}})}[Symbol.asyncIterator](){let i=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(i<this._results.length)return{done:!1,value:this._results[i++]};if(this._state===1)return{done:!0,value:void 0};await xt.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var n;return(n=this._onReturn)==null||n.call(this),{done:!0,value:void 0}}}}static map(i,n){return new ui(async l=>{for await(let o of i)l.emitOne(n(o))})}map(i){return ui.map(this,i)}static filter(i,n){return new ui(async l=>{for await(let o of i)n(o)&&l.emitOne(o)})}filter(i){return ui.filter(this,i)}static coalesce(i){return ui.filter(i,n=>!!n)}coalesce(){return ui.coalesce(this)}static async toPromise(i){let n=[];for await(let l of i)n.push(l);return n}toPromise(){return ui.toPromise(this)}emitOne(i){this._state===0&&(this._results.push(i),this._onStateChanged.fire())}emitMany(i){this._state===0&&(this._results=this._results.concat(i),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(i){this._state===0&&(this._state=2,this._error=i,this._onStateChanged.fire())}};np.EMPTY=np.fromArray([]);var{getWindow:Ti,getWindowId:Pw,onDidRegisterWindow:jw}=(function(){let e=new Map,i={window:Ii,disposables:new Bs};e.set(Ii.vscodeWindowId,i);let n=new Q,l=new Q,o=new Q;function h(d,_){return(typeof d=="number"?e.get(d):void 0)??(_?i:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:l.event,registerWindow(d){if(e.has(d.vscodeWindowId))return Se.None;let _=new Bs,v={window:d,disposables:_.add(new Bs)};return e.set(d.vscodeWindowId,v),_.add(qe(()=>{e.delete(d.vscodeWindowId),l.fire(d)})),_.add(fe(d,vt.BEFORE_UNLOAD,()=>{o.fire(d)})),n.fire(v),_},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(d){return d.vscodeWindowId},hasWindow(d){return e.has(d)},getWindowById:h,getWindow(d){var f;let _=d;if((f=_==null?void 0:_.ownerDocument)!=null&&f.defaultView)return _.ownerDocument.defaultView.window;let v=d;return v!=null&&v.view?v.view.window:Ii},getDocument(d){return Ti(d).document}}})(),qw=class{constructor(e,i,n,l){this._node=e,this._type=i,this._handler=n,this._options=l||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function fe(e,i,n,l){return new qw(e,i,n,l)}var lp=function(e,i,n,l){return fe(e,i,n,l)},od,Ww=class extends Hw{constructor(e){super(),this.defaultTarget=e&&Ti(e)}cancelAndSet(e,i,n){return super.cancelAndSet(e,i,n??this.defaultTarget)}},ap=class{constructor(e,i=0){this._runner=e,this.priority=i,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){no(e)}}static sort(e,i){return i.priority-e.priority}};(function(){let e=new Map,i=new Map,n=new Map,l=new Map,o=h=>{n.set(h,!1);let d=e.get(h)??[];for(i.set(h,d),e.set(h,[]),l.set(h,!0);d.length>0;)d.sort(ap.sort),d.shift().execute();l.set(h,!1)};od=(h,d,_=0)=>{let v=Pw(h),f=new ap(d,_),p=e.get(v);return p||(p=[],e.set(v,p)),p.push(f),n.get(v)||(n.set(v,!0),h.requestAnimationFrame(()=>o(v))),f}})();function Yw(e){let i=e.getBoundingClientRect(),n=Ti(e);return{left:i.left+n.scrollX,top:i.top+n.scrollY,width:i.width,height:i.height}}var vt={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},Kw=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let i=qt(e);this._maxWidth!==i&&(this._maxWidth=i,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let i=qt(e);this._width!==i&&(this._width=i,this.domNode.style.width=this._width)}setHeight(e){let i=qt(e);this._height!==i&&(this._height=i,this.domNode.style.height=this._height)}setTop(e){let i=qt(e);this._top!==i&&(this._top=i,this.domNode.style.top=this._top)}setLeft(e){let i=qt(e);this._left!==i&&(this._left=i,this.domNode.style.left=this._left)}setBottom(e){let i=qt(e);this._bottom!==i&&(this._bottom=i,this.domNode.style.bottom=this._bottom)}setRight(e){let i=qt(e);this._right!==i&&(this._right=i,this.domNode.style.right=this._right)}setPaddingTop(e){let i=qt(e);this._paddingTop!==i&&(this._paddingTop=i,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let i=qt(e);this._paddingLeft!==i&&(this._paddingLeft=i,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let i=qt(e);this._paddingBottom!==i&&(this._paddingBottom=i,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let i=qt(e);this._paddingRight!==i&&(this._paddingRight=i,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let i=qt(e);this._fontSize!==i&&(this._fontSize=i,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let i=qt(e);this._lineHeight!==i&&(this._lineHeight=i,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let i=qt(e);this._letterSpacing!==i&&(this._letterSpacing=i,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,i){this.domNode.classList.toggle(e,i),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,i){this.domNode.setAttribute(e,i)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function qt(e){return typeof e=="number"?`${e}px`:e}function xl(e){return new Kw(e)}var Ym=class{constructor(){this._hooks=new Bs,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,i){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(i)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,i,n,l,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=l,this._onStopCallback=o;let h=e;try{e.setPointerCapture(i),this._hooks.add(qe(()=>{try{e.releasePointerCapture(i)}catch{}}))}catch{h=Ti(e)}this._hooks.add(fe(h,vt.POINTER_MOVE,d=>{if(d.buttons!==n){this.stopMonitoring(!0);return}d.preventDefault(),this._pointerMoveCallback(d)})),this._hooks.add(fe(h,vt.POINTER_UP,d=>this.stopMonitoring(!0)))}};function Vw(e,i,n){let l=null,o=null;if(typeof n.value=="function"?(l="value",o=n.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(l="get",o=n.get),!o)throw new Error("not supported");let h=`$memoize$${i}`;n[l]=function(...d){return this.hasOwnProperty(h)||Object.defineProperty(this,h,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,d)}),this[h]}}var Mi;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Mi||(Mi={}));var ml=class Rt extends Se{constructor(){super(),this.dispatched=!1,this.targets=new Zg,this.ignoreTargets=new Zg,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(xt.runAndSubscribe(jw,({window:i,disposables:n})=>{n.add(fe(i.document,"touchstart",l=>this.onTouchStart(l),{passive:!1})),n.add(fe(i.document,"touchend",l=>this.onTouchEnd(i,l))),n.add(fe(i.document,"touchmove",l=>this.onTouchMove(l),{passive:!1}))},{window:Ii,disposables:this._store}))}static addTarget(i){if(!Rt.isTouchDevice())return Se.None;Rt.INSTANCE||(Rt.INSTANCE=new Rt);let n=Rt.INSTANCE.targets.push(i);return qe(n)}static ignoreTarget(i){if(!Rt.isTouchDevice())return Se.None;Rt.INSTANCE||(Rt.INSTANCE=new Rt);let n=Rt.INSTANCE.ignoreTargets.push(i);return qe(n)}static isTouchDevice(){return"ontouchstart"in Ii||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(i){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let l=0,o=i.targetTouches.length;l<o;l++){let h=i.targetTouches.item(l);this.activeTouches[h.identifier]={id:h.identifier,initialTarget:h.target,initialTimeStamp:n,initialPageX:h.pageX,initialPageY:h.pageY,rollingTimestamps:[n],rollingPageX:[h.pageX],rollingPageY:[h.pageY]};let d=this.newGestureEvent(Mi.Start,h.target);d.pageX=h.pageX,d.pageY=h.pageY,this.dispatchEvent(d)}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}onTouchEnd(i,n){let l=Date.now(),o=Object.keys(this.activeTouches).length;for(let h=0,d=n.changedTouches.length;h<d;h++){let _=n.changedTouches.item(h);if(!this.activeTouches.hasOwnProperty(String(_.identifier))){console.warn("move of an UNKNOWN touch",_);continue}let v=this.activeTouches[_.identifier],f=Date.now()-v.initialTimeStamp;if(f<Rt.HOLD_DELAY&&Math.abs(v.initialPageX-Qt(v.rollingPageX))<30&&Math.abs(v.initialPageY-Qt(v.rollingPageY))<30){let p=this.newGestureEvent(Mi.Tap,v.initialTarget);p.pageX=Qt(v.rollingPageX),p.pageY=Qt(v.rollingPageY),this.dispatchEvent(p)}else if(f>=Rt.HOLD_DELAY&&Math.abs(v.initialPageX-Qt(v.rollingPageX))<30&&Math.abs(v.initialPageY-Qt(v.rollingPageY))<30){let p=this.newGestureEvent(Mi.Contextmenu,v.initialTarget);p.pageX=Qt(v.rollingPageX),p.pageY=Qt(v.rollingPageY),this.dispatchEvent(p)}else if(o===1){let p=Qt(v.rollingPageX),S=Qt(v.rollingPageY),y=Qt(v.rollingTimestamps)-v.rollingTimestamps[0],E=p-v.rollingPageX[0],C=S-v.rollingPageY[0],x=[...this.targets].filter(z=>v.initialTarget instanceof Node&&z.contains(v.initialTarget));this.inertia(i,x,l,Math.abs(E)/y,E>0?1:-1,p,Math.abs(C)/y,C>0?1:-1,S)}this.dispatchEvent(this.newGestureEvent(Mi.End,v.initialTarget)),delete this.activeTouches[_.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(i,n){let l=document.createEvent("CustomEvent");return l.initEvent(i,!1,!0),l.initialTarget=n,l.tapCount=0,l}dispatchEvent(i){if(i.type===Mi.Tap){let n=new Date().getTime(),l=0;n-this._lastSetTapCountTime>Rt.CLEAR_TAP_COUNT_TIME?l=1:l=2,this._lastSetTapCountTime=n,i.tapCount=l}else(i.type===Mi.Change||i.type===Mi.Contextmenu)&&(this._lastSetTapCountTime=0);if(i.initialTarget instanceof Node){for(let l of this.ignoreTargets)if(l.contains(i.initialTarget))return;let n=[];for(let l of this.targets)if(l.contains(i.initialTarget)){let o=0,h=i.initialTarget;for(;h&&h!==l;)o++,h=h.parentElement;n.push([o,l])}n.sort((l,o)=>l[0]-o[0]);for(let[l,o]of n)o.dispatchEvent(i),this.dispatched=!0}}inertia(i,n,l,o,h,d,_,v,f){this.handle=od(i,()=>{let p=Date.now(),S=p-l,y=0,E=0,C=!0;o+=Rt.SCROLL_FRICTION*S,_+=Rt.SCROLL_FRICTION*S,o>0&&(C=!1,y=h*o*S),_>0&&(C=!1,E=v*_*S);let x=this.newGestureEvent(Mi.Change);x.translationX=y,x.translationY=E,n.forEach(z=>z.dispatchEvent(x)),C||this.inertia(i,n,p,o,h,d+y,_,v,f+E)})}onTouchMove(i){let n=Date.now();for(let l=0,o=i.changedTouches.length;l<o;l++){let h=i.changedTouches.item(l);if(!this.activeTouches.hasOwnProperty(String(h.identifier))){console.warn("end of an UNKNOWN touch",h);continue}let d=this.activeTouches[h.identifier],_=this.newGestureEvent(Mi.Change,d.initialTarget);_.translationX=h.pageX-Qt(d.rollingPageX),_.translationY=h.pageY-Qt(d.rollingPageY),_.pageX=h.pageX,_.pageY=h.pageY,this.dispatchEvent(_),d.rollingPageX.length>3&&(d.rollingPageX.shift(),d.rollingPageY.shift(),d.rollingTimestamps.shift()),d.rollingPageX.push(h.pageX),d.rollingPageY.push(h.pageY),d.rollingTimestamps.push(n)}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}};ml.SCROLL_FRICTION=-.005,ml.HOLD_DELAY=700,ml.CLEAR_TAP_COUNT_TIME=400,$e([Vw],ml,"isTouchDevice",1);var Xw=ml,cd=class extends Se{onclick(e,i){this._register(fe(e,vt.CLICK,n=>i(new Qa(Ti(e),n))))}onmousedown(e,i){this._register(fe(e,vt.MOUSE_DOWN,n=>i(new Qa(Ti(e),n))))}onmouseover(e,i){this._register(fe(e,vt.MOUSE_OVER,n=>i(new Qa(Ti(e),n))))}onmouseleave(e,i){this._register(fe(e,vt.MOUSE_LEAVE,n=>i(new Qa(Ti(e),n))))}onkeydown(e,i){this._register(fe(e,vt.KEY_DOWN,n=>i(new ip(n))))}onkeyup(e,i){this._register(fe(e,vt.KEY_UP,n=>i(new ip(n))))}oninput(e,i){this._register(fe(e,vt.INPUT,i))}onblur(e,i){this._register(fe(e,vt.BLUR,i))}onfocus(e,i){this._register(fe(e,vt.FOCUS,i))}onchange(e,i){this._register(fe(e,vt.CHANGE,i))}ignoreGesture(e){return Xw.ignoreTarget(e)}},op=11,Gw=class extends cd{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=op+"px",this.domNode.style.height=op+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new Ym),this._register(lp(this.bgDomNode,vt.POINTER_DOWN,i=>this._arrowPointerDown(i))),this._register(lp(this.domNode,vt.POINTER_DOWN,i=>this._arrowPointerDown(i))),this._pointerdownRepeatTimer=this._register(new Ww),this._pointerdownScheduleRepeatTimer=this._register(new ad)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ti(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(i,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},$w=class Eu{constructor(i,n,l,o,h,d,_){this._forceIntegerValues=i,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,l=l|0,o=o|0,h=h|0,d=d|0,_=_|0),this.rawScrollLeft=o,this.rawScrollTop=_,n<0&&(n=0),o+n>l&&(o=l-n),o<0&&(o=0),h<0&&(h=0),_+h>d&&(_=d-h),_<0&&(_=0),this.width=n,this.scrollWidth=l,this.scrollLeft=o,this.height=h,this.scrollHeight=d,this.scrollTop=_}equals(i){return this.rawScrollLeft===i.rawScrollLeft&&this.rawScrollTop===i.rawScrollTop&&this.width===i.width&&this.scrollWidth===i.scrollWidth&&this.scrollLeft===i.scrollLeft&&this.height===i.height&&this.scrollHeight===i.scrollHeight&&this.scrollTop===i.scrollTop}withScrollDimensions(i,n){return new Eu(this._forceIntegerValues,typeof i.width<"u"?i.width:this.width,typeof i.scrollWidth<"u"?i.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof i.height<"u"?i.height:this.height,typeof i.scrollHeight<"u"?i.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(i){return new Eu(this._forceIntegerValues,this.width,this.scrollWidth,typeof i.scrollLeft<"u"?i.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof i.scrollTop<"u"?i.scrollTop:this.rawScrollTop)}createScrollEvent(i,n){let l=this.width!==i.width,o=this.scrollWidth!==i.scrollWidth,h=this.scrollLeft!==i.scrollLeft,d=this.height!==i.height,_=this.scrollHeight!==i.scrollHeight,v=this.scrollTop!==i.scrollTop;return{inSmoothScrolling:n,oldWidth:i.width,oldScrollWidth:i.scrollWidth,oldScrollLeft:i.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:i.height,oldScrollHeight:i.scrollHeight,oldScrollTop:i.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:l,scrollWidthChanged:o,scrollLeftChanged:h,heightChanged:d,scrollHeightChanged:_,scrollTopChanged:v}}},Fw=class extends Se{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new $w(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,i){var l;let n=this._state.withScrollDimensions(e,i);this._setState(n,!!this._smoothScrolling),(l=this._smoothScrolling)==null||l.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let i=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(i,!1)}setScrollPositionSmooth(e,i){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let l;i?l=new hp(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):l=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=l}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=hp.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),i=this._state.withScrollPosition(e);if(this._setState(i,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,i){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,i)))}},cp=class{constructor(e,i,n){this.scrollLeft=e,this.scrollTop=i,this.isDone=n}};function $h(e,i){let n=i-e;return function(l){return e+n*Qw(l)}}function Iw(e,i,n){return function(l){return l<n?e(l/n):i((l-n)/(1-n))}}var hp=class ku{constructor(i,n,l,o){this.from=i,this.to=n,this.duration=o,this.startTime=l,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(i,n,l){if(Math.abs(i-n)>2.5*l){let o,h;return i<n?(o=i+.75*l,h=n-.75*l):(o=i-.75*l,h=n+.75*l),Iw($h(i,o),$h(h,n),.33)}return $h(i,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(i){this.to=i.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(i){let n=(i-this.startTime)/this.duration;if(n<1){let l=this.scrollLeft(n),o=this.scrollTop(n);return new cp(l,o,!1)}return new cp(this.to.scrollLeft,this.to.scrollTop,!0)}combine(i,n,l){return ku.start(i,n,l)}static start(i,n,l){l=l+10;let o=Date.now()-10;return new ku(i,n,o,l)}};function Zw(e){return Math.pow(e,3)}function Qw(e){return 1-Zw(1-e)}var Jw=class extends Se{constructor(e,i,n){super(),this._visibility=e,this._visibleClassName=i,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new ad)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var i;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(i=this._domNode)==null||i.setClassName(this._invisibleClassName+(e?" fade":"")))}},eC=140,Km=class extends cd{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Jw(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Ym),this._shouldRender=!0,this.domNode=xl(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(fe(this.domNode.domNode,vt.POINTER_DOWN,i=>this._domNodePointerDown(i)))}_createArrow(e){let i=this._register(new Gw(e));this.domNode.domNode.appendChild(i.bgDomNode),this.domNode.domNode.appendChild(i.domNode)}_createSlider(e,i,n,l){this.slider=xl(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(i),typeof n=="number"&&this.slider.setWidth(n),typeof l=="number"&&this.slider.setHeight(l),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(fe(this.slider.domNode,vt.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let i=this.domNode.domNode.getClientRects()[0].top,n=i+this._scrollbarState.getSliderPosition(),l=i+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);n<=o&&o<=l?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let i,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")i=e.offsetX,n=e.offsetY;else{let o=Yw(this.domNode.domNode);i=e.pageX-o.left,n=e.pageY-o.top}let l=this._pointerDownRelativePosition(i,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(l):this._scrollbarState.getDesiredScrollPositionFromOffset(l)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),l=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{let h=this._sliderOrthogonalPointerPosition(o),d=Math.abs(h-n);if(Pm&&d>eC){this._setDesiredScrollPositionNow(l.getScrollPosition());return}let _=this._sliderPointerPosition(o)-i;this._setDesiredScrollPositionNow(l.getDesiredScrollPositionFromDelta(_))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let i={};this.writeScrollPosition(i,e),this._scrollable.setScrollPositionNow(i)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},Vm=class Mu{constructor(i,n,l,o,h,d){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(l),this._arrowSize=Math.round(i),this._visibleSize=o,this._scrollSize=h,this._scrollPosition=d,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Mu(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(i){let n=Math.round(i);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(i){let n=Math.round(i);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(i){let n=Math.round(i);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(i){this._scrollbarSize=Math.round(i)}setOppositeScrollbarSize(i){this._oppositeScrollbarSize=Math.round(i)}static _computeValues(i,n,l,o,h){let d=Math.max(0,l-i),_=Math.max(0,d-2*n),v=o>0&&o>l;if(!v)return{computedAvailableSize:Math.round(d),computedIsNeeded:v,computedSliderSize:Math.round(_),computedSliderRatio:0,computedSliderPosition:0};let f=Math.round(Math.max(20,Math.floor(l*_/o))),p=(_-f)/(o-l),S=h*p;return{computedAvailableSize:Math.round(d),computedIsNeeded:v,computedSliderSize:Math.round(f),computedSliderRatio:p,computedSliderPosition:Math.round(S)}}_refreshComputedValues(){let i=Mu._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=i.computedAvailableSize,this._computedIsNeeded=i.computedIsNeeded,this._computedSliderSize=i.computedSliderSize,this._computedSliderRatio=i.computedSliderRatio,this._computedSliderPosition=i.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(i){if(!this._computedIsNeeded)return 0;let n=i-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(i){if(!this._computedIsNeeded)return 0;let n=i-this._arrowSize,l=this._scrollPosition;return n<this._computedSliderPosition?l-=this._visibleSize:l+=this._visibleSize,l}getDesiredScrollPositionFromDelta(i){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+i;return Math.round(n/this._computedSliderRatio)}},tC=class extends Km{constructor(e,i,n){let l=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new Vm(i.horizontalHasArrows?i.arrowSize:0,i.horizontal===2?0:i.horizontalScrollbarSize,i.vertical===2?0:i.verticalScrollbarSize,l.width,l.scrollWidth,o.scrollLeft),visibility:i.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:i.scrollByPage}),i.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((i.horizontalScrollbarSize-i.horizontalSliderSize)/2),0,void 0,i.horizontalSliderSize)}_updateSlider(e,i){this.slider.setWidth(e),this.slider.setLeft(i)}_renderDomNode(e,i){this.domNode.setWidth(e),this.domNode.setHeight(i),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,i){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,i){e.scrollLeft=i}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},iC=class extends Km{constructor(e,i,n){let l=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new Vm(i.verticalHasArrows?i.arrowSize:0,i.vertical===2?0:i.verticalScrollbarSize,0,l.height,l.scrollHeight,o.scrollTop),visibility:i.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:i.scrollByPage}),i.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((i.verticalScrollbarSize-i.verticalSliderSize)/2),i.verticalSliderSize,void 0)}_updateSlider(e,i){this.slider.setHeight(e),this.slider.setTop(i)}_renderDomNode(e,i){this.domNode.setWidth(i),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,i){return i}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,i){e.scrollTop=i}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},sC=500,up=50,rC=class{constructor(e,i,n){this.timestamp=e,this.deltaX=i,this.deltaY=n,this.score=0}},Du=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let i=1,n=0,l=1,o=this._rear;do{let h=o===this._front?i:Math.pow(2,-l);if(i-=h,n+=this._memory[o].score*h,o===this._front)break;o=(this._capacity+o-1)%this._capacity,l++}while(!0);return n<=.5}acceptStandardWheelEvent(i){if(nd){let n=Ti(i.browserEvent),l=vw(n);this.accept(Date.now(),i.deltaX*l,i.deltaY*l)}else this.accept(Date.now(),i.deltaX,i.deltaY)}accept(i,n,l){let o=null,h=new rC(i,n,l);this._front===-1&&this._rear===-1?(this._memory[0]=h,this._front=0,this._rear=0):(o=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=h),h.score=this._computeScore(h,o)}_computeScore(i,n){if(Math.abs(i.deltaX)>0&&Math.abs(i.deltaY)>0)return 1;let l=.5;if((!this._isAlmostInt(i.deltaX)||!this._isAlmostInt(i.deltaY))&&(l+=.25),n){let o=Math.abs(i.deltaX),h=Math.abs(i.deltaY),d=Math.abs(n.deltaX),_=Math.abs(n.deltaY),v=Math.max(Math.min(o,d),1),f=Math.max(Math.min(h,_),1),p=Math.max(o,d),S=Math.max(h,_);p%v===0&&S%f===0&&(l-=.5)}return Math.min(Math.max(l,0),1)}_isAlmostInt(i){return Math.abs(Math.round(i)-i)<.01}};Du.INSTANCE=new Du;var nC=Du,lC=class extends cd{constructor(e,i,n){super(),this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Q),this.onWillScroll=this._onWillScroll.event,this._options=oC(i),this._scrollable=n,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));let l={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new iC(this._scrollable,this._options,l)),this._horizontalScrollbar=this._register(new tC(this._scrollable,this._options,l)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=xl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=xl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=xl(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new ad),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=ar(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Ai&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new rp(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=ar(this._mouseWheelToDispose),e)){let i=n=>{this._onMouseWheel(new rp(n))};this._mouseWheelToDispose.push(fe(this._listenOnDomNode,vt.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var o;if((o=e.browserEvent)!=null&&o.defaultPrevented)return;let i=nC.INSTANCE;i.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let h=e.deltaY*this._options.mouseWheelScrollSensitivity,d=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&d+h===0?d=h=0:Math.abs(h)>=Math.abs(d)?d=0:h=0),this._options.flipAxes&&([h,d]=[d,h]);let _=!Ai&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||_)&&!d&&(d=h,h=0),e.browserEvent&&e.browserEvent.altKey&&(d=d*this._options.fastScrollSensitivity,h=h*this._options.fastScrollSensitivity);let v=this._scrollable.getFutureScrollPosition(),f={};if(h){let p=up*h,S=v.scrollTop-(p<0?Math.floor(p):Math.ceil(p));this._verticalScrollbar.writeScrollPosition(f,S)}if(d){let p=up*d,S=v.scrollLeft-(p<0?Math.floor(p):Math.ceil(p));this._horizontalScrollbar.writeScrollPosition(f,S)}f=this._scrollable.validateScrollPosition(f),(v.scrollLeft!==f.scrollLeft||v.scrollTop!==f.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(f):this._scrollable.setScrollPositionNow(f),n=!0)}let l=n;!l&&this._options.alwaysConsumeMouseWheel&&(l=!0),!l&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(l=!0),l&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),i=e.scrollTop>0,n=e.scrollLeft>0,l=n?" left":"",o=i?" top":"",h=n||i?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${l}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${h}${o}${l}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),sC)}},aC=class extends lC{constructor(e,i,n){super(e,i,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function oC(e){let i={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return i.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:i.horizontalScrollbarSize,i.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:i.verticalScrollbarSize,Ai&&(i.className+=" mac"),i}var Ru=class extends Se{constructor(e,i,n,l,o,h,d,_){super(),this._bufferService=n,this._optionsService=d,this._renderService=_,this._onRequestScrollLines=this._register(new Q),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let v=this._register(new Fw({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:f=>od(l.window,f)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{v.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new aC(i,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},v)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(o.onProtocolChange(f=>{this._scrollableElement.updateOptions({handleMouseWheel:!(f&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(xt.runAndSubscribe(h.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=h.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(qe(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=l.mainDocument.createElement("style"),i.appendChild(this._styleElement),this._register(qe(()=>this._styleElement.remove())),this._register(xt.runAndSubscribe(h.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${h.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${h.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${h.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
194
+ `)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(f=>this._handleScroll(f)))}scrollLines(e){let i=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:i.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,i){i&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!i,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let i=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=i-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=i,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};Ru=$e([te(2,Ot),te(3,Qi),te(4,Em),te(5,cn),te(6,Lt),te(7,Ji)],Ru);var Tu=class extends Se{constructor(e,i,n,l,o){super(),this._screenElement=e,this._bufferService=i,this._coreBrowserService=n,this._decorationService=l,this._renderService=o,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(h=>this._removeDecoration(h))),this._register(qe(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var l;let i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",((l=e==null?void 0:e.options)==null?void 0:l.layer)==="top"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){let i=e.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${i*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,i=e.element){if(!i)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?i.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":i.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var i;(i=this._decorationElements.get(e))==null||i.remove(),this._decorationElements.delete(e),e.dispose()}};Tu=$e([te(1,Ot),te(2,Qi),te(3,Tl),te(4,Ji)],Tu);var cC=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(e){if(e.options.overviewRulerOptions){for(let i of this._zones)if(i.color===e.options.overviewRulerOptions.color&&i.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(i,e.marker.line))return;if(this._lineAdjacentToZone(i,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(i,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,i){return i>=e.startBufferLine&&i<=e.endBufferLine}_lineAdjacentToZone(e,i,n){return i>=e.startBufferLine-this._linePadding[n||"full"]&&i<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,i){e.startBufferLine=Math.min(e.startBufferLine,i),e.endBufferLine=Math.max(e.endBufferLine,i)}},Ei={full:0,left:0,center:0,right:0},ks={full:0,left:0,center:0,right:0},ul={full:0,left:0,center:0,right:0},go=class extends Se{constructor(e,i,n,l,o,h,d,_){var f;super(),this._viewportElement=e,this._screenElement=i,this._bufferService=n,this._decorationService=l,this._renderService=o,this._optionsService=h,this._themeService=d,this._coreBrowserService=_,this._colorZoneStore=new cC,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(),(f=this._viewportElement.parentElement)==null||f.insertBefore(this._canvas,this._viewportElement),this._register(qe(()=>{var p;return(p=this._canvas)==null?void 0:p.remove()}));let v=this._canvas.getContext("2d");if(v)this._ctx=v;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),i=Math.ceil((this._canvas.width-1)/3);ks.full=this._canvas.width,ks.left=e,ks.center=i,ks.right=e,this._refreshDrawHeightConstants(),ul.full=1,ul.left=1,ul.center=1+ks.left,ul.right=1+ks.left+ks.center}_refreshDrawHeightConstants(){Ei.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,i=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Ei.left=i,Ei.center=i,Ei.right=i}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ei.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ei.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ei.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ei.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(let i of this._decorationService.decorations)this._colorZoneStore.addDecoration(i);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let i of e)i.position!=="full"&&this._renderColorZone(i);for(let i of e)i.position==="full"&&this._renderColorZone(i);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(ul[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Ei[e.position||"full"]/2),ks[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Ei[e.position||"full"]))}_queueRefresh(e,i){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=i||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};go=$e([te(2,Ot),te(3,Tl),te(4,Ji),te(5,Lt),te(6,cn),te(7,Qi)],go);var X;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
195
+ `,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(X||(X={}));var oo;(e=>(e.PAD="€",e.HOP="",e.BPH="‚",e.NBH="ƒ",e.IND="„",e.NEL="…",e.SSA="†",e.ESA="‡",e.HTS="ˆ",e.HTJ="‰",e.VTS="Š",e.PLD="‹",e.PLU="Œ",e.RI="",e.SS2="Ž",e.SS3="",e.DCS="",e.PU1="‘",e.PU2="’",e.STS="“",e.CCH="”",e.MW="•",e.SPA="–",e.EPA="—",e.SOS="˜",e.SGCI="™",e.SCI="š",e.CSI="›",e.ST="œ",e.OSC="",e.PM="ž",e.APC="Ÿ"))(oo||(oo={}));var Xm;(e=>e.ST=`${X.ESC}\\`)(Xm||(Xm={}));var Au=class{constructor(e,i,n,l,o,h){this._textarea=e,this._compositionView=i,this._bufferService=n,this._optionsService=l,this._coreService=o,this._renderService=h,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;i.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(i.start,this._compositionPosition.start):n=this._textarea.value.substring(i.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let i=this._textarea.value,n=i.replace(e,"");this._dataAlreadySent=n,i.length>e.length?this._coreService.triggerDataEvent(n,!0):i.length<e.length?this._coreService.triggerDataEvent(`${X.DEL}`,!0):i.length===e.length&&i!==e&&this._coreService.triggerDataEvent(i,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=i*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=l+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let h=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=l+"px",this._textarea.style.width=Math.max(h.width,1)+"px",this._textarea.style.height=Math.max(h.height,1)+"px",this._textarea.style.lineHeight=h.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Au=$e([te(2,Ot),te(3,Lt),te(4,ur),te(5,Ji)],Au);var gt=0,pt=0,mt=0,Ge=0,dp={css:"#00000000",rgba:0},rt;(e=>{function i(o,h,d,_){return _!==void 0?`#${Js(o)}${Js(h)}${Js(d)}${Js(_)}`:`#${Js(o)}${Js(h)}${Js(d)}`}e.toCss=i;function n(o,h,d,_=255){return(o<<24|h<<16|d<<8|_)>>>0}e.toRgba=n;function l(o,h,d,_){return{css:e.toCss(o,h,d,_),rgba:e.toRgba(o,h,d,_)}}e.toColor=l})(rt||(rt={}));var Pe;(e=>{function i(v,f){if(Ge=(f.rgba&255)/255,Ge===1)return{css:f.css,rgba:f.rgba};let p=f.rgba>>24&255,S=f.rgba>>16&255,y=f.rgba>>8&255,E=v.rgba>>24&255,C=v.rgba>>16&255,x=v.rgba>>8&255;gt=E+Math.round((p-E)*Ge),pt=C+Math.round((S-C)*Ge),mt=x+Math.round((y-x)*Ge);let z=rt.toCss(gt,pt,mt),T=rt.toRgba(gt,pt,mt);return{css:z,rgba:T}}e.blend=i;function n(v){return(v.rgba&255)===255}e.isOpaque=n;function l(v,f,p){let S=co.ensureContrastRatio(v.rgba,f.rgba,p);if(S)return rt.toColor(S>>24&255,S>>16&255,S>>8&255)}e.ensureContrastRatio=l;function o(v){let f=(v.rgba|255)>>>0;return[gt,pt,mt]=co.toChannels(f),{css:rt.toCss(gt,pt,mt),rgba:f}}e.opaque=o;function h(v,f){return Ge=Math.round(f*255),[gt,pt,mt]=co.toChannels(v.rgba),{css:rt.toCss(gt,pt,mt,Ge),rgba:rt.toRgba(gt,pt,mt,Ge)}}e.opacity=h;function d(v,f){return Ge=v.rgba&255,h(v,Ge*f/255)}e.multiplyOpacity=d;function _(v){return[v.rgba>>24&255,v.rgba>>16&255,v.rgba>>8&255]}e.toColorRGB=_})(Pe||(Pe={}));var Ke;(e=>{let i,n;try{let o=document.createElement("canvas");o.width=1,o.height=1;let h=o.getContext("2d",{willReadFrequently:!0});h&&(i=h,i.globalCompositeOperation="copy",n=i.createLinearGradient(0,0,1,1))}catch{}function l(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return gt=parseInt(o.slice(1,2).repeat(2),16),pt=parseInt(o.slice(2,3).repeat(2),16),mt=parseInt(o.slice(3,4).repeat(2),16),rt.toColor(gt,pt,mt);case 5:return gt=parseInt(o.slice(1,2).repeat(2),16),pt=parseInt(o.slice(2,3).repeat(2),16),mt=parseInt(o.slice(3,4).repeat(2),16),Ge=parseInt(o.slice(4,5).repeat(2),16),rt.toColor(gt,pt,mt,Ge);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let h=o.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(h)return gt=parseInt(h[1]),pt=parseInt(h[2]),mt=parseInt(h[3]),Ge=Math.round((h[5]===void 0?1:parseFloat(h[5]))*255),rt.toColor(gt,pt,mt,Ge);if(!i||!n)throw new Error("css.toColor: Unsupported css format");if(i.fillStyle=n,i.fillStyle=o,typeof i.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(i.fillRect(0,0,1,1),[gt,pt,mt,Ge]=i.getImageData(0,0,1,1).data,Ge!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:rt.toRgba(gt,pt,mt,Ge),css:o}}e.toColor=l})(Ke||(Ke={}));var At;(e=>{function i(l){return n(l>>16&255,l>>8&255,l&255)}e.relativeLuminance=i;function n(l,o,h){let d=l/255,_=o/255,v=h/255,f=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4),p=_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4),S=v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4);return f*.2126+p*.7152+S*.0722}e.relativeLuminance2=n})(At||(At={}));var co;(e=>{function i(d,_){if(Ge=(_&255)/255,Ge===1)return _;let v=_>>24&255,f=_>>16&255,p=_>>8&255,S=d>>24&255,y=d>>16&255,E=d>>8&255;return gt=S+Math.round((v-S)*Ge),pt=y+Math.round((f-y)*Ge),mt=E+Math.round((p-E)*Ge),rt.toRgba(gt,pt,mt)}e.blend=i;function n(d,_,v){let f=At.relativeLuminance(d>>8),p=At.relativeLuminance(_>>8);if($i(f,p)<v){if(p<f){let E=l(d,_,v),C=$i(f,At.relativeLuminance(E>>8));if(C<v){let x=o(d,_,v),z=$i(f,At.relativeLuminance(x>>8));return C>z?E:x}return E}let S=o(d,_,v),y=$i(f,At.relativeLuminance(S>>8));if(y<v){let E=l(d,_,v),C=$i(f,At.relativeLuminance(E>>8));return y>C?S:E}return S}}e.ensureContrastRatio=n;function l(d,_,v){let f=d>>24&255,p=d>>16&255,S=d>>8&255,y=_>>24&255,E=_>>16&255,C=_>>8&255,x=$i(At.relativeLuminance2(y,E,C),At.relativeLuminance2(f,p,S));for(;x<v&&(y>0||E>0||C>0);)y-=Math.max(0,Math.ceil(y*.1)),E-=Math.max(0,Math.ceil(E*.1)),C-=Math.max(0,Math.ceil(C*.1)),x=$i(At.relativeLuminance2(y,E,C),At.relativeLuminance2(f,p,S));return(y<<24|E<<16|C<<8|255)>>>0}e.reduceLuminance=l;function o(d,_,v){let f=d>>24&255,p=d>>16&255,S=d>>8&255,y=_>>24&255,E=_>>16&255,C=_>>8&255,x=$i(At.relativeLuminance2(y,E,C),At.relativeLuminance2(f,p,S));for(;x<v&&(y<255||E<255||C<255);)y=Math.min(255,y+Math.ceil((255-y)*.1)),E=Math.min(255,E+Math.ceil((255-E)*.1)),C=Math.min(255,C+Math.ceil((255-C)*.1)),x=$i(At.relativeLuminance2(y,E,C),At.relativeLuminance2(f,p,S));return(y<<24|E<<16|C<<8|255)>>>0}e.increaseLuminance=o;function h(d){return[d>>24&255,d>>16&255,d>>8&255,d&255]}e.toChannels=h})(co||(co={}));function Js(e){let i=e.toString(16);return i.length<2?"0"+i:i}function $i(e,i){return e<i?(i+.05)/(e+.05):(e+.05)/(i+.05)}var hC=class extends Rl{constructor(e,i,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},po=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new fi}register(e){let i={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(i),i.id}deregister(e){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===e)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let i=this._bufferService.buffer.lines.get(e);if(!i||i.length===0)return[];let n=[],l=i.translateToString(!0),o=0,h=0,d=0,_=i.getFg(0),v=i.getBg(0);for(let f=0;f<i.getTrimmedLength();f++)if(i.loadCell(f,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==_||this._workCell.bg!==v){if(f-o>1){let p=this._getJoinedRanges(l,d,h,i,o);for(let S=0;S<p.length;S++)n.push(p[S])}o=f,d=h,_=this._workCell.fg,v=this._workCell.bg}h+=this._workCell.getChars().length||Ts.length}if(this._bufferService.cols-o>1){let f=this._getJoinedRanges(l,d,h,i,o);for(let p=0;p<f.length;p++)n.push(f[p])}return n}_getJoinedRanges(e,i,n,l,o){let h=e.substring(i,n),d=[];try{d=this._characterJoiners[0].handler(h)}catch(_){console.error(_)}for(let _=1;_<this._characterJoiners.length;_++)try{let v=this._characterJoiners[_].handler(h);for(let f=0;f<v.length;f++)po._mergeRanges(d,v[f])}catch(v){console.error(v)}return this._stringRangesToCellRanges(d,l,o),d}_stringRangesToCellRanges(e,i,n){let l=0,o=!1,h=0,d=e[l];if(d){for(let _=n;_<this._bufferService.cols;_++){let v=i.getWidth(_),f=i.getString(_).length||Ts.length;if(v!==0){if(!o&&d[0]<=h&&(d[0]=_,o=!0),d[1]<=h){if(d[1]=_,d=e[++l],!d)break;d[0]<=h?(d[0]=_,o=!0):o=!1}h+=f}}d&&(d[1]=this._bufferService.cols)}}static _mergeRanges(e,i){let n=!1;for(let l=0;l<e.length;l++){let o=e[l];if(n){if(i[1]<=o[0])return e[l-1][1]=i[1],e;if(i[1]<=o[1])return e[l-1][1]=Math.max(i[1],o[1]),e.splice(l,1),e;e.splice(l,1),l--}else{if(i[1]<=o[0])return e.splice(l,0,i),e;if(i[1]<=o[1])return o[0]=Math.min(i[0],o[0]),e;i[0]<o[1]&&(o[0]=Math.min(i[0],o[0]),n=!0);continue}}return n?e[e.length-1][1]=i[1]:e.push(i),e}};po=$e([te(0,Ot)],po);function uC(e){return 57508<=e&&e<=57558}function dC(e){return 9472<=e&&e<=9631}function fC(e){return uC(e)||dC(e)}function _C(){return{css:{canvas:Ja(),cell:Ja()},device:{canvas:Ja(),cell:Ja(),char:{width:0,height:0,left:0,top:0}}}}function Ja(){return{width:0,height:0}}var Bu=class{constructor(e,i,n,l,o,h,d){this._document=e,this._characterJoinerService=i,this._optionsService=n,this._coreBrowserService=l,this._coreService=o,this._decorationService=h,this._themeService=d,this._workCell=new fi,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,i,n){this._selectionStart=e,this._selectionEnd=i,this._columnSelectMode=n}createRow(e,i,n,l,o,h,d,_,v,f,p){let S=[],y=this._characterJoinerService.getJoinedCharacters(i),E=this._themeService.colors,C=e.getNoBgTrimmedLength();n&&C<h+1&&(C=h+1);let x,z=0,T="",L=0,V=0,P=0,H=0,ee=!1,ae=0,_e=!1,Te=0,Je=0,ie=[],$=f!==-1&&p!==-1;for(let U=0;U<C;U++){e.loadCell(U,this._workCell);let I=this._workCell.getWidth();if(I===0)continue;let F=!1,M=U>=Je,q=U,j=this._workCell;if(y.length>0&&U===y[0][0]&&M){let xe=y.shift(),zs=this._isCellInSelection(xe[0],i);for(L=xe[0]+1;L<xe[1];L++)M&&(M=zs===this._isCellInSelection(L,i));M&&(M=!n||h<xe[0]||h>=xe[1]),M?(F=!0,j=new hC(this._workCell,e.translateToString(!0,xe[0],xe[1]),xe[1]-xe[0]),q=xe[1]-1,I=j.getWidth()):Je=xe[1]}let ce=this._isCellInSelection(U,i),w=n&&U===h,Y=$&&U>=f&&U<=p,J=!1;this._decorationService.forEachDecorationAtCell(U,i,void 0,xe=>{J=!0});let Z=j.getChars()||Ts;if(Z===" "&&(j.isUnderline()||j.isOverline())&&(Z=" "),Te=I*_-v.get(Z,j.isBold(),j.isItalic()),!x)x=this._document.createElement("span");else if(z&&(ce&&_e||!ce&&!_e&&j.bg===V)&&(ce&&_e&&E.selectionForeground||j.fg===P)&&j.extended.ext===H&&Y===ee&&Te===ae&&!w&&!F&&!J&&M){j.isInvisible()?T+=Ts:T+=Z,z++;continue}else z&&(x.textContent=T),x=this._document.createElement("span"),z=0,T="";if(V=j.bg,P=j.fg,H=j.extended.ext,ee=Y,ae=Te,_e=ce,F&&h>=U&&h<=q&&(h=U),!this._coreService.isCursorHidden&&w&&this._coreService.isCursorInitialized){if(ie.push("xterm-cursor"),this._coreBrowserService.isFocused)d&&ie.push("xterm-cursor-blink"),ie.push(l==="bar"?"xterm-cursor-bar":l==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":ie.push("xterm-cursor-outline");break;case"block":ie.push("xterm-cursor-block");break;case"bar":ie.push("xterm-cursor-bar");break;case"underline":ie.push("xterm-cursor-underline");break}}if(j.isBold()&&ie.push("xterm-bold"),j.isItalic()&&ie.push("xterm-italic"),j.isDim()&&ie.push("xterm-dim"),j.isInvisible()?T=Ts:T=j.getChars()||Ts,j.isUnderline()&&(ie.push(`xterm-underline-${j.extended.underlineStyle}`),T===" "&&(T=" "),!j.isUnderlineColorDefault()))if(j.isUnderlineColorRGB())x.style.textDecorationColor=`rgb(${Rl.toColorRGB(j.getUnderlineColor()).join(",")})`;else{let xe=j.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&j.isBold()&&xe<8&&(xe+=8),x.style.textDecorationColor=E.ansi[xe].css}j.isOverline()&&(ie.push("xterm-overline"),T===" "&&(T=" ")),j.isStrikethrough()&&ie.push("xterm-strikethrough"),Y&&(x.style.textDecoration="underline");let se=j.getFgColor(),ve=j.getFgColorMode(),re=j.getBgColor(),Ue=j.getBgColorMode(),Me=!!j.isInverse();if(Me){let xe=se;se=re,re=xe;let zs=ve;ve=Ue,Ue=zs}let nt,es,mi=!1;this._decorationService.forEachDecorationAtCell(U,i,void 0,xe=>{xe.options.layer!=="top"&&mi||(xe.backgroundColorRGB&&(Ue=50331648,re=xe.backgroundColorRGB.rgba>>8&16777215,nt=xe.backgroundColorRGB),xe.foregroundColorRGB&&(ve=50331648,se=xe.foregroundColorRGB.rgba>>8&16777215,es=xe.foregroundColorRGB),mi=xe.options.layer==="top")}),!mi&&ce&&(nt=this._coreBrowserService.isFocused?E.selectionBackgroundOpaque:E.selectionInactiveBackgroundOpaque,re=nt.rgba>>8&16777215,Ue=50331648,mi=!0,E.selectionForeground&&(ve=50331648,se=E.selectionForeground.rgba>>8&16777215,es=E.selectionForeground)),mi&&ie.push("xterm-decoration-top");let ei;switch(Ue){case 16777216:case 33554432:ei=E.ansi[re],ie.push(`xterm-bg-${re}`);break;case 50331648:ei=rt.toColor(re>>16,re>>8&255,re&255),this._addStyle(x,`background-color:#${fp((re>>>0).toString(16),"0",6)}`);break;case 0:default:Me?(ei=E.foreground,ie.push("xterm-bg-257")):ei=E.background}switch(nt||j.isDim()&&(nt=Pe.multiplyOpacity(ei,.5)),ve){case 16777216:case 33554432:j.isBold()&&se<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(se+=8),this._applyMinimumContrast(x,ei,E.ansi[se],j,nt,void 0)||ie.push(`xterm-fg-${se}`);break;case 50331648:let xe=rt.toColor(se>>16&255,se>>8&255,se&255);this._applyMinimumContrast(x,ei,xe,j,nt,es)||this._addStyle(x,`color:#${fp(se.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(x,ei,E.foreground,j,nt,es)||Me&&ie.push("xterm-fg-257")}ie.length&&(x.className=ie.join(" "),ie.length=0),!w&&!F&&!J&&M?z++:x.textContent=T,Te!==this.defaultSpacing&&(x.style.letterSpacing=`${Te}px`),S.push(x),U=q}return x&&z&&(x.textContent=T),S}_applyMinimumContrast(e,i,n,l,o,h){if(this._optionsService.rawOptions.minimumContrastRatio===1||fC(l.getCode()))return!1;let d=this._getContrastCache(l),_;if(!o&&!h&&(_=d.getColor(i.rgba,n.rgba)),_===void 0){let v=this._optionsService.rawOptions.minimumContrastRatio/(l.isDim()?2:1);_=Pe.ensureContrastRatio(o||i,h||n,v),d.setColor((o||i).rgba,(h||n).rgba,_??null)}return _?(this._addStyle(e,`color:${_.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,i){e.setAttribute("style",`${e.getAttribute("style")||""}${i};`)}_isCellInSelection(e,i){let n=this._selectionStart,l=this._selectionEnd;return!n||!l?!1:this._columnSelectMode?n[0]<=l[0]?e>=n[0]&&i>=n[1]&&e<l[0]&&i<=l[1]:e<n[0]&&i>=n[1]&&e>=l[0]&&i<=l[1]:i>n[1]&&i<l[1]||n[1]===l[1]&&i===n[1]&&e>=n[0]&&e<l[0]||n[1]<l[1]&&i===l[1]&&e<l[0]||n[1]<l[1]&&i===n[1]&&e>=n[0]}};Bu=$e([te(1,Dm),te(2,Lt),te(3,Qi),te(4,ur),te(5,Tl),te(6,cn)],Bu);function fp(e,i,n){for(;e.length<n;)e=i+e;return e}var vC=class{constructor(e,i){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.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";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontStyle="italic";let h=e.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold",h.style.fontStyle="italic",this._measureElements=[n,l,o,h],this._container.appendChild(n),this._container.appendChild(l),this._container.appendChild(o),this._container.appendChild(h),i.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(e,i,n,l){e===this._font&&i===this._fontSize&&n===this._weight&&l===this._weightBold||(this._font=e,this._fontSize=i,this._weight=n,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(e,i,n){let l=0;if(!i&&!n&&e.length===1&&(l=e.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];let d=this._measure(e,0);return d>0&&(this._flat[l]=d),d}let o=e;i&&(o+="B"),n&&(o+="I");let h=this._holey.get(o);if(h===void 0){let d=0;i&&(d|=1),n&&(d|=2),h=this._measure(e,d),h>0&&this._holey.set(o,h)}return h}_measure(e,i){let n=this._measureElements[i];return n.textContent=e.repeat(32),n.offsetWidth/32}},gC=class{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(e,i,n,l=!1){if(this.selectionStart=i,this.selectionEnd=n,!i||!n||i[0]===n[0]&&i[1]===n[1]){this.clear();return}let o=e.buffers.active.ydisp,h=i[1]-o,d=n[1]-o,_=Math.max(h,0),v=Math.min(d,e.rows-1);if(_>=e.rows||v<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=l,this.viewportStartRow=h,this.viewportEndRow=d,this.viewportCappedStartRow=_,this.viewportCappedEndRow=v,this.startCol=i[0],this.endCol=n[0]}isCellSelected(e,i,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&n>=this.viewportCappedStartRow&&i<this.endCol&&n<=this.viewportCappedEndRow:i<this.startCol&&n>=this.viewportCappedStartRow&&i>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol):!1}};function pC(){return new gC}var Fh="xterm-dom-renderer-owner-",hi="xterm-rows",eo="xterm-fg-",_p="xterm-bg-",dl="xterm-focus",to="xterm-selection",mC=1,zu=class extends Se{constructor(e,i,n,l,o,h,d,_,v,f,p,S,y,E){super(),this._terminal=e,this._document=i,this._element=n,this._screenElement=l,this._viewportElement=o,this._helperContainer=h,this._linkifier2=d,this._charSizeService=v,this._optionsService=f,this._bufferService=p,this._coreService=S,this._coreBrowserService=y,this._themeService=E,this._terminalClass=mC++,this._rowElements=[],this._selectionRenderModel=pC(),this.onRequestRedraw=this._register(new Q).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(hi),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(to),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=_C(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(C=>this._injectCss(C))),this._injectCss(this._themeService.colors),this._rowFactory=_.createInstance(Bu,document),this._element.classList.add(Fh+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(C=>this._handleLinkHover(C))),this._register(this._linkifier2.onHideLinkUnderline(C=>this._handleLinkLeave(C))),this._register(qe(()=>{this._element.classList.remove(Fh+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new vC(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(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),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(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let i=`${this._terminalSelector} .${hi} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=i,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(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let i=`${this._terminalSelector} .${hi} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;i+=`${this._terminalSelector} .${hi} .xterm-dim { color: ${Pe.multiplyOpacity(e.foreground,.5).css};}`,i+=`${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;}`;let n=`blink_underline_${this._terminalClass}`,l=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;i+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,i+=`@keyframes ${l} { 50% { box-shadow: none; }}`,i+=`@keyframes ${o} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,i+=`${this._terminalSelector} .${hi}.${dl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${hi}.${dl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${l} 1s step-end infinite;}${this._terminalSelector} .${hi}.${dl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${hi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${hi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${hi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${hi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${hi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,i+=`${this._terminalSelector} .${to} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${to} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${to} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[h,d]of e.ansi.entries())i+=`${this._terminalSelector} .${eo}${h} { color: ${d.css}; }${this._terminalSelector} .${eo}${h}.xterm-dim { color: ${Pe.multiplyOpacity(d,.5).css}; }${this._terminalSelector} .${_p}${h} { background-color: ${d.css}; }`;i+=`${this._terminalSelector} .${eo}257 { color: ${Pe.opaque(e.background).css}; }${this._terminalSelector} .${eo}257.xterm-dim { color: ${Pe.multiplyOpacity(Pe.opaque(e.background),.5).css}; }${this._terminalSelector} .${_p}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=i}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,i){for(let n=this._rowElements.length;n<=i;n++){let l=this._document.createElement("div");this._rowContainer.appendChild(l),this._rowElements.push(l)}for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,i){this._refreshRowElements(e,i),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(dl),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(dl),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,i,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,i,n),this.renderRows(0,this._bufferService.rows-1),!e||!i||(this._selectionRenderModel.update(this._terminal,e,i,n),!this._selectionRenderModel.hasSelection))return;let l=this._selectionRenderModel.viewportStartRow,o=this._selectionRenderModel.viewportEndRow,h=this._selectionRenderModel.viewportCappedStartRow,d=this._selectionRenderModel.viewportCappedEndRow,_=this._document.createDocumentFragment();if(n){let v=e[0]>i[0];_.appendChild(this._createSelectionElement(h,v?i[0]:e[0],v?e[0]:i[0],d-h+1))}else{let v=l===h?e[0]:0,f=h===o?i[0]:this._bufferService.cols;_.appendChild(this._createSelectionElement(h,v,f));let p=d-h-1;if(_.appendChild(this._createSelectionElement(h+1,0,this._bufferService.cols,p)),h!==d){let S=o===d?i[0]:this._bufferService.cols;_.appendChild(this._createSelectionElement(d,0,S))}}this._selectionContainer.appendChild(_)}_createSelectionElement(e,i,n,l=1){let o=this._document.createElement("div"),h=i*this.dimensions.css.cell.width,d=this.dimensions.css.cell.width*(n-i);return h+d>this.dimensions.css.canvas.width&&(d=this.dimensions.css.canvas.width-h),o.style.height=`${l*this.dimensions.css.cell.height}px`,o.style.top=`${e*this.dimensions.css.cell.height}px`,o.style.left=`${h}px`,o.style.width=`${d}px`,o}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(let e of this._rowElements)e.replaceChildren()}renderRows(e,i){let n=this._bufferService.buffer,l=n.ybase+n.y,o=Math.min(n.x,this._bufferService.cols-1),h=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,d=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,_=this._optionsService.rawOptions.cursorInactiveStyle;for(let v=e;v<=i;v++){let f=v+n.ydisp,p=this._rowElements[v],S=n.lines.get(f);if(!p||!S)break;p.replaceChildren(...this._rowFactory.createRow(S,f,f===l,d,_,o,h,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Fh}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,i,n,l,o,h){n<0&&(e=0),l<0&&(i=0);let d=this._bufferService.rows-1;n=Math.max(Math.min(n,d),0),l=Math.max(Math.min(l,d),0),o=Math.min(o,this._bufferService.cols);let _=this._bufferService.buffer,v=_.ybase+_.y,f=Math.min(_.x,o-1),p=this._optionsService.rawOptions.cursorBlink,S=this._optionsService.rawOptions.cursorStyle,y=this._optionsService.rawOptions.cursorInactiveStyle;for(let E=n;E<=l;++E){let C=E+_.ydisp,x=this._rowElements[E],z=_.lines.get(C);if(!x||!z)break;x.replaceChildren(...this._rowFactory.createRow(z,C,C===v,S,y,f,p,this.dimensions.css.cell.width,this._widthCache,h?E===n?e:0:-1,h?(E===l?i:o)-1:-1))}}};zu=$e([te(7,id),te(8,Co),te(9,Lt),te(10,Ot),te(11,ur),te(12,Qi),te(13,cn)],zu);var Ou=class extends Se{constructor(e,i,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new Q),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new yC(this._optionsService))}catch{this._measureStrategy=this._register(new SC(e,i,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Ou=$e([te(2,Lt)],Ou);var Gm=class extends Se{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,i){e!==void 0&&e>0&&i!==void 0&&i>0&&(this._result.width=e,this._result.height=i)}},SC=class extends Gm{constructor(e,i,n){super(),this._document=e,this._parentElement=i,this._optionsService=n,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}},yC=class extends Gm{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let i=this._ctx.measureText("W");if(!("width"in i&&"fontBoundingBoxAscent"in i&&"fontBoundingBoxDescent"in i))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},bC=class extends Se{constructor(e,i,n){super(),this._textarea=e,this._window=i,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new wC(this._window)),this._onDprChange=this._register(new Q),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new Q),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(l=>this._screenDprMonitor.setWindow(l))),this._register(xt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(fe(this._textarea,"focus",()=>this._isFocused=!0)),this._register(fe(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},wC=class extends Se{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new on),this._onDprChange=this._register(new Q),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(qe(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=fe(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},CC=class extends Se{constructor(){super(),this.linkProviders=[],this._register(qe(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let i=this.linkProviders.indexOf(e);i!==-1&&this.linkProviders.splice(i,1)}}}};function hd(e,i,n){let l=n.getBoundingClientRect(),o=e.getComputedStyle(n),h=parseInt(o.getPropertyValue("padding-left")),d=parseInt(o.getPropertyValue("padding-top"));return[i.clientX-l.left-h,i.clientY-l.top-d]}function xC(e,i,n,l,o,h,d,_,v){if(!h)return;let f=hd(e,i,n);if(f)return f[0]=Math.ceil((f[0]+(v?d/2:0))/d),f[1]=Math.ceil(f[1]/_),f[0]=Math.min(Math.max(f[0],1),l+(v?1:0)),f[1]=Math.min(Math.max(f[1],1),o),f}var Lu=class{constructor(e,i){this._renderService=e,this._charSizeService=i}getCoords(e,i,n,l,o){return xC(window,e,i,n,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(e,i){let n=hd(window,e,i);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};Lu=$e([te(0,Ji),te(1,Co)],Lu);var EC=class{constructor(e,i){this._renderCallback=e,this._coreBrowserService=i,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i,!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){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},$m={};Lb($m,{getSafariVersion:()=>MC,isChromeOS:()=>Qm,isFirefox:()=>Fm,isIpad:()=>DC,isIphone:()=>RC,isLegacyEdge:()=>kC,isLinux:()=>ud,isMac:()=>mo,isNode:()=>xo,isSafari:()=>Im,isWindows:()=>Zm});var xo=typeof process<"u"&&"title"in process,Al=xo?"node":navigator.userAgent,Bl=xo?"node":navigator.platform,Fm=Al.includes("Firefox"),kC=Al.includes("Edge"),Im=/^((?!chrome|android).)*safari/i.test(Al);function MC(){if(!Im)return 0;let e=Al.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var mo=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Bl),DC=Bl==="iPad",RC=Bl==="iPhone",Zm=["Windows","Win16","Win32","WinCE"].includes(Bl),ud=Bl.indexOf("Linux")>=0,Qm=/\bCrOS\b/.test(Al),Jm=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let i=0,n=0,l=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(i=performance.now(),this._tasks[this._i]()||this._i++,i=Math.max(1,performance.now()-i),n=Math.max(i,n),o=e.timeRemaining(),n*1.5>o){l-i<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(l-i))}ms`),this._start();return}l=o}this.clear()}},TC=class extends Jm{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let i=performance.now()+e;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},AC=class extends Jm{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},So=!xo&&"requestIdleCallback"in window?AC:TC,BC=class{constructor(){this._queue=new So}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Nu=class extends Se{constructor(e,i,n,l,o,h,d,_,v){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=l,this._coreService=o,this._coreBrowserService=_,this._renderer=this._register(new on),this._pausedResizeTask=new BC,this._observerDisposable=this._register(new on),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 Q),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new Q),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new Q),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new Q),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new EC((f,p)=>this._renderRows(f,p),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new zC(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(qe(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(d.onResize(()=>this._fullRefresh())),this._register(d.buffers.onBufferActivate(()=>{var f;return(f=this._renderer.value)==null?void 0:f.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(h.onDecorationRegistered(()=>this._fullRefresh())),this._register(h.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(d.cols,d.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(d.buffer.y,d.buffer.y,!0))),this._register(v.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,i),this._register(this._coreBrowserService.onWindowChange(f=>this._registerIntersectionObserver(f,i)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,i){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(l=>this._handleIntersectionChange(l[l.length-1]),{threshold:0});n.observe(i),this._observerDisposable.value=qe(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,i,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}let l=this._syncOutputHandler.flush();l&&(e=Math.min(e,l.start),i=Math.max(i,l.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i,this._rowCount)}_renderRows(e,i){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}e=Math.min(e,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(e,i),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:i}),this._onRender.fire({start:e,end:i}),this._isNextRenderRedrawOnly=!0}}resize(e,i){this._rowCount=i,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(i=>this.refreshRows(i.start,i.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,i;this._renderer.value&&((i=(e=this._renderer.value).clearTextureAtlas)==null||i.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var n;return(n=this._renderer.value)==null?void 0:n.handleResize(e,i)}):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,i,n){var l;this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=n,(l=this._renderer.value)==null||l.handleSelectionChanged(e,i,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};Nu=$e([te(2,Lt),te(3,Co),te(4,ur),te(5,Tl),te(6,Ot),te(7,Qi),te(8,cn)],Nu);var zC=class{constructor(e,i,n){this._coreBrowserService=e,this._coreService=i,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,i){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,i)):(this._start=e,this._end=i,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function OC(e,i,n,l){let o=n.buffer.x,h=n.buffer.y;if(!n.buffer.hasScrollback)return HC(o,h,e,i,n,l)+Eo(h,i,n,l)+UC(o,h,e,i,n,l);let d;if(h===i)return d=o>e?"D":"C",Ml(Math.abs(o-e),kl(d,l));d=h>i?"D":"C";let _=Math.abs(h-i),v=NC(h>i?e:o,n)+(_-1)*n.cols+1+LC(h>i?o:e);return Ml(v,kl(d,l))}function LC(e,i){return e-1}function NC(e,i){return i.cols-e}function HC(e,i,n,l,o,h){return Eo(i,l,o,h).length===0?"":Ml(t0(e,i,e,i-or(i,o),!1,o).length,kl("D",h))}function Eo(e,i,n,l){let o=e-or(e,n),h=i-or(i,n),d=Math.abs(o-h)-PC(e,i,n);return Ml(d,kl(e0(e,i),l))}function UC(e,i,n,l,o,h){let d;Eo(i,l,o,h).length>0?d=l-or(l,o):d=i;let _=l,v=jC(e,i,n,l,o,h);return Ml(t0(e,d,n,_,v==="C",o).length,kl(v,h))}function PC(e,i,n){var d;let l=0,o=e-or(e,n),h=i-or(i,n);for(let _=0;_<Math.abs(o-h);_++){let v=e0(e,i)==="A"?-1:1;(d=n.buffer.lines.get(o+v*_))!=null&&d.isWrapped&&l++}return l}function or(e,i){let n=0,l=i.buffer.lines.get(e),o=l==null?void 0:l.isWrapped;for(;o&&e>=0&&e<i.rows;)n++,l=i.buffer.lines.get(--e),o=l==null?void 0:l.isWrapped;return n}function jC(e,i,n,l,o,h){let d;return Eo(n,l,o,h).length>0?d=l-or(l,o):d=i,e<n&&d<=l||e>=n&&d<l?"C":"D"}function e0(e,i){return e>i?"A":"B"}function t0(e,i,n,l,o,h){let d=e,_=i,v="";for(;(d!==n||_!==l)&&_>=0&&_<h.buffer.lines.length;)d+=o?1:-1,o&&d>h.cols-1?(v+=h.buffer.translateBufferLineToString(_,!1,e,d),d=0,e=0,_++):!o&&d<0&&(v+=h.buffer.translateBufferLineToString(_,!1,0,e+1),d=h.cols-1,e=d,_--);return v+h.buffer.translateBufferLineToString(_,!1,e,d)}function kl(e,i){let n=i?"O":"[";return X.ESC+n+e}function Ml(e,i){e=Math.floor(e);let n="";for(let l=0;l<e;l++)n+=i;return n}var qC=class{constructor(e){this._bufferService=e,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.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()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,i=this.selectionEnd;return!e||!i?!1:e[1]>i[1]||e[1]===i[1]&&e[0]>i[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function vp(e,i){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return i*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Ih=50,WC=15,YC=50,KC=500,VC=" ",XC=new RegExp(VC,"g"),Hu=class extends Se{constructor(e,i,n,l,o,h,d,_,v){super(),this._element=e,this._screenElement=i,this._linkifier=n,this._bufferService=l,this._coreService=o,this._mouseService=h,this._optionsService=d,this._renderService=_,this._coreBrowserService=v,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new fi,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new Q),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new Q),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new Q),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new Q),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=f=>this._handleMouseMove(f),this._mouseUpListener=f=>this._handleMouseUp(f),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(f=>this._handleTrim(f)),this._register(this._bufferService.buffers.onBufferActivate(f=>this._handleBufferActivate(f))),this.enable(),this._model=new qC(this._bufferService),this._activeSelectionMode=0,this._register(qe(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(f=>{f.rowsChanged&&this.clearSelection()}))}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(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!e||!i?!1:e[0]!==i[0]||e[1]!==i[1]}get selectionText(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;if(!e||!i)return"";let n=this._bufferService.buffer,l=[];if(this._activeSelectionMode===3){if(e[0]===i[0])return"";let o=e[0]<i[0]?e[0]:i[0],h=e[0]<i[0]?i[0]:e[0];for(let d=e[1];d<=i[1];d++){let _=n.translateBufferLineToString(d,!0,o,h);l.push(_)}}else{let o=e[1]===i[1]?i[0]:void 0;l.push(n.translateBufferLineToString(e[1],!0,e[0],o));for(let h=e[1]+1;h<=i[1]-1;h++){let d=n.lines.get(h),_=n.translateBufferLineToString(h,!0);d!=null&&d.isWrapped?l[l.length-1]+=_:l.push(_)}if(e[1]!==i[1]){let h=n.lines.get(i[1]),d=n.translateBufferLineToString(i[1],!0,0,i[0]);h&&h.isWrapped?l[l.length-1]+=d:l.push(d)}}return l.map(o=>o.replace(XC," ")).join(Zm?`\r
196
+ `:`
197
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),ud&&e&&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(e){let i=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,l=this._model.finalSelectionEnd;return!n||!l||!i?!1:this._areCoordsInSelection(i,n,l)}isCellInSelection(e,i){let n=this._model.finalSelectionStart,l=this._model.finalSelectionEnd;return!n||!l?!1:this._areCoordsInSelection([e,i],n,l)}_areCoordsInSelection(e,i,n){return e[1]>i[1]&&e[1]<n[1]||i[1]===n[1]&&e[1]===i[1]&&e[0]>=i[0]&&e[0]<n[0]||i[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||i[1]<n[1]&&e[1]===i[1]&&e[0]>=i[0]}_selectWordAtCursor(e,i){var o,h;let n=(h=(o=this._linkifier.currentLink)==null?void 0:o.link)==null?void 0:h.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=vp(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let l=this._getMouseBufferCoords(e);return l?(this._selectWordAt(l,i),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i){this._model.clearSelection(),e=Math.max(e,0),i=Math.min(i,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i)return i[0]--,i[1]--,i[1]+=this._bufferService.buffer.ydisp,i}_getMouseEventScrollAmount(e){let i=hd(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=n?0:(i>n&&(i-=n),i=Math.min(Math.max(i,-Ih),Ih),i/=Ih,i/Math.abs(i)+Math.round(i*(WC-1)))}shouldForceSelection(e){return mo?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),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(),YC)}_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(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let i=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i&&i.length!==this._model.selectionStart[0]&&i.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i=this._getMouseBufferCoords(e);i&&(this._activeSelectionMode=2,this._selectLineAt(i[1]))}shouldColumnSelect(e){return e.altKey&&!(mo&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}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(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let l=n.lines.get(this._model.selectionEnd[1]);l&&l.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!i||i[0]!==this._model.selectionEnd[0]||i[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});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let i=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&i<KC&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let l=OC(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(l,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd,n=!!e&&!!i&&(e[0]!==i[0]||e[1]!==i[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,i,n);return}!e||!i||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||i[0]!==this._oldSelectionEnd[0]||i[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,i,n)}_fireOnSelectionChange(e,i,n){this._oldSelectionStart=e,this._oldSelectionEnd=i,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(i=>this._handleTrim(i))}_convertViewportColToCharacterIndex(e,i){let n=i;for(let l=0;i>=l;l++){let o=e.loadCell(l,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:o>1&&i!==l&&(n+=o-1)}return n}setSelection(e,i,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i,n=!0,l=!0){if(e[0]>=this._bufferService.cols)return;let o=this._bufferService.buffer,h=o.lines.get(e[1]);if(!h)return;let d=o.translateBufferLineToString(e[1],!1),_=this._convertViewportColToCharacterIndex(h,e[0]),v=_,f=e[0]-_,p=0,S=0,y=0,E=0;if(d.charAt(_)===" "){for(;_>0&&d.charAt(_-1)===" ";)_--;for(;v<d.length&&d.charAt(v+1)===" ";)v++}else{let z=e[0],T=e[0];h.getWidth(z)===0&&(p++,z--),h.getWidth(T)===2&&(S++,T++);let L=h.getString(T).length;for(L>1&&(E+=L-1,v+=L-1);z>0&&_>0&&!this._isCharWordSeparator(h.loadCell(z-1,this._workCell));){h.loadCell(z-1,this._workCell);let V=this._workCell.getChars().length;this._workCell.getWidth()===0?(p++,z--):V>1&&(y+=V-1,_-=V-1),_--,z--}for(;T<h.length&&v+1<d.length&&!this._isCharWordSeparator(h.loadCell(T+1,this._workCell));){h.loadCell(T+1,this._workCell);let V=this._workCell.getChars().length;this._workCell.getWidth()===2?(S++,T++):V>1&&(E+=V-1,v+=V-1),v++,T++}}v++;let C=_+f-p+y,x=Math.min(this._bufferService.cols,v-_+p+S-y-E);if(!(!i&&d.slice(_,v).trim()==="")){if(n&&C===0&&h.getCodePoint(0)!==32){let z=o.lines.get(e[1]-1);if(z&&h.isWrapped&&z.getCodePoint(this._bufferService.cols-1)!==32){let T=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(T){let L=this._bufferService.cols-T.start;C-=L,x+=L}}}if(l&&C+x===this._bufferService.cols&&h.getCodePoint(this._bufferService.cols-1)!==32){let z=o.lines.get(e[1]+1);if(z!=null&&z.isWrapped&&z.getCodePoint(0)!==32){let T=this._getWordAt([0,e[1]+1],!1,!1,!0);T&&(x+=T.length)}}return{start:C,length:x}}}_selectWordAt(e,i){let n=this._getWordAt(e,i);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let i=this._getWordAt(e,!0);if(i){let n=e[1];for(;i.start<0;)i.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:i.first},end:{x:this._bufferService.cols-1,y:i.last}};this._model.selectionStart=[0,i.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=vp(n,this._bufferService.cols)}};Hu=$e([te(3,Ot),te(4,ur),te(5,sd),te(6,Lt),te(7,Ji),te(8,Qi)],Hu);var gp=class{constructor(){this._data={}}set(e,i,n){this._data[e]||(this._data[e]={}),this._data[e][i]=n}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},pp=class{constructor(){this._color=new gp,this._css=new gp}setCss(e,i,n){this._css.set(e,i,n)}getCss(e,i){return this._css.get(e,i)}setColor(e,i,n){this._color.set(e,i,n)}getColor(e,i){return this._color.get(e,i)}clear(){this._color.clear(),this._css.clear()}},ot=Object.freeze((()=>{let e=[Ke.toColor("#2e3436"),Ke.toColor("#cc0000"),Ke.toColor("#4e9a06"),Ke.toColor("#c4a000"),Ke.toColor("#3465a4"),Ke.toColor("#75507b"),Ke.toColor("#06989a"),Ke.toColor("#d3d7cf"),Ke.toColor("#555753"),Ke.toColor("#ef2929"),Ke.toColor("#8ae234"),Ke.toColor("#fce94f"),Ke.toColor("#729fcf"),Ke.toColor("#ad7fa8"),Ke.toColor("#34e2e2"),Ke.toColor("#eeeeec")],i=[0,95,135,175,215,255];for(let n=0;n<216;n++){let l=i[n/36%6|0],o=i[n/6%6|0],h=i[n%6];e.push({css:rt.toCss(l,o,h),rgba:rt.toRgba(l,o,h)})}for(let n=0;n<24;n++){let l=8+n*10;e.push({css:rt.toCss(l,l,l),rgba:rt.toRgba(l,l,l)})}return e})()),er=Ke.toColor("#ffffff"),Sl=Ke.toColor("#000000"),mp=Ke.toColor("#ffffff"),Sp=Sl,fl={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},GC=er,Uu=class extends Se{constructor(e){super(),this._optionsService=e,this._contrastCache=new pp,this._halfContrastCache=new pp,this._onChangeColors=this._register(new Q),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:er,background:Sl,cursor:mp,cursorAccent:Sp,selectionForeground:void 0,selectionBackgroundTransparent:fl,selectionBackgroundOpaque:Pe.blend(Sl,fl),selectionInactiveBackgroundTransparent:fl,selectionInactiveBackgroundOpaque:Pe.blend(Sl,fl),scrollbarSliderBackground:Pe.opacity(er,.2),scrollbarSliderHoverBackground:Pe.opacity(er,.4),scrollbarSliderActiveBackground:Pe.opacity(er,.5),overviewRulerBorder:er,ansi:ot.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)))}get colors(){return this._colors}_setTheme(e={}){let i=this._colors;if(i.foreground=Oe(e.foreground,er),i.background=Oe(e.background,Sl),i.cursor=Pe.blend(i.background,Oe(e.cursor,mp)),i.cursorAccent=Pe.blend(i.background,Oe(e.cursorAccent,Sp)),i.selectionBackgroundTransparent=Oe(e.selectionBackground,fl),i.selectionBackgroundOpaque=Pe.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=Oe(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=Pe.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?Oe(e.selectionForeground,dp):void 0,i.selectionForeground===dp&&(i.selectionForeground=void 0),Pe.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=Pe.opacity(i.selectionBackgroundTransparent,.3)),Pe.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=Pe.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=Oe(e.scrollbarSliderBackground,Pe.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=Oe(e.scrollbarSliderHoverBackground,Pe.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=Oe(e.scrollbarSliderActiveBackground,Pe.opacity(i.foreground,.5)),i.overviewRulerBorder=Oe(e.overviewRulerBorder,GC),i.ansi=ot.slice(),i.ansi[0]=Oe(e.black,ot[0]),i.ansi[1]=Oe(e.red,ot[1]),i.ansi[2]=Oe(e.green,ot[2]),i.ansi[3]=Oe(e.yellow,ot[3]),i.ansi[4]=Oe(e.blue,ot[4]),i.ansi[5]=Oe(e.magenta,ot[5]),i.ansi[6]=Oe(e.cyan,ot[6]),i.ansi[7]=Oe(e.white,ot[7]),i.ansi[8]=Oe(e.brightBlack,ot[8]),i.ansi[9]=Oe(e.brightRed,ot[9]),i.ansi[10]=Oe(e.brightGreen,ot[10]),i.ansi[11]=Oe(e.brightYellow,ot[11]),i.ansi[12]=Oe(e.brightBlue,ot[12]),i.ansi[13]=Oe(e.brightMagenta,ot[13]),i.ansi[14]=Oe(e.brightCyan,ot[14]),i.ansi[15]=Oe(e.brightWhite,ot[15]),e.extendedAnsi){let n=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let l=0;l<n;l++)i.ansi[l+16]=Oe(e.extendedAnsi[l],ot[l+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let i=0;i<this._restoreColors.ansi.length;++i)this._colors.ansi[i]=this._restoreColors.ansi[i];return}switch(e){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[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(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()}}};Uu=$e([te(0,Lt)],Uu);function Oe(e,i){if(e!==void 0)try{return Ke.toColor(e)}catch{}return i}var $C=class{constructor(...e){this._entries=new Map;for(let[i,n]of e)this.set(i,n)}set(e,i){let n=this._entries.get(e);return this._entries.set(e,i),n}forEach(e){for(let[i,n]of this._entries.entries())e(i,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},FC=class{constructor(){this._services=new $C,this._services.set(id,this)}setService(e,i){this._services.set(e,i)}getService(e){return this._services.get(e)}createInstance(e,...i){let n=Wb(e).sort((h,d)=>h.index-d.index),l=[];for(let h of n){let d=this._services.get(h.id);if(!d)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${h.id._id}.`);l.push(d)}let o=n.length>0?n[0].index:i.length;if(i.length!==o)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${i.length} static arguments`);return new e(...i,...l)}},IC={trace:0,debug:1,info:2,warn:3,error:4,off:5},ZC="xterm.js: ",Pu=class extends Se{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=IC[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)typeof e[i]=="function"&&(e[i]=e[i]())}_log(e,i,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":ZC)+i,...n)}trace(e,...i){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,e,i)}debug(e,...i){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,e,i)}info(e,...i){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,e,i)}warn(e,...i){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,e,i)}error(e,...i){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,e,i)}};Pu=$e([te(0,Lt)],Pu);var yp=class extends Se{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new Q),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new Q),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new Q),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let i=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)i[n]=this._array[this._getCyclicIndex(n)];this._array=i,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let i=this._length;i<e;i++)this._array[i]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,i){this._array[this._getCyclicIndex(e)]=i}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,i,...n){if(i){for(let l=e;l<this._length-i;l++)this._array[this._getCyclicIndex(l)]=this._array[this._getCyclicIndex(l+i)];this._length-=i,this.onDeleteEmitter.fire({index:e,amount:i})}for(let l=this._length-1;l>=e;l--)this._array[this._getCyclicIndex(l+n.length)]=this._array[this._getCyclicIndex(l)];for(let l=0;l<n.length;l++)this._array[this._getCyclicIndex(e+l)]=n[l];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let l=this._length+n.length-this._maxLength;this._startIndex+=l,this._length=this._maxLength,this.onTrimEmitter.fire(l)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i,n){if(!(i<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let o=i-1;o>=0;o--)this.set(e+o+n,this.get(e+o));let l=e+i+n-this._length;if(l>0)for(this._length+=l;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let l=0;l<i;l++)this.set(e+l+n,this.get(e+l))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},me=3,it=Object.freeze(new Rl),io=0,Zh=2,yl=class i0{constructor(i,n,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(i*me);let o=n||fi.fromCharData([0,bm,1,0]);for(let h=0;h<i;++h)this.setCell(h,o);this.length=i}get(i){let n=this._data[i*me+0],l=n&2097151;return[this._data[i*me+1],n&2097152?this._combined[i]:l?Ds(l):"",n>>22,n&2097152?this._combined[i].charCodeAt(this._combined[i].length-1):l]}set(i,n){this._data[i*me+1]=n[0],n[1].length>1?(this._combined[i]=n[1],this._data[i*me+0]=i|2097152|n[2]<<22):this._data[i*me+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(i){return this._data[i*me+0]>>22}hasWidth(i){return this._data[i*me+0]&12582912}getFg(i){return this._data[i*me+1]}getBg(i){return this._data[i*me+2]}hasContent(i){return this._data[i*me+0]&4194303}getCodePoint(i){let n=this._data[i*me+0];return n&2097152?this._combined[i].charCodeAt(this._combined[i].length-1):n&2097151}isCombined(i){return this._data[i*me+0]&2097152}getString(i){let n=this._data[i*me+0];return n&2097152?this._combined[i]:n&2097151?Ds(n&2097151):""}isProtected(i){return this._data[i*me+2]&536870912}loadCell(i,n){return io=i*me,n.content=this._data[io+0],n.fg=this._data[io+1],n.bg=this._data[io+2],n.content&2097152&&(n.combinedData=this._combined[i]),n.bg&268435456&&(n.extended=this._extendedAttrs[i]),n}setCell(i,n){n.content&2097152&&(this._combined[i]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[i]=n.extended),this._data[i*me+0]=n.content,this._data[i*me+1]=n.fg,this._data[i*me+2]=n.bg}setCellFromCodepoint(i,n,l,o){o.bg&268435456&&(this._extendedAttrs[i]=o.extended),this._data[i*me+0]=n|l<<22,this._data[i*me+1]=o.fg,this._data[i*me+2]=o.bg}addCodepointToCell(i,n,l){let o=this._data[i*me+0];o&2097152?this._combined[i]+=Ds(n):o&2097151?(this._combined[i]=Ds(o&2097151)+Ds(n),o&=-2097152,o|=2097152):o=n|1<<22,l&&(o&=-12582913,o|=l<<22),this._data[i*me+0]=o}insertCells(i,n,l){if(i%=this.length,i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,l),n<this.length-i){let o=new fi;for(let h=this.length-i-n-1;h>=0;--h)this.setCell(i+n+h,this.loadCell(i+h,o));for(let h=0;h<n;++h)this.setCell(i+h,l)}else for(let o=i;o<this.length;++o)this.setCell(o,l);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,l)}deleteCells(i,n,l){if(i%=this.length,n<this.length-i){let o=new fi;for(let h=0;h<this.length-i-n;++h)this.setCell(i+h,this.loadCell(i+n+h,o));for(let h=this.length-n;h<this.length;++h)this.setCell(h,l)}else for(let o=i;o<this.length;++o)this.setCell(o,l);i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,l),this.getWidth(i)===0&&!this.hasContent(i)&&this.setCellFromCodepoint(i,0,1,l)}replaceCells(i,n,l,o=!1){if(o){for(i&&this.getWidth(i-1)===2&&!this.isProtected(i-1)&&this.setCellFromCodepoint(i-1,0,1,l),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,l);i<n&&i<this.length;)this.isProtected(i)||this.setCell(i,l),i++;return}for(i&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,l),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,l);i<n&&i<this.length;)this.setCell(i++,l)}resize(i,n){if(i===this.length)return this._data.length*4*Zh<this._data.buffer.byteLength;let l=i*me;if(i>this.length){if(this._data.buffer.byteLength>=l*4)this._data=new Uint32Array(this._data.buffer,0,l);else{let o=new Uint32Array(l);o.set(this._data),this._data=o}for(let o=this.length;o<i;++o)this.setCell(o,n)}else{this._data=this._data.subarray(0,l);let o=Object.keys(this._combined);for(let d=0;d<o.length;d++){let _=parseInt(o[d],10);_>=i&&delete this._combined[_]}let h=Object.keys(this._extendedAttrs);for(let d=0;d<h.length;d++){let _=parseInt(h[d],10);_>=i&&delete this._extendedAttrs[_]}}return this.length=i,l*4*Zh<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Zh<this._data.buffer.byteLength){let i=new Uint32Array(this._data.length);return i.set(this._data),this._data=i,1}return 0}fill(i,n=!1){if(n){for(let l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,i);return}this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,i)}copyFrom(i){this.length!==i.length?this._data=new Uint32Array(i._data):this._data.set(i._data),this.length=i.length,this._combined={};for(let n in i._combined)this._combined[n]=i._combined[n];this._extendedAttrs={};for(let n in i._extendedAttrs)this._extendedAttrs[n]=i._extendedAttrs[n];this.isWrapped=i.isWrapped}clone(){let i=new i0(0);i._data=new Uint32Array(this._data),i.length=this.length;for(let n in this._combined)i._combined[n]=this._combined[n];for(let n in this._extendedAttrs)i._extendedAttrs[n]=this._extendedAttrs[n];return i.isWrapped=this.isWrapped,i}getTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(this._data[i*me+0]&4194303)return i+(this._data[i*me+0]>>22);return 0}getNoBgTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(this._data[i*me+0]&4194303||this._data[i*me+2]&50331648)return i+(this._data[i*me+0]>>22);return 0}copyCellsFrom(i,n,l,o,h){let d=i._data;if(h)for(let v=o-1;v>=0;v--){for(let f=0;f<me;f++)this._data[(l+v)*me+f]=d[(n+v)*me+f];d[(n+v)*me+2]&268435456&&(this._extendedAttrs[l+v]=i._extendedAttrs[n+v])}else for(let v=0;v<o;v++){for(let f=0;f<me;f++)this._data[(l+v)*me+f]=d[(n+v)*me+f];d[(n+v)*me+2]&268435456&&(this._extendedAttrs[l+v]=i._extendedAttrs[n+v])}let _=Object.keys(i._combined);for(let v=0;v<_.length;v++){let f=parseInt(_[v],10);f>=n&&(this._combined[f-n+l]=i._combined[f])}}translateToString(i,n,l,o){n=n??0,l=l??this.length,i&&(l=Math.min(l,this.getTrimmedLength())),o&&(o.length=0);let h="";for(;n<l;){let d=this._data[n*me+0],_=d&2097151,v=d&2097152?this._combined[n]:_?Ds(_):Ts;if(h+=v,o)for(let f=0;f<v.length;++f)o.push(n);n+=d>>22||1}return o&&o.push(n),h}};function QC(e,i,n,l,o,h){let d=[];for(let _=0;_<e.length-1;_++){let v=_,f=e.get(++v);if(!f.isWrapped)continue;let p=[e.get(_)];for(;v<e.length&&f.isWrapped;)p.push(f),f=e.get(++v);if(!h&&l>=_&&l<v){_+=p.length-1;continue}let S=0,y=Dl(p,S,i),E=1,C=0;for(;E<p.length;){let z=Dl(p,E,i),T=z-C,L=n-y,V=Math.min(T,L);p[S].copyCellsFrom(p[E],C,y,V,!1),y+=V,y===n&&(S++,y=0),C+=V,C===z&&(E++,C=0),y===0&&S!==0&&p[S-1].getWidth(n-1)===2&&(p[S].copyCellsFrom(p[S-1],n-1,y++,1,!1),p[S-1].setCell(n-1,o))}p[S].replaceCells(y,n,o);let x=0;for(let z=p.length-1;z>0&&(z>S||p[z].getTrimmedLength()===0);z--)x++;x>0&&(d.push(_+p.length-x),d.push(x)),_+=p.length-1}return d}function JC(e,i){let n=[],l=0,o=i[l],h=0;for(let d=0;d<e.length;d++)if(o===d){let _=i[++l];e.onDeleteEmitter.fire({index:d-h,amount:_}),d+=_-1,h+=_,o=i[++l]}else n.push(d);return{layout:n,countRemoved:h}}function e2(e,i){let n=[];for(let l=0;l<i.length;l++)n.push(e.get(i[l]));for(let l=0;l<n.length;l++)e.set(l,n[l]);e.length=i.length}function t2(e,i,n){let l=[],o=e.map((v,f)=>Dl(e,f,i)).reduce((v,f)=>v+f),h=0,d=0,_=0;for(;_<o;){if(o-_<n){l.push(o-_);break}h+=n;let v=Dl(e,d,i);h>v&&(h-=v,d++);let f=e[d].getWidth(h-1)===2;f&&h--;let p=f?n-1:n;l.push(p),_+=p}return l}function Dl(e,i,n){if(i===e.length-1)return e[i].getTrimmedLength();let l=!e[i].hasContent(n-1)&&e[i].getWidth(n-1)===1,o=e[i+1].getWidth(0)===2;return l&&o?n-1:n}var s0=class r0{constructor(i){this.line=i,this.isDisposed=!1,this._disposables=[],this._id=r0._nextId++,this._onDispose=this.register(new Q),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),ar(this._disposables),this._disposables.length=0)}register(i){return this._disposables.push(i),i}};s0._nextId=1;var i2=s0,ht={},tr=ht.B;ht[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:"≥","{":"π","|":"≠","}":"£","~":"·"};ht.A={"#":"£"};ht.B=void 0;ht[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ht.C=ht[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ht.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ht.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ht.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ht.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ht.E=ht[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ht.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ht.H=ht[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ht["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var bp=4294967295,wp=class{constructor(e,i,n){this._hasScrollback=e,this._optionsService=i,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=it.clone(),this.savedCharset=tr,this.markers=[],this._nullCell=fi.fromCharData([0,bm,1,0]),this._whitespaceCell=fi.fromCharData([0,Ts,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new So,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new yp(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new vo),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new vo),this._whitespaceCell}getBlankLine(e,i){return new yl(this._bufferService.cols,this.getNullCell(e),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let i=e+this._optionsService.rawOptions.scrollback;return i>bp?bp:i}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=it);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new yp(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,i){let n=this.getNullCell(it),l=0,o=this._getCorrectBufferLength(i);if(o>this.lines.maxLength&&(this.lines.maxLength=o),this.lines.length>0){if(this._cols<e)for(let d=0;d<this.lines.length;d++)l+=+this.lines.get(d).resize(e,n);let h=0;if(this._rows<i)for(let d=this._rows;d<i;d++)this.lines.length<i+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new yl(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+h+1?(this.ybase--,h++,this.ydisp>0&&this.ydisp--):this.lines.push(new yl(e,n)));else for(let d=this._rows;d>i;d--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(o<this.lines.maxLength){let d=this.lines.length-o;d>0&&(this.lines.trimStart(d),this.ybase=Math.max(this.ybase-d,0),this.ydisp=Math.max(this.ydisp-d,0),this.savedY=Math.max(this.savedY-d,0)),this.lines.maxLength=o}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,i-1),h&&(this.y+=h),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(e,i),this._cols>e))for(let h=0;h<this.lines.length;h++)l+=+this.lines.get(h).resize(e,n);this._cols=e,this._rows=i,this._memoryCleanupQueue.clear(),l>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let i=0;for(;this._memoryCleanupPosition<this.lines.length;)if(i+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),i>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,i){this._cols!==e&&(e>this._cols?this._reflowLarger(e,i):this._reflowSmaller(e,i))}_reflowLarger(e,i){let n=this._optionsService.rawOptions.reflowCursorLine,l=QC(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(it),n);if(l.length>0){let o=JC(this.lines,l);e2(this.lines,o.layout),this._reflowLargerAdjustViewport(e,i,o.countRemoved)}}_reflowLargerAdjustViewport(e,i,n){let l=this.getNullCell(it),o=n;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new yl(e,l))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,i){let n=this._optionsService.rawOptions.reflowCursorLine,l=this.getNullCell(it),o=[],h=0;for(let d=this.lines.length-1;d>=0;d--){let _=this.lines.get(d);if(!_||!_.isWrapped&&_.getTrimmedLength()<=e)continue;let v=[_];for(;_.isWrapped&&d>0;)_=this.lines.get(--d),v.unshift(_);if(!n){let V=this.ybase+this.y;if(V>=d&&V<d+v.length)continue}let f=v[v.length-1].getTrimmedLength(),p=t2(v,this._cols,e),S=p.length-v.length,y;this.ybase===0&&this.y!==this.lines.length-1?y=Math.max(0,this.y-this.lines.maxLength+S):y=Math.max(0,this.lines.length-this.lines.maxLength+S);let E=[];for(let V=0;V<S;V++){let P=this.getBlankLine(it,!0);E.push(P)}E.length>0&&(o.push({start:d+v.length+h,newLines:E}),h+=E.length),v.push(...E);let C=p.length-1,x=p[C];x===0&&(C--,x=p[C]);let z=v.length-S-1,T=f;for(;z>=0;){let V=Math.min(T,x);if(v[C]===void 0)break;if(v[C].copyCellsFrom(v[z],T-V,x-V,V,!0),x-=V,x===0&&(C--,x=p[C]),T-=V,T===0){z--;let P=Math.max(z,0);T=Dl(v,P,this._cols)}}for(let V=0;V<v.length;V++)p[V]<e&&v[V].setCell(p[V],l);let L=S-y;for(;L-- >0;)this.ybase===0?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+h)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+S,this.ybase+i-1)}if(o.length>0){let d=[],_=[];for(let x=0;x<this.lines.length;x++)_.push(this.lines.get(x));let v=this.lines.length,f=v-1,p=0,S=o[p];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+h);let y=0;for(let x=Math.min(this.lines.maxLength-1,v+h-1);x>=0;x--)if(S&&S.start>f+y){for(let z=S.newLines.length-1;z>=0;z--)this.lines.set(x--,S.newLines[z]);x++,d.push({index:f+1,amount:S.newLines.length}),y+=S.newLines.length,S=o[++p]}else this.lines.set(x,_[f--]);let E=0;for(let x=d.length-1;x>=0;x--)d[x].index+=E,this.lines.onInsertEmitter.fire(d[x]),E+=d[x].amount;let C=Math.max(0,v+h-this.lines.maxLength);C>0&&this.lines.onTrimEmitter.fire(C)}}translateBufferLineToString(e,i,n=0,l){let o=this.lines.get(e);return o?o.translateToString(i,n,l):""}getWrappedRangeForLine(e){let i=e,n=e;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:i,last:n}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].line===e&&(this.markers[i].dispose(),this.markers.splice(i--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let i=new i2(e);return this.markers.push(i),i.register(this.lines.onTrim(n=>{i.line-=n,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(n=>{i.line>=n.index&&(i.line+=n.amount)})),i.register(this.lines.onDelete(n=>{i.line>=n.index&&i.line<n.index+n.amount&&i.dispose(),i.line>n.index&&(i.line-=n.amount)})),i.register(i.onDispose(()=>this._removeMarker(i))),i}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},s2=class extends Se{constructor(e,i){super(),this._optionsService=e,this._bufferService=i,this._onBufferActivate=this._register(new Q),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 wp(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new wp(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,i){this._normal.resize(e,i),this._alt.resize(e,i),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},n0=2,l0=1,ju=class extends Se{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new Q),this.onResize=this._onResize.event,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,n0),this.rows=Math.max(e.rawOptions.rows||0,l0),this.buffers=this._register(new s2(e,this)),this._register(this.buffers.onBufferActivate(i=>{this._onScroll.fire(i.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,i){let n=this.cols!==e,l=this.rows!==i;this.cols=e,this.rows=i,this.buffers.resize(e,i),this._onResize.fire({cols:e,rows:i,colsChanged:n,rowsChanged:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,i=!1){let n=this.buffer,l;l=this._cachedBlankLine,(!l||l.length!==this.cols||l.getFg(0)!==e.fg||l.getBg(0)!==e.bg)&&(l=n.getBlankLine(e,i),this._cachedBlankLine=l),l.isWrapped=i;let o=n.ybase+n.scrollTop,h=n.ybase+n.scrollBottom;if(n.scrollTop===0){let d=n.lines.isFull;h===n.lines.length-1?d?n.lines.recycle().copyFrom(l):n.lines.push(l.clone()):n.lines.splice(h+1,0,l.clone()),d?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let d=h-o+1;n.lines.shiftElements(o+1,d-1,-1),n.lines.set(h,l.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,i){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let l=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),l!==n.ydisp&&(i||this._onScroll.fire(n.ydisp))}};ju=$e([te(0,Lt)],ju);var en={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:mo,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},r2=["normal","bold","100","200","300","400","500","600","700","800","900"],n2=class extends Se{constructor(e){super(),this._onOptionChange=this._register(new Q),this.onOptionChange=this._onOptionChange.event;let i={...en};for(let n in e)if(n in i)try{let l=e[n];i[n]=this._sanitizeAndValidateOption(n,l)}catch(l){console.error(l)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register(qe(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i){return this.onOptionChange(n=>{n===e&&i(this.rawOptions[e])})}onMultipleOptionChange(e,i){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&i()})}_setupOptions(){let e=n=>{if(!(n in en))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},i=(n,l)=>{if(!(n in en))throw new Error(`No option with key "${n}"`);l=this._sanitizeAndValidateOption(n,l),this.rawOptions[n]!==l&&(this.rawOptions[n]=l,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let l={get:e.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this.options,n,l)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=en[e]),!l2(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=en[e]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=r2.includes(i)?i:en[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(i*10)/10));break;case"scrollback":if(i=Math.min(i,4294967295),i<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{};break}return i}};function l2(e){return e==="block"||e==="underline"||e==="bar"}function bl(e,i=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let l in e)n[l]=i<=1?e[l]:e[l]&&bl(e[l],i-1);return n}var Cp=Object.freeze({insertMode:!1}),xp=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),qu=class extends Se{constructor(e,i,n){super(),this._bufferService=e,this._logService=i,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new Q),this.onData=this._onData.event,this._onUserInput=this._register(new Q),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new Q),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new Q),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=bl(Cp),this.decPrivateModes=bl(xp)}reset(){this.modes=bl(Cp),this.decPrivateModes=bl(xp)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(l=>l.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(i=>i.charCodeAt(0))),this._onBinary.fire(e))}};qu=$e([te(0,Ot),te(1,km),te(2,Lt)],qu);var Ep={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Qh(e,i){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!i&&(n|=3)),n}var Jh=String.fromCharCode,kp={DEFAULT:e=>{let i=[Qh(e,!1)+32,e.col+32,e.row+32];return i[0]>255||i[1]>255||i[2]>255?"":`\x1B[M${Jh(i[0])}${Jh(i[1])}${Jh(i[2])}`},SGR:e=>{let i=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Qh(e,!0)};${e.col};${e.row}${i}`},SGR_PIXELS:e=>{let i=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Qh(e,!0)};${e.x};${e.y}${i}`}},Wu=class extends Se{constructor(e,i,n){super(),this._bufferService=e,this._coreService=i,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new Q),this.onProtocolChange=this._onProtocolChange.event;for(let l of Object.keys(Ep))this.addProtocol(l,Ep[l]);for(let l of Object.keys(kp))this.addEncoding(l,kp[l]);this.reset()}addProtocol(e,i){this._protocols[e]=i}addEncoding(e,i){this._encodings[e]=i}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,i,n){if(e.deltaY===0||e.shiftKey||i===void 0||n===void 0)return 0;let l=i/n,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=l+0,Math.abs(e.deltaY)<50&&(o*=.3),this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(e,i){return i.altKey||i.ctrlKey||i.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let i=this._encodings[this._activeEncoding](e);return i&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(i):this._coreService.triggerDataEvent(i,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,i,n){if(n){if(e.x!==i.x||e.y!==i.y)return!1}else if(e.col!==i.col||e.row!==i.row)return!1;return!(e.button!==i.button||e.action!==i.action||e.ctrl!==i.ctrl||e.alt!==i.alt||e.shift!==i.shift)}};Wu=$e([te(0,Ot),te(1,ur),te(2,Lt)],Wu);var eu=[[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]],a2=[[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]],ct;function o2(e,i){let n=0,l=i.length-1,o;if(e<i[0][0]||e>i[l][1])return!1;for(;l>=n;)if(o=n+l>>1,e>i[o][1])n=o+1;else if(e<i[o][0])l=o-1;else return!0;return!1}var c2=class{constructor(){if(this.version="6",!ct){ct=new Uint8Array(65536),ct.fill(1),ct[0]=0,ct.fill(0,1,32),ct.fill(0,127,160),ct.fill(2,4352,4448),ct[9001]=2,ct[9002]=2,ct.fill(2,11904,42192),ct[12351]=1,ct.fill(2,44032,55204),ct.fill(2,63744,64256),ct.fill(2,65040,65050),ct.fill(2,65072,65136),ct.fill(2,65280,65377),ct.fill(2,65504,65511);for(let e=0;e<eu.length;++e)ct.fill(0,eu[e][0],eu[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ct[e]:o2(e,a2)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,i){let n=this.wcwidth(e),l=n===0&&i!==0;if(l){let o=ir.extractWidth(i);o===0?l=!1:o>n&&(n=o)}return ir.createPropertyValue(0,n,l)}},ir=class ho{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Q,this.onChange=this._onChange.event;let i=new c2;this.register(i),this._active=i.version,this._activeProvider=i}static extractShouldJoin(i){return(i&1)!==0}static extractWidth(i){return i>>1&3}static extractCharKind(i){return i>>3}static createPropertyValue(i,n,l=!1){return(i&16777215)<<3|(n&3)<<1|(l?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(i){if(!this._providers[i])throw new Error(`unknown Unicode version "${i}"`);this._active=i,this._activeProvider=this._providers[i],this._onChange.fire(i)}register(i){this._providers[i.version]=i}wcwidth(i){return this._activeProvider.wcwidth(i)}getStringCellWidth(i){let n=0,l=0,o=i.length;for(let h=0;h<o;++h){let d=i.charCodeAt(h);if(55296<=d&&d<=56319){if(++h>=o)return n+this.wcwidth(d);let f=i.charCodeAt(h);56320<=f&&f<=57343?d=(d-55296)*1024+f-56320+65536:n+=this.wcwidth(f)}let _=this.charProperties(d,l),v=ho.extractWidth(_);ho.extractShouldJoin(_)&&(v-=ho.extractWidth(l)),n+=v,l=_}return n}charProperties(i,n){return this._activeProvider.charProperties(i,n)}},h2=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,i){this._charsets[e]=i,this.glevel===e&&(this.charset=i)}};function Mp(e){var l;let i=(l=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:l.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&i&&(n.isWrapped=i[3]!==0&&i[3]!==32)}var _l=2147483647,u2=256,a0=class Yu{constructor(i=32,n=32){if(this.maxLength=i,this.maxSubParamsLength=n,n>u2)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(i),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(i),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(i){let n=new Yu;if(!i.length)return n;for(let l=Array.isArray(i[0])?1:0;l<i.length;++l){let o=i[l];if(Array.isArray(o))for(let h=0;h<o.length;++h)n.addSubParam(o[h]);else n.addParam(o)}return n}clone(){let i=new Yu(this.maxLength,this.maxSubParamsLength);return i.params.set(this.params),i.length=this.length,i._subParams.set(this._subParams),i._subParamsLength=this._subParamsLength,i._subParamsIdx.set(this._subParamsIdx),i._rejectDigits=this._rejectDigits,i._rejectSubDigits=this._rejectSubDigits,i._digitIsSub=this._digitIsSub,i}toArray(){let i=[];for(let n=0;n<this.length;++n){i.push(this.params[n]);let l=this._subParamsIdx[n]>>8,o=this._subParamsIdx[n]&255;o-l>0&&i.push(Array.prototype.slice.call(this._subParams,l,o))}return i}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(i){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(i<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=i>_l?_l:i}addSubParam(i){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(i<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=i>_l?_l:i,this._subParamsIdx[this.length-1]++}}hasSubParams(i){return(this._subParamsIdx[i]&255)-(this._subParamsIdx[i]>>8)>0}getSubParams(i){let n=this._subParamsIdx[i]>>8,l=this._subParamsIdx[i]&255;return l-n>0?this._subParams.subarray(n,l):null}getSubParamsAll(){let i={};for(let n=0;n<this.length;++n){let l=this._subParamsIdx[n]>>8,o=this._subParamsIdx[n]&255;o-l>0&&(i[n]=this._subParams.slice(l,o))}return i}addDigit(i){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let l=this._digitIsSub?this._subParams:this.params,o=l[n-1];l[n-1]=~o?Math.min(o*10+i,_l):i}},vl=[],d2=class{constructor(){this._state=0,this._active=vl,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let l=n.indexOf(i);l!==-1&&n.splice(l,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=vl}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=vl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||vl,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,i,n){if(!this._active.length)this._handlerFb(this._id,"PUT",wo(e,i,n));else for(let l=this._active.length-1;l>=0;l--)this._active[l].put(e,i,n)}start(){this.reset(),this._state=1}put(e,i,n){if(this._state!==3){if(this._state===1)for(;i<n;){let l=e[i++];if(l===59){this._state=2,this._start();break}if(l<48||57<l){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+l-48}this._state===2&&n-i>0&&this._put(e,i,n)}}end(e,i=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,l=this._active.length-1,o=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,n=i,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;l>=0&&(n=this._active[l].end(e),n!==!0);l--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,n;l--}for(;l>=0;l--)if(n=this._active[l].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,n}this._active=vl,this._id=-1,this._state=0}}},Jt=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,i,n){this._hitLimit||(this._data+=wo(e,i,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data),i instanceof Promise))return i.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,i}},gl=[],f2=class{constructor(){this._handlers=Object.create(null),this._active=gl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=gl}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let l=n.indexOf(i);l!==-1&&n.splice(l,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=gl,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||gl,!this._active.length)this._handlerFb(this._ident,"HOOK",i);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(i)}put(e,i,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",wo(e,i,n));else for(let l=this._active.length-1;l>=0;l--)this._active[l].put(e,i,n)}unhook(e,i=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,l=this._active.length-1,o=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,n=i,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;l>=0&&(n=this._active[l].unhook(e),n!==!0);l--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,n;l--}for(;l>=0;l--)if(n=this._active[l].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,n}this._active=gl,this._ident=0}},wl=new a0;wl.addParam(0);var Dp=class{constructor(e){this._handler=e,this._data="",this._params=wl,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():wl,this._data="",this._hitLimit=!1}put(e,i,n){this._hitLimit||(this._data+=wo(e,i,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data,this._params),i instanceof Promise))return i.then(n=>(this._params=wl,this._data="",this._hitLimit=!1,n));return this._params=wl,this._data="",this._hitLimit=!1,i}},_2=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,i){this.table.fill(e<<4|i)}add(e,i,n,l){this.table[i<<8|e]=n<<4|l}addMany(e,i,n,l){for(let o=0;o<e.length;o++)this.table[i<<8|e[o]]=n<<4|l}},di=160,v2=(function(){let e=new _2(4095),i=Array.apply(null,Array(256)).map((_,v)=>v),n=(_,v)=>i.slice(_,v),l=n(32,127),o=n(0,24);o.push(25),o.push.apply(o,n(28,32));let h=n(0,14),d;e.setDefault(1,0),e.addMany(l,0,2,0);for(d in h)e.addMany([24,26,153,154],d,3,0),e.addMany(n(128,144),d,3,0),e.addMany(n(144,152),d,3,0),e.add(156,d,0,0),e.add(27,d,11,1),e.add(157,d,4,8),e.addMany([152,158,159],d,0,7),e.add(155,d,11,3),e.add(144,d,11,9);return e.addMany(o,0,3,0),e.addMany(o,1,3,1),e.add(127,1,0,1),e.addMany(o,8,0,8),e.addMany(o,3,3,3),e.add(127,3,0,3),e.addMany(o,4,3,4),e.add(127,4,0,4),e.addMany(o,6,3,6),e.addMany(o,5,3,5),e.add(127,5,0,5),e.addMany(o,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(l,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(l,7,0,7),e.addMany(o,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(o,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(o,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(o,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(o,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(o,13,13,13),e.addMany(l,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(di,0,2,0),e.add(di,8,5,8),e.add(di,6,0,6),e.add(di,11,0,11),e.add(di,13,13,13),e})(),g2=class extends Se{constructor(e=v2){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new a0,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,n,l)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,n)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(qe(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new d2),this._dcsParser=this._register(new f2),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let o=0;o<e.intermediates.length;++o){let h=e.intermediates.charCodeAt(o);if(32>h||h>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=h}}if(e.final.length!==1)throw new Error("final must be a single byte");let l=e.final.charCodeAt(0);if(i[0]>l||l>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return n<<=8,n|=l,n}identToString(e){let i=[];for(;e;)i.push(String.fromCharCode(e&255)),e>>=8;return i.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let l=this._escHandlers[n];return l.push(i),{dispose:()=>{let o=l.indexOf(i);o!==-1&&l.splice(o,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,i){this._executeHandlers[e.charCodeAt(0)]=i}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let l=this._csiHandlers[n];return l.push(i),{dispose:()=>{let o=l.indexOf(i);o!==-1&&l.splice(o,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i){return this._dcsParser.registerHandler(this._identifier(e),i)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i){return this._oscParser.registerHandler(e,i)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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(e,i,n,l,o){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=n,this._parseStack.transition=l,this._parseStack.chunkPos=o}parse(e,i,n){let l=0,o=0,h=0,d;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,h=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let _=this._parseStack.handlers,v=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&v>-1){for(;v>=0&&(d=_[v](this._params),d!==!0);v--)if(d instanceof Promise)return this._parseStack.handlerPos=v,d}this._parseStack.handlers=[];break;case 4:if(n===!1&&v>-1){for(;v>=0&&(d=_[v](),d!==!0);v--)if(d instanceof Promise)return this._parseStack.handlerPos=v,d}this._parseStack.handlers=[];break;case 6:if(l=e[this._parseStack.chunkPos],d=this._dcsParser.unhook(l!==24&&l!==26,n),d)return d;l===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(l=e[this._parseStack.chunkPos],d=this._oscParser.end(l!==24&&l!==26,n),d)return d;l===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,h=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let _=h;_<i;++_){switch(l=e[_],o=this._transitions.table[this.currentState<<8|(l<160?l:di)],o>>4){case 2:for(let y=_+1;;++y){if(y>=i||(l=e[y])<32||l>126&&l<di){this._printHandler(e,_,y),_=y-1;break}if(++y>=i||(l=e[y])<32||l>126&&l<di){this._printHandler(e,_,y),_=y-1;break}if(++y>=i||(l=e[y])<32||l>126&&l<di){this._printHandler(e,_,y),_=y-1;break}if(++y>=i||(l=e[y])<32||l>126&&l<di){this._printHandler(e,_,y),_=y-1;break}}break;case 3:this._executeHandlers[l]?this._executeHandlers[l]():this._executeHandlerFb(l),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:_,code:l,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let v=this._csiHandlers[this._collect<<8|l],f=v?v.length-1:-1;for(;f>=0&&(d=v[f](this._params),d!==!0);f--)if(d instanceof Promise)return this._preserveStack(3,v,f,o,_),d;f<0&&this._csiHandlerFb(this._collect<<8|l,this._params),this.precedingJoinState=0;break;case 8:do switch(l){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(l-48)}while(++_<i&&(l=e[_])>47&&l<60);_--;break;case 9:this._collect<<=8,this._collect|=l;break;case 10:let p=this._escHandlers[this._collect<<8|l],S=p?p.length-1:-1;for(;S>=0&&(d=p[S](),d!==!0);S--)if(d instanceof Promise)return this._preserveStack(4,p,S,o,_),d;S<0&&this._escHandlerFb(this._collect<<8|l),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|l,this._params);break;case 13:for(let y=_+1;;++y)if(y>=i||(l=e[y])===24||l===26||l===27||l>127&&l<di){this._dcsParser.put(e,_,y),_=y-1;break}break;case 14:if(d=this._dcsParser.unhook(l!==24&&l!==26),d)return this._preserveStack(6,[],0,o,_),d;l===27&&(o|=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 y=_+1;;y++)if(y>=i||(l=e[y])<32||l>127&&l<di){this._oscParser.put(e,_,y),_=y-1;break}break;case 6:if(d=this._oscParser.end(l!==24&&l!==26),d)return this._preserveStack(5,[],0,o,_),d;l===27&&(o|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=o&15}}},p2=/^([\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})$/,m2=/^[\da-f]+$/;function Rp(e){if(!e)return;let i=e.toLowerCase();if(i.indexOf("rgb:")===0){i=i.slice(4);let n=p2.exec(i);if(n){let l=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/l*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/l*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/l*255)]}}else if(i.indexOf("#")===0&&(i=i.slice(1),m2.exec(i)&&[3,6,9,12].includes(i.length))){let n=i.length/3,l=[0,0,0];for(let o=0;o<3;++o){let h=parseInt(i.slice(n*o,n*o+n),16);l[o]=n===1?h<<4:n===2?h:n===3?h>>4:h>>8}return l}}function tu(e,i){let n=e.toString(16),l=n.length<2?"0"+n:n;switch(i){case 4:return n[0];case 8:return l;case 12:return(l+l).slice(0,3);default:return l+l}}function S2(e,i=16){let[n,l,o]=e;return`rgb:${tu(n,i)}/${tu(l,i)}/${tu(o,i)}`}var y2={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Ms=131072,Tp=10;function Ap(e,i){if(e>24)return i.setWinLines||!1;switch(e){case 1:return!!i.restoreWin;case 2:return!!i.minimizeWin;case 3:return!!i.setWinPosition;case 4:return!!i.setWinSizePixels;case 5:return!!i.raiseWin;case 6:return!!i.lowerWin;case 7:return!!i.refreshWin;case 8:return!!i.setWinSizeChars;case 9:return!!i.maximizeWin;case 10:return!!i.fullscreenWin;case 11:return!!i.getWinState;case 13:return!!i.getWinPosition;case 14:return!!i.getWinSizePixels;case 15:return!!i.getScreenSizePixels;case 16:return!!i.getCellSizePixels;case 18:return!!i.getWinSizeChars;case 19:return!!i.getScreenSizeChars;case 20:return!!i.getIconTitle;case 21:return!!i.getWinTitle;case 22:return!!i.pushTitle;case 23:return!!i.popTitle;case 24:return!!i.setWinLines}return!1}var Bp=5e3,zp=0,b2=class extends Se{constructor(e,i,n,l,o,h,d,_,v=new g2){super(),this._bufferService=e,this._charsetService=i,this._coreService=n,this._logService=l,this._optionsService=o,this._oscLinkService=h,this._coreMouseService=d,this._unicodeService=_,this._parser=v,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new jb,this._utf8Decoder=new qb,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=it.clone(),this._eraseAttrDataInternal=it.clone(),this._onRequestBell=this._register(new Q),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new Q),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new Q),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new Q),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new Q),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new Q),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new Q),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new Q),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new Q),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new Q),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new Q),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new Q),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 Ku(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(f=>this._activeBuffer=f.activeBuffer)),this._parser.setCsiHandlerFallback((f,p)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(f),params:p.toArray()})}),this._parser.setEscHandlerFallback(f=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(f)})}),this._parser.setExecuteHandlerFallback(f=>{this._logService.debug("Unknown EXECUTE code: ",{code:f})}),this._parser.setOscHandlerFallback((f,p,S)=>{this._logService.debug("Unknown OSC code: ",{identifier:f,action:p,data:S})}),this._parser.setDcsHandlerFallback((f,p,S)=>{p==="HOOK"&&(S=S.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(f),action:p,payload:S})}),this._parser.setPrintHandler((f,p,S)=>this.print(f,p,S)),this._parser.registerCsiHandler({final:"@"},f=>this.insertChars(f)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},f=>this.scrollLeft(f)),this._parser.registerCsiHandler({final:"A"},f=>this.cursorUp(f)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},f=>this.scrollRight(f)),this._parser.registerCsiHandler({final:"B"},f=>this.cursorDown(f)),this._parser.registerCsiHandler({final:"C"},f=>this.cursorForward(f)),this._parser.registerCsiHandler({final:"D"},f=>this.cursorBackward(f)),this._parser.registerCsiHandler({final:"E"},f=>this.cursorNextLine(f)),this._parser.registerCsiHandler({final:"F"},f=>this.cursorPrecedingLine(f)),this._parser.registerCsiHandler({final:"G"},f=>this.cursorCharAbsolute(f)),this._parser.registerCsiHandler({final:"H"},f=>this.cursorPosition(f)),this._parser.registerCsiHandler({final:"I"},f=>this.cursorForwardTab(f)),this._parser.registerCsiHandler({final:"J"},f=>this.eraseInDisplay(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},f=>this.eraseInDisplay(f,!0)),this._parser.registerCsiHandler({final:"K"},f=>this.eraseInLine(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},f=>this.eraseInLine(f,!0)),this._parser.registerCsiHandler({final:"L"},f=>this.insertLines(f)),this._parser.registerCsiHandler({final:"M"},f=>this.deleteLines(f)),this._parser.registerCsiHandler({final:"P"},f=>this.deleteChars(f)),this._parser.registerCsiHandler({final:"S"},f=>this.scrollUp(f)),this._parser.registerCsiHandler({final:"T"},f=>this.scrollDown(f)),this._parser.registerCsiHandler({final:"X"},f=>this.eraseChars(f)),this._parser.registerCsiHandler({final:"Z"},f=>this.cursorBackwardTab(f)),this._parser.registerCsiHandler({final:"`"},f=>this.charPosAbsolute(f)),this._parser.registerCsiHandler({final:"a"},f=>this.hPositionRelative(f)),this._parser.registerCsiHandler({final:"b"},f=>this.repeatPrecedingCharacter(f)),this._parser.registerCsiHandler({final:"c"},f=>this.sendDeviceAttributesPrimary(f)),this._parser.registerCsiHandler({prefix:">",final:"c"},f=>this.sendDeviceAttributesSecondary(f)),this._parser.registerCsiHandler({final:"d"},f=>this.linePosAbsolute(f)),this._parser.registerCsiHandler({final:"e"},f=>this.vPositionRelative(f)),this._parser.registerCsiHandler({final:"f"},f=>this.hVPosition(f)),this._parser.registerCsiHandler({final:"g"},f=>this.tabClear(f)),this._parser.registerCsiHandler({final:"h"},f=>this.setMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"h"},f=>this.setModePrivate(f)),this._parser.registerCsiHandler({final:"l"},f=>this.resetMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"l"},f=>this.resetModePrivate(f)),this._parser.registerCsiHandler({final:"m"},f=>this.charAttributes(f)),this._parser.registerCsiHandler({final:"n"},f=>this.deviceStatus(f)),this._parser.registerCsiHandler({prefix:"?",final:"n"},f=>this.deviceStatusPrivate(f)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},f=>this.softReset(f)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},f=>this.setCursorStyle(f)),this._parser.registerCsiHandler({final:"r"},f=>this.setScrollRegion(f)),this._parser.registerCsiHandler({final:"s"},f=>this.saveCursor(f)),this._parser.registerCsiHandler({final:"t"},f=>this.windowOptions(f)),this._parser.registerCsiHandler({final:"u"},f=>this.restoreCursor(f)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},f=>this.insertColumns(f)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},f=>this.deleteColumns(f)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},f=>this.selectProtected(f)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},f=>this.requestMode(f,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},f=>this.requestMode(f,!1)),this._parser.setExecuteHandler(X.BEL,()=>this.bell()),this._parser.setExecuteHandler(X.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(X.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(X.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(X.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(X.BS,()=>this.backspace()),this._parser.setExecuteHandler(X.HT,()=>this.tab()),this._parser.setExecuteHandler(X.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(X.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(oo.IND,()=>this.index()),this._parser.setExecuteHandler(oo.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(oo.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Jt(f=>(this.setTitle(f),this.setIconName(f),!0))),this._parser.registerOscHandler(1,new Jt(f=>this.setIconName(f))),this._parser.registerOscHandler(2,new Jt(f=>this.setTitle(f))),this._parser.registerOscHandler(4,new Jt(f=>this.setOrReportIndexedColor(f))),this._parser.registerOscHandler(8,new Jt(f=>this.setHyperlink(f))),this._parser.registerOscHandler(10,new Jt(f=>this.setOrReportFgColor(f))),this._parser.registerOscHandler(11,new Jt(f=>this.setOrReportBgColor(f))),this._parser.registerOscHandler(12,new Jt(f=>this.setOrReportCursorColor(f))),this._parser.registerOscHandler(104,new Jt(f=>this.restoreIndexedColor(f))),this._parser.registerOscHandler(110,new Jt(f=>this.restoreFgColor(f))),this._parser.registerOscHandler(111,new Jt(f=>this.restoreBgColor(f))),this._parser.registerOscHandler(112,new Jt(f=>this.restoreCursorColor(f))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let f in ht)this._parser.registerEscHandler({intermediates:"(",final:f},()=>this.selectCharset("("+f)),this._parser.registerEscHandler({intermediates:")",final:f},()=>this.selectCharset(")"+f)),this._parser.registerEscHandler({intermediates:"*",final:f},()=>this.selectCharset("*"+f)),this._parser.registerEscHandler({intermediates:"+",final:f},()=>this.selectCharset("+"+f)),this._parser.registerEscHandler({intermediates:"-",final:f},()=>this.selectCharset("-"+f)),this._parser.registerEscHandler({intermediates:".",final:f},()=>this.selectCharset("."+f)),this._parser.registerEscHandler({intermediates:"/",final:f},()=>this.selectCharset("/"+f));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(f=>(this._logService.error("Parsing error: ",f),f)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new Dp((f,p)=>this.requestStatusString(f,p)))}getAttrData(){return this._curAttrData}_preserveStack(e,i,n,l){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=i,this._parseStack.decodedLength=n,this._parseStack.position=l}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((i,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),Bp))]).catch(i=>{if(i!=="#SLOW_TIMEOUT")throw i;console.warn(`async parser handler taking longer than ${Bp} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,i){let n,l=this._activeBuffer.x,o=this._activeBuffer.y,h=0,d=this._parseStack.paused;if(d){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,i))return this._logSlowResolvingAsync(n),n;l=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Ms&&(h=this._parseStack.position+Ms)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,f=>String.fromCharCode(f)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(f=>f.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Ms&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Ms))),d||this._dirtyRowTracker.clearRange(),e.length>Ms)for(let f=h;f<e.length;f+=Ms){let p=f+Ms<e.length?f+Ms:e.length,S=typeof e=="string"?this._stringDecoder.decode(e.substring(f,p),this._parseBuffer):this._utf8Decoder.decode(e.subarray(f,p),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,S))return this._preserveStack(l,o,S,f),this._logSlowResolvingAsync(n),n}else if(!d){let f=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,f))return this._preserveStack(l,o,f,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==l||this._activeBuffer.y!==o)&&this._onCursorMove.fire();let _=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),v=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);v<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(v,this._bufferService.rows-1),end:Math.min(_,this._bufferService.rows-1)})}print(e,i,n){let l,o,h=this._charsetService.charset,d=this._optionsService.rawOptions.screenReaderMode,_=this._bufferService.cols,v=this._coreService.decPrivateModes.wraparound,f=this._coreService.modes.insertMode,p=this._curAttrData,S=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-i>0&&S.getWidth(this._activeBuffer.x-1)===2&&S.setCellFromCodepoint(this._activeBuffer.x-1,0,1,p);let y=this._parser.precedingJoinState;for(let E=i;E<n;++E){if(l=e[E],l<127&&h){let T=h[String.fromCharCode(l)];T&&(l=T.charCodeAt(0))}let C=this._unicodeService.charProperties(l,y);o=ir.extractWidth(C);let x=ir.extractShouldJoin(C),z=x?ir.extractWidth(y):0;if(y=C,d&&this._onA11yChar.fire(Ds(l)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o-z>_){if(v){let T=S,L=this._activeBuffer.x-z;for(this._activeBuffer.x=z,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),S=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),z>0&&S instanceof yl&&S.copyCellsFrom(T,L,0,z,!1);L<_;)T.setCellFromCodepoint(L++,0,1,p)}else if(this._activeBuffer.x=_-1,o===2)continue}if(x&&this._activeBuffer.x){let T=S.getWidth(this._activeBuffer.x-1)?1:2;S.addCodepointToCell(this._activeBuffer.x-T,l,o);for(let L=o-z;--L>=0;)S.setCellFromCodepoint(this._activeBuffer.x++,0,0,p);continue}if(f&&(S.insertCells(this._activeBuffer.x,o-z,this._activeBuffer.getNullCell(p)),S.getWidth(_-1)===2&&S.setCellFromCodepoint(_-1,0,1,p)),S.setCellFromCodepoint(this._activeBuffer.x++,l,o,p),o>0)for(;--o;)S.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}this._parser.precedingJoinState=y,this._activeBuffer.x<_&&n-i>0&&S.getWidth(this._activeBuffer.x)===0&&!S.hasContent(this._activeBuffer.x)&&S.setCellFromCodepoint(this._activeBuffer.x,0,1,p),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,i){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>Ap(n.params[0],this._optionsService.rawOptions.windowOptions)?i(n):!0):this._parser.registerCsiHandler(e,i)}registerDcsHandler(e,i){return this._parser.registerDcsHandler(e,new Dp(i))}registerEscHandler(e,i){return this._parser.registerEscHandler(e,i)}registerOscHandler(e,i){return this._parser.registerOscHandler(e,new Jt(i))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;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&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);i.hasWidth(this._activeBuffer.x)&&!i.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,i){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+i):(this._activeBuffer.x=e,this._activeBuffer.y=i),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,i){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+i)}cursorUp(e){let i=this._activeBuffer.y-this._activeBuffer.scrollTop;return i>=0?this._moveCursor(0,-Math.min(i,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let i=this._activeBuffer.scrollBottom-this._activeBuffer.y;return i>=0?this._moveCursor(0,Math.min(i,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let i=e.params[0];return i===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:i===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let i=e.params[0];return i===1&&(this._curAttrData.bg|=536870912),(i===2||i===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,i,n,l=!1,o=!1){let h=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);h.replaceCells(i,n,this._activeBuffer.getNullCell(this._eraseAttrData()),o),l&&(h.isWrapped=!1)}_resetBufferLine(e,i=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),i),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,i=!1){var l;this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,i);n<this._bufferService.rows;n++)this._resetBufferLine(n,i);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,i),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,i);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!((l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&l.getTrimmedLength()););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,i);this._dirtyRowTracker.markDirty(0)}break;case 3:let o=this._activeBuffer.lines.length-this._bufferService.rows;o>0&&(this._activeBuffer.lines.trimStart(o),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-o,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-o,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,i=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,i);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,i);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,i);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let i=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,l=this._bufferService.rows-1-this._activeBuffer.scrollBottom,o=this._bufferService.rows-1+this._activeBuffer.ybase-l+1;for(;i--;)this._activeBuffer.lines.splice(o-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let i=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,l;for(l=this._bufferService.rows-1-this._activeBuffer.scrollBottom,l=this._bufferService.rows-1+this._activeBuffer.ybase-l;i--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(l,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let i=e.params[0]||1;for(;i--;)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(e){let i=e.params[0]||1;for(;i--;)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(it));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.deleteCells(0,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.insertCells(0,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.insertCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);l.deleteCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(this._eraseAttrData())),l.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let i=this._parser.precedingJoinState;if(!i)return!0;let n=e.params[0]||1,l=ir.extractWidth(i),o=this._activeBuffer.x-l,h=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(o),d=new Uint32Array(h.length*n),_=0;for(let f=0;f<h.length;){let p=h.codePointAt(f)||0;d[_++]=p,f+=p>65535?2:1}let v=_;for(let f=1;f<n;++f)d.copyWithin(v,0,_),v+=_;return this.print(d,0,v),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(X.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(X.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(X.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(X.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(X.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,tr),this._charsetService.setgCharset(1,tr),this._charsetService.setgCharset(2,tr),this._charsetService.setgCharset(3,tr);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let i=0;i<e.length;i++)switch(e.params[i]){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:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[i]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,i){(x=>(x[x.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",x[x.SET=1]="SET",x[x.RESET=2]="RESET",x[x.PERMANENTLY_SET=3]="PERMANENTLY_SET",x[x.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let l=this._coreService.decPrivateModes,{activeProtocol:o,activeEncoding:h}=this._coreMouseService,d=this._coreService,{buffers:_,cols:v}=this._bufferService,{active:f,alt:p}=_,S=this._optionsService.rawOptions,y=(x,z)=>(d.triggerDataEvent(`${X.ESC}[${i?"":"?"}${x};${z}$y`),!0),E=x=>x?1:2,C=e.params[0];return i?C===2?y(C,4):C===4?y(C,E(d.modes.insertMode)):C===12?y(C,3):C===20?y(C,E(S.convertEol)):y(C,0):C===1?y(C,E(l.applicationCursorKeys)):C===3?y(C,S.windowOptions.setWinLines?v===80?2:v===132?1:0:0):C===6?y(C,E(l.origin)):C===7?y(C,E(l.wraparound)):C===8?y(C,3):C===9?y(C,E(o==="X10")):C===12?y(C,E(S.cursorBlink)):C===25?y(C,E(!d.isCursorHidden)):C===45?y(C,E(l.reverseWraparound)):C===66?y(C,E(l.applicationKeypad)):C===67?y(C,4):C===1e3?y(C,E(o==="VT200")):C===1002?y(C,E(o==="DRAG")):C===1003?y(C,E(o==="ANY")):C===1004?y(C,E(l.sendFocus)):C===1005?y(C,4):C===1006?y(C,E(h==="SGR")):C===1015?y(C,4):C===1016?y(C,E(h==="SGR_PIXELS")):C===1048?y(C,1):C===47||C===1047||C===1049?y(C,E(f===p)):C===2004?y(C,E(l.bracketedPasteMode)):C===2026?y(C,E(l.synchronizedOutput)):y(C,0)}_updateAttrColor(e,i,n,l,o){return i===2?(e|=50331648,e&=-16777216,e|=Rl.fromColorRGB([n,l,o])):i===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,i,n){let l=[0,0,-1,0,0,0],o=0,h=0;do{if(l[h+o]=e.params[i+h],e.hasSubParams(i+h)){let d=e.getSubParams(i+h),_=0;do l[1]===5&&(o=1),l[h+_+1+o]=d[_];while(++_<d.length&&_+h+1+o<l.length);break}if(l[1]===5&&h+o>=2||l[1]===2&&h+o>=5)break;l[1]&&(o=1)}while(++h+i<e.length&&h+o<l.length);for(let d=2;d<l.length;++d)l[d]===-1&&(l[d]=0);switch(l[0]){case 38:n.fg=this._updateAttrColor(n.fg,l[1],l[3],l[4],l[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,l[1],l[3],l[4],l[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,l[1],l[3],l[4],l[5])}return h}_processUnderline(e,i){i.extended=i.extended.clone(),(!~e||e>5)&&(e=1),i.extended.underlineStyle=e,i.fg|=268435456,e===0&&(i.fg&=-268435457),i.updateExtended()}_processSGR0(e){e.fg=it.fg,e.bg=it.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let i=e.length,n,l=this._curAttrData;for(let o=0;o<i;o++)n=e.params[o],n>=30&&n<=37?(l.fg&=-50331904,l.fg|=16777216|n-30):n>=40&&n<=47?(l.bg&=-50331904,l.bg|=16777216|n-40):n>=90&&n<=97?(l.fg&=-50331904,l.fg|=16777216|n-90|8):n>=100&&n<=107?(l.bg&=-50331904,l.bg|=16777216|n-100|8):n===0?this._processSGR0(l):n===1?l.fg|=134217728:n===3?l.bg|=67108864:n===4?(l.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,l)):n===5?l.fg|=536870912:n===7?l.fg|=67108864:n===8?l.fg|=1073741824:n===9?l.fg|=2147483648:n===2?l.bg|=134217728:n===21?this._processUnderline(2,l):n===22?(l.fg&=-134217729,l.bg&=-134217729):n===23?l.bg&=-67108865:n===24?(l.fg&=-268435457,this._processUnderline(0,l)):n===25?l.fg&=-536870913:n===27?l.fg&=-67108865:n===28?l.fg&=-1073741825:n===29?l.fg&=2147483647:n===39?(l.fg&=-67108864,l.fg|=it.fg&16777215):n===49?(l.bg&=-67108864,l.bg|=it.bg&16777215):n===38||n===48||n===58?o+=this._extractColor(e,o,l):n===53?l.bg|=1073741824:n===55?l.bg&=-1073741825:n===59?(l.extended=l.extended.clone(),l.extended.underlineColor=-1,l.updateExtended()):n===100?(l.fg&=-67108864,l.fg|=it.fg&16777215,l.bg&=-67108864,l.bg|=it.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${X.ESC}[0n`);break;case 6:let i=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${X.ESC}[${i};${n}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let i=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${X.ESC}[?${i};${n}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=it.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(e){let i=e.length===0?1:e.params[0];if(i===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(i){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let n=i%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(e){let i=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>i&&(this._activeBuffer.scrollTop=i-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Ap(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let i=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:i!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${X.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(i===0||i===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Tp&&this._windowTitleStack.shift()),(i===0||i===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Tp&&this._iconNameStack.shift());break;case 23:(i===0||i===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(i===0||i===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let i=[],n=e.split(";");for(;n.length>1;){let l=n.shift(),o=n.shift();if(/^\d+$/.exec(l)){let h=parseInt(l);if(Op(h))if(o==="?")i.push({type:0,index:h});else{let d=Rp(o);d&&i.push({type:1,index:h,color:d})}}}return i.length&&this._onColor.fire(i),!0}setHyperlink(e){let i=e.indexOf(";");if(i===-1)return!0;let n=e.slice(0,i).trim(),l=e.slice(i+1);return l?this._createHyperlink(n,l):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,i){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),l,o=n.findIndex(h=>h.startsWith("id="));return o!==-1&&(l=n[o].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:l,uri:i}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,i){let n=e.split(";");for(let l=0;l<n.length&&!(i>=this._specialColors.length);++l,++i)if(n[l]==="?")this._onColor.fire([{type:0,index:this._specialColors[i]}]);else{let o=Rp(n[l]);o&&this._onColor.fire([{type:1,index:this._specialColors[i],color:o}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let i=[],n=e.split(";");for(let l=0;l<n.length;++l)if(/^\d+$/.exec(n[l])){let o=parseInt(n[l]);Op(o)&&i.push({type:2,index:o})}return i.length&&this._onColor.fire(i),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,tr),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(y2[e[0]],ht[e[1]]||tr),!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){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=it.clone(),this._eraseAttrDataInternal=it.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new fi;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let i=0;i<this._bufferService.rows;++i){let n=this._activeBuffer.ybase+this._activeBuffer.y+i,l=this._activeBuffer.lines.get(n);l&&(l.fill(e),l.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,i){let n=d=>(this._coreService.triggerDataEvent(`${X.ESC}${d}${X.ESC}\\`),!0),l=this._bufferService.buffer,o=this._optionsService.rawOptions;return n(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${l.scrollTop+1};${l.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[o.cursorStyle]-(o.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,i){this._dirtyRowTracker.markRangeDirty(e,i)}},Ku=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,i){e>i&&(zp=e,e=i,i=zp),e<this.start&&(this.start=e),i>this.end&&(this.end=i)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Ku=$e([te(0,Ot)],Ku);function Op(e){return 0<=e&&e<256}var w2=5e7,Lp=12,C2=50,x2=class extends Se{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new Q),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,i){if(i!==void 0&&this._syncCalls>i){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let l=this._callbacks.shift();l&&l()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,i){if(this._pendingData>w2)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i)}_innerWrite(e=0,i=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let l=this._writeBuffer[this._bufferOffset],o=this._action(l,i);if(o){let d=_=>performance.now()-n>=Lp?setTimeout(()=>this._innerWrite(0,_)):this._innerWrite(n,_);o.catch(_=>(queueMicrotask(()=>{throw _}),Promise.resolve(!1))).then(d);return}let h=this._callbacks[this._bufferOffset];if(h&&h(),this._bufferOffset++,this._pendingData-=l.length,performance.now()-n>=Lp)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>C2&&(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()}},Vu=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let i=this._bufferService.buffer;if(e.id===void 0){let _=i.addMarker(i.ybase+i.y),v={data:e,id:this._nextId++,lines:[_]};return _.onDispose(()=>this._removeMarkerFromLink(v,_)),this._dataByLinkId.set(v.id,v),v.id}let n=e,l=this._getEntryIdKey(n),o=this._entriesWithId.get(l);if(o)return this.addLineToLink(o.id,i.ybase+i.y),o.id;let h=i.addMarker(i.ybase+i.y),d={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[h]};return h.onDispose(()=>this._removeMarkerFromLink(d,h)),this._entriesWithId.set(d.key,d),this._dataByLinkId.set(d.id,d),d.id}addLineToLink(e,i){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(l=>l.line!==i)){let l=this._bufferService.buffer.addMarker(i);n.lines.push(l),l.onDispose(()=>this._removeMarkerFromLink(n,l))}}getLinkData(e){var i;return(i=this._dataByLinkId.get(e))==null?void 0:i.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,i){let n=e.lines.indexOf(i);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Vu=$e([te(0,Ot)],Vu);var Np=!1,E2=class extends Se{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new on),this._onBinary=this._register(new Q),this.onBinary=this._onBinary.event,this._onData=this._register(new Q),this.onData=this._onData.event,this._onLineFeed=this._register(new Q),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new Q),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new Q),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new Q),this._instantiationService=new FC,this.optionsService=this._register(new n2(e)),this._instantiationService.setService(Lt,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(ju)),this._instantiationService.setService(Ot,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Pu)),this._instantiationService.setService(km,this._logService),this.coreService=this._register(this._instantiationService.createInstance(qu)),this._instantiationService.setService(ur,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Wu)),this._instantiationService.setService(Em,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(ir)),this._instantiationService.setService(Vb,this.unicodeService),this._charsetService=this._instantiationService.createInstance(h2),this._instantiationService.setService(Kb,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Vu),this._instantiationService.setService(Mm,this._oscLinkService),this._inputHandler=this._register(new b2(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(xt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(xt.forward(this._bufferService.onResize,this._onResize)),this._register(xt.forward(this.coreService.onData,this._onData)),this._register(xt.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new x2((i,n)=>this._inputHandler.parse(i,n))),this._register(xt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new Q),this._onScroll.event(e=>{var i;(i=this._onScrollApi)==null||i.fire(e.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(e){for(let i in e)this.optionsService.options[i]=e[i]}write(e,i){this._writeBuffer.write(e,i)}writeSync(e,i){this._logService.logLevel<=3&&!Np&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Np=!0),this._writeBuffer.writeSync(e,i)}input(e,i=!0){this.coreService.triggerDataEvent(e,i)}resize(e,i){isNaN(e)||isNaN(i)||(e=Math.max(e,n0),i=Math.max(i,l0),this._bufferService.resize(e,i))}scroll(e,i=!1){this._bufferService.scroll(e,i)}scrollLines(e,i){this._bufferService.scrollLines(e,i)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}registerEscHandler(e,i){return this._inputHandler.registerEscHandler(e,i)}registerDcsHandler(e,i){return this._inputHandler.registerDcsHandler(e,i)}registerCsiHandler(e,i){return this._inputHandler.registerCsiHandler(e,i)}registerOscHandler(e,i){return this._inputHandler.registerOscHandler(e,i)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,i=this.optionsService.rawOptions.windowsPty;i&&i.buildNumber!==void 0&&i.buildNumber!==void 0?e=i.backend==="conpty"&&i.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(Mp.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(Mp(this._bufferService),!1))),this._windowsWrappingHeuristics.value=qe(()=>{for(let i of e)i.dispose()})}}},k2={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:["'",'"']};function M2(e,i,n,l){var d;let o={type:0,cancel:!1,key:void 0},h=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?i?o.key=X.ESC+"OA":o.key=X.ESC+"[A":e.key==="UIKeyInputLeftArrow"?i?o.key=X.ESC+"OD":o.key=X.ESC+"[D":e.key==="UIKeyInputRightArrow"?i?o.key=X.ESC+"OC":o.key=X.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(i?o.key=X.ESC+"OB":o.key=X.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":X.DEL,e.altKey&&(o.key=X.ESC+o.key);break;case 9:if(e.shiftKey){o.key=X.ESC+"[Z";break}o.key=X.HT,o.cancel=!0;break;case 13:o.key=e.altKey?X.ESC+X.CR:X.CR,o.cancel=!0;break;case 27:o.key=X.ESC,e.altKey&&(o.key=X.ESC+X.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;h?o.key=X.ESC+"[1;"+(h+1)+"D":i?o.key=X.ESC+"OD":o.key=X.ESC+"[D";break;case 39:if(e.metaKey)break;h?o.key=X.ESC+"[1;"+(h+1)+"C":i?o.key=X.ESC+"OC":o.key=X.ESC+"[C";break;case 38:if(e.metaKey)break;h?o.key=X.ESC+"[1;"+(h+1)+"A":i?o.key=X.ESC+"OA":o.key=X.ESC+"[A";break;case 40:if(e.metaKey)break;h?o.key=X.ESC+"[1;"+(h+1)+"B":i?o.key=X.ESC+"OB":o.key=X.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=X.ESC+"[2~");break;case 46:h?o.key=X.ESC+"[3;"+(h+1)+"~":o.key=X.ESC+"[3~";break;case 36:h?o.key=X.ESC+"[1;"+(h+1)+"H":i?o.key=X.ESC+"OH":o.key=X.ESC+"[H";break;case 35:h?o.key=X.ESC+"[1;"+(h+1)+"F":i?o.key=X.ESC+"OF":o.key=X.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=X.ESC+"[5;"+(h+1)+"~":o.key=X.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=X.ESC+"[6;"+(h+1)+"~":o.key=X.ESC+"[6~";break;case 112:h?o.key=X.ESC+"[1;"+(h+1)+"P":o.key=X.ESC+"OP";break;case 113:h?o.key=X.ESC+"[1;"+(h+1)+"Q":o.key=X.ESC+"OQ";break;case 114:h?o.key=X.ESC+"[1;"+(h+1)+"R":o.key=X.ESC+"OR";break;case 115:h?o.key=X.ESC+"[1;"+(h+1)+"S":o.key=X.ESC+"OS";break;case 116:h?o.key=X.ESC+"[15;"+(h+1)+"~":o.key=X.ESC+"[15~";break;case 117:h?o.key=X.ESC+"[17;"+(h+1)+"~":o.key=X.ESC+"[17~";break;case 118:h?o.key=X.ESC+"[18;"+(h+1)+"~":o.key=X.ESC+"[18~";break;case 119:h?o.key=X.ESC+"[19;"+(h+1)+"~":o.key=X.ESC+"[19~";break;case 120:h?o.key=X.ESC+"[20;"+(h+1)+"~":o.key=X.ESC+"[20~";break;case 121:h?o.key=X.ESC+"[21;"+(h+1)+"~":o.key=X.ESC+"[21~";break;case 122:h?o.key=X.ESC+"[23;"+(h+1)+"~":o.key=X.ESC+"[23~";break;case 123:h?o.key=X.ESC+"[24;"+(h+1)+"~":o.key=X.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=X.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=X.DEL:e.keyCode===219?o.key=X.ESC:e.keyCode===220?o.key=X.FS:e.keyCode===221&&(o.key=X.GS);else if((!n||l)&&e.altKey&&!e.metaKey){let _=(d=k2[e.keyCode])==null?void 0:d[e.shiftKey?1:0];if(_)o.key=X.ESC+_;else if(e.keyCode>=65&&e.keyCode<=90){let v=e.ctrlKey?e.keyCode-64:e.keyCode+32,f=String.fromCharCode(v);e.shiftKey&&(f=f.toUpperCase()),o.key=X.ESC+f}else if(e.keyCode===32)o.key=X.ESC+(e.ctrlKey?X.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let v=e.code.slice(3,4);e.shiftKey||(v=v.toLowerCase()),o.key=X.ESC+v,o.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(o.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(o.key=X.US),e.key==="@"&&(o.key=X.NUL));break}return o}var Ze=0,D2=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new So,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new So,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((o,h)=>this._getKey(o)-this._getKey(h)),i=0,n=0,l=new Array(this._array.length+this._insertedValues.length);for(let o=0;o<l.length;o++)n>=this._array.length||this._getKey(e[i])<=this._getKey(this._array[n])?(l[o]=e[i],i++):l[o]=this._array[n++];this._array=l,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let i=this._getKey(e);if(i===void 0||(Ze=this._search(i),Ze===-1)||this._getKey(this._array[Ze])!==i)return!1;do if(this._array[Ze]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Ze),!0;while(++Ze<this._array.length&&this._getKey(this._array[Ze])===i);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((o,h)=>o-h),i=0,n=new Array(this._array.length-e.length),l=0;for(let o=0;o<this._array.length;o++)e[i]===o?i++:n[l++]=this._array[o];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Ze=this._search(e),!(Ze<0||Ze>=this._array.length)&&this._getKey(this._array[Ze])===e))do yield this._array[Ze];while(++Ze<this._array.length&&this._getKey(this._array[Ze])===e)}forEachByKey(e,i){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Ze=this._search(e),!(Ze<0||Ze>=this._array.length)&&this._getKey(this._array[Ze])===e))do i(this._array[Ze]);while(++Ze<this._array.length&&this._getKey(this._array[Ze])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let i=0,n=this._array.length-1;for(;n>=i;){let l=i+n>>1,o=this._getKey(this._array[l]);if(o>e)n=l-1;else if(o<e)i=l+1;else{for(;l>0&&this._getKey(this._array[l-1])===e;)l--;return l}}return i}},iu=0,Hp=0,R2=class extends Se{constructor(){super(),this._decorations=new D2(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new Q),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new Q),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(qe(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let i=new T2(e);if(i){let n=i.marker.onDispose(()=>i.dispose()),l=i.onDispose(()=>{l.dispose(),i&&(this._decorations.delete(i)&&this._onDecorationRemoved.fire(i),n.dispose())});this._decorations.insert(i),this._onDecorationRegistered.fire(i)}return i}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,i,n){let l=0,o=0;for(let h of this._decorations.getKeyIterator(i))l=h.options.x??0,o=l+(h.options.width??1),e>=l&&e<o&&(!n||(h.options.layer??"bottom")===n)&&(yield h)}forEachDecorationAtCell(e,i,n,l){this._decorations.forEachByKey(i,o=>{iu=o.options.x??0,Hp=iu+(o.options.width??1),e>=iu&&e<Hp&&(!n||(o.options.layer??"bottom")===n)&&l(o)})}},T2=class extends Bs{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new Q),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new Q),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Ke.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Ke.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},A2=1e3,B2=class{constructor(e,i=A2){this._renderCallback=e,this._debounceThresholdMS=i,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i;let l=performance.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){let o=l-this._lastRefreshMs,h=this._debounceThresholdMS-o;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},h)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i)}},Up=20,yo=class extends Se{constructor(e,i,n,l){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=l,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let o=this._coreBrowserService.mainDocument;this._accessibilityContainer=o.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=o.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let h=0;h<this._terminal.rows;h++)this._rowElements[h]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[h]);if(this._topBoundaryFocusListener=h=>this._handleBoundaryFocus(h,0),this._bottomBoundaryFocusListener=h=>this._handleBoundaryFocus(h,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=o.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new B2(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(h=>this._handleResize(h.rows))),this._register(this._terminal.onRender(h=>this._refreshRows(h.start,h.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(h=>this._handleChar(h))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
198
+ `))),this._register(this._terminal.onA11yTab(h=>this._handleTab(h))),this._register(this._terminal.onKey(h=>this._handleKey(h.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(fe(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(qe(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let i=0;i<e;i++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Up+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
199
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===Up+1&&(this._liveRegion.textContent+=uu.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,i){this._liveRegionDebouncer.refresh(e,i,this._terminal.rows)}_renderRows(e,i){let n=this._terminal.buffer,l=n.lines.length.toString();for(let o=e;o<=i;o++){let h=n.lines.get(n.ydisp+o),d=[],_=(h==null?void 0:h.translateToString(!0,void 0,void 0,d))||"",v=(n.ydisp+o+1).toString(),f=this._rowElements[o];f&&(_.length===0?(f.textContent=" ",this._rowColumns.set(f,[0,1])):(f.textContent=_,this._rowColumns.set(f,d)),f.setAttribute("aria-posinset",v),f.setAttribute("aria-setsize",l),this._alignRowWidth(f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,i){let n=e.target,l=this._rowElements[i===0?1:this._rowElements.length-2],o=n.getAttribute("aria-posinset"),h=i===0?"1":`${this._terminal.buffer.lines.length}`;if(o===h||e.relatedTarget!==l)return;let d,_;if(i===0?(d=n,_=this._rowElements.pop(),this._rowContainer.removeChild(_)):(d=this._rowElements.shift(),_=n,this._rowContainer.removeChild(d)),d.removeEventListener("focus",this._topBoundaryFocusListener),_.removeEventListener("focus",this._bottomBoundaryFocusListener),i===0){let v=this._createAccessibilityTreeNode();this._rowElements.unshift(v),this._rowContainer.insertAdjacentElement("afterbegin",v)}else{let v=this._createAccessibilityTreeNode();this._rowElements.push(v),this._rowContainer.appendChild(v)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(i===0?-1:1),this._rowElements[i===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var _;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let i={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((i.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||i.node===n.node&&i.offset>n.offset)&&([i,n]=[n,i]),i.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i.node))return;let l=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(l)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:l,offset:((_=l.textContent)==null?void 0:_.length)??0}),!this._rowContainer.contains(n.node))return;let o=({node:v,offset:f})=>{let p=v instanceof Text?v.parentNode:v,S=parseInt(p==null?void 0:p.getAttribute("aria-posinset"),10)-1;if(isNaN(S))return console.warn("row is invalid. Race condition?"),null;let y=this._rowColumns.get(p);if(!y)return console.warn("columns is null. Race condition?"),null;let E=f<y.length?y[f]:y.slice(-1)[0]+1;return E>=this._terminal.cols&&(++S,E=0),{row:S,column:E}},h=o(i),d=o(n);if(!(!h||!d)){if(h.row>d.row||h.row===d.row&&h.column>=d.column)throw new Error("invalid range");this._terminal.select(h.column,h.row,(d.row-h.row)*this._terminal.cols-h.column+d.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let i=this._rowContainer.children.length;i<this._terminal.rows;i++)this._rowElements[i]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[i]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var o,h;e.style.transform="";let i=e.getBoundingClientRect().width,n=(h=(o=this._rowColumns.get(e))==null?void 0:o.slice(-1))==null?void 0:h[0];if(!n)return;let l=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${l/i})`}};yo=$e([te(1,id),te(2,Qi),te(3,Ji)],yo);var Xu=class extends Se{constructor(e,i,n,l,o){super(),this._element=e,this._mouseService=i,this._renderService=n,this._bufferService=l,this._linkProviderService=o,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new Q),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new Q),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(qe(()=>{var h;ar(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(h=this._activeProviderReplies)==null||h.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(fe(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(fe(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(fe(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(fe(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let i=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;let n=e.composedPath();for(let l=0;l<n.length;l++){let o=n[l];if(o.classList.contains("xterm"))break;if(o.classList.contains("xterm-hover"))return}(!this._lastBufferCell||i.x!==this._lastBufferCell.x||i.y!==this._lastBufferCell.y)&&(this._handleHover(i),this._lastBufferCell=i)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,i){var l,o;(!this._activeProviderReplies||!i)&&((l=this._activeProviderReplies)==null||l.forEach(h=>{h==null||h.forEach(d=>{d.link.dispose&&d.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[h,d]of this._linkProviderService.linkProviders.entries())i?(o=this._activeProviderReplies)!=null&&o.get(h)&&(n=this._checkLinkProviderResult(h,e,n)):d.provideLinks(e.y,_=>{var f,p;if(this._isMouseOut)return;let v=_==null?void 0:_.map(S=>({link:S}));(f=this._activeProviderReplies)==null||f.set(h,v),n=this._checkLinkProviderResult(h,e,n),((p=this._activeProviderReplies)==null?void 0:p.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,i){let n=new Set;for(let l=0;l<i.size;l++){let o=i.get(l);if(o)for(let h=0;h<o.length;h++){let d=o[h],_=d.link.range.start.y<e?0:d.link.range.start.x,v=d.link.range.end.y>e?this._bufferService.cols:d.link.range.end.x;for(let f=_;f<=v;f++){if(n.has(f)){o.splice(h--,1);break}n.add(f)}}}}_checkLinkProviderResult(e,i,n){var h;if(!this._activeProviderReplies)return n;let l=this._activeProviderReplies.get(e),o=!1;for(let d=0;d<e;d++)(!this._activeProviderReplies.has(d)||this._activeProviderReplies.get(d))&&(o=!0);if(!o&&l){let d=l.find(_=>this._linkAtPosition(_.link,i));d&&(n=!0,this._handleNewLink(d))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let d=0;d<this._activeProviderReplies.size;d++){let _=(h=this._activeProviderReplies.get(d))==null?void 0:h.find(v=>this._linkAtPosition(v.link,i));if(_){n=!0,this._handleNewLink(_);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let i=this._positionFromMouseEvent(e,this._element,this._mouseService);i&&this._mouseDownLink&&z2(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,i){!this._currentLink||!this._lastMouseEvent||(!e||!i||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,ar(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(e.link,i)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var n,l;return(l=(n=this._currentLink)==null?void 0:n.state)==null?void 0:l.decorations.pointerCursor},set:n=>{var l;(l=this._currentLink)!=null&&l.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,l;return(l=(n=this._currentLink)==null?void 0:n.state)==null?void 0:l.decorations.underline},set:n=>{var l,o,h;(l=this._currentLink)!=null&&l.state&&((h=(o=this._currentLink)==null?void 0:o.state)==null?void 0:h.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let l=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(l,o),this._lastMouseEvent)){let h=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);h&&this._askForLink(h,!1)}})))}_linkHover(e,i,n){var l;(l=this._currentLink)!=null&&l.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(n,i.text)}_fireUnderlineEvent(e,i){let n=e.range,l=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-l-1,n.end.x,n.end.y-l-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,i,n){var l;(l=this._currentLink)!=null&&l.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(n,i.text)}_linkAtPosition(e,i){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,l=e.range.end.y*this._bufferService.cols+e.range.end.x,o=i.y*this._bufferService.cols+i.x;return n<=o&&o<=l}_positionFromMouseEvent(e,i,n){let l=n.getCoords(e,i,this._bufferService.cols,this._bufferService.rows);if(l)return{x:l[0],y:l[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,i,n,l,o){return{x1:e,y1:i,x2:n,y2:l,cols:this._bufferService.cols,fg:o}}};Xu=$e([te(1,sd),te(2,Ji),te(3,Ot),te(4,Rm)],Xu);function z2(e,i){return e.text===i.text&&e.range.start.x===i.range.start.x&&e.range.start.y===i.range.start.y&&e.range.end.x===i.range.end.x&&e.range.end.y===i.range.end.y}var O2=class extends E2{constructor(e={}){super(e),this._linkifier=this._register(new on),this.browser=$m,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new on),this._onCursorMove=this._register(new Q),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new Q),this.onKey=this._onKey.event,this._onRender=this._register(new Q),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new Q),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new Q),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new Q),this.onBell=this._onBell.event,this._onFocus=this._register(new Q),this._onBlur=this._register(new Q),this._onA11yCharEmitter=this._register(new Q),this._onA11yTabEmitter=this._register(new Q),this._onWillOpen=this._register(new Q),this._setup(),this._decorationService=this._instantiationService.createInstance(R2),this._instantiationService.setService(Tl,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(CC),this._instantiationService.setService(Rm,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(fu)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(i=>this.refresh((i==null?void 0:i.start)??0,(i==null?void 0:i.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(i=>this._reportWindowsOptions(i))),this._register(this._inputHandler.onColor(i=>this._handleColorEvent(i))),this._register(xt.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(xt.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(xt.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(xt.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(i=>this._afterResize(i.cols,i.rows))),this._register(qe(()=>{var i,n;this._customKeyEventHandler=void 0,(n=(i=this.element)==null?void 0:i.parentNode)==null||n.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_handleColorEvent(e){if(this._themeService)for(let i of e){let n,l="";switch(i.index){case 256:n="foreground",l="10";break;case 257:n="background",l="11";break;case 258:n="cursor",l="12";break;default:n="ansi",l="4;"+i.index}switch(i.type){case 0:let o=Pe.toColorRGB(n==="ansi"?this._themeService.colors.ansi[i.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${X.ESC}]${l};${S2(o)}${Xm.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(h=>h.ansi[i.index]=rt.toColor(...i.color));else{let h=n;this._themeService.modifyColors(d=>d[h]=rt.toColor(...i.color))}break;case 2:this._themeService.restoreColor(i.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(yo,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,i=this.buffer.lines.get(e);if(!i)return;let n=Math.min(this.buffer.x,this.cols-1),l=this._renderService.dimensions.css.cell.height,o=i.getWidth(n),h=this._renderService.dimensions.css.cell.width*o,d=this.buffer.y*this._renderService.dimensions.css.cell.height,_=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=_+"px",this.textarea.style.top=d+"px",this.textarea.style.width=h+"px",this.textarea.style.height=l+"px",this.textarea.style.lineHeight=l+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(fe(this.element,"copy",i=>{this.hasSelection()&&Ub(i,this._selectionService)}));let e=i=>Pb(i,this.textarea,this.coreService,this.optionsService);this._register(fe(this.textarea,"paste",e)),this._register(fe(this.element,"paste",e)),Fm?this._register(fe(this.element,"mousedown",i=>{i.button===2&&$g(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(fe(this.element,"contextmenu",i=>{$g(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),ud&&this._register(fe(this.element,"auxclick",i=>{i.button===1&&ym(i,this.textarea,this.screenElement)}))}_bindKeys(){this._register(fe(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(fe(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(fe(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(fe(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(fe(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(fe(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(fe(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var o;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((o=this.element)==null?void 0:o.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.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"),e.appendChild(this.element);let i=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(fe(this.screenElement,"mousemove",h=>this.updateCursorStyle(h))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",hu.get()),Qm||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._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(bC,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Qi,this._coreBrowserService),this._register(fe(this.textarea,"focus",h=>this._handleTextAreaFocus(h))),this._register(fe(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Ou,this._document,this._helperContainer),this._instantiationService.setService(Co,this._charSizeService),this._themeService=this._instantiationService.createInstance(Uu),this._instantiationService.setService(cn,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(po),this._instantiationService.setService(Dm,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Nu,this.rows,this.screenElement)),this._instantiationService.setService(Ji,this._renderService),this._register(this._renderService.onRenderedViewportChange(h=>this._onRender.fire(h))),this.onResize(h=>this._renderService.resize(h.cols,h.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Au,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Lu),this._instantiationService.setService(sd,this._mouseService);let l=this._linkifier.value=this._register(this._instantiationService.createInstance(Xu,this.screenElement));this.element.appendChild(i);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(Ru,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(h=>{super.scrollLines(h,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Hu,this.element,this.screenElement,l)),this._instantiationService.setService(Gb,this._selectionService),this._register(this._selectionService.onRequestScrollLines(h=>this.scrollLines(h.amount,h.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(h=>this._renderService.handleSelectionChanged(h.start,h.end,h.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(h=>{this.textarea.value=h,this.textarea.focus(),this.textarea.select()})),this._register(xt.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var h;this._selectionService.refresh(),(h=this._viewport)==null||h.queueSync()})),this._register(this._instantiationService.createInstance(Tu,this.screenElement)),this._register(fe(this.element,"mousedown",h=>this._selectionService.handleMouseDown(h))),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(yo,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",h=>this._handleScreenReaderModeOptionChange(h))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(go,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",h=>{!this._overviewRulerRenderer&&h&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(go,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(zu,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function n(h){var f,p,S,y,E;let d=e._mouseService.getMouseReportCoords(h,e.screenElement);if(!d)return!1;let _,v;switch(h.overrideType||h.type){case"mousemove":v=32,h.buttons===void 0?(_=3,h.button!==void 0&&(_=h.button<3?h.button:3)):_=h.buttons&1?0:h.buttons&4?1:h.buttons&2?2:3;break;case"mouseup":v=0,_=h.button<3?h.button:3;break;case"mousedown":v=1,_=h.button<3?h.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(h)===!1)return!1;let C=h.deltaY;if(C===0||e.coreMouseService.consumeWheelEvent(h,(y=(S=(p=(f=e._renderService)==null?void 0:f.dimensions)==null?void 0:p.device)==null?void 0:S.cell)==null?void 0:y.height,(E=e._coreBrowserService)==null?void 0:E.dpr)===0)return!1;v=C<0?0:1,_=4;break;default:return!1}return v===void 0||_===void 0||_>4?!1:e.coreMouseService.triggerMouseEvent({col:d.col,row:d.row,x:d.x,y:d.y,button:_,action:v,ctrl:h.ctrlKey,alt:h.altKey,shift:h.shiftKey})}let l={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o={mouseup:h=>(n(h),h.buttons||(this._document.removeEventListener("mouseup",l.mouseup),l.mousedrag&&this._document.removeEventListener("mousemove",l.mousedrag)),this.cancel(h)),wheel:h=>(n(h),this.cancel(h,!0)),mousedrag:h=>{h.buttons&&n(h)},mousemove:h=>{h.buttons||n(h)}};this._register(this.coreMouseService.onProtocolChange(h=>{h?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(h)),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()),h&8?l.mousemove||(i.addEventListener("mousemove",o.mousemove),l.mousemove=o.mousemove):(i.removeEventListener("mousemove",l.mousemove),l.mousemove=null),h&16?l.wheel||(i.addEventListener("wheel",o.wheel,{passive:!1}),l.wheel=o.wheel):(i.removeEventListener("wheel",l.wheel),l.wheel=null),h&2?l.mouseup||(l.mouseup=o.mouseup):(this._document.removeEventListener("mouseup",l.mouseup),l.mouseup=null),h&4?l.mousedrag||(l.mousedrag=o.mousedrag):(this._document.removeEventListener("mousemove",l.mousedrag),l.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(fe(i,"mousedown",h=>{if(h.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(h)))return n(h),l.mouseup&&this._document.addEventListener("mouseup",l.mouseup),l.mousedrag&&this._document.addEventListener("mousemove",l.mousedrag),this.cancel(h)})),this._register(fe(i,"wheel",h=>{var d,_,v,f,p;if(!l.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(h)===!1)return!1;if(!this.buffer.hasScrollback){if(h.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(h,(f=(v=(_=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:_.device)==null?void 0:v.cell)==null?void 0:f.height,(p=e._coreBrowserService)==null?void 0:p.dpr)===0)return this.cancel(h,!0);let S=X.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(h.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(S,!0),this.cancel(h,!0)}}},{passive:!1}))}refresh(e,i){var n;(n=this._renderService)==null||n.refreshRows(e,i)}updateCursorStyle(e){var i;(i=this._selectionService)!=null&&i.shouldColumnSelect(e)?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(e,i){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,i),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}paste(e){Sm(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let i=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),i}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,i,n){this._selectionService.setSelection(e,i,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,i){var n;(n=this._selectionService)==null||n.selectLines(e,i)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let i=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!i&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!i&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=M2(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let l=this.rows-1;return this.scrollLines(n.type===2?-l:l),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===X.ETX||n.key===X.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,i){let n=e.isMac&&!this.options.macOptionIsMeta&&i.altKey&&!i.ctrlKey&&!i.metaKey||e.isWindows&&i.altKey&&i.ctrlKey&&!i.metaKey||e.isWindows&&i.getModifierState("AltGraph");return i.type==="keypress"?n:n&&(!i.keyCode||i.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(L2(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let i;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)i=e.charCode;else if(e.which===null||e.which===void 0)i=e.keyCode;else if(e.which!==0&&e.charCode!==0)i=e.which;else return!1;return!i||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(i=String.fromCharCode(i),this._onKey.fire({key:i,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let i=e.data;return this.coreService.triggerDataEvent(i,!0),this.cancel(e),!0}return!1}resize(e,i){if(e===this.cols&&i===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,i)}_afterResize(e,i){var n;(n=this._charSizeService)==null||n.measure()}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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(it));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var i;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(i=this._selectionService)==null||i.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(X.ESC+"[I"):this.coreService.triggerDataEvent(X.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let i=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.ESC}[4;${n};${i}t`);break;case 1:let l=this._renderService.dimensions.css.cell.width.toFixed(0),o=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.ESC}[6;${o};${l}t`);break}}cancel(e,i){if(!(!this.options.cancelEvents&&!i))return e.preventDefault(),e.stopPropagation(),!1}};function L2(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var N2=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,i){let n={instance:i,dispose:i.dispose,isDisposed:!1};this._addons.push(n),i.dispose=()=>this._wrappedAddonDispose(n),i.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let i=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){i=n;break}if(i===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(i,1)}},H2=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,i){if(!(e<0||e>=this._line.length))return i?(this._line.loadCell(e,i),i):this._line.loadCell(e,new fi)}translateToString(e,i,n){return this._line.translateToString(e,i,n)}},Pp=class{constructor(e,i){this._buffer=e,this.type=i}init(e){return this._buffer=e,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(e){let i=this._buffer.lines.get(e);if(i)return new H2(i)}getNullCell(){return new fi}},U2=class extends Se{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new Q),this.onBufferChange=this._onBufferChange.event,this._normal=new Pp(this._core.buffers.normal,"normal"),this._alternate=new Pp(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)}},P2=class{constructor(e){this._core=e}registerCsiHandler(e,i){return this._core.registerCsiHandler(e,n=>i(n.toArray()))}addCsiHandler(e,i){return this.registerCsiHandler(e,i)}registerDcsHandler(e,i){return this._core.registerDcsHandler(e,(n,l)=>i(n,l.toArray()))}addDcsHandler(e,i){return this.registerDcsHandler(e,i)}registerEscHandler(e,i){return this._core.registerEscHandler(e,i)}addEscHandler(e,i){return this.registerEscHandler(e,i)}registerOscHandler(e,i){return this._core.registerOscHandler(e,i)}addOscHandler(e,i){return this.registerOscHandler(e,i)}},j2=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},q2=["cols","rows"],ki=0,W2=class extends Se{constructor(e){super(),this._core=this._register(new O2(e)),this._addonManager=this._register(new N2),this._publicOptions={...this._core.options};let i=l=>this._core.options[l],n=(l,o)=>{this._checkReadonlyOptions(l),this._core.options[l]=o};for(let l in this._core.options){let o={get:i.bind(this,l),set:n.bind(this,l)};Object.defineProperty(this._publicOptions,l,o)}}_checkReadonlyOptions(e){if(q2.includes(e))throw new Error(`Option "${e}" 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 P2(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new j2(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 U2(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let i in e)this._publicOptions[i]=e[i]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,i=!0){this._core.input(e,i)}resize(e,i){this._verifyIntegers(e,i),this._core.resize(e,i)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,i,n){this._verifyIntegers(e,i,n),this._core.select(e,i,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,i){this._verifyIntegers(e,i),this._core.selectLines(e,i)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,i){this._core.write(e,i)}writeln(e,i){this._core.write(e),this._core.write(`\r
200
+ `,i)}paste(e){this._core.paste(e)}refresh(e,i){this._verifyIntegers(e,i),this._core.refresh(e,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return hu.get()},set promptLabel(e){hu.set(e)},get tooMuchOutput(){return uu.get()},set tooMuchOutput(e){uu.set(e)}}}_verifyIntegers(...e){for(ki of e)if(ki===1/0||isNaN(ki)||ki%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(ki of e)if(ki&&(ki===1/0||isNaN(ki)||ki%1!==0||ki<0))throw new Error("This API only accepts positive integers")}};/**
201
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
202
+ * @license MIT
203
+ *
204
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
205
+ * @license MIT
206
+ *
207
+ * Originally forked from (with the author's permission):
208
+ * Fabrice Bellard's javascript vt100 for jslinux:
209
+ * http://bellard.org/jslinux/
210
+ * Copyright (c) 2011 Fabrice Bellard
211
+ */var Y2=2,K2=1,V2=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let i=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var S;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let i=this._terminal.options.scrollback===0?0:((S=this._terminal.options.overviewRuler)==null?void 0:S.width)||14,n=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(n.getPropertyValue("height")),o=Math.max(0,parseInt(n.getPropertyValue("width"))),h=window.getComputedStyle(this._terminal.element),d={top:parseInt(h.getPropertyValue("padding-top")),bottom:parseInt(h.getPropertyValue("padding-bottom")),right:parseInt(h.getPropertyValue("padding-right")),left:parseInt(h.getPropertyValue("padding-left"))},_=d.top+d.bottom,v=d.right+d.left,f=l-_,p=o-v-i;return{cols:Math.max(Y2,Math.floor(p/e.css.cell.width)),rows:Math.max(K2,Math.floor(f/e.css.cell.height))}}};/**
212
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
213
+ * @license MIT
214
+ *
215
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
216
+ * @license MIT
217
+ *
218
+ * Originally forked from (with the author's permission):
219
+ * Fabrice Bellard's javascript vt100 for jslinux:
220
+ * http://bellard.org/jslinux/
221
+ * Copyright (c) 2011 Fabrice Bellard
222
+ */var X2=class{constructor(e,i,n,l={}){this._terminal=e,this._regex=i,this._handler=n,this._options=l}provideLinks(e,i){let n=$2.computeLink(e,this._regex,this._terminal,this._handler);i(this._addCallbacks(n))}_addCallbacks(e){return e.map(i=>(i.leave=this._options.leave,i.hover=(n,l)=>{if(this._options.hover){let{range:o}=i;this._options.hover(n,l,o)}},i))}};function G2(e){try{let i=new URL(e),n=i.password&&i.username?`${i.protocol}//${i.username}:${i.password}@${i.host}`:i.username?`${i.protocol}//${i.username}@${i.host}`:`${i.protocol}//${i.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var $2=class uo{static computeLink(i,n,l,o){let h=new RegExp(n.source,(n.flags||"")+"g"),[d,_]=uo._getWindowedLineStrings(i-1,l),v=d.join(""),f,p=[];for(;f=h.exec(v);){let S=f[0];if(!G2(S))continue;let[y,E]=uo._mapStrIdx(l,_,0,f.index),[C,x]=uo._mapStrIdx(l,y,E,S.length);if(y===-1||E===-1||C===-1||x===-1)continue;let z={start:{x:E+1,y:y+1},end:{x,y:C+1}};p.push({range:z,text:S,activate:o})}return p}static _getWindowedLineStrings(i,n){let l,o=i,h=i,d=0,_="",v=[];if(l=n.buffer.active.getLine(i)){let f=l.translateToString(!0);if(l.isWrapped&&f[0]!==" "){for(d=0;(l=n.buffer.active.getLine(--o))&&d<2048&&(_=l.translateToString(!0),d+=_.length,v.push(_),!(!l.isWrapped||_.indexOf(" ")!==-1)););v.reverse()}for(v.push(f),d=0;(l=n.buffer.active.getLine(++h))&&l.isWrapped&&d<2048&&(_=l.translateToString(!0),d+=_.length,v.push(_),_.indexOf(" ")===-1););}return[v,o]}static _mapStrIdx(i,n,l,o){let h=i.buffer.active,d=h.getNullCell(),_=l;for(;o;){let v=h.getLine(n);if(!v)return[-1,-1];for(let f=_;f<v.length;++f){v.getCell(f,d);let p=d.getChars();if(d.getWidth()&&(o-=p.length||1,f===v.length-1&&p==="")){let S=h.getLine(n+1);S&&S.isWrapped&&(S.getCell(0,d),d.getWidth()===2&&(o+=1))}if(o<0)return[n,f]}n++,_=0}return[n,_]}},F2=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function I2(e,i){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}var Z2=class{constructor(e=I2,i={}){this._handler=e,this._options=i}activate(e){this._terminal=e;let i=this._options,n=i.urlRegex||F2;this._linkProvider=this._terminal.registerLinkProvider(new X2(this._terminal,n,this._handler,i))}dispose(){var e;(e=this._linkProvider)==null||e.dispose()}};let Dt=null;const tn=bo((e,i)=>({connected:!1,connectedSession:null,onMessage:null,connect:(n,l,o)=>{Dt&&(Dt.close(),Dt=null);const h=location.protocol==="https:"?"wss:":"ws:",d=l&&o?`?cols=${l}&rows=${o}`:"",_=`${h}//${location.host}/ws/terminal/${encodeURIComponent(n)}${d}`,v=new WebSocket(_);Dt=v,v.binaryType="arraybuffer",v.onopen=()=>{e({connected:!0,connectedSession:n})},v.onmessage=f=>{const p=i().onMessage;if(p)if(f.data instanceof ArrayBuffer)p(f.data);else try{const S=JSON.parse(f.data);S.type==="replay"?p(S.data):S.type==="error"&&console.error("[ws]",S.message)}catch{p(f.data)}},v.onclose=()=>{e({connected:!1,connectedSession:null}),Dt=null},v.onerror=()=>{v.close()}},disconnect:()=>{Dt&&(Dt.close(),Dt=null),e({connected:!1,connectedSession:null})},send:n=>{(Dt==null?void 0:Dt.readyState)===WebSocket.OPEN&&Dt.send(n)},resize:(n,l)=>{(Dt==null?void 0:Dt.readyState)===WebSocket.OPEN&&Dt.send(JSON.stringify({type:"resize",cols:n,rows:l}))},setOnMessage:n=>{e({onMessage:n})}}));function so(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function Q2(e,i){const n=le.useRef(null),l=le.useRef(null);le.useEffect(()=>{const o=i.current;if(!o)return;const h=new W2({fontFamily:so("--font-mono")||"'JetBrains Mono', monospace",fontSize:14,theme:{background:so("--color-terminal-bg")||"#0D1117",foreground:so("--color-terminal-text")||"#E6EDF3",cursor:so("--color-terminal-text")||"#E6EDF3",selectionBackground:"rgba(91,107,255,0.3)"},cursorBlink:!0,allowProposedApi:!0}),d=new V2;h.loadAddon(d),h.loadAddon(new Z2),h.open(o),d.fit(),h.focus(),o.addEventListener("click",()=>{h.hasSelection()||h.focus()}),n.current=h,l.current=d,tn.getState().setOnMessage(y=>{typeof y=="string"?h.write(y):h.write(new Uint8Array(y))});const _=/\x1b\[[\x3c-\x3f]?[\d;]*[cRn]|\x1bP[^\x1b]*\x1b\\/g,v=h.onData(y=>{const E=y.replace(_,"");E&&tn.getState().send(E)}),{cols:f,rows:p}=h;tn.getState().connect(e,f,p);const S=new ResizeObserver(()=>{d.fit();const{cols:y,rows:E}=h;tn.getState().resize(y,E)});return S.observe(o),()=>{S.disconnect(),v.dispose(),tn.getState().setOnMessage(null),tn.getState().disconnect(),h.dispose(),n.current=null,l.current=null}},[e,i])}function su({sessionName:e}){const i=le.useRef(null);return Q2(e,i),R.jsx("div",{className:"flex h-full min-h-0 w-full flex-1 flex-col bg-terminal-bg p-3",children:R.jsx("div",{ref:i,className:"min-h-0 flex-1"})})}function ru({sessionName:e,url:i}){const[n,l]=le.useState(""),[o,h]=le.useState(!1),d=st(p=>p.fetchMeta),_=zt(p=>p.previewViewport);async function v(p){p.preventDefault();const S=n.trim();if(S){h(!0);try{await fetch(`/api/sessions/${encodeURIComponent(e)}/meta`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({previewUrl:S})}),await d(e),l("")}finally{h(!1)}}}if(!i)return R.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-4 bg-sidebar dark:bg-bg-dark",children:[R.jsx(Ip,{size:32,className:"text-text-secondary/40"}),R.jsx("p",{className:"text-sm text-text-secondary",children:"No preview URL set"}),R.jsxs("p",{className:"text-xs text-text-secondary/60",children:["Run ",R.jsxs("code",{className:"rounded bg-divider px-1.5 py-0.5 font-mono dark:bg-divider-dark",children:["unloved ",e," url <url>"]})," to set one"]}),R.jsx("p",{className:"text-xs text-text-secondary/40",children:"or"}),R.jsxs("form",{onSubmit:v,className:"flex w-72 gap-2",children:[R.jsx("input",{type:"url",value:n,onChange:p=>l(p.target.value),placeholder:"https://localhost:3000",className:"flex-1 rounded-lg border border-divider bg-bg px-3 py-1.5 text-sm text-text outline-none focus:border-accent dark:border-divider-dark dark:bg-bg-dark dark:text-text-dark"}),R.jsx("button",{type:"submit",disabled:o||!n.trim(),className:"rounded-lg bg-accent px-3 py-1.5 text-sm text-white transition-opacity disabled:opacity-50",children:"Set"})]})]});if(_==="default")return R.jsx("iframe",{src:i,title:"Preview",className:"h-full w-full border-0"});const f=R1[_];return R.jsx("div",{className:"flex h-full w-full items-center justify-center overflow-auto bg-sidebar dark:bg-bg-dark",children:R.jsx("iframe",{src:i,title:"Preview",className:"shrink-0 border border-divider dark:border-divider-dark",style:{width:f.w,height:f.h}})})}const jp="unloved_split_v",qp="unloved_split_h";function Wp(e,i){const n=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));if(!n)return i;try{const l=JSON.parse(decodeURIComponent(n[1]));if(Array.isArray(l)&&l.every(o=>typeof o=="number"))return l}catch{}return i}function Yp(e,i){const n=Object.values(i);document.cookie=`${e}=${encodeURIComponent(JSON.stringify(n))};path=/;max-age=31536000;SameSite=Lax`}function J2(){return R.jsx("div",{className:"flex h-full items-center justify-center",children:R.jsx("div",{className:"h-8 w-1 rounded-full bg-text-secondary/30"})})}function ex(){return R.jsx("div",{className:"flex w-full items-center justify-center",children:R.jsx("div",{className:"h-1 w-8 rounded-full bg-text-secondary/30"})})}const Fi=typeof window<"u"?window.matchMedia("(min-width: 768px)"):null;function tx(e){return Fi==null||Fi.addEventListener("change",e),()=>Fi==null?void 0:Fi.removeEventListener("change",e)}function ix(){return(Fi==null?void 0:Fi.matches)??!0}function sx({sessionName:e}){const i=st(p=>p.sessionMetas),n=zt(p=>p.viewMode),o=!le.useSyncExternalStore(tx,ix)&&(n==="both"||n==="side-by-side")?"terminal":n,h=i[e],d=h==null?void 0:h.previewUrl,_=le.useCallback(p=>{Yp(jp,p)},[]),v=le.useCallback(p=>{Yp(qp,p)},[]);if(o==="preview")return R.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:R.jsx(ru,{sessionName:e,url:d})});if(o==="terminal")return R.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:R.jsx(su,{sessionName:e})});if(o==="side-by-side"){const p=Wp(qp,[50,50]);return R.jsxs(ou,{orientation:"horizontal",className:"min-h-0 flex-1",onLayoutChanged:v,children:[R.jsx(pl,{defaultSize:`${p[0]}%`,minSize:"20%",children:R.jsx(su,{sessionName:e})}),R.jsx(cu,{className:"w-1.5 bg-divider transition-colors hover:bg-accent dark:bg-divider-dark dark:hover:bg-accent-dark",children:R.jsx(J2,{})}),R.jsx(pl,{defaultSize:`${p[1]}%`,minSize:"20%",children:R.jsx(ru,{sessionName:e,url:d})})]})}const f=Wp(jp,[60,40]);return R.jsxs(ou,{orientation:"vertical",className:"min-h-0 flex-1",onLayoutChanged:_,children:[R.jsx(pl,{defaultSize:`${f[0]}%`,minSize:"20%",children:R.jsx(su,{sessionName:e})}),R.jsx(cu,{className:"h-1.5 bg-divider transition-colors hover:bg-accent dark:bg-divider-dark dark:hover:bg-accent-dark",children:R.jsx(ex,{})}),R.jsx(pl,{defaultSize:`${f[1]}%`,minSize:"15%",children:R.jsx(ru,{sessionName:e,url:d})})]})}function rx(){const e=st(i=>i.activeSessionName);return e?R.jsx(sx,{sessionName:e}):R.jsxs("div",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-hidden px-11",children:[R.jsx(eb,{}),R.jsx(J1,{})]})}function nx(){return R.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[R.jsx(Q1,{}),R.jsx(rx,{})]})}function lx(){const e=zt(n=>n.sidebarOpen),i=zt(n=>n.closeSidebar);return R.jsxs("div",{className:"flex h-dvh w-dvw overflow-hidden bg-bg pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] dark:bg-bg-dark",children:[R.jsx("div",{className:"hidden shrink-0 overflow-hidden transition-[width] duration-300 ease-in-out md:block",style:{width:e?"var(--sidebar-width)":"0px"},children:R.jsx(Dg,{})}),R.jsx("button",{type:"button",className:["fixed inset-0 z-40 cursor-default bg-black/20 backdrop-blur-[2px] transition-opacity duration-300 ease-in-out md:hidden",e?"visible opacity-100":"invisible opacity-0"].join(" "),onClick:i,"aria-label":"Close sidebar"}),R.jsxs("div",{className:["fixed inset-y-0 left-0 z-50 transition-transform duration-300 ease-in-out md:hidden",e?"translate-x-0":"-translate-x-full"].join(" "),style:{width:"var(--sidebar-width)"},children:[R.jsx(Dg,{}),R.jsx("button",{type:"button",onClick:i,className:"absolute right-2 top-3.5 flex h-7 w-7 cursor-pointer items-center justify-center rounded-full text-text-secondary transition-colors hover:bg-sidebar-hover dark:hover:bg-divider-dark","aria-label":"Close sidebar",children:R.jsx(E1,{size:15})})]}),R.jsx(nx,{})]})}function ax(){const e=nu(n=>n.hydrate),i=st(n=>n.startPolling);return le.useEffect(()=>(e(),i()),[e,i]),R.jsx(lx,{})}Py.createRoot(document.getElementById("root")).render(R.jsx(ax,{}));