create-claudeportal 0.2.0 → 0.2.2
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.
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(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)}})();var Oh={exports:{}},Fn={};var cg;function ly(){if(cg)return Fn;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 Fn.Fragment=i,Fn.jsx=n,Fn.jsxs=n,Fn}var hg;function ay(){return hg||(hg=1,Oh.exports=ly()),Oh.exports}var m=ay(),Lh={exports:{}},_e={};var ug;function oy(){if(ug)return _e;ug=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"),p=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),x=Symbol.iterator;function C(k){return k===null||typeof k!="object"?null:(k=x&&k[x]||k["@@iterator"],typeof k=="function"?k:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,j={};function X(k,q,J){this.props=k,this.context=q,this.refs=j,this.updater=J||b}X.prototype.isReactComponent={},X.prototype.setState=function(k,q){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,q,"setState")},X.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function K(){}K.prototype=X.prototype;function A(k,q,J){this.props=k,this.context=q,this.refs=j,this.updater=J||b}var L=A.prototype=new K;L.constructor=A,R(L,X.prototype),L.isPureReactComponent=!0;var H=Array.isArray;function Z(){}var F={H:null,A:null,T:null,S:null},pe=Object.prototype.hasOwnProperty;function ke(k,q,J){var te=J.ref;return{$$typeof:e,type:k,key:q,ref:te!==void 0?te:null,props:J}}function St(k,q){return ke(k.type,q,k.props)}function ue(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function V(k){var q={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(J){return q[J]})}var G=/\/+/g;function ie(k,q){return typeof k=="object"&&k!==null&&k.key!=null?V(""+k.key):q.toString(36)}function ee(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(Z,Z):(k.status="pending",k.then(function(q){k.status==="pending"&&(k.status="fulfilled",k.value=q)},function(q){k.status==="pending"&&(k.status="rejected",k.reason=q)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function T(k,q,J,te,oe){var he=typeof k;(he==="undefined"||he==="boolean")&&(k=null);var ye=!1;if(k===null)ye=!0;else switch(he){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(k.$$typeof){case e:case i:ye=!0;break;case y:return ye=k._init,T(ye(k._payload),q,J,te,oe)}}if(ye)return oe=oe(k),ye=te===""?"."+ie(k,0):te,H(oe)?(J="",ye!=null&&(J=ye.replace(G,"$&/")+"/"),T(oe,q,J,"",function(wi){return wi})):oe!=null&&(ue(oe)&&(oe=St(oe,J+(oe.key==null||k&&k.key===oe.key?"":(""+oe.key).replace(G,"$&/")+"/")+ye)),q.push(oe)),1;ye=0;var at=te===""?".":te+":";if(H(k))for(var Ae=0;Ae<k.length;Ae++)te=k[Ae],he=at+ie(te,Ae),ye+=T(te,q,J,he,oe);else if(Ae=C(k),typeof Ae=="function")for(k=Ae.call(k),Ae=0;!(te=k.next()).done;)te=te.value,he=at+ie(te,Ae++),ye+=T(te,q,J,he,oe);else if(he==="object"){if(typeof k.then=="function")return T(ee(k),q,J,te,oe);throw q=String(k),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return ye}function W(k,q,J){if(k==null)return k;var te=[],oe=0;return T(k,te,"","",function(he){return q.call(J,he,oe++)}),te}function Y(k){if(k._status===-1){var q=k._result;q=q(),q.then(function(J){(k._status===0||k._status===-1)&&(k._status=1,k._result=J)},function(J){(k._status===0||k._status===-1)&&(k._status=2,k._result=J)}),k._status===-1&&(k._status=0,k._result=q)}if(k._status===1)return k._result.default;throw k._result}var ae=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},fe={map:W,forEach:function(k,q,J){W(k,function(){q.apply(this,arguments)},J)},count:function(k){var q=0;return W(k,function(){q++}),q},toArray:function(k){return W(k,function(q){return q})||[]},only:function(k){if(!ue(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return _e.Activity=S,_e.Children=fe,_e.Component=X,_e.Fragment=n,_e.Profiler=o,_e.PureComponent=A,_e.StrictMode=l,_e.Suspense=p,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,_e.__COMPILER_RUNTIME={__proto__:null,c:function(k){return F.H.useMemoCache(k)}},_e.cache=function(k){return function(){return k.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(k,q,J){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var te=R({},k.props),oe=k.key;if(q!=null)for(he in q.key!==void 0&&(oe=""+q.key),q)!pe.call(q,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&q.ref===void 0||(te[he]=q[he]);var he=arguments.length-2;if(he===1)te.children=J;else if(1<he){for(var ye=Array(he),at=0;at<he;at++)ye[at]=arguments[at+2];te.children=ye}return ke(k.type,oe,te)},_e.createContext=function(k){return k={$$typeof:d,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:h,_context:k},k},_e.createElement=function(k,q,J){var te,oe={},he=null;if(q!=null)for(te in q.key!==void 0&&(he=""+q.key),q)pe.call(q,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(oe[te]=q[te]);var ye=arguments.length-2;if(ye===1)oe.children=J;else if(1<ye){for(var at=Array(ye),Ae=0;Ae<ye;Ae++)at[Ae]=arguments[Ae+2];oe.children=at}if(k&&k.defaultProps)for(te in ye=k.defaultProps,ye)oe[te]===void 0&&(oe[te]=ye[te]);return ke(k,he,oe)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(k){return{$$typeof:_,render:k}},_e.isValidElement=ue,_e.lazy=function(k){return{$$typeof:y,_payload:{_status:-1,_result:k},_init:Y}},_e.memo=function(k,q){return{$$typeof:f,type:k,compare:q===void 0?null:q}},_e.startTransition=function(k){var q=F.T,J={};F.T=J;try{var te=k(),oe=F.S;oe!==null&&oe(J,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(Z,ae)}catch(he){ae(he)}finally{q!==null&&J.types!==null&&(q.types=J.types),F.T=q}},_e.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},_e.use=function(k){return F.H.use(k)},_e.useActionState=function(k,q,J){return F.H.useActionState(k,q,J)},_e.useCallback=function(k,q){return F.H.useCallback(k,q)},_e.useContext=function(k){return F.H.useContext(k)},_e.useDebugValue=function(){},_e.useDeferredValue=function(k,q){return F.H.useDeferredValue(k,q)},_e.useEffect=function(k,q){return F.H.useEffect(k,q)},_e.useEffectEvent=function(k){return F.H.useEffectEvent(k)},_e.useId=function(){return F.H.useId()},_e.useImperativeHandle=function(k,q,J){return F.H.useImperativeHandle(k,q,J)},_e.useInsertionEffect=function(k,q){return F.H.useInsertionEffect(k,q)},_e.useLayoutEffect=function(k,q){return F.H.useLayoutEffect(k,q)},_e.useMemo=function(k,q){return F.H.useMemo(k,q)},_e.useOptimistic=function(k,q){return F.H.useOptimistic(k,q)},_e.useReducer=function(k,q,J){return F.H.useReducer(k,q,J)},_e.useRef=function(k){return F.H.useRef(k)},_e.useState=function(k){return F.H.useState(k)},_e.useSyncExternalStore=function(k,q,J){return F.H.useSyncExternalStore(k,q,J)},_e.useTransition=function(){return F.H.useTransition()},_e.version="19.2.4",_e}var dg;function Pu(){return dg||(dg=1,Lh.exports=oy()),Lh.exports}var O=Pu(),Nh={exports:{}},Zn={},jh={exports:{}},Hh={};var fg;function cy(){return fg||(fg=1,(function(e){function i(T,W){var Y=T.length;T.push(W);e:for(;0<Y;){var ae=Y-1>>>1,fe=T[ae];if(0<o(fe,W))T[ae]=W,T[Y]=fe,Y=ae;else break e}}function n(T){return T.length===0?null:T[0]}function l(T){if(T.length===0)return null;var W=T[0],Y=T.pop();if(Y!==W){T[0]=Y;e:for(var ae=0,fe=T.length,k=fe>>>1;ae<k;){var q=2*(ae+1)-1,J=T[q],te=q+1,oe=T[te];if(0>o(J,Y))te<fe&&0>o(oe,J)?(T[ae]=oe,T[te]=Y,ae=te):(T[ae]=J,T[q]=Y,ae=q);else if(te<fe&&0>o(oe,Y))T[ae]=oe,T[te]=Y,ae=te;else break e}}return W}function o(T,W){var Y=T.sortIndex-W.sortIndex;return Y!==0?Y:T.id-W.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 p=[],f=[],y=1,S=null,x=3,C=!1,b=!1,R=!1,j=!1,X=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function L(T){for(var W=n(f);W!==null;){if(W.callback===null)l(f);else if(W.startTime<=T)l(f),W.sortIndex=W.expirationTime,i(p,W);else break;W=n(f)}}function H(T){if(R=!1,L(T),!b)if(n(p)!==null)b=!0,Z||(Z=!0,V());else{var W=n(f);W!==null&&ee(H,W.startTime-T)}}var Z=!1,F=-1,pe=5,ke=-1;function St(){return j?!0:!(e.unstable_now()-ke<pe)}function ue(){if(j=!1,Z){var T=e.unstable_now();ke=T;var W=!0;try{e:{b=!1,R&&(R=!1,K(F),F=-1),C=!0;var Y=x;try{t:{for(L(T),S=n(p);S!==null&&!(S.expirationTime>T&&St());){var ae=S.callback;if(typeof ae=="function"){S.callback=null,x=S.priorityLevel;var fe=ae(S.expirationTime<=T);if(T=e.unstable_now(),typeof fe=="function"){S.callback=fe,L(T),W=!0;break t}S===n(p)&&l(p),L(T)}else l(p);S=n(p)}if(S!==null)W=!0;else{var k=n(f);k!==null&&ee(H,k.startTime-T),W=!1}}break e}finally{S=null,x=Y,C=!1}W=void 0}}finally{W?V():Z=!1}}}var V;if(typeof A=="function")V=function(){A(ue)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,ie=G.port2;G.port1.onmessage=ue,V=function(){ie.postMessage(null)}}else V=function(){X(ue,0)};function ee(T,W){F=X(function(){T(e.unstable_now())},W)}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(T){T.callback=null},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):pe=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(T){switch(x){case 1:case 2:case 3:var W=3;break;default:W=x}var Y=x;x=W;try{return T()}finally{x=Y}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(T,W){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var Y=x;x=T;try{return W()}finally{x=Y}},e.unstable_scheduleCallback=function(T,W,Y){var ae=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?ae+Y:ae):Y=ae,T){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=Y+fe,T={id:y++,callback:W,priorityLevel:T,startTime:Y,expirationTime:fe,sortIndex:-1},Y>ae?(T.sortIndex=Y,i(f,T),n(p)===null&&T===n(f)&&(R?(K(F),F=-1):R=!0,ee(H,Y-ae))):(T.sortIndex=fe,i(p,T),b||C||(b=!0,Z||(Z=!0,V()))),T},e.unstable_shouldYield=St,e.unstable_wrapCallback=function(T){var W=x;return function(){var Y=x;x=W;try{return T.apply(this,arguments)}finally{x=Y}}}})(Hh)),Hh}var pg;function hy(){return pg||(pg=1,jh.exports=cy()),jh.exports}var Uh={exports:{}},Et={};var _g;function uy(){if(_g)return Et;_g=1;var e=Pu();function i(p){var f="https://react.dev/errors/"+p;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)f+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; 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(p,f,y){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:S==null?null:""+S,children:p,containerInfo:f,implementation:y}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function _(p,f){if(p==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Et.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Et.createPortal=function(p,f){var y=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(p,f,null,y)},Et.flushSync=function(p){var f=d.T,y=l.p;try{if(d.T=null,l.p=2,p)return p()}finally{d.T=f,l.p=y,l.d.f()}},Et.preconnect=function(p,f){typeof p=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,l.d.C(p,f))},Et.prefetchDNS=function(p){typeof p=="string"&&l.d.D(p)},Et.preinit=function(p,f){if(typeof p=="string"&&f&&typeof f.as=="string"){var y=f.as,S=_(y,f.crossOrigin),x=typeof f.integrity=="string"?f.integrity:void 0,C=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;y==="style"?l.d.S(p,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:S,integrity:x,fetchPriority:C}):y==="script"&&l.d.X(p,{crossOrigin:S,integrity:x,fetchPriority:C,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Et.preinitModule=function(p,f){if(typeof p=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var y=_(f.as,f.crossOrigin);l.d.M(p,{crossOrigin:y,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&l.d.M(p)},Et.preload=function(p,f){if(typeof p=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var y=f.as,S=_(y,f.crossOrigin);l.d.L(p,y,{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})}},Et.preloadModule=function(p,f){if(typeof p=="string")if(f){var y=_(f.as,f.crossOrigin);l.d.m(p,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:y,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else l.d.m(p)},Et.requestFormReset=function(p){l.d.r(p)},Et.unstable_batchedUpdates=function(p,f){return p(f)},Et.useFormState=function(p,f,y){return d.H.useFormState(p,f,y)},Et.useFormStatus=function(){return d.H.useHostTransitionStatus()},Et.version="19.2.4",Et}var gg;function dy(){if(gg)return Uh.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(),Uh.exports=uy(),Uh.exports}var mg;function fy(){if(mg)return Zn;mg=1;var e=hy(),i=Pu(),n=dy();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(t.tag===31){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function p(t){if(h(t)!==t)throw Error(l(188))}function f(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 p(c),t;if(u===a)return p(c),s;u=u.sibling}throw Error(l(188))}if(r.return!==a.return)r=c,a=u;else{for(var g=!1,v=c.child;v;){if(v===r){g=!0,r=c,a=u;break}if(v===a){g=!0,a=c,r=u;break}v=v.sibling}if(!g){for(v=u.child;v;){if(v===r){g=!0,r=u,a=c;break}if(v===a){g=!0,a=u,r=c;break}v=v.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 y(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t;for(t=t.child;t!==null;){if(s=y(t),s!==null)return s;t=t.sibling}return null}var S=Object.assign,x=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),A=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),pe=Symbol.for("react.lazy"),ke=Symbol.for("react.activity"),St=Symbol.for("react.memo_cache_sentinel"),ue=Symbol.iterator;function V(t){return t===null||typeof t!="object"?null:(t=ue&&t[ue]||t["@@iterator"],typeof t=="function"?t:null)}var G=Symbol.for("react.client.reference");function ie(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===G?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case R:return"Fragment";case X:return"Profiler";case j:return"StrictMode";case H:return"Suspense";case Z:return"SuspenseList";case ke:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case b:return"Portal";case A:return t.displayName||"Context";case K:return(t._context.displayName||"Context")+".Consumer";case L:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case F:return s=t.displayName||null,s!==null?s:ie(t.type)||"Memo";case pe:s=t._payload,t=t._init;try{return ie(t(s))}catch{}}return null}var ee=Array.isArray,T=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},ae=[],fe=-1;function k(t){return{current:t}}function q(t){0>fe||(t.current=ae[fe],ae[fe]=null,fe--)}function J(t,s){fe++,ae[fe]=t.current,t.current=s}var te=k(null),oe=k(null),he=k(null),ye=k(null);function at(t,s){switch(J(he,s),J(oe,t),J(te,null),s.nodeType){case 9:case 11:t=(t=s.documentElement)&&(t=t.namespaceURI)?A_(t):0;break;default:if(t=s.tagName,s=s.namespaceURI)s=A_(s),t=z_(s,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}q(te),J(te,t)}function Ae(){q(te),q(oe),q(he)}function wi(t){t.memoizedState!==null&&J(ye,t);var s=te.current,r=z_(s,t.type);s!==r&&(J(oe,t),J(te,r))}function Ci(t){oe.current===t&&(q(te),q(oe)),ye.current===t&&(q(ye),In._currentValue=Y)}var ti,Re;function mi(t){if(ti===void 0)try{throw Error()}catch(r){var s=r.stack.trim().match(/\n( *(at )?)/);ti=s&&s[1]||"",Re=-1<r.stack.indexOf(`
|
|
1
|
+
(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)}})();var Oh={exports:{}},Fn={};var cg;function ly(){if(cg)return Fn;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 Fn.Fragment=i,Fn.jsx=n,Fn.jsxs=n,Fn}var hg;function ay(){return hg||(hg=1,Oh.exports=ly()),Oh.exports}var m=ay(),Lh={exports:{}},pe={};var ug;function oy(){if(ug)return pe;ug=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"),p=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),x=Symbol.iterator;function C(k){return k===null||typeof k!="object"?null:(k=x&&k[x]||k["@@iterator"],typeof k=="function"?k:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,M={};function W(k,q,Z){this.props=k,this.context=q,this.refs=M,this.updater=Z||b}W.prototype.isReactComponent={},W.prototype.setState=function(k,q){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,q,"setState")},W.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function te(){}te.prototype=W.prototype;function N(k,q,Z){this.props=k,this.context=q,this.refs=M,this.updater=Z||b}var L=N.prototype=new te;L.constructor=N,R(L,W.prototype),L.isPureReactComponent=!0;var U=Array.isArray;function X(){}var J={H:null,A:null,T:null,S:null},ge=Object.prototype.hasOwnProperty;function we(k,q,Z){var ee=Z.ref;return{$$typeof:e,type:k,key:q,ref:ee!==void 0?ee:null,props:Z}}function Qe(k,q){return we(k.type,q,k.props)}function ue(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function V(k){var q={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(Z){return q[Z]})}var G=/\/+/g;function ie(k,q){return typeof k=="object"&&k!==null&&k.key!=null?V(""+k.key):q.toString(36)}function Q(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(X,X):(k.status="pending",k.then(function(q){k.status==="pending"&&(k.status="fulfilled",k.value=q)},function(q){k.status==="pending"&&(k.status="rejected",k.reason=q)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function T(k,q,Z,ee,oe){var he=typeof k;(he==="undefined"||he==="boolean")&&(k=null);var ye=!1;if(k===null)ye=!0;else switch(he){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(k.$$typeof){case e:case i:ye=!0;break;case y:return ye=k._init,T(ye(k._payload),q,Z,ee,oe)}}if(ye)return oe=oe(k),ye=ee===""?"."+ie(k,0):ee,U(oe)?(Z="",ye!=null&&(Z=ye.replace(G,"$&/")+"/"),T(oe,q,Z,"",function(wi){return wi})):oe!=null&&(ue(oe)&&(oe=Qe(oe,Z+(oe.key==null||k&&k.key===oe.key?"":(""+oe.key).replace(G,"$&/")+"/")+ye)),q.push(oe)),1;ye=0;var ot=ee===""?".":ee+":";if(U(k))for(var Ae=0;Ae<k.length;Ae++)ee=k[Ae],he=ot+ie(ee,Ae),ye+=T(ee,q,Z,he,oe);else if(Ae=C(k),typeof Ae=="function")for(k=Ae.call(k),Ae=0;!(ee=k.next()).done;)ee=ee.value,he=ot+ie(ee,Ae++),ye+=T(ee,q,Z,he,oe);else if(he==="object"){if(typeof k.then=="function")return T(Q(k),q,Z,ee,oe);throw q=String(k),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return ye}function P(k,q,Z){if(k==null)return k;var ee=[],oe=0;return T(k,ee,"","",function(he){return q.call(Z,he,oe++)}),ee}function Y(k){if(k._status===-1){var q=k._result;q=q(),q.then(function(Z){(k._status===0||k._status===-1)&&(k._status=1,k._result=Z)},function(Z){(k._status===0||k._status===-1)&&(k._status=2,k._result=Z)}),k._status===-1&&(k._status=0,k._result=q)}if(k._status===1)return k._result.default;throw k._result}var ae=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},fe={map:P,forEach:function(k,q,Z){P(k,function(){q.apply(this,arguments)},Z)},count:function(k){var q=0;return P(k,function(){q++}),q},toArray:function(k){return P(k,function(q){return q})||[]},only:function(k){if(!ue(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return pe.Activity=S,pe.Children=fe,pe.Component=W,pe.Fragment=n,pe.Profiler=o,pe.PureComponent=N,pe.StrictMode=l,pe.Suspense=p,pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J,pe.__COMPILER_RUNTIME={__proto__:null,c:function(k){return J.H.useMemoCache(k)}},pe.cache=function(k){return function(){return k.apply(null,arguments)}},pe.cacheSignal=function(){return null},pe.cloneElement=function(k,q,Z){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var ee=R({},k.props),oe=k.key;if(q!=null)for(he in q.key!==void 0&&(oe=""+q.key),q)!ge.call(q,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&q.ref===void 0||(ee[he]=q[he]);var he=arguments.length-2;if(he===1)ee.children=Z;else if(1<he){for(var ye=Array(he),ot=0;ot<he;ot++)ye[ot]=arguments[ot+2];ee.children=ye}return we(k.type,oe,ee)},pe.createContext=function(k){return k={$$typeof:d,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:h,_context:k},k},pe.createElement=function(k,q,Z){var ee,oe={},he=null;if(q!=null)for(ee in q.key!==void 0&&(he=""+q.key),q)ge.call(q,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(oe[ee]=q[ee]);var ye=arguments.length-2;if(ye===1)oe.children=Z;else if(1<ye){for(var ot=Array(ye),Ae=0;Ae<ye;Ae++)ot[Ae]=arguments[Ae+2];oe.children=ot}if(k&&k.defaultProps)for(ee in ye=k.defaultProps,ye)oe[ee]===void 0&&(oe[ee]=ye[ee]);return we(k,he,oe)},pe.createRef=function(){return{current:null}},pe.forwardRef=function(k){return{$$typeof:_,render:k}},pe.isValidElement=ue,pe.lazy=function(k){return{$$typeof:y,_payload:{_status:-1,_result:k},_init:Y}},pe.memo=function(k,q){return{$$typeof:f,type:k,compare:q===void 0?null:q}},pe.startTransition=function(k){var q=J.T,Z={};J.T=Z;try{var ee=k(),oe=J.S;oe!==null&&oe(Z,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(X,ae)}catch(he){ae(he)}finally{q!==null&&Z.types!==null&&(q.types=Z.types),J.T=q}},pe.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()},pe.use=function(k){return J.H.use(k)},pe.useActionState=function(k,q,Z){return J.H.useActionState(k,q,Z)},pe.useCallback=function(k,q){return J.H.useCallback(k,q)},pe.useContext=function(k){return J.H.useContext(k)},pe.useDebugValue=function(){},pe.useDeferredValue=function(k,q){return J.H.useDeferredValue(k,q)},pe.useEffect=function(k,q){return J.H.useEffect(k,q)},pe.useEffectEvent=function(k){return J.H.useEffectEvent(k)},pe.useId=function(){return J.H.useId()},pe.useImperativeHandle=function(k,q,Z){return J.H.useImperativeHandle(k,q,Z)},pe.useInsertionEffect=function(k,q){return J.H.useInsertionEffect(k,q)},pe.useLayoutEffect=function(k,q){return J.H.useLayoutEffect(k,q)},pe.useMemo=function(k,q){return J.H.useMemo(k,q)},pe.useOptimistic=function(k,q){return J.H.useOptimistic(k,q)},pe.useReducer=function(k,q,Z){return J.H.useReducer(k,q,Z)},pe.useRef=function(k){return J.H.useRef(k)},pe.useState=function(k){return J.H.useState(k)},pe.useSyncExternalStore=function(k,q,Z){return J.H.useSyncExternalStore(k,q,Z)},pe.useTransition=function(){return J.H.useTransition()},pe.version="19.2.4",pe}var dg;function Pu(){return dg||(dg=1,Lh.exports=oy()),Lh.exports}var O=Pu(),Nh={exports:{}},Zn={},jh={exports:{}},Hh={};var fg;function cy(){return fg||(fg=1,(function(e){function i(T,P){var Y=T.length;T.push(P);e:for(;0<Y;){var ae=Y-1>>>1,fe=T[ae];if(0<o(fe,P))T[ae]=P,T[Y]=fe,Y=ae;else break e}}function n(T){return T.length===0?null:T[0]}function l(T){if(T.length===0)return null;var P=T[0],Y=T.pop();if(Y!==P){T[0]=Y;e:for(var ae=0,fe=T.length,k=fe>>>1;ae<k;){var q=2*(ae+1)-1,Z=T[q],ee=q+1,oe=T[ee];if(0>o(Z,Y))ee<fe&&0>o(oe,Z)?(T[ae]=oe,T[ee]=Y,ae=ee):(T[ae]=Z,T[q]=Y,ae=q);else if(ee<fe&&0>o(oe,Y))T[ae]=oe,T[ee]=Y,ae=ee;else break e}}return P}function o(T,P){var Y=T.sortIndex-P.sortIndex;return Y!==0?Y:T.id-P.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 p=[],f=[],y=1,S=null,x=3,C=!1,b=!1,R=!1,M=!1,W=typeof setTimeout=="function"?setTimeout:null,te=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function L(T){for(var P=n(f);P!==null;){if(P.callback===null)l(f);else if(P.startTime<=T)l(f),P.sortIndex=P.expirationTime,i(p,P);else break;P=n(f)}}function U(T){if(R=!1,L(T),!b)if(n(p)!==null)b=!0,X||(X=!0,V());else{var P=n(f);P!==null&&Q(U,P.startTime-T)}}var X=!1,J=-1,ge=5,we=-1;function Qe(){return M?!0:!(e.unstable_now()-we<ge)}function ue(){if(M=!1,X){var T=e.unstable_now();we=T;var P=!0;try{e:{b=!1,R&&(R=!1,te(J),J=-1),C=!0;var Y=x;try{t:{for(L(T),S=n(p);S!==null&&!(S.expirationTime>T&&Qe());){var ae=S.callback;if(typeof ae=="function"){S.callback=null,x=S.priorityLevel;var fe=ae(S.expirationTime<=T);if(T=e.unstable_now(),typeof fe=="function"){S.callback=fe,L(T),P=!0;break t}S===n(p)&&l(p),L(T)}else l(p);S=n(p)}if(S!==null)P=!0;else{var k=n(f);k!==null&&Q(U,k.startTime-T),P=!1}}break e}finally{S=null,x=Y,C=!1}P=void 0}}finally{P?V():X=!1}}}var V;if(typeof N=="function")V=function(){N(ue)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,ie=G.port2;G.port1.onmessage=ue,V=function(){ie.postMessage(null)}}else V=function(){W(ue,0)};function Q(T,P){J=W(function(){T(e.unstable_now())},P)}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(T){T.callback=null},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ge=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(T){switch(x){case 1:case 2:case 3:var P=3;break;default:P=x}var Y=x;x=P;try{return T()}finally{x=Y}},e.unstable_requestPaint=function(){M=!0},e.unstable_runWithPriority=function(T,P){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var Y=x;x=T;try{return P()}finally{x=Y}},e.unstable_scheduleCallback=function(T,P,Y){var ae=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?ae+Y:ae):Y=ae,T){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=Y+fe,T={id:y++,callback:P,priorityLevel:T,startTime:Y,expirationTime:fe,sortIndex:-1},Y>ae?(T.sortIndex=Y,i(f,T),n(p)===null&&T===n(f)&&(R?(te(J),J=-1):R=!0,Q(U,Y-ae))):(T.sortIndex=fe,i(p,T),b||C||(b=!0,X||(X=!0,V()))),T},e.unstable_shouldYield=Qe,e.unstable_wrapCallback=function(T){var P=x;return function(){var Y=x;x=P;try{return T.apply(this,arguments)}finally{x=Y}}}})(Hh)),Hh}var pg;function hy(){return pg||(pg=1,jh.exports=cy()),jh.exports}var Uh={exports:{}},Et={};var _g;function uy(){if(_g)return Et;_g=1;var e=Pu();function i(p){var f="https://react.dev/errors/"+p;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)f+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; 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(p,f,y){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:S==null?null:""+S,children:p,containerInfo:f,implementation:y}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function _(p,f){if(p==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Et.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Et.createPortal=function(p,f){var y=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(p,f,null,y)},Et.flushSync=function(p){var f=d.T,y=l.p;try{if(d.T=null,l.p=2,p)return p()}finally{d.T=f,l.p=y,l.d.f()}},Et.preconnect=function(p,f){typeof p=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,l.d.C(p,f))},Et.prefetchDNS=function(p){typeof p=="string"&&l.d.D(p)},Et.preinit=function(p,f){if(typeof p=="string"&&f&&typeof f.as=="string"){var y=f.as,S=_(y,f.crossOrigin),x=typeof f.integrity=="string"?f.integrity:void 0,C=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;y==="style"?l.d.S(p,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:S,integrity:x,fetchPriority:C}):y==="script"&&l.d.X(p,{crossOrigin:S,integrity:x,fetchPriority:C,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Et.preinitModule=function(p,f){if(typeof p=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var y=_(f.as,f.crossOrigin);l.d.M(p,{crossOrigin:y,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&l.d.M(p)},Et.preload=function(p,f){if(typeof p=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var y=f.as,S=_(y,f.crossOrigin);l.d.L(p,y,{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})}},Et.preloadModule=function(p,f){if(typeof p=="string")if(f){var y=_(f.as,f.crossOrigin);l.d.m(p,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:y,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else l.d.m(p)},Et.requestFormReset=function(p){l.d.r(p)},Et.unstable_batchedUpdates=function(p,f){return p(f)},Et.useFormState=function(p,f,y){return d.H.useFormState(p,f,y)},Et.useFormStatus=function(){return d.H.useHostTransitionStatus()},Et.version="19.2.4",Et}var gg;function dy(){if(gg)return Uh.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(),Uh.exports=uy(),Uh.exports}var mg;function fy(){if(mg)return Zn;mg=1;var e=hy(),i=Pu(),n=dy();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(t.tag===31){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function p(t){if(h(t)!==t)throw Error(l(188))}function f(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 p(c),t;if(u===a)return p(c),s;u=u.sibling}throw Error(l(188))}if(r.return!==a.return)r=c,a=u;else{for(var g=!1,v=c.child;v;){if(v===r){g=!0,r=c,a=u;break}if(v===a){g=!0,a=c,r=u;break}v=v.sibling}if(!g){for(v=u.child;v;){if(v===r){g=!0,r=u,a=c;break}if(v===a){g=!0,a=u,r=c;break}v=v.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 y(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t;for(t=t.child;t!==null;){if(s=y(t),s!==null)return s;t=t.sibling}return null}var S=Object.assign,x=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),te=Symbol.for("react.consumer"),N=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),ge=Symbol.for("react.lazy"),we=Symbol.for("react.activity"),Qe=Symbol.for("react.memo_cache_sentinel"),ue=Symbol.iterator;function V(t){return t===null||typeof t!="object"?null:(t=ue&&t[ue]||t["@@iterator"],typeof t=="function"?t:null)}var G=Symbol.for("react.client.reference");function ie(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===G?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case R:return"Fragment";case W:return"Profiler";case M:return"StrictMode";case U:return"Suspense";case X:return"SuspenseList";case we:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case b:return"Portal";case N:return t.displayName||"Context";case te:return(t._context.displayName||"Context")+".Consumer";case L:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case J:return s=t.displayName||null,s!==null?s:ie(t.type)||"Memo";case ge:s=t._payload,t=t._init;try{return ie(t(s))}catch{}}return null}var Q=Array.isArray,T=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},ae=[],fe=-1;function k(t){return{current:t}}function q(t){0>fe||(t.current=ae[fe],ae[fe]=null,fe--)}function Z(t,s){fe++,ae[fe]=t.current,t.current=s}var ee=k(null),oe=k(null),he=k(null),ye=k(null);function ot(t,s){switch(Z(he,s),Z(oe,t),Z(ee,null),s.nodeType){case 9:case 11:t=(t=s.documentElement)&&(t=t.namespaceURI)?A_(t):0;break;default:if(t=s.tagName,s=s.namespaceURI)s=A_(s),t=z_(s,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}q(ee),Z(ee,t)}function Ae(){q(ee),q(oe),q(he)}function wi(t){t.memoizedState!==null&&Z(ye,t);var s=ee.current,r=z_(s,t.type);s!==r&&(Z(oe,t),Z(ee,r))}function Ci(t){oe.current===t&&(q(ee),q(oe)),ye.current===t&&(q(ye),In._currentValue=Y)}var ti,Re;function mi(t){if(ti===void 0)try{throw Error()}catch(r){var s=r.stack.trim().match(/\n( *(at )?)/);ti=s&&s[1]||"",Re=-1<r.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+ti+t+Re}var mo=!1;function vo(t,s){if(!t||mo)return"";mo=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(s){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(
|
|
4
|
-
`),
|
|
5
|
-
`);for(c=a=0;a<w.length&&!w[a].includes("DetermineComponentFrameRoot");)a++;for(;c<
|
|
6
|
-
`+w[a].replace(" at new "," at ");return t.displayName&&
|
|
3
|
+
`+ti+t+Re}var mo=!1;function vo(t,s){if(!t||mo)return"";mo=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(s){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(j){var z=j}Reflect.construct(t,[],$)}else{try{$.call()}catch(j){z=j}t.call($.prototype)}}else{try{throw Error()}catch(j){z=j}($=t())&&typeof $.catch=="function"&&$.catch(function(){})}}catch(j){if(j&&z&&typeof j.stack=="string")return[j.stack,z.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],v=u[1];if(g&&v){var w=g.split(`
|
|
4
|
+
`),A=v.split(`
|
|
5
|
+
`);for(c=a=0;a<w.length&&!w[a].includes("DetermineComponentFrameRoot");)a++;for(;c<A.length&&!A[c].includes("DetermineComponentFrameRoot");)c++;if(a===w.length||c===A.length)for(a=w.length-1,c=A.length-1;1<=a&&0<=c&&w[a]!==A[c];)c--;for(;1<=a&&0<=c;a--,c--)if(w[a]!==A[c]){if(a!==1||c!==1)do if(a--,c--,0>c||w[a]!==A[c]){var H=`
|
|
6
|
+
`+w[a].replace(" at new "," at ");return t.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",t.displayName)),H}while(1<=a&&0<=c);break}}}finally{mo=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?mi(r):""}function jv(t,s){switch(t.tag){case 26:case 27:case 5:return mi(t.type);case 16:return mi("Lazy");case 13:return t.child!==s&&s!==null?mi("Suspense Fallback"):mi("Suspense");case 19:return mi("SuspenseList");case 0:case 15:return vo(t.type,!1);case 11:return vo(t.type.render,!1);case 1:return vo(t.type,!0);case 31:return mi("Activity");default:return""}}function od(t){try{var s="",r=null;do s+=jv(t,r),r=t,t=t.return;while(t);return s}catch(a){return`
|
|
7
7
|
Error generating stack: `+a.message+`
|
|
8
|
-
`+a.stack}}var So=Object.prototype.hasOwnProperty,yo=e.unstable_scheduleCallback,bo=e.unstable_cancelCallback,Hv=e.unstable_shouldYield,Uv=e.unstable_requestPaint,Pt=e.unstable_now,qv=e.unstable_getCurrentPriorityLevel,cd=e.unstable_ImmediatePriority,hd=e.unstable_UserBlockingPriority,xl=e.unstable_NormalPriority,Wv=e.unstable_LowPriority,ud=e.unstable_IdlePriority,Pv=e.log,Kv=e.unstable_setDisableYieldValue,rn=null,Kt=null;function ls(t){if(typeof Pv=="function"&&Kv(t),Kt&&typeof Kt.setStrictMode=="function")try{Kt.setStrictMode(rn,t)}catch{}}var Yt=Math.clz32?Math.clz32:Iv,Yv=Math.log,$v=Math.LN2;function Iv(t){return t>>>=0,t===0?32:31-(Yv(t)/$v|0)|0}var wl=256,Cl=262144,kl=4194304;function js(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:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;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 El(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 v=a&134217727;return v!==0?(a=v&~u,a!==0?c=js(a):(g&=v,g!==0?c=js(g):r||(r=v&~t,r!==0&&(c=js(r))))):(v=a&~u,v!==0?c=js(v):g!==0?c=js(g):r||(r=a&~t,r!==0&&(c=js(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 nn(t,s){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&s)===0}function Gv(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 dd(){var t=kl;return kl<<=1,(kl&62914560)===0&&(kl=4194304),t}function xo(t){for(var s=[],r=0;31>r;r++)s.push(t);return s}function ln(t,s){t.pendingLanes|=s,s!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Xv(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 v=t.entanglements,w=t.expirationTimes,B=t.hiddenUpdates;for(r=g&~r;0<r;){var U=31-Yt(r),$=1<<U;v[U]=0,w[U]=-1;var z=B[U];if(z!==null)for(B[U]=null,U=0;U<z.length;U++){var N=z[U];N!==null&&(N.lane&=-536870913)}r&=~$}a!==0&&fd(t,a,0),u!==0&&c===0&&t.tag!==0&&(t.suspendedLanes|=u&~(g&~s))}function fd(t,s,r){t.pendingLanes|=s,t.suspendedLanes&=~s;var a=31-Yt(s);t.entangledLanes|=s,t.entanglements[a]=t.entanglements[a]|1073741824|r&261930}function pd(t,s){var r=t.entangledLanes|=s;for(t=t.entanglements;r;){var a=31-Yt(r),c=1<<a;c&s|t[a]&s&&(t[a]|=s),r&=~c}}function _d(t,s){var r=s&-s;return r=(r&42)!==0?1:wo(r),(r&(t.suspendedLanes|s))!==0?0:r}function wo(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 Co(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function gd(){var t=W.p;return t!==0?t:(t=window.event,t===void 0?32:ig(t.type))}function md(t,s){var r=W.p;try{return W.p=t,s()}finally{W.p=r}}var as=Math.random().toString(36).slice(2),yt="__reactFiber$"+as,Ot="__reactProps$"+as,dr="__reactContainer$"+as,ko="__reactEvents$"+as,Vv="__reactListeners$"+as,Fv="__reactHandles$"+as,vd="__reactResources$"+as,an="__reactMarker$"+as;function Eo(t){delete t[yt],delete t[Ot],delete t[ko],delete t[Vv],delete t[Fv]}function fr(t){var s=t[yt];if(s)return s;for(var r=t.parentNode;r;){if(s=r[dr]||r[yt]){if(r=s.alternate,s.child!==null||r!==null&&r.child!==null)for(t=q_(t);t!==null;){if(r=t[yt])return r;t=q_(t)}return s}t=r,r=t.parentNode}return null}function pr(t){if(t=t[yt]||t[dr]){var s=t.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return t}return null}function on(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t.stateNode;throw Error(l(33))}function _r(t){var s=t[vd];return s||(s=t[vd]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function dt(t){t[an]=!0}var Sd=new Set,yd={};function Hs(t,s){gr(t,s),gr(t+"Capture",s)}function gr(t,s){for(yd[t]=s,t=0;t<s.length;t++)Sd.add(s[t])}var Zv=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]*$"),bd={},xd={};function Qv(t){return So.call(xd,t)?!0:So.call(bd,t)?!1:Zv.test(t)?xd[t]=!0:(bd[t]=!0,!1)}function Tl(t,s,r){if(Qv(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 Rl(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 ji(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)}}function ii(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function wd(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Jv(t,s,r){var a=Object.getOwnPropertyDescriptor(t.constructor.prototype,s);if(!t.hasOwnProperty(s)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var c=a.get,u=a.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return c.call(this)},set:function(g){r=""+g,u.call(this,g)}}),Object.defineProperty(t,s,{enumerable:a.enumerable}),{getValue:function(){return r},setValue:function(g){r=""+g},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function To(t){if(!t._valueTracker){var s=wd(t)?"checked":"value";t._valueTracker=Jv(t,s,""+t[s])}}function Cd(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var r=s.getValue(),a="";return t&&(a=wd(t)?t.checked?"true":"false":t.value),t=a,t!==r?(s.setValue(t),!0):!1}function Dl(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 e0=/[\n"\\]/g;function si(t){return t.replace(e0,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Ro(t,s,r,a,c,u,g,v){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=""+ii(s)):t.value!==""+ii(s)&&(t.value=""+ii(s)):g!=="submit"&&g!=="reset"||t.removeAttribute("value"),s!=null?Do(t,g,ii(s)):r!=null?Do(t,g,ii(r)):a!=null&&t.removeAttribute("value"),c==null&&u!=null&&(t.defaultChecked=!!u),c!=null&&(t.checked=c&&typeof c!="function"&&typeof c!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.name=""+ii(v):t.removeAttribute("name")}function kd(t,s,r,a,c,u,g,v){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)){To(t);return}r=r!=null?""+ii(r):"",s=s!=null?""+ii(s):r,v||s===t.value||(t.value=s),t.defaultValue=s}a=a??c,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=v?t.checked:!!a,t.defaultChecked=!!a,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.name=g),To(t)}function Do(t,s,r){s==="number"&&Dl(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=""+ii(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 Ed(t,s,r){if(s!=null&&(s=""+ii(s),s!==t.value&&(t.value=s),r==null)){t.defaultValue!==s&&(t.defaultValue=s);return}t.defaultValue=r!=null?""+ii(r):""}function Td(t,s,r,a){if(s==null){if(a!=null){if(r!=null)throw Error(l(92));if(ee(a)){if(1<a.length)throw Error(l(93));a=a[0]}r=a}r==null&&(r=""),s=r}r=ii(s),t.defaultValue=r,a=t.textContent,a===r&&a!==""&&a!==null&&(t.value=a),To(t)}function vr(t,s){if(s){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=s;return}}t.textContent=s}var t0=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 Rd(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||t0.has(s)?s==="float"?t.cssFloat=r:t[s]=(""+r).trim():t[s]=r+"px"}function Dd(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&&Rd(t,c,a)}else for(var u in s)s.hasOwnProperty(u)&&Rd(t,u,s[u])}function Mo(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 i0=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"]]),s0=/^[\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 Ml(t){return s0.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Hi(){}var Bo=null;function Ao(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Sr=null,yr=null;function Md(t){var s=pr(t);if(s&&(t=s.stateNode)){var r=t[Ot]||null;e:switch(t=s.stateNode,s.type){case"input":if(Ro(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="'+si(""+s)+'"][type="radio"]'),s=0;s<r.length;s++){var a=r[s];if(a!==t&&a.form===t.form){var c=a[Ot]||null;if(!c)throw Error(l(90));Ro(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&&Cd(a)}break e;case"textarea":Ed(t,r.value,r.defaultValue);break e;case"select":s=r.value,s!=null&&mr(t,!!r.multiple,s,!1)}}}var zo=!1;function Bd(t,s,r){if(zo)return t(s,r);zo=!0;try{var a=t(s);return a}finally{if(zo=!1,(Sr!==null||yr!==null)&&(ma(),Sr&&(s=Sr,t=yr,yr=Sr=null,Md(s),t)))for(s=0;s<t.length;s++)Md(t[s])}}function cn(t,s){var r=t.stateNode;if(r===null)return null;var a=r[Ot]||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 Ui=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oo=!1;if(Ui)try{var hn={};Object.defineProperty(hn,"passive",{get:function(){Oo=!0}}),window.addEventListener("test",hn,hn),window.removeEventListener("test",hn,hn)}catch{Oo=!1}var os=null,Lo=null,Bl=null;function Ad(){if(Bl)return Bl;var t,s=Lo,r=s.length,a,c="value"in os?os.value:os.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 Bl=c.slice(t,1<a?1-a:void 0)}function Al(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 zl(){return!0}function zd(){return!1}function Lt(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 v in t)t.hasOwnProperty(v)&&(r=t[v],this[v]=r?r(u):u[v]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?zl:zd,this.isPropagationStopped=zd,this}return S(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=zl)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=zl)},persist:function(){},isPersistent:zl}),s}var Us={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ol=Lt(Us),un=S({},Us,{view:0,detail:0}),r0=Lt(un),No,jo,dn,Ll=S({},un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uo,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!==dn&&(dn&&t.type==="mousemove"?(No=t.screenX-dn.screenX,jo=t.screenY-dn.screenY):jo=No=0,dn=t),No)},movementY:function(t){return"movementY"in t?t.movementY:jo}}),Od=Lt(Ll),n0=S({},Ll,{dataTransfer:0}),l0=Lt(n0),a0=S({},un,{relatedTarget:0}),Ho=Lt(a0),o0=S({},Us,{animationName:0,elapsedTime:0,pseudoElement:0}),c0=Lt(o0),h0=S({},Us,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),u0=Lt(h0),d0=S({},Us,{data:0}),Ld=Lt(d0),f0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},p0={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"},_0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function g0(t){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(t):(t=_0[t])?!!s[t]:!1}function Uo(){return g0}var m0=S({},un,{key:function(t){if(t.key){var s=f0[t.key]||t.key;if(s!=="Unidentified")return s}return t.type==="keypress"?(t=Al(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?p0[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uo,charCode:function(t){return t.type==="keypress"?Al(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Al(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),v0=Lt(m0),S0=S({},Ll,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nd=Lt(S0),y0=S({},un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uo}),b0=Lt(y0),x0=S({},Us,{propertyName:0,elapsedTime:0,pseudoElement:0}),w0=Lt(x0),C0=S({},Ll,{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}),k0=Lt(C0),E0=S({},Us,{newState:0,oldState:0}),T0=Lt(E0),R0=[9,13,27,32],qo=Ui&&"CompositionEvent"in window,fn=null;Ui&&"documentMode"in document&&(fn=document.documentMode);var D0=Ui&&"TextEvent"in window&&!fn,jd=Ui&&(!qo||fn&&8<fn&&11>=fn),Hd=" ",Ud=!1;function qd(t,s){switch(t){case"keyup":return R0.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wd(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var br=!1;function M0(t,s){switch(t){case"compositionend":return Wd(s);case"keypress":return s.which!==32?null:(Ud=!0,Hd);case"textInput":return t=s.data,t===Hd&&Ud?null:t;default:return null}}function B0(t,s){if(br)return t==="compositionend"||!qo&&qd(t,s)?(t=Ad(),Bl=Lo=os=null,br=!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 jd&&s.locale!=="ko"?null:s.data;default:return null}}var A0={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 Pd(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s==="input"?!!A0[t.type]:s==="textarea"}function Kd(t,s,r,a){Sr?yr?yr.push(a):yr=[a]:Sr=a,s=Ca(s,"onChange"),0<s.length&&(r=new Ol("onChange","change",null,r,a),t.push({event:r,listeners:s}))}var pn=null,_n=null;function z0(t){E_(t,0)}function Nl(t){var s=on(t);if(Cd(s))return t}function Yd(t,s){if(t==="change")return s}var $d=!1;if(Ui){var Wo;if(Ui){var Po="oninput"in document;if(!Po){var Id=document.createElement("div");Id.setAttribute("oninput","return;"),Po=typeof Id.oninput=="function"}Wo=Po}else Wo=!1;$d=Wo&&(!document.documentMode||9<document.documentMode)}function Gd(){pn&&(pn.detachEvent("onpropertychange",Xd),_n=pn=null)}function Xd(t){if(t.propertyName==="value"&&Nl(_n)){var s=[];Kd(s,_n,t,Ao(t)),Bd(z0,s)}}function O0(t,s,r){t==="focusin"?(Gd(),pn=s,_n=r,pn.attachEvent("onpropertychange",Xd)):t==="focusout"&&Gd()}function L0(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Nl(_n)}function N0(t,s){if(t==="click")return Nl(s)}function j0(t,s){if(t==="input"||t==="change")return Nl(s)}function H0(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var $t=typeof Object.is=="function"?Object.is:H0;function gn(t,s){if($t(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(!So.call(s,c)||!$t(t[c],s[c]))return!1}return!0}function Vd(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Fd(t,s){var r=Vd(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=Vd(r)}}function Zd(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?Zd(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function Qd(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var s=Dl(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=Dl(t.document)}return s}function Ko(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 U0=Ui&&"documentMode"in document&&11>=document.documentMode,xr=null,Yo=null,mn=null,$o=!1;function Jd(t,s,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;$o||xr==null||xr!==Dl(a)||(a=xr,"selectionStart"in a&&Ko(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}),mn&&gn(mn,a)||(mn=a,a=Ca(Yo,"onSelect"),0<a.length&&(s=new Ol("onSelect","select",null,s,r),t.push({event:s,listeners:a}),s.target=xr)))}function qs(t,s){var r={};return r[t.toLowerCase()]=s.toLowerCase(),r["Webkit"+t]="webkit"+s,r["Moz"+t]="moz"+s,r}var wr={animationend:qs("Animation","AnimationEnd"),animationiteration:qs("Animation","AnimationIteration"),animationstart:qs("Animation","AnimationStart"),transitionrun:qs("Transition","TransitionRun"),transitionstart:qs("Transition","TransitionStart"),transitioncancel:qs("Transition","TransitionCancel"),transitionend:qs("Transition","TransitionEnd")},Io={},ef={};Ui&&(ef=document.createElement("div").style,"AnimationEvent"in window||(delete wr.animationend.animation,delete wr.animationiteration.animation,delete wr.animationstart.animation),"TransitionEvent"in window||delete wr.transitionend.transition);function Ws(t){if(Io[t])return Io[t];if(!wr[t])return t;var s=wr[t],r;for(r in s)if(s.hasOwnProperty(r)&&r in ef)return Io[t]=s[r];return t}var tf=Ws("animationend"),sf=Ws("animationiteration"),rf=Ws("animationstart"),q0=Ws("transitionrun"),W0=Ws("transitionstart"),P0=Ws("transitioncancel"),nf=Ws("transitionend"),lf=new Map,Go="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(" ");Go.push("scrollEnd");function vi(t,s){lf.set(t,s),Hs(s,[t])}var jl=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)},ri=[],Cr=0,Xo=0;function Hl(){for(var t=Cr,s=Xo=Cr=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&&af(r,c,u)}}function Ul(t,s,r,a){ri[Cr++]=t,ri[Cr++]=s,ri[Cr++]=r,ri[Cr++]=a,Xo|=a,t.lanes|=a,t=t.alternate,t!==null&&(t.lanes|=a)}function Vo(t,s,r,a){return Ul(t,s,r,a),ql(t)}function Ps(t,s){return Ul(t,null,null,s),ql(t)}function af(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-Yt(r),t=u.hiddenUpdates,a=t[c],a===null?t[c]=[s]:a.push(s),s.lane=r|536870912),u):null}function ql(t){if(50<Un)throw Un=0,rh=null,Error(l(185));for(var s=t.return;s!==null;)t=s,s=t.return;return t.tag===3?t.stateNode:null}var kr={};function K0(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 It(t,s,r,a){return new K0(t,s,r,a)}function Fo(t){return t=t.prototype,!(!t||!t.isReactComponent)}function qi(t,s){var r=t.alternate;return r===null?(r=It(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 of(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 Wl(t,s,r,a,c,u){var g=0;if(a=t,typeof t=="function")Fo(t)&&(g=1);else if(typeof t=="string")g=XS(t,r,te.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ke:return t=It(31,r,s,c),t.elementType=ke,t.lanes=u,t;case R:return Ks(r.children,c,u,s);case j:g=8,c|=24;break;case X:return t=It(12,r,s,c|2),t.elementType=X,t.lanes=u,t;case H:return t=It(13,r,s,c),t.elementType=H,t.lanes=u,t;case Z:return t=It(19,r,s,c),t.elementType=Z,t.lanes=u,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case A:g=10;break e;case K:g=9;break e;case L:g=11;break e;case F:g=14;break e;case pe:g=16,a=null;break e}g=29,r=Error(l(130,t===null?"null":typeof t,"")),a=null}return s=It(g,r,s,c),s.elementType=t,s.type=a,s.lanes=u,s}function Ks(t,s,r,a){return t=It(7,t,a,s),t.lanes=r,t}function Zo(t,s,r){return t=It(6,t,null,s),t.lanes=r,t}function cf(t){var s=It(18,null,null,0);return s.stateNode=t,s}function Qo(t,s,r){return s=It(4,t.children!==null?t.children:[],t.key,s),s.lanes=r,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}var hf=new WeakMap;function ni(t,s){if(typeof t=="object"&&t!==null){var r=hf.get(t);return r!==void 0?r:(s={value:t,source:s,stack:od(s)},hf.set(t,s),s)}return{value:t,source:s,stack:od(s)}}var Er=[],Tr=0,Pl=null,vn=0,li=[],ai=0,cs=null,ki=1,Ei="";function Wi(t,s){Er[Tr++]=vn,Er[Tr++]=Pl,Pl=t,vn=s}function uf(t,s,r){li[ai++]=ki,li[ai++]=Ei,li[ai++]=cs,cs=t;var a=ki;t=Ei;var c=32-Yt(a)-1;a&=~(1<<c),r+=1;var u=32-Yt(s)+c;if(30<u){var g=c-c%5;u=(a&(1<<g)-1).toString(32),a>>=g,c-=g,ki=1<<32-Yt(s)+c|r<<c|a,Ei=u+t}else ki=1<<u|r<<c|a,Ei=t}function Jo(t){t.return!==null&&(Wi(t,1),uf(t,1,0))}function ec(t){for(;t===Pl;)Pl=Er[--Tr],Er[Tr]=null,vn=Er[--Tr],Er[Tr]=null;for(;t===cs;)cs=li[--ai],li[ai]=null,Ei=li[--ai],li[ai]=null,ki=li[--ai],li[ai]=null}function df(t,s){li[ai++]=ki,li[ai++]=Ei,li[ai++]=cs,ki=s.id,Ei=s.overflow,cs=t}var bt=null,We=null,Ee=!1,hs=null,oi=!1,tc=Error(l(519));function us(t){var s=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Sn(ni(s,t)),tc}function ff(t){var s=t.stateNode,r=t.type,a=t.memoizedProps;switch(s[yt]=t,s[Ot]=a,r){case"dialog":xe("cancel",s),xe("close",s);break;case"iframe":case"object":case"embed":xe("load",s);break;case"video":case"audio":for(r=0;r<Wn.length;r++)xe(Wn[r],s);break;case"source":xe("error",s);break;case"img":case"image":case"link":xe("error",s),xe("load",s);break;case"details":xe("toggle",s);break;case"input":xe("invalid",s),kd(s,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":xe("invalid",s);break;case"textarea":xe("invalid",s),Td(s,a.value,a.defaultValue,a.children)}r=a.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||s.textContent===""+r||a.suppressHydrationWarning===!0||M_(s.textContent,r)?(a.popover!=null&&(xe("beforetoggle",s),xe("toggle",s)),a.onScroll!=null&&xe("scroll",s),a.onScrollEnd!=null&&xe("scrollend",s),a.onClick!=null&&(s.onclick=Hi),s=!0):s=!1,s||us(t,!0)}function pf(t){for(bt=t.return;bt;)switch(bt.tag){case 5:case 31:case 13:oi=!1;return;case 27:case 3:oi=!0;return;default:bt=bt.return}}function Rr(t){if(t!==bt)return!1;if(!Ee)return pf(t),Ee=!0,!1;var s=t.tag,r;if((r=s!==3&&s!==27)&&((r=s===5)&&(r=t.type,r=!(r!=="form"&&r!=="button")||Sh(t.type,t.memoizedProps)),r=!r),r&&We&&us(t),pf(t),s===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));We=U_(t)}else if(s===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));We=U_(t)}else s===27?(s=We,ks(t.type)?(t=Ch,Ch=null,We=t):We=s):We=bt?hi(t.stateNode.nextSibling):null;return!0}function Ys(){We=bt=null,Ee=!1}function ic(){var t=hs;return t!==null&&(Ut===null?Ut=t:Ut.push.apply(Ut,t),hs=null),t}function Sn(t){hs===null?hs=[t]:hs.push(t)}var sc=k(null),$s=null,Pi=null;function ds(t,s,r){J(sc,s._currentValue),s._currentValue=r}function Ki(t){t._currentValue=sc.current,q(sc)}function rc(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 nc(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 v=u;u=c;for(var w=0;w<s.length;w++)if(v.context===s[w]){u.lanes|=r,v=u.alternate,v!==null&&(v.lanes|=r),rc(u.return,r,t),a||(g=null);break e}u=v.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),rc(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 Dr(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 v=c.type;$t(c.pendingProps.value,g.value)||(t!==null?t.push(v):t=[v])}}else if(c===ye.current){if(g=c.alternate,g===null)throw Error(l(387));g.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(t!==null?t.push(In):t=[In])}c=c.return}t!==null&&nc(s,t,r,a),s.flags|=262144}function Kl(t){for(t=t.firstContext;t!==null;){if(!$t(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Is(t){$s=t,Pi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function xt(t){return _f($s,t)}function Yl(t,s){return $s===null&&Is(t),_f(t,s)}function _f(t,s){var r=s._currentValue;if(s={context:s,memoizedValue:r,next:null},Pi===null){if(t===null)throw Error(l(308));Pi=s,t.dependencies={lanes:0,firstContext:s},t.flags|=524288}else Pi=Pi.next=s;return r}var Y0=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()})}},$0=e.unstable_scheduleCallback,I0=e.unstable_NormalPriority,tt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lc(){return{controller:new Y0,data:new Map,refCount:0}}function yn(t){t.refCount--,t.refCount===0&&$0(I0,function(){t.controller.abort()})}var bn=null,ac=0,Mr=0,Br=null;function G0(t,s){if(bn===null){var r=bn=[];ac=0,Mr=hh(),Br={status:"pending",value:void 0,then:function(a){r.push(a)}}}return ac++,s.then(gf,gf),s}function gf(){if(--ac===0&&bn!==null){Br!==null&&(Br.status="fulfilled");var t=bn;bn=null,Mr=0,Br=null;for(var s=0;s<t.length;s++)(0,t[s])()}}function X0(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 mf=T.S;T.S=function(t,s){e_=Pt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&G0(t,s),mf!==null&&mf(t,s)};var Gs=k(null);function oc(){var t=Gs.current;return t!==null?t:qe.pooledCache}function $l(t,s){s===null?J(Gs,Gs.current):J(Gs,s.pool)}function vf(){var t=oc();return t===null?null:{parent:tt._currentValue,pool:t}}var Ar=Error(l(460)),cc=Error(l(474)),Il=Error(l(542)),Gl={then:function(){}};function Sf(t){return t=t.status,t==="fulfilled"||t==="rejected"}function yf(t,s,r){switch(r=t[r],r===void 0?t.push(s):r!==s&&(s.then(Hi,Hi),s=r),s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,xf(t),t;default:if(typeof s.status=="string")s.then(Hi,Hi);else{if(t=qe,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,xf(t),t}throw Vs=s,Ar}}function Xs(t){try{var s=t._init;return s(t._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Vs=r,Ar):r}}var Vs=null;function bf(){if(Vs===null)throw Error(l(459));var t=Vs;return Vs=null,t}function xf(t){if(t===Ar||t===Il)throw Error(l(483))}var zr=null,xn=0;function Xl(t){var s=xn;return xn+=1,zr===null&&(zr=[]),yf(zr,t,s)}function wn(t,s){s=s.props.ref,t.ref=s!==void 0?s:null}function Vl(t,s){throw s.$$typeof===x?Error(l(525)):(t=Object.prototype.toString.call(s),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":t)))}function wf(t){function s(D,E){if(t){var M=D.deletions;M===null?(D.deletions=[E],D.flags|=16):M.push(E)}}function r(D,E){if(!t)return null;for(;E!==null;)s(D,E),E=E.sibling;return null}function a(D){for(var E=new Map;D!==null;)D.key!==null?E.set(D.key,D):E.set(D.index,D),D=D.sibling;return E}function c(D,E){return D=qi(D,E),D.index=0,D.sibling=null,D}function u(D,E,M){return D.index=M,t?(M=D.alternate,M!==null?(M=M.index,M<E?(D.flags|=67108866,E):M):(D.flags|=67108866,E)):(D.flags|=1048576,E)}function g(D){return t&&D.alternate===null&&(D.flags|=67108866),D}function v(D,E,M,P){return E===null||E.tag!==6?(E=Zo(M,D.mode,P),E.return=D,E):(E=c(E,M),E.return=D,E)}function w(D,E,M,P){var le=M.type;return le===R?U(D,E,M.props.children,P,M.key):E!==null&&(E.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===pe&&Xs(le)===E.type)?(E=c(E,M.props),wn(E,M),E.return=D,E):(E=Wl(M.type,M.key,M.props,null,D.mode,P),wn(E,M),E.return=D,E)}function B(D,E,M,P){return E===null||E.tag!==4||E.stateNode.containerInfo!==M.containerInfo||E.stateNode.implementation!==M.implementation?(E=Qo(M,D.mode,P),E.return=D,E):(E=c(E,M.children||[]),E.return=D,E)}function U(D,E,M,P,le){return E===null||E.tag!==7?(E=Ks(M,D.mode,P,le),E.return=D,E):(E=c(E,M),E.return=D,E)}function $(D,E,M){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=Zo(""+E,D.mode,M),E.return=D,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case C:return M=Wl(E.type,E.key,E.props,null,D.mode,M),wn(M,E),M.return=D,M;case b:return E=Qo(E,D.mode,M),E.return=D,E;case pe:return E=Xs(E),$(D,E,M)}if(ee(E)||V(E))return E=Ks(E,D.mode,M,null),E.return=D,E;if(typeof E.then=="function")return $(D,Xl(E),M);if(E.$$typeof===A)return $(D,Yl(D,E),M);Vl(D,E)}return null}function z(D,E,M,P){var le=E!==null?E.key:null;if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return le!==null?null:v(D,E,""+M,P);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case C:return M.key===le?w(D,E,M,P):null;case b:return M.key===le?B(D,E,M,P):null;case pe:return M=Xs(M),z(D,E,M,P)}if(ee(M)||V(M))return le!==null?null:U(D,E,M,P,null);if(typeof M.then=="function")return z(D,E,Xl(M),P);if(M.$$typeof===A)return z(D,E,Yl(D,M),P);Vl(D,M)}return null}function N(D,E,M,P,le){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return D=D.get(M)||null,v(E,D,""+P,le);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case C:return D=D.get(P.key===null?M:P.key)||null,w(E,D,P,le);case b:return D=D.get(P.key===null?M:P.key)||null,B(E,D,P,le);case pe:return P=Xs(P),N(D,E,M,P,le)}if(ee(P)||V(P))return D=D.get(M)||null,U(E,D,P,le,null);if(typeof P.then=="function")return N(D,E,M,Xl(P),le);if(P.$$typeof===A)return N(D,E,M,Yl(E,P),le);Vl(E,P)}return null}function re(D,E,M,P){for(var le=null,De=null,ne=E,me=E=0,Ce=null;ne!==null&&me<M.length;me++){ne.index>me?(Ce=ne,ne=null):Ce=ne.sibling;var Me=z(D,ne,M[me],P);if(Me===null){ne===null&&(ne=Ce);break}t&&ne&&Me.alternate===null&&s(D,ne),E=u(Me,E,me),De===null?le=Me:De.sibling=Me,De=Me,ne=Ce}if(me===M.length)return r(D,ne),Ee&&Wi(D,me),le;if(ne===null){for(;me<M.length;me++)ne=$(D,M[me],P),ne!==null&&(E=u(ne,E,me),De===null?le=ne:De.sibling=ne,De=ne);return Ee&&Wi(D,me),le}for(ne=a(ne);me<M.length;me++)Ce=N(ne,D,me,M[me],P),Ce!==null&&(t&&Ce.alternate!==null&&ne.delete(Ce.key===null?me:Ce.key),E=u(Ce,E,me),De===null?le=Ce:De.sibling=Ce,De=Ce);return t&&ne.forEach(function(Ms){return s(D,Ms)}),Ee&&Wi(D,me),le}function ce(D,E,M,P){if(M==null)throw Error(l(151));for(var le=null,De=null,ne=E,me=E=0,Ce=null,Me=M.next();ne!==null&&!Me.done;me++,Me=M.next()){ne.index>me?(Ce=ne,ne=null):Ce=ne.sibling;var Ms=z(D,ne,Me.value,P);if(Ms===null){ne===null&&(ne=Ce);break}t&&ne&&Ms.alternate===null&&s(D,ne),E=u(Ms,E,me),De===null?le=Ms:De.sibling=Ms,De=Ms,ne=Ce}if(Me.done)return r(D,ne),Ee&&Wi(D,me),le;if(ne===null){for(;!Me.done;me++,Me=M.next())Me=$(D,Me.value,P),Me!==null&&(E=u(Me,E,me),De===null?le=Me:De.sibling=Me,De=Me);return Ee&&Wi(D,me),le}for(ne=a(ne);!Me.done;me++,Me=M.next())Me=N(ne,D,me,Me.value,P),Me!==null&&(t&&Me.alternate!==null&&ne.delete(Me.key===null?me:Me.key),E=u(Me,E,me),De===null?le=Me:De.sibling=Me,De=Me);return t&&ne.forEach(function(ny){return s(D,ny)}),Ee&&Wi(D,me),le}function He(D,E,M,P){if(typeof M=="object"&&M!==null&&M.type===R&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case C:e:{for(var le=M.key;E!==null;){if(E.key===le){if(le=M.type,le===R){if(E.tag===7){r(D,E.sibling),P=c(E,M.props.children),P.return=D,D=P;break e}}else if(E.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===pe&&Xs(le)===E.type){r(D,E.sibling),P=c(E,M.props),wn(P,M),P.return=D,D=P;break e}r(D,E);break}else s(D,E);E=E.sibling}M.type===R?(P=Ks(M.props.children,D.mode,P,M.key),P.return=D,D=P):(P=Wl(M.type,M.key,M.props,null,D.mode,P),wn(P,M),P.return=D,D=P)}return g(D);case b:e:{for(le=M.key;E!==null;){if(E.key===le)if(E.tag===4&&E.stateNode.containerInfo===M.containerInfo&&E.stateNode.implementation===M.implementation){r(D,E.sibling),P=c(E,M.children||[]),P.return=D,D=P;break e}else{r(D,E);break}else s(D,E);E=E.sibling}P=Qo(M,D.mode,P),P.return=D,D=P}return g(D);case pe:return M=Xs(M),He(D,E,M,P)}if(ee(M))return re(D,E,M,P);if(V(M)){if(le=V(M),typeof le!="function")throw Error(l(150));return M=le.call(M),ce(D,E,M,P)}if(typeof M.then=="function")return He(D,E,Xl(M),P);if(M.$$typeof===A)return He(D,E,Yl(D,M),P);Vl(D,M)}return typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint"?(M=""+M,E!==null&&E.tag===6?(r(D,E.sibling),P=c(E,M),P.return=D,D=P):(r(D,E),P=Zo(M,D.mode,P),P.return=D,D=P),g(D)):r(D,E)}return function(D,E,M,P){try{xn=0;var le=He(D,E,M,P);return zr=null,le}catch(ne){if(ne===Ar||ne===Il)throw ne;var De=It(29,ne,null,D.mode);return De.lanes=P,De.return=D,De}}}var Fs=wf(!0),Cf=wf(!1),fs=!1;function hc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uc(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 ps(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function _s(t,s,r){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(Be&2)!==0){var c=a.pending;return c===null?s.next=s:(s.next=c.next,c.next=s),a.pending=s,s=ql(t),af(t,null,r),s}return Ul(t,a,s,r),ql(t)}function Cn(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,pd(t,r)}}function dc(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 fc=!1;function kn(){if(fc){var t=Br;if(t!==null)throw t}}function En(t,s,r,a){fc=!1;var c=t.updateQueue;fs=!1;var u=c.firstBaseUpdate,g=c.lastBaseUpdate,v=c.shared.pending;if(v!==null){c.shared.pending=null;var w=v,B=w.next;w.next=null,g===null?u=B:g.next=B,g=w;var U=t.alternate;U!==null&&(U=U.updateQueue,v=U.lastBaseUpdate,v!==g&&(v===null?U.firstBaseUpdate=B:v.next=B,U.lastBaseUpdate=w))}if(u!==null){var $=c.baseState;g=0,U=B=w=null,v=u;do{var z=v.lane&-536870913,N=z!==v.lane;if(N?(we&z)===z:(a&z)===z){z!==0&&z===Mr&&(fc=!0),U!==null&&(U=U.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var re=t,ce=v;z=s;var He=r;switch(ce.tag){case 1:if(re=ce.payload,typeof re=="function"){$=re.call(He,$,z);break e}$=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=ce.payload,z=typeof re=="function"?re.call(He,$,z):re,z==null)break e;$=S({},$,z);break e;case 2:fs=!0}}z=v.callback,z!==null&&(t.flags|=64,N&&(t.flags|=8192),N=c.callbacks,N===null?c.callbacks=[z]:N.push(z))}else N={lane:z,tag:v.tag,payload:v.payload,callback:v.callback,next:null},U===null?(B=U=N,w=$):U=U.next=N,g|=z;if(v=v.next,v===null){if(v=c.shared.pending,v===null)break;N=v,v=N.next,N.next=null,c.lastBaseUpdate=N,c.shared.pending=null}}while(!0);U===null&&(w=$),c.baseState=w,c.firstBaseUpdate=B,c.lastBaseUpdate=U,u===null&&(c.shared.lanes=0),ys|=g,t.lanes=g,t.memoizedState=$}}function kf(t,s){if(typeof t!="function")throw Error(l(191,t));t.call(s)}function Ef(t,s){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;t<r.length;t++)kf(r[t],s)}var Or=k(null),Fl=k(0);function Tf(t,s){t=Qi,J(Fl,t),J(Or,s),Qi=t|s.baseLanes}function pc(){J(Fl,Qi),J(Or,Or.current)}function _c(){Qi=Fl.current,q(Or),q(Fl)}var Gt=k(null),ci=null;function gs(t){var s=t.alternate;J(Qe,Qe.current&1),J(Gt,t),ci===null&&(s===null||Or.current!==null||s.memoizedState!==null)&&(ci=t)}function gc(t){J(Qe,Qe.current),J(Gt,t),ci===null&&(ci=t)}function Rf(t){t.tag===22?(J(Qe,Qe.current),J(Gt,t),ci===null&&(ci=t)):ms()}function ms(){J(Qe,Qe.current),J(Gt,Gt.current)}function Xt(t){q(Gt),ci===t&&(ci=null),q(Qe)}var Qe=k(0);function Zl(t){for(var s=t;s!==null;){if(s.tag===13){var r=s.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||xh(r)||wh(r)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){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}var Yi=0,ge=null,Ne=null,it=null,Ql=!1,Lr=!1,Zs=!1,Jl=0,Tn=0,Nr=null,V0=0;function Xe(){throw Error(l(321))}function mc(t,s){if(s===null)return!1;for(var r=0;r<s.length&&r<t.length;r++)if(!$t(t[r],s[r]))return!1;return!0}function vc(t,s,r,a,c,u){return Yi=u,ge=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,T.H=t===null||t.memoizedState===null?up:zc,Zs=!1,u=r(a,c),Zs=!1,Lr&&(u=Mf(s,r,a,c)),Df(t),u}function Df(t){T.H=Mn;var s=Ne!==null&&Ne.next!==null;if(Yi=0,it=Ne=ge=null,Ql=!1,Tn=0,Nr=null,s)throw Error(l(300));t===null||st||(t=t.dependencies,t!==null&&Kl(t)&&(st=!0))}function Mf(t,s,r,a){ge=t;var c=0;do{if(Lr&&(Nr=null),Tn=0,Lr=!1,25<=c)throw Error(l(301));if(c+=1,it=Ne=null,t.updateQueue!=null){var u=t.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}T.H=dp,u=s(r,a)}while(Lr);return u}function F0(){var t=T.H,s=t.useState()[0];return s=typeof s.then=="function"?Rn(s):s,t=t.useState()[0],(Ne!==null?Ne.memoizedState:null)!==t&&(ge.flags|=1024),s}function Sc(){var t=Jl!==0;return Jl=0,t}function yc(t,s,r){s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~r}function bc(t){if(Ql){for(t=t.memoizedState;t!==null;){var s=t.queue;s!==null&&(s.pending=null),t=t.next}Ql=!1}Yi=0,it=Ne=ge=null,Lr=!1,Tn=Jl=0,Nr=null}function Dt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return it===null?ge.memoizedState=it=t:it=it.next=t,it}function Je(){if(Ne===null){var t=ge.alternate;t=t!==null?t.memoizedState:null}else t=Ne.next;var s=it===null?ge.memoizedState:it.next;if(s!==null)it=s,Ne=t;else{if(t===null)throw ge.alternate===null?Error(l(467)):Error(l(310));Ne=t,t={memoizedState:Ne.memoizedState,baseState:Ne.baseState,baseQueue:Ne.baseQueue,queue:Ne.queue,next:null},it===null?ge.memoizedState=it=t:it=it.next=t}return it}function ea(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Rn(t){var s=Tn;return Tn+=1,Nr===null&&(Nr=[]),t=yf(Nr,t,s),s=ge,(it===null?s.memoizedState:it.next)===null&&(s=s.alternate,T.H=s===null||s.memoizedState===null?up:zc),t}function ta(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Rn(t);if(t.$$typeof===A)return xt(t)}throw Error(l(438,String(t)))}function xc(t){var s=null,r=ge.updateQueue;if(r!==null&&(s=r.memoCache),s==null){var a=ge.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=ea(),ge.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]=St;return s.index++,r}function $i(t,s){return typeof s=="function"?s(t):s}function ia(t){var s=Je();return wc(s,Ne,t)}function wc(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 v=g=null,w=null,B=s,U=!1;do{var $=B.lane&-536870913;if($!==B.lane?(we&$)===$:(Yi&$)===$){var z=B.revertLane;if(z===0)w!==null&&(w=w.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),$===Mr&&(U=!0);else if((Yi&z)===z){B=B.next,z===Mr&&(U=!0);continue}else $={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},w===null?(v=w=$,g=u):w=w.next=$,ge.lanes|=z,ys|=z;$=B.action,Zs&&r(u,$),u=B.hasEagerState?B.eagerState:r(u,$)}else z={lane:$,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},w===null?(v=w=z,g=u):w=w.next=z,ge.lanes|=$,ys|=$;B=B.next}while(B!==null&&B!==s);if(w===null?g=u:w.next=v,!$t(u,t.memoizedState)&&(st=!0,U&&(r=Br,r!==null)))throw r;t.memoizedState=u,t.baseState=g,t.baseQueue=w,a.lastRenderedState=u}return c===null&&(a.lanes=0),[t.memoizedState,a.dispatch]}function Cc(t){var s=Je(),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);$t(u,s.memoizedState)||(st=!0),s.memoizedState=u,s.baseQueue===null&&(s.baseState=u),r.lastRenderedState=u}return[u,a]}function Bf(t,s,r){var a=ge,c=Je(),u=Ee;if(u){if(r===void 0)throw Error(l(407));r=r()}else r=s();var g=!$t((Ne||c).memoizedState,r);if(g&&(c.memoizedState=r,st=!0),c=c.queue,Tc(Of.bind(null,a,c,t),[t]),c.getSnapshot!==s||g||it!==null&&it.memoizedState.tag&1){if(a.flags|=2048,jr(9,{destroy:void 0},zf.bind(null,a,c,r,s),null),qe===null)throw Error(l(349));u||(Yi&127)!==0||Af(a,s,r)}return r}function Af(t,s,r){t.flags|=16384,t={getSnapshot:s,value:r},s=ge.updateQueue,s===null?(s=ea(),ge.updateQueue=s,s.stores=[t]):(r=s.stores,r===null?s.stores=[t]:r.push(t))}function zf(t,s,r,a){s.value=r,s.getSnapshot=a,Lf(s)&&Nf(t)}function Of(t,s,r){return r(function(){Lf(s)&&Nf(t)})}function Lf(t){var s=t.getSnapshot;t=t.value;try{var r=s();return!$t(t,r)}catch{return!0}}function Nf(t){var s=Ps(t,2);s!==null&&qt(s,t,2)}function kc(t){var s=Dt();if(typeof t=="function"){var r=t;if(t=r(),Zs){ls(!0);try{r()}finally{ls(!1)}}}return s.memoizedState=s.baseState=t,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:t},s}function jf(t,s,r,a){return t.baseState=r,wc(t,Ne,typeof a=="function"?a:$i)}function Z0(t,s,r,a,c){if(na(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)}};T.T!==null?r(!0):u.isTransition=!1,a(u),r=s.pending,r===null?(u.next=s.pending=u,Hf(s,u)):(u.next=r.next,s.pending=r.next=u)}}function Hf(t,s){var r=s.action,a=s.payload,c=t.state;if(s.isTransition){var u=T.T,g={};T.T=g;try{var v=r(c,a),w=T.S;w!==null&&w(g,v),Uf(t,s,v)}catch(B){Ec(t,s,B)}finally{u!==null&&g.types!==null&&(u.types=g.types),T.T=u}}else try{u=r(c,a),Uf(t,s,u)}catch(B){Ec(t,s,B)}}function Uf(t,s,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(a){qf(t,s,a)},function(a){return Ec(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,Hf(t,r)))}function Ec(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 Pf(t,s){return s}function Kf(t,s){if(Ee){var r=qe.formState;if(r!==null){e:{var a=ge;if(Ee){if(We){t:{for(var c=We,u=oi;c.nodeType!==8;){if(!u){c=null;break t}if(c=hi(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){We=hi(c.nextSibling),a=c.data==="F!";break e}}us(a)}a=!1}a&&(s=r[0])}}return r=Dt(),r.memoizedState=r.baseState=s,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pf,lastRenderedState:s},r.queue=a,r=op.bind(null,ge,a),a.dispatch=r,a=kc(!1),u=Ac.bind(null,ge,!1,a.queue),a=Dt(),c={state:s,dispatch:null,action:t,pending:null},a.queue=c,r=Z0.bind(null,ge,c,u,r),c.dispatch=r,a.memoizedState=t,[s,r,!1]}function Yf(t){var s=Je();return $f(s,Ne,t)}function $f(t,s,r){if(s=wc(t,s,Pf)[0],t=ia($i)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var a=Rn(s)}catch(g){throw g===Ar?Il:g}else a=s;s=Je();var c=s.queue,u=c.dispatch;return r!==s.memoizedState&&(ge.flags|=2048,jr(9,{destroy:void 0},Q0.bind(null,c,r),null)),[a,u,t]}function Q0(t,s){t.action=s}function If(t){var s=Je(),r=Ne;if(r!==null)return $f(s,r,t);Je(),s=s.memoizedState,r=Je();var a=r.queue.dispatch;return r.memoizedState=t,[s,a,!1]}function jr(t,s,r,a){return t={tag:t,create:r,deps:a,inst:s,next:null},s=ge.updateQueue,s===null&&(s=ea(),ge.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 Gf(){return Je().memoizedState}function sa(t,s,r,a){var c=Dt();ge.flags|=t,c.memoizedState=jr(1|s,{destroy:void 0},r,a===void 0?null:a)}function ra(t,s,r,a){var c=Je();a=a===void 0?null:a;var u=c.memoizedState.inst;Ne!==null&&a!==null&&mc(a,Ne.memoizedState.deps)?c.memoizedState=jr(s,u,r,a):(ge.flags|=t,c.memoizedState=jr(1|s,u,r,a))}function Xf(t,s){sa(8390656,8,t,s)}function Tc(t,s){ra(2048,8,t,s)}function J0(t){ge.flags|=4;var s=ge.updateQueue;if(s===null)s=ea(),ge.updateQueue=s,s.events=[t];else{var r=s.events;r===null?s.events=[t]:r.push(t)}}function Vf(t){var s=Je().memoizedState;return J0({ref:s,nextImpl:t}),function(){if((Be&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}function Ff(t,s){return ra(4,2,t,s)}function Zf(t,s){return ra(4,4,t,s)}function Qf(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 Jf(t,s,r){r=r!=null?r.concat([t]):null,ra(4,4,Qf.bind(null,s,t),r)}function Rc(){}function ep(t,s){var r=Je();s=s===void 0?null:s;var a=r.memoizedState;return s!==null&&mc(s,a[1])?a[0]:(r.memoizedState=[t,s],t)}function tp(t,s){var r=Je();s=s===void 0?null:s;var a=r.memoizedState;if(s!==null&&mc(s,a[1]))return a[0];if(a=t(),Zs){ls(!0);try{t()}finally{ls(!1)}}return r.memoizedState=[a,s],a}function Dc(t,s,r){return r===void 0||(Yi&1073741824)!==0&&(we&261930)===0?t.memoizedState=s:(t.memoizedState=r,t=i_(),ge.lanes|=t,ys|=t,r)}function ip(t,s,r,a){return $t(r,s)?r:Or.current!==null?(t=Dc(t,r,a),$t(t,s)||(st=!0),t):(Yi&42)===0||(Yi&1073741824)!==0&&(we&261930)===0?(st=!0,t.memoizedState=r):(t=i_(),ge.lanes|=t,ys|=t,s)}function sp(t,s,r,a,c){var u=W.p;W.p=u!==0&&8>u?u:8;var g=T.T,v={};T.T=v,Ac(t,!1,s,r);try{var w=c(),B=T.S;if(B!==null&&B(v,w),w!==null&&typeof w=="object"&&typeof w.then=="function"){var U=X0(w,a);Dn(t,s,U,Zt(t))}else Dn(t,s,a,Zt(t))}catch($){Dn(t,s,{then:function(){},status:"rejected",reason:$},Zt())}finally{W.p=u,g!==null&&v.types!==null&&(g.types=v.types),T.T=g}}function eS(){}function Mc(t,s,r,a){if(t.tag!==5)throw Error(l(476));var c=rp(t).queue;sp(t,c,s,Y,r===null?eS:function(){return np(t),r(a)})}function rp(t){var s=t.memoizedState;if(s!==null)return s;s={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:Y},next:null};var r={};return s.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:r},next:null},t.memoizedState=s,t=t.alternate,t!==null&&(t.memoizedState=s),s}function np(t){var s=rp(t);s.next===null&&(s=t.alternate.memoizedState),Dn(t,s.next.queue,{},Zt())}function Bc(){return xt(In)}function lp(){return Je().memoizedState}function ap(){return Je().memoizedState}function tS(t){for(var s=t.return;s!==null;){switch(s.tag){case 24:case 3:var r=Zt();t=ps(r);var a=_s(s,t,r);a!==null&&(qt(a,s,r),Cn(a,s,r)),s={cache:lc()},t.payload=s;return}s=s.return}}function iS(t,s,r){var a=Zt();r={lane:a,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},na(t)?cp(s,r):(r=Vo(t,s,r,a),r!==null&&(qt(r,t,a),hp(r,s,a)))}function op(t,s,r){var a=Zt();Dn(t,s,r,a)}function Dn(t,s,r,a){var c={lane:a,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(na(t))cp(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,v=u(g,r);if(c.hasEagerState=!0,c.eagerState=v,$t(v,g))return Ul(t,s,c,0),qe===null&&Hl(),!1}catch{}if(r=Vo(t,s,c,a),r!==null)return qt(r,t,a),hp(r,s,a),!0}return!1}function Ac(t,s,r,a){if(a={lane:2,revertLane:hh(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},na(t)){if(s)throw Error(l(479))}else s=Vo(t,r,a,2),s!==null&&qt(s,t,2)}function na(t){var s=t.alternate;return t===ge||s!==null&&s===ge}function cp(t,s){Lr=Ql=!0;var r=t.pending;r===null?s.next=s:(s.next=r.next,r.next=s),t.pending=s}function hp(t,s,r){if((r&4194048)!==0){var a=s.lanes;a&=t.pendingLanes,r|=a,s.lanes=r,pd(t,r)}}var Mn={readContext:xt,use:ta,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useLayoutEffect:Xe,useInsertionEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useSyncExternalStore:Xe,useId:Xe,useHostTransitionStatus:Xe,useFormState:Xe,useActionState:Xe,useOptimistic:Xe,useMemoCache:Xe,useCacheRefresh:Xe};Mn.useEffectEvent=Xe;var up={readContext:xt,use:ta,useCallback:function(t,s){return Dt().memoizedState=[t,s===void 0?null:s],t},useContext:xt,useEffect:Xf,useImperativeHandle:function(t,s,r){r=r!=null?r.concat([t]):null,sa(4194308,4,Qf.bind(null,s,t),r)},useLayoutEffect:function(t,s){return sa(4194308,4,t,s)},useInsertionEffect:function(t,s){sa(4,2,t,s)},useMemo:function(t,s){var r=Dt();s=s===void 0?null:s;var a=t();if(Zs){ls(!0);try{t()}finally{ls(!1)}}return r.memoizedState=[a,s],a},useReducer:function(t,s,r){var a=Dt();if(r!==void 0){var c=r(s);if(Zs){ls(!0);try{r(s)}finally{ls(!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=iS.bind(null,ge,t),[a.memoizedState,t]},useRef:function(t){var s=Dt();return t={current:t},s.memoizedState=t},useState:function(t){t=kc(t);var s=t.queue,r=op.bind(null,ge,s);return s.dispatch=r,[t.memoizedState,r]},useDebugValue:Rc,useDeferredValue:function(t,s){var r=Dt();return Dc(r,t,s)},useTransition:function(){var t=kc(!1);return t=sp.bind(null,ge,t.queue,!0,!1),Dt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,s,r){var a=ge,c=Dt();if(Ee){if(r===void 0)throw Error(l(407));r=r()}else{if(r=s(),qe===null)throw Error(l(349));(we&127)!==0||Af(a,s,r)}c.memoizedState=r;var u={value:r,getSnapshot:s};return c.queue=u,Xf(Of.bind(null,a,u,t),[t]),a.flags|=2048,jr(9,{destroy:void 0},zf.bind(null,a,u,r,s),null),r},useId:function(){var t=Dt(),s=qe.identifierPrefix;if(Ee){var r=Ei,a=ki;r=(a&~(1<<32-Yt(a)-1)).toString(32)+r,s="_"+s+"R_"+r,r=Jl++,0<r&&(s+="H"+r.toString(32)),s+="_"}else r=V0++,s="_"+s+"r_"+r.toString(32)+"_";return t.memoizedState=s},useHostTransitionStatus:Bc,useFormState:Kf,useActionState:Kf,useOptimistic:function(t){var s=Dt();s.memoizedState=s.baseState=t;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=r,s=Ac.bind(null,ge,!0,r),r.dispatch=s,[t,s]},useMemoCache:xc,useCacheRefresh:function(){return Dt().memoizedState=tS.bind(null,ge)},useEffectEvent:function(t){var s=Dt(),r={impl:t};return s.memoizedState=r,function(){if((Be&2)!==0)throw Error(l(440));return r.impl.apply(void 0,arguments)}}},zc={readContext:xt,use:ta,useCallback:ep,useContext:xt,useEffect:Tc,useImperativeHandle:Jf,useInsertionEffect:Ff,useLayoutEffect:Zf,useMemo:tp,useReducer:ia,useRef:Gf,useState:function(){return ia($i)},useDebugValue:Rc,useDeferredValue:function(t,s){var r=Je();return ip(r,Ne.memoizedState,t,s)},useTransition:function(){var t=ia($i)[0],s=Je().memoizedState;return[typeof t=="boolean"?t:Rn(t),s]},useSyncExternalStore:Bf,useId:lp,useHostTransitionStatus:Bc,useFormState:Yf,useActionState:Yf,useOptimistic:function(t,s){var r=Je();return jf(r,Ne,t,s)},useMemoCache:xc,useCacheRefresh:ap};zc.useEffectEvent=Vf;var dp={readContext:xt,use:ta,useCallback:ep,useContext:xt,useEffect:Tc,useImperativeHandle:Jf,useInsertionEffect:Ff,useLayoutEffect:Zf,useMemo:tp,useReducer:Cc,useRef:Gf,useState:function(){return Cc($i)},useDebugValue:Rc,useDeferredValue:function(t,s){var r=Je();return Ne===null?Dc(r,t,s):ip(r,Ne.memoizedState,t,s)},useTransition:function(){var t=Cc($i)[0],s=Je().memoizedState;return[typeof t=="boolean"?t:Rn(t),s]},useSyncExternalStore:Bf,useId:lp,useHostTransitionStatus:Bc,useFormState:If,useActionState:If,useOptimistic:function(t,s){var r=Je();return Ne!==null?jf(r,Ne,t,s):(r.baseState=t,[t,r.queue.dispatch])},useMemoCache:xc,useCacheRefresh:ap};dp.useEffectEvent=Vf;function Oc(t,s,r,a){s=t.memoizedState,r=r(a,s),r=r==null?s:S({},s,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var Lc={enqueueSetState:function(t,s,r){t=t._reactInternals;var a=Zt(),c=ps(a);c.payload=s,r!=null&&(c.callback=r),s=_s(t,c,a),s!==null&&(qt(s,t,a),Cn(s,t,a))},enqueueReplaceState:function(t,s,r){t=t._reactInternals;var a=Zt(),c=ps(a);c.tag=1,c.payload=s,r!=null&&(c.callback=r),s=_s(t,c,a),s!==null&&(qt(s,t,a),Cn(s,t,a))},enqueueForceUpdate:function(t,s){t=t._reactInternals;var r=Zt(),a=ps(r);a.tag=2,s!=null&&(a.callback=s),s=_s(t,a,r),s!==null&&(qt(s,t,r),Cn(s,t,r))}};function fp(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?!gn(r,a)||!gn(c,u):!0}function pp(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&&Lc.enqueueReplaceState(s,s.state,null)}function Qs(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=S({},r));for(var c in t)r[c]===void 0&&(r[c]=t[c])}return r}function _p(t){jl(t)}function gp(t){console.error(t)}function mp(t){jl(t)}function la(t,s){try{var r=t.onUncaughtError;r(s.value,{componentStack:s.stack})}catch(a){setTimeout(function(){throw a})}}function vp(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 Nc(t,s,r){return r=ps(r),r.tag=3,r.payload={element:null},r.callback=function(){la(t,s)},r}function Sp(t){return t=ps(t),t.tag=3,t}function yp(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(){vp(s,r,a)}}var g=r.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(t.callback=function(){vp(s,r,a),typeof c!="function"&&(bs===null?bs=new Set([this]):bs.add(this));var v=a.stack;this.componentDidCatch(a.value,{componentStack:v!==null?v:""})})}function sS(t,s,r,a,c){if(r.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(s=r.alternate,s!==null&&Dr(s,r,c,!0),r=Gt.current,r!==null){switch(r.tag){case 31:case 13:return ci===null?va():r.alternate===null&&Ve===0&&(Ve=3),r.flags&=-257,r.flags|=65536,r.lanes=c,a===Gl?r.flags|=16384:(s=r.updateQueue,s===null?r.updateQueue=new Set([a]):s.add(a),ah(t,a,c)),!1;case 22:return r.flags|=65536,a===Gl?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)),ah(t,a,c)),!1}throw Error(l(435,r.tag))}return ah(t,a,c),va(),!1}if(Ee)return s=Gt.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=c,a!==tc&&(t=Error(l(422),{cause:a}),Sn(ni(t,r)))):(a!==tc&&(s=Error(l(423),{cause:a}),Sn(ni(s,r))),t=t.current.alternate,t.flags|=65536,c&=-c,t.lanes|=c,a=ni(a,r),c=Nc(t.stateNode,a,c),dc(t,c),Ve!==4&&(Ve=2)),!1;var u=Error(l(520),{cause:a});if(u=ni(u,r),Hn===null?Hn=[u]:Hn.push(u),Ve!==4&&(Ve=2),s===null)return!0;a=ni(a,r),r=s;do{switch(r.tag){case 3:return r.flags|=65536,t=c&-c,r.lanes|=t,t=Nc(r.stateNode,a,t),dc(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"&&(bs===null||!bs.has(u))))return r.flags|=65536,c&=-c,r.lanes|=c,c=Sp(c),yp(c,t,r,a),dc(r,c),!1}r=r.return}while(r!==null);return!1}var jc=Error(l(461)),st=!1;function wt(t,s,r,a){s.child=t===null?Cf(s,null,r,a):Fs(s,t.child,r,a)}function bp(t,s,r,a,c){r=r.render;var u=s.ref;if("ref"in a){var g={};for(var v in a)v!=="ref"&&(g[v]=a[v])}else g=a;return Is(s),a=vc(t,s,r,g,u,c),v=Sc(),t!==null&&!st?(yc(t,s,c),Ii(t,s,c)):(Ee&&v&&Jo(s),s.flags|=1,wt(t,s,a,c),s.child)}function xp(t,s,r,a,c){if(t===null){var u=r.type;return typeof u=="function"&&!Fo(u)&&u.defaultProps===void 0&&r.compare===null?(s.tag=15,s.type=u,wp(t,s,u,a,c)):(t=Wl(r.type,null,a,s,s.mode,c),t.ref=s.ref,t.return=s,s.child=t)}if(u=t.child,!$c(t,c)){var g=u.memoizedProps;if(r=r.compare,r=r!==null?r:gn,r(g,a)&&t.ref===s.ref)return Ii(t,s,c)}return s.flags|=1,t=qi(u,a),t.ref=s.ref,t.return=s,s.child=t}function wp(t,s,r,a,c){if(t!==null){var u=t.memoizedProps;if(gn(u,a)&&t.ref===s.ref)if(st=!1,s.pendingProps=a=u,$c(t,c))(t.flags&131072)!==0&&(st=!0);else return s.lanes=t.lanes,Ii(t,s,c)}return Hc(t,s,r,a,c)}function Cp(t,s,r,a){var c=a.children,u=t!==null?t.memoizedState:null;if(t===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((s.flags&128)!==0){if(u=u!==null?u.baseLanes|r:r,t!==null){for(a=s.child=t.child,c=0;a!==null;)c=c|a.lanes|a.childLanes,a=a.sibling;a=c&~u}else a=0,s.child=null;return kp(t,s,u,r,a)}if((r&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},t!==null&&$l(s,u!==null?u.cachePool:null),u!==null?Tf(s,u):pc(),Rf(s);else return a=s.lanes=536870912,kp(t,s,u!==null?u.baseLanes|r:r,r,a)}else u!==null?($l(s,u.cachePool),Tf(s,u),ms(),s.memoizedState=null):(t!==null&&$l(s,null),pc(),ms());return wt(t,s,c,r),s.child}function Bn(t,s){return t!==null&&t.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function kp(t,s,r,a,c){var u=oc();return u=u===null?null:{parent:tt._currentValue,pool:u},s.memoizedState={baseLanes:r,cachePool:u},t!==null&&$l(s,null),pc(),Rf(s),t!==null&&Dr(t,s,a,!0),s.childLanes=c,null}function aa(t,s){return s=ca({mode:s.mode,children:s.children},t.mode),s.ref=t.ref,t.child=s,s.return=t,s}function Ep(t,s,r){return Fs(s,t.child,null,r),t=aa(s,s.pendingProps),t.flags|=2,Xt(s),s.memoizedState=null,t}function rS(t,s,r){var a=s.pendingProps,c=(s.flags&128)!==0;if(s.flags&=-129,t===null){if(Ee){if(a.mode==="hidden")return t=aa(s,a),s.lanes=536870912,Bn(null,t);if(gc(s),(t=We)?(t=H_(t,oi),t=t!==null&&t.data==="&"?t:null,t!==null&&(s.memoizedState={dehydrated:t,treeContext:cs!==null?{id:ki,overflow:Ei}:null,retryLane:536870912,hydrationErrors:null},r=cf(t),r.return=s,s.child=r,bt=s,We=null)):t=null,t===null)throw us(s);return s.lanes=536870912,null}return aa(s,a)}var u=t.memoizedState;if(u!==null){var g=u.dehydrated;if(gc(s),c)if(s.flags&256)s.flags&=-257,s=Ep(t,s,r);else if(s.memoizedState!==null)s.child=t.child,s.flags|=128,s=null;else throw Error(l(558));else if(st||Dr(t,s,r,!1),c=(r&t.childLanes)!==0,st||c){if(a=qe,a!==null&&(g=_d(a,r),g!==0&&g!==u.retryLane))throw u.retryLane=g,Ps(t,g),qt(a,t,g),jc;va(),s=Ep(t,s,r)}else t=u.treeContext,We=hi(g.nextSibling),bt=s,Ee=!0,hs=null,oi=!1,t!==null&&df(s,t),s=aa(s,a),s.flags|=4096;return s}return t=qi(t.child,{mode:a.mode,children:a.children}),t.ref=s.ref,s.child=t,t.return=s,t}function oa(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 Hc(t,s,r,a,c){return Is(s),r=vc(t,s,r,a,void 0,c),a=Sc(),t!==null&&!st?(yc(t,s,c),Ii(t,s,c)):(Ee&&a&&Jo(s),s.flags|=1,wt(t,s,r,c),s.child)}function Tp(t,s,r,a,c,u){return Is(s),s.updateQueue=null,r=Mf(s,a,r,c),Df(t),a=Sc(),t!==null&&!st?(yc(t,s,u),Ii(t,s,u)):(Ee&&a&&Jo(s),s.flags|=1,wt(t,s,r,u),s.child)}function Rp(t,s,r,a,c){if(Is(s),s.stateNode===null){var u=kr,g=r.contextType;typeof g=="object"&&g!==null&&(u=xt(g)),u=new r(a,u),s.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Lc,s.stateNode=u,u._reactInternals=s,u=s.stateNode,u.props=a,u.state=s.memoizedState,u.refs={},hc(s),g=r.contextType,u.context=typeof g=="object"&&g!==null?xt(g):kr,u.state=s.memoizedState,g=r.getDerivedStateFromProps,typeof g=="function"&&(Oc(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&&Lc.enqueueReplaceState(u,u.state,null),En(s,a,u,c),kn(),u.state=s.memoizedState),typeof u.componentDidMount=="function"&&(s.flags|=4194308),a=!0}else if(t===null){u=s.stateNode;var v=s.memoizedProps,w=Qs(r,v);u.props=w;var B=u.context,U=r.contextType;g=kr,typeof U=="object"&&U!==null&&(g=xt(U));var $=r.getDerivedStateFromProps;U=typeof $=="function"||typeof u.getSnapshotBeforeUpdate=="function",v=s.pendingProps!==v,U||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(v||B!==g)&&pp(s,u,a,g),fs=!1;var z=s.memoizedState;u.state=z,En(s,a,u,c),kn(),B=s.memoizedState,v||z!==B||fs?(typeof $=="function"&&(Oc(s,r,$,a),B=s.memoizedState),(w=fs||fp(s,r,w,a,z,B,g))?(U||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=w):(typeof u.componentDidMount=="function"&&(s.flags|=4194308),a=!1)}else{u=s.stateNode,uc(t,s),g=s.memoizedProps,U=Qs(r,g),u.props=U,$=s.pendingProps,z=u.context,B=r.contextType,w=kr,typeof B=="object"&&B!==null&&(w=xt(B)),v=r.getDerivedStateFromProps,(B=typeof v=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g!==$||z!==w)&&pp(s,u,a,w),fs=!1,z=s.memoizedState,u.state=z,En(s,a,u,c),kn();var N=s.memoizedState;g!==$||z!==N||fs||t!==null&&t.dependencies!==null&&Kl(t.dependencies)?(typeof v=="function"&&(Oc(s,r,v,a),N=s.memoizedState),(U=fs||fp(s,r,U,a,z,N,w)||t!==null&&t.dependencies!==null&&Kl(t.dependencies))?(B||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,N,w),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,N,w)),typeof u.componentDidUpdate=="function"&&(s.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof u.componentDidUpdate!="function"||g===t.memoizedProps&&z===t.memoizedState||(s.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===t.memoizedProps&&z===t.memoizedState||(s.flags|=1024),s.memoizedProps=a,s.memoizedState=N),u.props=a,u.state=N,u.context=w,a=U):(typeof u.componentDidUpdate!="function"||g===t.memoizedProps&&z===t.memoizedState||(s.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===t.memoizedProps&&z===t.memoizedState||(s.flags|=1024),a=!1)}return u=a,oa(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=Fs(s,t.child,null,c),s.child=Fs(s,null,r,c)):wt(t,s,r,c),s.memoizedState=u.state,t=s.child):t=Ii(t,s,c),t}function Dp(t,s,r,a){return Ys(),s.flags|=256,wt(t,s,r,a),s.child}var Uc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(t){return{baseLanes:t,cachePool:vf()}}function Wc(t,s,r){return t=t!==null?t.childLanes&~r:0,s&&(t|=Ft),t}function Mp(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:(Qe.current&2)!==0),g&&(c=!0,s.flags&=-129),g=(s.flags&32)!==0,s.flags&=-33,t===null){if(Ee){if(c?gs(s):ms(),(t=We)?(t=H_(t,oi),t=t!==null&&t.data!=="&"?t:null,t!==null&&(s.memoizedState={dehydrated:t,treeContext:cs!==null?{id:ki,overflow:Ei}:null,retryLane:536870912,hydrationErrors:null},r=cf(t),r.return=s,s.child=r,bt=s,We=null)):t=null,t===null)throw us(s);return wh(t)?s.lanes=32:s.lanes=536870912,null}var v=a.children;return a=a.fallback,c?(ms(),c=s.mode,v=ca({mode:"hidden",children:v},c),a=Ks(a,c,r,null),v.return=s,a.return=s,v.sibling=a,s.child=v,a=s.child,a.memoizedState=qc(r),a.childLanes=Wc(t,g,r),s.memoizedState=Uc,Bn(null,a)):(gs(s),Pc(s,v))}var w=t.memoizedState;if(w!==null&&(v=w.dehydrated,v!==null)){if(u)s.flags&256?(gs(s),s.flags&=-257,s=Kc(t,s,r)):s.memoizedState!==null?(ms(),s.child=t.child,s.flags|=128,s=null):(ms(),v=a.fallback,c=s.mode,a=ca({mode:"visible",children:a.children},c),v=Ks(v,c,r,null),v.flags|=2,a.return=s,v.return=s,a.sibling=v,s.child=a,Fs(s,t.child,null,r),a=s.child,a.memoizedState=qc(r),a.childLanes=Wc(t,g,r),s.memoizedState=Uc,s=Bn(null,a));else if(gs(s),wh(v)){if(g=v.nextSibling&&v.nextSibling.dataset,g)var B=g.dgst;g=B,a=Error(l(419)),a.stack="",a.digest=g,Sn({value:a,source:null,stack:null}),s=Kc(t,s,r)}else if(st||Dr(t,s,r,!1),g=(r&t.childLanes)!==0,st||g){if(g=qe,g!==null&&(a=_d(g,r),a!==0&&a!==w.retryLane))throw w.retryLane=a,Ps(t,a),qt(g,t,a),jc;xh(v)||va(),s=Kc(t,s,r)}else xh(v)?(s.flags|=192,s.child=t.child,s=null):(t=w.treeContext,We=hi(v.nextSibling),bt=s,Ee=!0,hs=null,oi=!1,t!==null&&df(s,t),s=Pc(s,a.children),s.flags|=4096);return s}return c?(ms(),v=a.fallback,c=s.mode,w=t.child,B=w.sibling,a=qi(w,{mode:"hidden",children:a.children}),a.subtreeFlags=w.subtreeFlags&65011712,B!==null?v=qi(B,v):(v=Ks(v,c,r,null),v.flags|=2),v.return=s,a.return=s,a.sibling=v,s.child=a,Bn(null,a),a=s.child,v=t.child.memoizedState,v===null?v=qc(r):(c=v.cachePool,c!==null?(w=tt._currentValue,c=c.parent!==w?{parent:w,pool:w}:c):c=vf(),v={baseLanes:v.baseLanes|r,cachePool:c}),a.memoizedState=v,a.childLanes=Wc(t,g,r),s.memoizedState=Uc,Bn(t.child,a)):(gs(s),r=t.child,t=r.sibling,r=qi(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 Pc(t,s){return s=ca({mode:"visible",children:s},t.mode),s.return=t,t.child=s}function ca(t,s){return t=It(22,t,null,s),t.lanes=0,t}function Kc(t,s,r){return Fs(s,t.child,null,r),t=Pc(s,s.pendingProps.children),t.flags|=2,s.memoizedState=null,t}function Bp(t,s,r){t.lanes|=s;var a=t.alternate;a!==null&&(a.lanes|=s),rc(t.return,s,r)}function Yc(t,s,r,a,c,u){var g=t.memoizedState;g===null?t.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:a,tail:r,tailMode:c,treeForkCount:u}:(g.isBackwards=s,g.rendering=null,g.renderingStartTime=0,g.last=a,g.tail=r,g.tailMode=c,g.treeForkCount=u)}function Ap(t,s,r){var a=s.pendingProps,c=a.revealOrder,u=a.tail;a=a.children;var g=Qe.current,v=(g&2)!==0;if(v?(g=g&1|2,s.flags|=128):g&=1,J(Qe,g),wt(t,s,a,r),a=Ee?vn:0,!v&&t!==null&&(t.flags&128)!==0)e:for(t=s.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Bp(t,r,s);else if(t.tag===19)Bp(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}switch(c){case"forwards":for(r=s.child,c=null;r!==null;)t=r.alternate,t!==null&&Zl(t)===null&&(c=r),r=r.sibling;r=c,r===null?(c=s.child,s.child=null):(c=r.sibling,r.sibling=null),Yc(s,!1,c,r,u,a);break;case"backwards":case"unstable_legacy-backwards":for(r=null,c=s.child,s.child=null;c!==null;){if(t=c.alternate,t!==null&&Zl(t)===null){s.child=c;break}t=c.sibling,c.sibling=r,r=c,c=t}Yc(s,!0,r,null,u,a);break;case"together":Yc(s,!1,null,null,void 0,a);break;default:s.memoizedState=null}return s.child}function Ii(t,s,r){if(t!==null&&(s.dependencies=t.dependencies),ys|=s.lanes,(r&s.childLanes)===0)if(t!==null){if(Dr(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=qi(t,t.pendingProps),s.child=r,r.return=s;t.sibling!==null;)t=t.sibling,r=r.sibling=qi(t,t.pendingProps),r.return=s;r.sibling=null}return s.child}function $c(t,s){return(t.lanes&s)!==0?!0:(t=t.dependencies,!!(t!==null&&Kl(t)))}function nS(t,s,r){switch(s.tag){case 3:at(s,s.stateNode.containerInfo),ds(s,tt,t.memoizedState.cache),Ys();break;case 27:case 5:wi(s);break;case 4:at(s,s.stateNode.containerInfo);break;case 10:ds(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,gc(s),null;break;case 13:var a=s.memoizedState;if(a!==null)return a.dehydrated!==null?(gs(s),s.flags|=128,null):(r&s.child.childLanes)!==0?Mp(t,s,r):(gs(s),t=Ii(t,s,r),t!==null?t.sibling:null);gs(s);break;case 19:var c=(t.flags&128)!==0;if(a=(r&s.childLanes)!==0,a||(Dr(t,s,r,!1),a=(r&s.childLanes)!==0),c){if(a)return Ap(t,s,r);s.flags|=128}if(c=s.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),J(Qe,Qe.current),a)break;return null;case 22:return s.lanes=0,Cp(t,s,r,s.pendingProps);case 24:ds(s,tt,t.memoizedState.cache)}return Ii(t,s,r)}function zp(t,s,r){if(t!==null)if(t.memoizedProps!==s.pendingProps)st=!0;else{if(!$c(t,r)&&(s.flags&128)===0)return st=!1,nS(t,s,r);st=(t.flags&131072)!==0}else st=!1,Ee&&(s.flags&1048576)!==0&&uf(s,vn,s.index);switch(s.lanes=0,s.tag){case 16:e:{var a=s.pendingProps;if(t=Xs(s.elementType),s.type=t,typeof t=="function")Fo(t)?(a=Qs(t,a),s.tag=1,s=Rp(null,s,t,a,r)):(s.tag=0,s=Hc(null,s,t,a,r));else{if(t!=null){var c=t.$$typeof;if(c===L){s.tag=11,s=bp(null,s,t,a,r);break e}else if(c===F){s.tag=14,s=xp(null,s,t,a,r);break e}}throw s=ie(t)||t,Error(l(306,s,""))}}return s;case 0:return Hc(t,s,s.type,s.pendingProps,r);case 1:return a=s.type,c=Qs(a,s.pendingProps),Rp(t,s,a,c,r);case 3:e:{if(at(s,s.stateNode.containerInfo),t===null)throw Error(l(387));a=s.pendingProps;var u=s.memoizedState;c=u.element,uc(t,s),En(s,a,null,r);var g=s.memoizedState;if(a=g.cache,ds(s,tt,a),a!==u.cache&&nc(s,[tt],r,!0),kn(),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=Dp(t,s,a,r);break e}else if(a!==c){c=ni(Error(l(424)),s),Sn(c),s=Dp(t,s,a,r);break e}else for(t=s.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,We=hi(t.firstChild),bt=s,Ee=!0,hs=null,oi=!0,r=Cf(s,null,a,r),s.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ys(),a===c){s=Ii(t,s,r);break e}wt(t,s,a,r)}s=s.child}return s;case 26:return oa(t,s),t===null?(r=Y_(s.type,null,s.pendingProps,null))?s.memoizedState=r:Ee||(r=s.type,t=s.pendingProps,a=ka(he.current).createElement(r),a[yt]=s,a[Ot]=t,Ct(a,r,t),dt(a),s.stateNode=a):s.memoizedState=Y_(s.type,t.memoizedProps,s.pendingProps,t.memoizedState),null;case 27:return wi(s),t===null&&Ee&&(a=s.stateNode=W_(s.type,s.pendingProps,he.current),bt=s,oi=!0,c=We,ks(s.type)?(Ch=c,We=hi(a.firstChild)):We=c),wt(t,s,s.pendingProps.children,r),oa(t,s),t===null&&(s.flags|=4194304),s.child;case 5:return t===null&&Ee&&((c=a=We)&&(a=LS(a,s.type,s.pendingProps,oi),a!==null?(s.stateNode=a,bt=s,We=hi(a.firstChild),oi=!1,c=!0):c=!1),c||us(s)),wi(s),c=s.type,u=s.pendingProps,g=t!==null?t.memoizedProps:null,a=u.children,Sh(c,u)?a=null:g!==null&&Sh(c,g)&&(s.flags|=32),s.memoizedState!==null&&(c=vc(t,s,F0,null,null,r),In._currentValue=c),oa(t,s),wt(t,s,a,r),s.child;case 6:return t===null&&Ee&&((t=r=We)&&(r=NS(r,s.pendingProps,oi),r!==null?(s.stateNode=r,bt=s,We=null,t=!0):t=!1),t||us(s)),null;case 13:return Mp(t,s,r);case 4:return at(s,s.stateNode.containerInfo),a=s.pendingProps,t===null?s.child=Fs(s,null,a,r):wt(t,s,a,r),s.child;case 11:return bp(t,s,s.type,s.pendingProps,r);case 7:return wt(t,s,s.pendingProps,r),s.child;case 8:return wt(t,s,s.pendingProps.children,r),s.child;case 12:return wt(t,s,s.pendingProps.children,r),s.child;case 10:return a=s.pendingProps,ds(s,s.type,a.value),wt(t,s,a.children,r),s.child;case 9:return c=s.type._context,a=s.pendingProps.children,Is(s),c=xt(c),a=a(c),s.flags|=1,wt(t,s,a,r),s.child;case 14:return xp(t,s,s.type,s.pendingProps,r);case 15:return wp(t,s,s.type,s.pendingProps,r);case 19:return Ap(t,s,r);case 31:return rS(t,s,r);case 22:return Cp(t,s,r,s.pendingProps);case 24:return Is(s),a=xt(tt),t===null?(c=oc(),c===null&&(c=qe,u=lc(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=r),c=u),s.memoizedState={parent:a,cache:c},hc(s),ds(s,tt,c)):((t.lanes&r)!==0&&(uc(t,s),En(s,null,null,r),kn()),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),ds(s,tt,a)):(a=u.cache,ds(s,tt,a),a!==c.cache&&nc(s,[tt],r,!0))),wt(t,s,s.pendingProps.children,r),s.child;case 29:throw s.pendingProps}throw Error(l(156,s.tag))}function Gi(t){t.flags|=4}function Ic(t,s,r,a,c){if((s=(t.mode&32)!==0)&&(s=!1),s){if(t.flags|=16777216,(c&335544128)===c)if(t.stateNode.complete)t.flags|=8192;else if(l_())t.flags|=8192;else throw Vs=Gl,cc}else t.flags&=-16777217}function Op(t,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!V_(s))if(l_())t.flags|=8192;else throw Vs=Gl,cc}function ha(t,s){s!==null&&(t.flags|=4),t.flags&16384&&(s=t.tag!==22?dd():536870912,t.lanes|=s,Wr|=s)}function An(t,s){if(!Ee)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 Pe(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 lS(t,s,r){var a=s.pendingProps;switch(ec(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(s),null;case 1:return Pe(s),null;case 3:return r=s.stateNode,a=null,t!==null&&(a=t.memoizedState.cache),s.memoizedState.cache!==a&&(s.flags|=2048),Ki(tt),Ae(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Rr(s)?Gi(s):t===null||t.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,ic())),Pe(s),null;case 26:var c=s.type,u=s.memoizedState;return t===null?(Gi(s),u!==null?(Pe(s),Op(s,u)):(Pe(s),Ic(s,c,null,a,r))):u?u!==t.memoizedState?(Gi(s),Pe(s),Op(s,u)):(Pe(s),s.flags&=-16777217):(t=t.memoizedProps,t!==a&&Gi(s),Pe(s),Ic(s,c,t,a,r)),null;case 27:if(Ci(s),r=he.current,c=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==a&&Gi(s);else{if(!a){if(s.stateNode===null)throw Error(l(166));return Pe(s),null}t=te.current,Rr(s)?ff(s):(t=W_(c,a,r),s.stateNode=t,Gi(s))}return Pe(s),null;case 5:if(Ci(s),c=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==a&&Gi(s);else{if(!a){if(s.stateNode===null)throw Error(l(166));return Pe(s),null}if(u=te.current,Rr(s))ff(s);else{var g=ka(he.current);switch(u){case 1:u=g.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=g.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=g.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=g.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=g.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?g.createElement("select",{is:a.is}):g.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?g.createElement(c,{is:a.is}):g.createElement(c)}}u[yt]=s,u[Ot]=a;e:for(g=s.child;g!==null;){if(g.tag===5||g.tag===6)u.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===s)break e;for(;g.sibling===null;){if(g.return===null||g.return===s)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}s.stateNode=u;e:switch(Ct(u,c,a),c){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Gi(s)}}return Pe(s),Ic(s,s.type,t===null?null:t.memoizedProps,s.pendingProps,r),null;case 6:if(t&&s.stateNode!=null)t.memoizedProps!==a&&Gi(s);else{if(typeof a!="string"&&s.stateNode===null)throw Error(l(166));if(t=he.current,Rr(s)){if(t=s.stateNode,r=s.memoizedProps,a=null,c=bt,c!==null)switch(c.tag){case 27:case 5:a=c.memoizedProps}t[yt]=s,t=!!(t.nodeValue===r||a!==null&&a.suppressHydrationWarning===!0||M_(t.nodeValue,r)),t||us(s,!0)}else t=ka(t).createTextNode(a),t[yt]=s,s.stateNode=t}return Pe(s),null;case 31:if(r=s.memoizedState,t===null||t.memoizedState!==null){if(a=Rr(s),r!==null){if(t===null){if(!a)throw Error(l(318));if(t=s.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[yt]=s}else Ys(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Pe(s),t=!1}else r=ic(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return s.flags&256?(Xt(s),s):(Xt(s),null);if((s.flags&128)!==0)throw Error(l(558))}return Pe(s),null;case 13:if(a=s.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(c=Rr(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[yt]=s}else Ys(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Pe(s),c=!1}else c=ic(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=c),c=!0;if(!c)return s.flags&256?(Xt(s),s):(Xt(s),null)}return Xt(s),(s.flags&128)!==0?(s.lanes=r,s):(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),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==c&&(a.flags|=2048)),r!==t&&r&&(s.child.flags|=8192),ha(s,s.updateQueue),Pe(s),null);case 4:return Ae(),t===null&&ph(s.stateNode.containerInfo),Pe(s),null;case 10:return Ki(s.type),Pe(s),null;case 19:if(q(Qe),a=s.memoizedState,a===null)return Pe(s),null;if(c=(s.flags&128)!==0,u=a.rendering,u===null)if(c)An(a,!1);else{if(Ve!==0||t!==null&&(t.flags&128)!==0)for(t=s.child;t!==null;){if(u=Zl(t),u!==null){for(s.flags|=128,An(a,!1),t=u.updateQueue,s.updateQueue=t,ha(s,t),s.subtreeFlags=0,t=r,r=s.child;r!==null;)of(r,t),r=r.sibling;return J(Qe,Qe.current&1|2),Ee&&Wi(s,a.treeForkCount),s.child}t=t.sibling}a.tail!==null&&Pt()>_a&&(s.flags|=128,c=!0,An(a,!1),s.lanes=4194304)}else{if(!c)if(t=Zl(u),t!==null){if(s.flags|=128,c=!0,t=t.updateQueue,s.updateQueue=t,ha(s,t),An(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!Ee)return Pe(s),null}else 2*Pt()-a.renderingStartTime>_a&&r!==536870912&&(s.flags|=128,c=!0,An(a,!1),s.lanes=4194304);a.isBackwards?(u.sibling=s.child,s.child=u):(t=a.last,t!==null?t.sibling=u:s.child=u,a.last=u)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Pt(),t.sibling=null,r=Qe.current,J(Qe,c?r&1|2:r&1),Ee&&Wi(s,a.treeForkCount),t):(Pe(s),null);case 22:case 23:return Xt(s),_c(),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&&(Pe(s),s.subtreeFlags&6&&(s.flags|=8192)):Pe(s),r=s.updateQueue,r!==null&&ha(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&&q(Gs),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),s.memoizedState.cache!==r&&(s.flags|=2048),Ki(tt),Pe(s),null;case 25:return null;case 30:return null}throw Error(l(156,s.tag))}function aS(t,s){switch(ec(s),s.tag){case 1:return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return Ki(tt),Ae(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 26:case 27:case 5:return Ci(s),null;case 31:if(s.memoizedState!==null){if(Xt(s),s.alternate===null)throw Error(l(340));Ys()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 13:if(Xt(s),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(l(340));Ys()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return q(Qe),null;case 4:return Ae(),null;case 10:return Ki(s.type),null;case 22:case 23:return Xt(s),_c(),t!==null&&q(Gs),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 24:return Ki(tt),null;case 25:return null;default:return null}}function Lp(t,s){switch(ec(s),s.tag){case 3:Ki(tt),Ae();break;case 26:case 27:case 5:Ci(s);break;case 4:Ae();break;case 31:s.memoizedState!==null&&Xt(s);break;case 13:Xt(s);break;case 19:q(Qe);break;case 10:Ki(s.type);break;case 22:case 23:Xt(s),_c(),t!==null&&q(Gs);break;case 24:Ki(tt)}}function zn(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(v){Oe(s,s.return,v)}}function vs(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,v=g.destroy;if(v!==void 0){g.destroy=void 0,c=s;var w=r,B=v;try{B()}catch(U){Oe(c,w,U)}}}a=a.next}while(a!==u)}}catch(U){Oe(s,s.return,U)}}function Np(t){var s=t.updateQueue;if(s!==null){var r=t.stateNode;try{Ef(s,r)}catch(a){Oe(t,t.return,a)}}}function jp(t,s,r){r.props=Qs(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(a){Oe(t,s,a)}}function On(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){Oe(t,s,c)}}function Ti(t,s){var r=t.ref,a=t.refCleanup;if(r!==null)if(typeof a=="function")try{a()}catch(c){Oe(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){Oe(t,s,c)}else r.current=null}function Hp(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){Oe(t,t.return,c)}}function Gc(t,s,r){try{var a=t.stateNode;DS(a,t.type,r,s),a[Ot]=s}catch(c){Oe(t,t.return,c)}}function Up(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ks(t.type)||t.tag===4}function Xc(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Up(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&&ks(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 Vc(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=Hi));else if(a!==4&&(a===27&&ks(t.type)&&(r=t.stateNode,s=null),t=t.child,t!==null))for(Vc(t,s,r),t=t.sibling;t!==null;)Vc(t,s,r),t=t.sibling}function ua(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&&ks(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(ua(t,s,r),t=t.sibling;t!==null;)ua(t,s,r),t=t.sibling}function qp(t){var s=t.stateNode,r=t.memoizedProps;try{for(var a=t.type,c=s.attributes;c.length;)s.removeAttributeNode(c[0]);Ct(s,a,r),s[yt]=t,s[Ot]=r}catch(u){Oe(t,t.return,u)}}var Xi=!1,rt=!1,Fc=!1,Wp=typeof WeakSet=="function"?WeakSet:Set,ft=null;function oS(t,s){if(t=t.containerInfo,mh=Aa,t=Qd(t),Ko(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,v=-1,w=-1,B=0,U=0,$=t,z=null;t:for(;;){for(var N;$!==r||c!==0&&$.nodeType!==3||(v=g+c),$!==u||a!==0&&$.nodeType!==3||(w=g+a),$.nodeType===3&&(g+=$.nodeValue.length),(N=$.firstChild)!==null;)z=$,$=N;for(;;){if($===t)break t;if(z===r&&++B===c&&(v=g),z===u&&++U===a&&(w=g),(N=$.nextSibling)!==null)break;$=z,z=$.parentNode}$=N}r=v===-1||w===-1?null:{start:v,end:w}}else r=null}r=r||{start:0,end:0}}else r=null;for(vh={focusedElem:t,selectionRange:r},Aa=!1,ft=s;ft!==null;)if(s=ft,t=s.child,(s.subtreeFlags&1028)!==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:if((t&4)!==0&&(t=s.updateQueue,t=t!==null?t.events:null,t!==null))for(r=0;r<t.length;r++)c=t[r],c.ref.impl=c.nextImpl;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 re=Qs(r.type,c);t=a.getSnapshotBeforeUpdate(re,u),a.__reactInternalSnapshotBeforeUpdate=t}catch(ce){Oe(r,r.return,ce)}}break;case 3:if((t&1024)!==0){if(t=s.stateNode.containerInfo,r=t.nodeType,r===9)bh(t);else if(r===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":bh(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 Pp(t,s,r){var a=r.flags;switch(r.tag){case 0:case 11:case 15:Fi(t,r),a&4&&zn(5,r);break;case 1:if(Fi(t,r),a&4)if(t=r.stateNode,s===null)try{t.componentDidMount()}catch(g){Oe(r,r.return,g)}else{var c=Qs(r.type,s.memoizedProps);s=s.memoizedState;try{t.componentDidUpdate(c,s,t.__reactInternalSnapshotBeforeUpdate)}catch(g){Oe(r,r.return,g)}}a&64&&Np(r),a&512&&On(r,r.return);break;case 3:if(Fi(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{Ef(t,s)}catch(g){Oe(r,r.return,g)}}break;case 27:s===null&&a&4&&qp(r);case 26:case 5:Fi(t,r),s===null&&a&4&&Hp(r),a&512&&On(r,r.return);break;case 12:Fi(t,r);break;case 31:Fi(t,r),a&4&&$p(t,r);break;case 13:Fi(t,r),a&4&&Ip(t,r),a&64&&(t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(r=mS.bind(null,r),jS(t,r))));break;case 22:if(a=r.memoizedState!==null||Xi,!a){s=s!==null&&s.memoizedState!==null||rt,c=Xi;var u=rt;Xi=a,(rt=s)&&!u?Zi(t,r,(r.subtreeFlags&8772)!==0):Fi(t,r),Xi=c,rt=u}break;case 30:break;default:Fi(t,r)}}function Kp(t){var s=t.alternate;s!==null&&(t.alternate=null,Kp(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&Eo(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 Ye=null,Nt=!1;function Vi(t,s,r){for(r=r.child;r!==null;)Yp(t,s,r),r=r.sibling}function Yp(t,s,r){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(rn,r)}catch{}switch(r.tag){case 26:rt||Ti(r,s),Vi(t,s,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:rt||Ti(r,s);var a=Ye,c=Nt;ks(r.type)&&(Ye=r.stateNode,Nt=!1),Vi(t,s,r),Kn(r.stateNode),Ye=a,Nt=c;break;case 5:rt||Ti(r,s);case 6:if(a=Ye,c=Nt,Ye=null,Vi(t,s,r),Ye=a,Nt=c,Ye!==null)if(Nt)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(r.stateNode)}catch(u){Oe(r,s,u)}else try{Ye.removeChild(r.stateNode)}catch(u){Oe(r,s,u)}break;case 18:Ye!==null&&(Nt?(t=Ye,N_(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,r.stateNode),Vr(t)):N_(Ye,r.stateNode));break;case 4:a=Ye,c=Nt,Ye=r.stateNode.containerInfo,Nt=!0,Vi(t,s,r),Ye=a,Nt=c;break;case 0:case 11:case 14:case 15:vs(2,r,s),rt||vs(4,r,s),Vi(t,s,r);break;case 1:rt||(Ti(r,s),a=r.stateNode,typeof a.componentWillUnmount=="function"&&jp(r,s,a)),Vi(t,s,r);break;case 21:Vi(t,s,r);break;case 22:rt=(a=rt)||r.memoizedState!==null,Vi(t,s,r),rt=a;break;default:Vi(t,s,r)}}function $p(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Vr(t)}catch(r){Oe(s,s.return,r)}}}function Ip(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Vr(t)}catch(r){Oe(s,s.return,r)}}function cS(t){switch(t.tag){case 31:case 13:case 19:var s=t.stateNode;return s===null&&(s=t.stateNode=new Wp),s;case 22:return t=t.stateNode,s=t._retryCache,s===null&&(s=t._retryCache=new Wp),s;default:throw Error(l(435,t.tag))}}function da(t,s){var r=cS(t);s.forEach(function(a){if(!r.has(a)){r.add(a);var c=vS.bind(null,t,a);a.then(c,c)}})}function jt(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,v=g;e:for(;v!==null;){switch(v.tag){case 27:if(ks(v.type)){Ye=v.stateNode,Nt=!1;break e}break;case 5:Ye=v.stateNode,Nt=!1;break e;case 3:case 4:Ye=v.stateNode.containerInfo,Nt=!0;break e}v=v.return}if(Ye===null)throw Error(l(160));Yp(u,g,c),Ye=null,Nt=!1,u=c.alternate,u!==null&&(u.return=null),c.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Gp(s,t),s=s.sibling}var Si=null;function Gp(t,s){var r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:jt(s,t),Ht(t),a&4&&(vs(3,t,t.return),zn(3,t),vs(5,t,t.return));break;case 1:jt(s,t),Ht(t),a&512&&(rt||r===null||Ti(r,r.return)),a&64&&Xi&&(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=Si;if(jt(s,t),Ht(t),a&512&&(rt||r===null||Ti(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[an]||u[yt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=c.createElement(a),c.head.insertBefore(u,c.querySelector("head > title"))),Ct(u,a,r),u[yt]=t,dt(u),a=u;break e;case"link":var g=G_("link","href",c).get(a+(r.href||""));if(g){for(var v=0;v<g.length;v++)if(u=g[v],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(v,1);break t}}u=c.createElement(a),Ct(u,a,r),c.head.appendChild(u);break;case"meta":if(g=G_("meta","content",c).get(a+(r.content||""))){for(v=0;v<g.length;v++)if(u=g[v],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(v,1);break t}}u=c.createElement(a),Ct(u,a,r),c.head.appendChild(u);break;default:throw Error(l(468,a))}u[yt]=t,dt(u),a=u}t.stateNode=a}else X_(c,t.type,t.stateNode);else t.stateNode=I_(c,a,t.memoizedProps);else u!==a?(u===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):u.count--,a===null?X_(c,t.type,t.stateNode):I_(c,a,t.memoizedProps)):a===null&&t.stateNode!==null&&Gc(t,t.memoizedProps,r.memoizedProps)}break;case 27:jt(s,t),Ht(t),a&512&&(rt||r===null||Ti(r,r.return)),r!==null&&a&4&&Gc(t,t.memoizedProps,r.memoizedProps);break;case 5:if(jt(s,t),Ht(t),a&512&&(rt||r===null||Ti(r,r.return)),t.flags&32){c=t.stateNode;try{vr(c,"")}catch(re){Oe(t,t.return,re)}}a&4&&t.stateNode!=null&&(c=t.memoizedProps,Gc(t,c,r!==null?r.memoizedProps:c)),a&1024&&(Fc=!0);break;case 6:if(jt(s,t),Ht(t),a&4){if(t.stateNode===null)throw Error(l(162));a=t.memoizedProps,r=t.stateNode;try{r.nodeValue=a}catch(re){Oe(t,t.return,re)}}break;case 3:if(Ra=null,c=Si,Si=Ea(s.containerInfo),jt(s,t),Si=c,Ht(t),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Vr(s.containerInfo)}catch(re){Oe(t,t.return,re)}Fc&&(Fc=!1,Xp(t));break;case 4:a=Si,Si=Ea(t.stateNode.containerInfo),jt(s,t),Ht(t),Si=a;break;case 12:jt(s,t),Ht(t);break;case 31:jt(s,t),Ht(t),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,da(t,a)));break;case 13:jt(s,t),Ht(t),t.child.flags&8192&&t.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(pa=Pt()),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,da(t,a)));break;case 22:c=t.memoizedState!==null;var w=r!==null&&r.memoizedState!==null,B=Xi,U=rt;if(Xi=B||c,rt=U||w,jt(s,t),rt=U,Xi=B,Ht(t),a&8192)e:for(s=t.stateNode,s._visibility=c?s._visibility&-2:s._visibility|1,c&&(r===null||w||Xi||rt||Js(t)),r=null,s=t;;){if(s.tag===5||s.tag===26){if(r===null){w=r=s;try{if(u=w.stateNode,c)g=u.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{v=w.stateNode;var $=w.memoizedProps.style,z=$!=null&&$.hasOwnProperty("display")?$.display:null;v.style.display=z==null||typeof z=="boolean"?"":(""+z).trim()}}catch(re){Oe(w,w.return,re)}}}else if(s.tag===6){if(r===null){w=s;try{w.stateNode.nodeValue=c?"":w.memoizedProps}catch(re){Oe(w,w.return,re)}}}else if(s.tag===18){if(r===null){w=s;try{var N=w.stateNode;c?j_(N,!0):j_(w.stateNode,!1)}catch(re){Oe(w,w.return,re)}}}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,da(t,r))));break;case 19:jt(s,t),Ht(t),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,da(t,a)));break;case 30:break;case 21:break;default:jt(s,t),Ht(t)}}function Ht(t){var s=t.flags;if(s&2){try{for(var r,a=t.return;a!==null;){if(Up(a)){r=a;break}a=a.return}if(r==null)throw Error(l(160));switch(r.tag){case 27:var c=r.stateNode,u=Xc(t);ua(t,u,c);break;case 5:var g=r.stateNode;r.flags&32&&(vr(g,""),r.flags&=-33);var v=Xc(t);ua(t,v,g);break;case 3:case 4:var w=r.stateNode.containerInfo,B=Xc(t);Vc(t,B,w);break;default:throw Error(l(161))}}catch(U){Oe(t,t.return,U)}t.flags&=-3}s&4096&&(t.flags&=-4097)}function Xp(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var s=t;Xp(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),t=t.sibling}}function Fi(t,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Pp(t,s.alternate,s),s=s.sibling}function Js(t){for(t=t.child;t!==null;){var s=t;switch(s.tag){case 0:case 11:case 14:case 15:vs(4,s,s.return),Js(s);break;case 1:Ti(s,s.return);var r=s.stateNode;typeof r.componentWillUnmount=="function"&&jp(s,s.return,r),Js(s);break;case 27:Kn(s.stateNode);case 26:case 5:Ti(s,s.return),Js(s);break;case 22:s.memoizedState===null&&Js(s);break;case 30:Js(s);break;default:Js(s)}t=t.sibling}}function Zi(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:Zi(c,u,r),zn(4,u);break;case 1:if(Zi(c,u,r),a=u,c=a.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(B){Oe(a,a.return,B)}if(a=u,c=a.updateQueue,c!==null){var v=a.stateNode;try{var w=c.shared.hiddenCallbacks;if(w!==null)for(c.shared.hiddenCallbacks=null,c=0;c<w.length;c++)kf(w[c],v)}catch(B){Oe(a,a.return,B)}}r&&g&64&&Np(u),On(u,u.return);break;case 27:qp(u);case 26:case 5:Zi(c,u,r),r&&a===null&&g&4&&Hp(u),On(u,u.return);break;case 12:Zi(c,u,r);break;case 31:Zi(c,u,r),r&&g&4&&$p(c,u);break;case 13:Zi(c,u,r),r&&g&4&&Ip(c,u);break;case 22:u.memoizedState===null&&Zi(c,u,r),On(u,u.return);break;case 30:break;default:Zi(c,u,r)}s=s.sibling}}function Zc(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&&yn(r))}function Qc(t,s){t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&yn(t))}function yi(t,s,r,a){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Vp(t,s,r,a),s=s.sibling}function Vp(t,s,r,a){var c=s.flags;switch(s.tag){case 0:case 11:case 15:yi(t,s,r,a),c&2048&&zn(9,s);break;case 1:yi(t,s,r,a);break;case 3:yi(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&&yn(t)));break;case 12:if(c&2048){yi(t,s,r,a),t=s.stateNode;try{var u=s.memoizedProps,g=u.id,v=u.onPostCommit;typeof v=="function"&&v(g,s.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(w){Oe(s,s.return,w)}}else yi(t,s,r,a);break;case 31:yi(t,s,r,a);break;case 13:yi(t,s,r,a);break;case 23:break;case 22:u=s.stateNode,g=s.alternate,s.memoizedState!==null?u._visibility&2?yi(t,s,r,a):Ln(t,s):u._visibility&2?yi(t,s,r,a):(u._visibility|=2,Hr(t,s,r,a,(s.subtreeFlags&10256)!==0||!1)),c&2048&&Zc(g,s);break;case 24:yi(t,s,r,a),c&2048&&Qc(s.alternate,s);break;default:yi(t,s,r,a)}}function Hr(t,s,r,a,c){for(c=c&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var u=t,g=s,v=r,w=a,B=g.flags;switch(g.tag){case 0:case 11:case 15:Hr(u,g,v,w,c),zn(8,g);break;case 23:break;case 22:var U=g.stateNode;g.memoizedState!==null?U._visibility&2?Hr(u,g,v,w,c):Ln(u,g):(U._visibility|=2,Hr(u,g,v,w,c)),c&&B&2048&&Zc(g.alternate,g);break;case 24:Hr(u,g,v,w,c),c&&B&2048&&Qc(g.alternate,g);break;default:Hr(u,g,v,w,c)}s=s.sibling}}function Ln(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:Ln(r,a),c&2048&&Zc(a.alternate,a);break;case 24:Ln(r,a),c&2048&&Qc(a.alternate,a);break;default:Ln(r,a)}s=s.sibling}}var Nn=8192;function Ur(t,s,r){if(t.subtreeFlags&Nn)for(t=t.child;t!==null;)Fp(t,s,r),t=t.sibling}function Fp(t,s,r){switch(t.tag){case 26:Ur(t,s,r),t.flags&Nn&&t.memoizedState!==null&&VS(r,Si,t.memoizedState,t.memoizedProps);break;case 5:Ur(t,s,r);break;case 3:case 4:var a=Si;Si=Ea(t.stateNode.containerInfo),Ur(t,s,r),Si=a;break;case 22:t.memoizedState===null&&(a=t.alternate,a!==null&&a.memoizedState!==null?(a=Nn,Nn=16777216,Ur(t,s,r),Nn=a):Ur(t,s,r));break;default:Ur(t,s,r)}}function Zp(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 jn(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,Jp(a,t)}Zp(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Qp(t),t=t.sibling}function Qp(t){switch(t.tag){case 0:case 11:case 15:jn(t),t.flags&2048&&vs(9,t,t.return);break;case 3:jn(t);break;case 12:jn(t);break;case 22:var s=t.stateNode;t.memoizedState!==null&&s._visibility&2&&(t.return===null||t.return.tag!==13)?(s._visibility&=-3,fa(t)):jn(t);break;default:jn(t)}}function fa(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,Jp(a,t)}Zp(t)}for(t=t.child;t!==null;){switch(s=t,s.tag){case 0:case 11:case 15:vs(8,s,s.return),fa(s);break;case 22:r=s.stateNode,r._visibility&2&&(r._visibility&=-3,fa(s));break;default:fa(s)}t=t.sibling}}function Jp(t,s){for(;ft!==null;){var r=ft;switch(r.tag){case 0:case 11:case 15:vs(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:yn(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(Kp(a),a===r){ft=null;break e}if(c!==null){c.return=u,ft=c;break e}ft=u}}}var hS={getCacheForType:function(t){var s=xt(tt),r=s.data.get(t);return r===void 0&&(r=t(),s.data.set(t,r)),r},cacheSignal:function(){return xt(tt).controller.signal}},uS=typeof WeakMap=="function"?WeakMap:Map,Be=0,qe=null,be=null,we=0,ze=0,Vt=null,Ss=!1,qr=!1,Jc=!1,Qi=0,Ve=0,ys=0,er=0,eh=0,Ft=0,Wr=0,Hn=null,Ut=null,th=!1,pa=0,e_=0,_a=1/0,ga=null,bs=null,ot=0,xs=null,Pr=null,Ji=0,ih=0,sh=null,t_=null,Un=0,rh=null;function Zt(){return(Be&2)!==0&&we!==0?we&-we:T.T!==null?hh():gd()}function i_(){if(Ft===0)if((we&536870912)===0||Ee){var t=Cl;Cl<<=1,(Cl&3932160)===0&&(Cl=262144),Ft=t}else Ft=536870912;return t=Gt.current,t!==null&&(t.flags|=32),Ft}function qt(t,s,r){(t===qe&&(ze===2||ze===9)||t.cancelPendingCommit!==null)&&(Kr(t,0),ws(t,we,Ft,!1)),ln(t,r),((Be&2)===0||t!==qe)&&(t===qe&&((Be&2)===0&&(er|=r),Ve===4&&ws(t,we,Ft,!1)),Ri(t))}function s_(t,s,r){if((Be&6)!==0)throw Error(l(327));var a=!r&&(s&127)===0&&(s&t.expiredLanes)===0||nn(t,s),c=a?pS(t,s):lh(t,s,!0),u=a;do{if(c===0){qr&&!a&&ws(t,s,0,!1);break}else{if(r=t.current.alternate,u&&!dS(r)){c=lh(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 v=t;c=Hn;var w=v.current.memoizedState.isDehydrated;if(w&&(Kr(v,g).flags|=256),g=lh(v,g,!1),g!==2){if(Jc&&!w){v.errorRecoveryDisabledLanes|=u,er|=u,c=4;break e}u=Ut,Ut=c,u!==null&&(Ut===null?Ut=u:Ut.push.apply(Ut,u))}c=g}if(u=!1,c!==2)continue}}if(c===1){Kr(t,0),ws(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:ws(a,s,Ft,!Ss);break e;case 2:Ut=null;break;case 3:case 5:break;default:throw Error(l(329))}if((s&62914560)===s&&(c=pa+300-Pt(),10<c)){if(ws(a,s,Ft,!Ss),El(a,0,!0)!==0)break e;Ji=s,a.timeoutHandle=O_(r_.bind(null,a,r,Ut,ga,th,s,Ft,er,Wr,Ss,u,"Throttled",-0,0),c);break e}r_(a,r,Ut,ga,th,s,Ft,er,Wr,Ss,u,null,-0,0)}}break}while(!0);Ri(t)}function r_(t,s,r,a,c,u,g,v,w,B,U,$,z,N){if(t.timeoutHandle=-1,$=s.subtreeFlags,$&8192||($&16785408)===16785408){$={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Hi},Fp(s,u,$);var re=(u&62914560)===u?pa-Pt():(u&4194048)===u?e_-Pt():0;if(re=FS($,re),re!==null){Ji=u,t.cancelPendingCommit=re(d_.bind(null,t,s,u,r,a,c,g,v,w,U,$,null,z,N)),ws(t,u,g,!B);return}}d_(t,s,u,r,a,c,g,v,w)}function dS(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(!$t(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 ws(t,s,r,a){s&=~eh,s&=~er,t.suspendedLanes|=s,t.pingedLanes&=~s,a&&(t.warmLanes|=s),a=t.expirationTimes;for(var c=s;0<c;){var u=31-Yt(c),g=1<<u;a[u]=-1,c&=~g}r!==0&&fd(t,r,s)}function ma(){return(Be&6)===0?(qn(0),!1):!0}function nh(){if(be!==null){if(ze===0)var t=be.return;else t=be,Pi=$s=null,bc(t),zr=null,xn=0,t=be;for(;t!==null;)Lp(t.alternate,t),t=t.return;be=null}}function Kr(t,s){var r=t.timeoutHandle;r!==-1&&(t.timeoutHandle=-1,AS(r)),r=t.cancelPendingCommit,r!==null&&(t.cancelPendingCommit=null,r()),Ji=0,nh(),qe=t,be=r=qi(t.current,null),we=s,ze=0,Vt=null,Ss=!1,qr=nn(t,s),Jc=!1,Wr=Ft=eh=er=ys=Ve=0,Ut=Hn=null,th=!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-Yt(a),u=1<<c;s|=t[c],a&=~u}return Qi=s,Hl(),r}function n_(t,s){ge=null,T.H=Mn,s===Ar||s===Il?(s=bf(),ze=3):s===cc?(s=bf(),ze=4):ze=s===jc?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Vt=s,be===null&&(Ve=1,la(t,ni(s,t.current)))}function l_(){var t=Gt.current;return t===null?!0:(we&4194048)===we?ci===null:(we&62914560)===we||(we&536870912)!==0?t===ci:!1}function a_(){var t=T.H;return T.H=Mn,t===null?Mn:t}function o_(){var t=T.A;return T.A=hS,t}function va(){Ve=4,Ss||(we&4194048)!==we&&Gt.current!==null||(qr=!0),(ys&134217727)===0&&(er&134217727)===0||qe===null||ws(qe,we,Ft,!1)}function lh(t,s,r){var a=Be;Be|=2;var c=a_(),u=o_();(qe!==t||we!==s)&&(ga=null,Kr(t,s)),s=!1;var g=Ve;e:do try{if(ze!==0&&be!==null){var v=be,w=Vt;switch(ze){case 8:nh(),g=6;break e;case 3:case 2:case 9:case 6:Gt.current===null&&(s=!0);var B=ze;if(ze=0,Vt=null,Yr(t,v,w,B),r&&qr){g=0;break e}break;default:B=ze,ze=0,Vt=null,Yr(t,v,w,B)}}fS(),g=Ve;break}catch(U){n_(t,U)}while(!0);return s&&t.shellSuspendCounter++,Pi=$s=null,Be=a,T.H=c,T.A=u,be===null&&(qe=null,we=0,Hl()),g}function fS(){for(;be!==null;)c_(be)}function pS(t,s){var r=Be;Be|=2;var a=a_(),c=o_();qe!==t||we!==s?(ga=null,_a=Pt()+500,Kr(t,s)):qr=nn(t,s);e:do try{if(ze!==0&&be!==null){s=be;var u=Vt;t:switch(ze){case 1:ze=0,Vt=null,Yr(t,s,u,1);break;case 2:case 9:if(Sf(u)){ze=0,Vt=null,h_(s);break}s=function(){ze!==2&&ze!==9||qe!==t||(ze=7),Ri(t)},u.then(s,s);break e;case 3:ze=7;break e;case 4:ze=5;break e;case 7:Sf(u)?(ze=0,Vt=null,h_(s)):(ze=0,Vt=null,Yr(t,s,u,7));break;case 5:var g=null;switch(be.tag){case 26:g=be.memoizedState;case 5:case 27:var v=be;if(g?V_(g):v.stateNode.complete){ze=0,Vt=null;var w=v.sibling;if(w!==null)be=w;else{var B=v.return;B!==null?(be=B,Sa(B)):be=null}break t}}ze=0,Vt=null,Yr(t,s,u,5);break;case 6:ze=0,Vt=null,Yr(t,s,u,6);break;case 8:nh(),Ve=6;break e;default:throw Error(l(462))}}_S();break}catch(U){n_(t,U)}while(!0);return Pi=$s=null,T.H=a,T.A=c,Be=r,be!==null?0:(qe=null,we=0,Hl(),Ve)}function _S(){for(;be!==null&&!Hv();)c_(be)}function c_(t){var s=zp(t.alternate,t,Qi);t.memoizedProps=t.pendingProps,s===null?Sa(t):be=s}function h_(t){var s=t,r=s.alternate;switch(s.tag){case 15:case 0:s=Tp(r,s,s.pendingProps,s.type,void 0,we);break;case 11:s=Tp(r,s,s.pendingProps,s.type.render,s.ref,we);break;case 5:bc(s);default:Lp(r,s),s=be=of(s,Qi),s=zp(r,s,Qi)}t.memoizedProps=t.pendingProps,s===null?Sa(t):be=s}function Yr(t,s,r,a){Pi=$s=null,bc(s),zr=null,xn=0;var c=s.return;try{if(sS(t,c,s,r,we)){Ve=1,la(t,ni(r,t.current)),be=null;return}}catch(u){if(c!==null)throw be=c,u;Ve=1,la(t,ni(r,t.current)),be=null;return}s.flags&32768?(Ee||a===1?t=!0:qr||(we&536870912)!==0?t=!1:(Ss=t=!0,(a===2||a===9||a===3||a===6)&&(a=Gt.current,a!==null&&a.tag===13&&(a.flags|=16384))),u_(s,t)):Sa(s)}function Sa(t){var s=t;do{if((s.flags&32768)!==0){u_(s,Ss);return}t=s.return;var r=lS(s.alternate,s,Qi);if(r!==null){be=r;return}if(s=s.sibling,s!==null){be=s;return}be=s=t}while(s!==null);Ve===0&&(Ve=5)}function u_(t,s){do{var r=aS(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);Ve=6,be=null}function d_(t,s,r,a,c,u,g,v,w){t.cancelPendingCommit=null;do ya();while(ot!==0);if((Be&6)!==0)throw Error(l(327));if(s!==null){if(s===t.current)throw Error(l(177));if(u=s.lanes|s.childLanes,u|=Xo,Xv(t,r,u,g,v,w),t===qe&&(be=qe=null,we=0),Pr=s,xs=t,Ji=r,ih=u,sh=c,t_=a,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,SS(xl,function(){return m_(),null})):(t.callbackNode=null,t.callbackPriority=0),a=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||a){a=T.T,T.T=null,c=W.p,W.p=2,g=Be,Be|=4;try{oS(t,s,r)}finally{Be=g,W.p=c,T.T=a}}ot=1,f_(),p_(),__()}}function f_(){if(ot===1){ot=0;var t=xs,s=Pr,r=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||r){r=T.T,T.T=null;var a=W.p;W.p=2;var c=Be;Be|=4;try{Gp(s,t);var u=vh,g=Qd(t.containerInfo),v=u.focusedElem,w=u.selectionRange;if(g!==v&&v&&v.ownerDocument&&Zd(v.ownerDocument.documentElement,v)){if(w!==null&&Ko(v)){var B=w.start,U=w.end;if(U===void 0&&(U=B),"selectionStart"in v)v.selectionStart=B,v.selectionEnd=Math.min(U,v.value.length);else{var $=v.ownerDocument||document,z=$&&$.defaultView||window;if(z.getSelection){var N=z.getSelection(),re=v.textContent.length,ce=Math.min(w.start,re),He=w.end===void 0?ce:Math.min(w.end,re);!N.extend&&ce>He&&(g=He,He=ce,ce=g);var D=Fd(v,ce),E=Fd(v,He);if(D&&E&&(N.rangeCount!==1||N.anchorNode!==D.node||N.anchorOffset!==D.offset||N.focusNode!==E.node||N.focusOffset!==E.offset)){var M=$.createRange();M.setStart(D.node,D.offset),N.removeAllRanges(),ce>He?(N.addRange(M),N.extend(E.node,E.offset)):(M.setEnd(E.node,E.offset),N.addRange(M))}}}}for($=[],N=v;N=N.parentNode;)N.nodeType===1&&$.push({element:N,left:N.scrollLeft,top:N.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<$.length;v++){var P=$[v];P.element.scrollLeft=P.left,P.element.scrollTop=P.top}}Aa=!!mh,vh=mh=null}finally{Be=c,W.p=a,T.T=r}}t.current=s,ot=2}}function p_(){if(ot===2){ot=0;var t=xs,s=Pr,r=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||r){r=T.T,T.T=null;var a=W.p;W.p=2;var c=Be;Be|=4;try{Pp(t,s.alternate,s)}finally{Be=c,W.p=a,T.T=r}}ot=3}}function __(){if(ot===4||ot===3){ot=0,Uv();var t=xs,s=Pr,r=Ji,a=t_;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?ot=5:(ot=0,Pr=xs=null,g_(t,t.pendingLanes));var c=t.pendingLanes;if(c===0&&(bs=null),Co(r),s=s.stateNode,Kt&&typeof Kt.onCommitFiberRoot=="function")try{Kt.onCommitFiberRoot(rn,s,void 0,(s.current.flags&128)===128)}catch{}if(a!==null){s=T.T,c=W.p,W.p=2,T.T=null;try{for(var u=t.onRecoverableError,g=0;g<a.length;g++){var v=a[g];u(v.value,{componentStack:v.stack})}}finally{T.T=s,W.p=c}}(Ji&3)!==0&&ya(),Ri(t),c=t.pendingLanes,(r&261930)!==0&&(c&42)!==0?t===rh?Un++:(Un=0,rh=t):Un=0,qn(0)}}function g_(t,s){(t.pooledCacheLanes&=s)===0&&(s=t.pooledCache,s!=null&&(t.pooledCache=null,yn(s)))}function ya(){return f_(),p_(),__(),m_()}function m_(){if(ot!==5)return!1;var t=xs,s=ih;ih=0;var r=Co(Ji),a=T.T,c=W.p;try{W.p=32>r?32:r,T.T=null,r=sh,sh=null;var u=xs,g=Ji;if(ot=0,Pr=xs=null,Ji=0,(Be&6)!==0)throw Error(l(331));var v=Be;if(Be|=4,Qp(u.current),Vp(u,u.current,g,r),Be=v,qn(0,!1),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(rn,u)}catch{}return!0}finally{W.p=c,T.T=a,g_(t,s)}}function v_(t,s,r){s=ni(r,s),s=Nc(t.stateNode,s,2),t=_s(t,s,2),t!==null&&(ln(t,2),Ri(t))}function Oe(t,s,r){if(t.tag===3)v_(t,t,r);else for(;s!==null;){if(s.tag===3){v_(s,t,r);break}else if(s.tag===1){var a=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(bs===null||!bs.has(a))){t=ni(r,t),r=Sp(2),a=_s(s,r,2),a!==null&&(yp(r,a,s,t),ln(a,2),Ri(a));break}}s=s.return}}function ah(t,s,r){var a=t.pingCache;if(a===null){a=t.pingCache=new uS;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)||(Jc=!0,c.add(r),t=gS.bind(null,t,s,r),s.then(t,t))}function gS(t,s,r){var a=t.pingCache;a!==null&&a.delete(s),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,qe===t&&(we&r)===r&&(Ve===4||Ve===3&&(we&62914560)===we&&300>Pt()-pa?(Be&2)===0&&Kr(t,0):eh|=r,Wr===we&&(Wr=0)),Ri(t)}function S_(t,s){s===0&&(s=dd()),t=Ps(t,s),t!==null&&(ln(t,s),Ri(t))}function mS(t){var s=t.memoizedState,r=0;s!==null&&(r=s.retryLane),S_(t,r)}function vS(t,s){var r=0;switch(t.tag){case 31: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),S_(t,r)}function SS(t,s){return yo(t,s)}var ba=null,$r=null,oh=!1,xa=!1,ch=!1,Cs=0;function Ri(t){t!==$r&&t.next===null&&($r===null?ba=$r=t:$r=$r.next=t),xa=!0,oh||(oh=!0,bS())}function qn(t,s){if(!ch&&xa){ch=!0;do for(var r=!1,a=ba;a!==null;){if(t!==0){var c=a.pendingLanes;if(c===0)var u=0;else{var g=a.suspendedLanes,v=a.pingedLanes;u=(1<<31-Yt(42|t)+1)-1,u&=c&~(g&~v),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(r=!0,w_(a,u))}else u=we,u=El(a,a===qe?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||nn(a,u)||(r=!0,w_(a,u));a=a.next}while(r);ch=!1}}function yS(){y_()}function y_(){xa=oh=!1;var t=0;Cs!==0&&BS()&&(t=Cs);for(var s=Pt(),r=null,a=ba;a!==null;){var c=a.next,u=b_(a,s);u===0?(a.next=null,r===null?ba=c:r.next=c,c===null&&($r=r)):(r=a,(t!==0||(u&3)!==0)&&(xa=!0)),a=c}ot!==0&&ot!==5||qn(t),Cs!==0&&(Cs=0)}function b_(t,s){for(var r=t.suspendedLanes,a=t.pingedLanes,c=t.expirationTimes,u=t.pendingLanes&-62914561;0<u;){var g=31-Yt(u),v=1<<g,w=c[g];w===-1?((v&r)===0||(v&a)!==0)&&(c[g]=Gv(v,s)):w<=s&&(t.expiredLanes|=v),u&=~v}if(s=qe,r=we,r=El(t,t===s?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a=t.callbackNode,r===0||t===s&&(ze===2||ze===9)||t.cancelPendingCommit!==null)return a!==null&&a!==null&&bo(a),t.callbackNode=null,t.callbackPriority=0;if((r&3)===0||nn(t,r)){if(s=r&-r,s===t.callbackPriority)return s;switch(a!==null&&bo(a),Co(r)){case 2:case 8:r=hd;break;case 32:r=xl;break;case 268435456:r=ud;break;default:r=xl}return a=x_.bind(null,t),r=yo(r,a),t.callbackPriority=s,t.callbackNode=r,s}return a!==null&&a!==null&&bo(a),t.callbackPriority=2,t.callbackNode=null,2}function x_(t,s){if(ot!==0&&ot!==5)return t.callbackNode=null,t.callbackPriority=0,null;var r=t.callbackNode;if(ya()&&t.callbackNode!==r)return null;var a=we;return a=El(t,t===qe?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a===0?null:(s_(t,a,s),b_(t,Pt()),t.callbackNode!=null&&t.callbackNode===r?x_.bind(null,t):null)}function w_(t,s){if(ya())return null;s_(t,s,!0)}function bS(){zS(function(){(Be&6)!==0?yo(cd,yS):y_()})}function hh(){if(Cs===0){var t=Mr;t===0&&(t=wl,wl<<=1,(wl&261888)===0&&(wl=256)),Cs=t}return Cs}function C_(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ml(""+t)}function k_(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 xS(t,s,r,a,c){if(s==="submit"&&r&&r.stateNode===c){var u=C_((c[Ot]||null).action),g=a.submitter;g&&(s=(s=g[Ot]||null)?C_(s.formAction):g.getAttribute("formAction"),s!==null&&(u=s,g=null));var v=new Ol("action","action",null,a,c);t.push({event:v,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Cs!==0){var w=g?k_(c,g):new FormData(c);Mc(r,{pending:!0,data:w,method:c.method,action:u},null,w)}}else typeof u=="function"&&(v.preventDefault(),w=g?k_(c,g):new FormData(c),Mc(r,{pending:!0,data:w,method:c.method,action:u},u,w))},currentTarget:c}]})}}for(var uh=0;uh<Go.length;uh++){var dh=Go[uh],wS=dh.toLowerCase(),CS=dh[0].toUpperCase()+dh.slice(1);vi(wS,"on"+CS)}vi(tf,"onAnimationEnd"),vi(sf,"onAnimationIteration"),vi(rf,"onAnimationStart"),vi("dblclick","onDoubleClick"),vi("focusin","onFocus"),vi("focusout","onBlur"),vi(q0,"onTransitionRun"),vi(W0,"onTransitionStart"),vi(P0,"onTransitionCancel"),vi(nf,"onTransitionEnd"),gr("onMouseEnter",["mouseout","mouseover"]),gr("onMouseLeave",["mouseout","mouseover"]),gr("onPointerEnter",["pointerout","pointerover"]),gr("onPointerLeave",["pointerout","pointerover"]),Hs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Hs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Hs("onBeforeInput",["compositionend","keypress","textInput","paste"]),Hs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Hs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Hs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wn="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(" "),kS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wn));function E_(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 v=a[g],w=v.instance,B=v.currentTarget;if(v=v.listener,w!==u&&c.isPropagationStopped())break e;u=v,c.currentTarget=B;try{u(c)}catch(U){jl(U)}c.currentTarget=null,u=w}else for(g=0;g<a.length;g++){if(v=a[g],w=v.instance,B=v.currentTarget,v=v.listener,w!==u&&c.isPropagationStopped())break e;u=v,c.currentTarget=B;try{u(c)}catch(U){jl(U)}c.currentTarget=null,u=w}}}}function xe(t,s){var r=s[ko];r===void 0&&(r=s[ko]=new Set);var a=t+"__bubble";r.has(a)||(T_(s,t,2,!1),r.add(a))}function fh(t,s,r){var a=0;s&&(a|=4),T_(r,t,a,s)}var wa="_reactListening"+Math.random().toString(36).slice(2);function ph(t){if(!t[wa]){t[wa]=!0,Sd.forEach(function(r){r!=="selectionchange"&&(kS.has(r)||fh(r,!1,t),fh(r,!0,t))});var s=t.nodeType===9?t:t.ownerDocument;s===null||s[wa]||(s[wa]=!0,fh("selectionchange",!1,s))}}function T_(t,s,r,a){switch(ig(s)){case 2:var c=JS;break;case 8:c=ey;break;default:c=Dh}r=c.bind(null,s,r,t),c=void 0,!Oo||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 _h(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 v=a.stateNode.containerInfo;if(v===c)break;if(g===4)for(g=a.return;g!==null;){var w=g.tag;if((w===3||w===4)&&g.stateNode.containerInfo===c)return;g=g.return}for(;v!==null;){if(g=fr(v),g===null)return;if(w=g.tag,w===5||w===6||w===26||w===27){a=u=g;continue e}v=v.parentNode}}a=a.return}Bd(function(){var B=u,U=Ao(r),$=[];e:{var z=lf.get(t);if(z!==void 0){var N=Ol,re=t;switch(t){case"keypress":if(Al(r)===0)break e;case"keydown":case"keyup":N=v0;break;case"focusin":re="focus",N=Ho;break;case"focusout":re="blur",N=Ho;break;case"beforeblur":case"afterblur":N=Ho;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=Od;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":N=l0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":N=b0;break;case tf:case sf:case rf:N=c0;break;case nf:N=w0;break;case"scroll":case"scrollend":N=r0;break;case"wheel":N=k0;break;case"copy":case"cut":case"paste":N=u0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":N=Nd;break;case"toggle":case"beforetoggle":N=T0}var ce=(s&4)!==0,He=!ce&&(t==="scroll"||t==="scrollend"),D=ce?z!==null?z+"Capture":null:z;ce=[];for(var E=B,M;E!==null;){var P=E;if(M=P.stateNode,P=P.tag,P!==5&&P!==26&&P!==27||M===null||D===null||(P=cn(E,D),P!=null&&ce.push(Pn(E,P,M))),He)break;E=E.return}0<ce.length&&(z=new N(z,re,null,r,U),$.push({event:z,listeners:ce}))}}if((s&7)===0){e:{if(z=t==="mouseover"||t==="pointerover",N=t==="mouseout"||t==="pointerout",z&&r!==Bo&&(re=r.relatedTarget||r.fromElement)&&(fr(re)||re[dr]))break e;if((N||z)&&(z=U.window===U?U:(z=U.ownerDocument)?z.defaultView||z.parentWindow:window,N?(re=r.relatedTarget||r.toElement,N=B,re=re?fr(re):null,re!==null&&(He=h(re),ce=re.tag,re!==He||ce!==5&&ce!==27&&ce!==6)&&(re=null)):(N=null,re=B),N!==re)){if(ce=Od,P="onMouseLeave",D="onMouseEnter",E="mouse",(t==="pointerout"||t==="pointerover")&&(ce=Nd,P="onPointerLeave",D="onPointerEnter",E="pointer"),He=N==null?z:on(N),M=re==null?z:on(re),z=new ce(P,E+"leave",N,r,U),z.target=He,z.relatedTarget=M,P=null,fr(U)===B&&(ce=new ce(D,E+"enter",re,r,U),ce.target=M,ce.relatedTarget=He,P=ce),He=P,N&&re)t:{for(ce=ES,D=N,E=re,M=0,P=D;P;P=ce(P))M++;P=0;for(var le=E;le;le=ce(le))P++;for(;0<M-P;)D=ce(D),M--;for(;0<P-M;)E=ce(E),P--;for(;M--;){if(D===E||E!==null&&D===E.alternate){ce=D;break t}D=ce(D),E=ce(E)}ce=null}else ce=null;N!==null&&R_($,z,N,ce,!1),re!==null&&He!==null&&R_($,He,re,ce,!0)}}e:{if(z=B?on(B):window,N=z.nodeName&&z.nodeName.toLowerCase(),N==="select"||N==="input"&&z.type==="file")var De=Yd;else if(Pd(z))if($d)De=j0;else{De=L0;var ne=O0}else N=z.nodeName,!N||N.toLowerCase()!=="input"||z.type!=="checkbox"&&z.type!=="radio"?B&&Mo(B.elementType)&&(De=Yd):De=N0;if(De&&(De=De(t,B))){Kd($,De,r,U);break e}ne&&ne(t,z,B),t==="focusout"&&B&&z.type==="number"&&B.memoizedProps.value!=null&&Do(z,"number",z.value)}switch(ne=B?on(B):window,t){case"focusin":(Pd(ne)||ne.contentEditable==="true")&&(xr=ne,Yo=B,mn=null);break;case"focusout":mn=Yo=xr=null;break;case"mousedown":$o=!0;break;case"contextmenu":case"mouseup":case"dragend":$o=!1,Jd($,r,U);break;case"selectionchange":if(U0)break;case"keydown":case"keyup":Jd($,r,U)}var me;if(qo)e:{switch(t){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else br?qd(t,r)&&(Ce="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(Ce="onCompositionStart");Ce&&(jd&&r.locale!=="ko"&&(br||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&br&&(me=Ad()):(os=U,Lo="value"in os?os.value:os.textContent,br=!0)),ne=Ca(B,Ce),0<ne.length&&(Ce=new Ld(Ce,t,null,r,U),$.push({event:Ce,listeners:ne}),me?Ce.data=me:(me=Wd(r),me!==null&&(Ce.data=me)))),(me=D0?M0(t,r):B0(t,r))&&(Ce=Ca(B,"onBeforeInput"),0<Ce.length&&(ne=new Ld("onBeforeInput","beforeinput",null,r,U),$.push({event:ne,listeners:Ce}),ne.data=me)),xS($,t,B,r,U)}E_($,s)})}function Pn(t,s,r){return{instance:t,listener:s,currentTarget:r}}function Ca(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=cn(t,r),c!=null&&a.unshift(Pn(t,c,u)),c=cn(t,s),c!=null&&a.push(Pn(t,c,u))),t.tag===3)return a;t=t.return}return[]}function ES(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function R_(t,s,r,a,c){for(var u=s._reactName,g=[];r!==null&&r!==a;){var v=r,w=v.alternate,B=v.stateNode;if(v=v.tag,w!==null&&w===a)break;v!==5&&v!==26&&v!==27||B===null||(w=B,c?(B=cn(r,u),B!=null&&g.unshift(Pn(r,B,w))):c||(B=cn(r,u),B!=null&&g.push(Pn(r,B,w)))),r=r.return}g.length!==0&&t.push({event:s,listeners:g})}var TS=/\r\n?/g,RS=/\u0000|\uFFFD/g;function D_(t){return(typeof t=="string"?t:""+t).replace(TS,`
|
|
9
|
-
`).replace(RS,"")}function M_(t,s){return s=D_(s),D_(t)===s}function je(t,s,r,a,c,u){switch(r){case"children":typeof a=="string"?s==="body"||s==="textarea"&&a===""||vr(t,a):(typeof a=="number"||typeof a=="bigint")&&s!=="body"&&vr(t,""+a);break;case"className":Rl(t,"class",a);break;case"tabIndex":Rl(t,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Rl(t,r,a);break;case"style":Dd(t,a,u);break;case"data":if(s!=="object"){Rl(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=Ml(""+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"&&je(t,s,"name",c.name,c,null),je(t,s,"formEncType",c.formEncType,c,null),je(t,s,"formMethod",c.formMethod,c,null),je(t,s,"formTarget",c.formTarget,c,null)):(je(t,s,"encType",c.encType,c,null),je(t,s,"method",c.method,c,null),je(t,s,"target",c.target,c,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(r);break}a=Ml(""+a),t.setAttribute(r,a);break;case"onClick":a!=null&&(t.onclick=Hi);break;case"onScroll":a!=null&&xe("scroll",t);break;case"onScrollEnd":a!=null&&xe("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=Ml(""+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":xe("beforetoggle",t),xe("toggle",t),Tl(t,"popover",a);break;case"xlinkActuate":ji(t,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":ji(t,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":ji(t,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":ji(t,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":ji(t,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":ji(t,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":ji(t,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":ji(t,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":ji(t,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Tl(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=i0.get(r)||r,Tl(t,r,a))}}function gh(t,s,r,a,c,u){switch(r){case"style":Dd(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"?vr(t,a):(typeof a=="number"||typeof a=="bigint")&&vr(t,""+a);break;case"onScroll":a!=null&&xe("scroll",t);break;case"onScrollEnd":a!=null&&xe("scrollend",t);break;case"onClick":a!=null&&(t.onclick=Hi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yd.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[Ot]||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,""):Tl(t,r,a)}}}function Ct(t,s,r){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xe("error",t),xe("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:je(t,s,u,g,r,null)}}c&&je(t,s,"srcSet",r.srcSet,r,null),a&&je(t,s,"src",r.src,r,null);return;case"input":xe("invalid",t);var v=u=g=c=null,w=null,B=null;for(a in r)if(r.hasOwnProperty(a)){var U=r[a];if(U!=null)switch(a){case"name":c=U;break;case"type":g=U;break;case"checked":w=U;break;case"defaultChecked":B=U;break;case"value":u=U;break;case"defaultValue":v=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(l(137,s));break;default:je(t,s,a,U,r,null)}}kd(t,u,v,w,B,g,c,!1);return;case"select":xe("invalid",t),a=g=u=null;for(c in r)if(r.hasOwnProperty(c)&&(v=r[c],v!=null))switch(c){case"value":u=v;break;case"defaultValue":g=v;break;case"multiple":a=v;default:je(t,s,c,v,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":xe("invalid",t),u=c=a=null;for(g in r)if(r.hasOwnProperty(g)&&(v=r[g],v!=null))switch(g){case"value":a=v;break;case"defaultValue":c=v;break;case"children":u=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(l(91));break;default:je(t,s,g,v,r,null)}Td(t,a,c,u);return;case"option":for(w in r)r.hasOwnProperty(w)&&(a=r[w],a!=null)&&(w==="selected"?t.selected=a&&typeof a!="function"&&typeof a!="symbol":je(t,s,w,a,r,null));return;case"dialog":xe("beforetoggle",t),xe("toggle",t),xe("cancel",t),xe("close",t);break;case"iframe":case"object":xe("load",t);break;case"video":case"audio":for(a=0;a<Wn.length;a++)xe(Wn[a],t);break;case"image":xe("error",t),xe("load",t);break;case"details":xe("toggle",t);break;case"embed":case"source":case"link":xe("error",t),xe("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:je(t,s,B,a,r,null)}return;default:if(Mo(s)){for(U in r)r.hasOwnProperty(U)&&(a=r[U],a!==void 0&&gh(t,s,U,a,r,void 0));return}}for(v in r)r.hasOwnProperty(v)&&(a=r[v],a!=null&&je(t,s,v,a,r,null))}function DS(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,v=null,w=null,B=null,U=null;for(N in r){var $=r[N];if(r.hasOwnProperty(N)&&$!=null)switch(N){case"checked":break;case"value":break;case"defaultValue":w=$;default:a.hasOwnProperty(N)||je(t,s,N,null,a,$)}}for(var z in a){var N=a[z];if($=r[z],a.hasOwnProperty(z)&&(N!=null||$!=null))switch(z){case"type":u=N;break;case"name":c=N;break;case"checked":B=N;break;case"defaultChecked":U=N;break;case"value":g=N;break;case"defaultValue":v=N;break;case"children":case"dangerouslySetInnerHTML":if(N!=null)throw Error(l(137,s));break;default:N!==$&&je(t,s,z,N,a,$)}}Ro(t,g,v,w,B,U,u,c);return;case"select":N=g=v=z=null;for(u in r)if(w=r[u],r.hasOwnProperty(u)&&w!=null)switch(u){case"value":break;case"multiple":N=w;default:a.hasOwnProperty(u)||je(t,s,u,null,a,w)}for(c in a)if(u=a[c],w=r[c],a.hasOwnProperty(c)&&(u!=null||w!=null))switch(c){case"value":z=u;break;case"defaultValue":v=u;break;case"multiple":g=u;default:u!==w&&je(t,s,c,u,a,w)}s=v,r=g,a=N,z!=null?mr(t,!!r,z,!1):!!a!=!!r&&(s!=null?mr(t,!!r,s,!0):mr(t,!!r,r?[]:"",!1));return;case"textarea":N=z=null;for(v in r)if(c=r[v],r.hasOwnProperty(v)&&c!=null&&!a.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:je(t,s,v,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":z=c;break;case"defaultValue":N=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(l(91));break;default:c!==u&&je(t,s,g,c,a,u)}Ed(t,z,N);return;case"option":for(var re in r)z=r[re],r.hasOwnProperty(re)&&z!=null&&!a.hasOwnProperty(re)&&(re==="selected"?t.selected=!1:je(t,s,re,null,a,z));for(w in a)z=a[w],N=r[w],a.hasOwnProperty(w)&&z!==N&&(z!=null||N!=null)&&(w==="selected"?t.selected=z&&typeof z!="function"&&typeof z!="symbol":je(t,s,w,z,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 ce in r)z=r[ce],r.hasOwnProperty(ce)&&z!=null&&!a.hasOwnProperty(ce)&&je(t,s,ce,null,a,z);for(B in a)if(z=a[B],N=r[B],a.hasOwnProperty(B)&&z!==N&&(z!=null||N!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(l(137,s));break;default:je(t,s,B,z,a,N)}return;default:if(Mo(s)){for(var He in r)z=r[He],r.hasOwnProperty(He)&&z!==void 0&&!a.hasOwnProperty(He)&&gh(t,s,He,void 0,a,z);for(U in a)z=a[U],N=r[U],!a.hasOwnProperty(U)||z===N||z===void 0&&N===void 0||gh(t,s,U,z,a,N);return}}for(var D in r)z=r[D],r.hasOwnProperty(D)&&z!=null&&!a.hasOwnProperty(D)&&je(t,s,D,null,a,z);for($ in a)z=a[$],N=r[$],!a.hasOwnProperty($)||z===N||z==null&&N==null||je(t,s,$,z,a,N)}function B_(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function MS(){if(typeof performance.getEntriesByType=="function"){for(var t=0,s=0,r=performance.getEntriesByType("resource"),a=0;a<r.length;a++){var c=r[a],u=c.transferSize,g=c.initiatorType,v=c.duration;if(u&&v&&B_(g)){for(g=0,v=c.responseEnd,a+=1;a<r.length;a++){var w=r[a],B=w.startTime;if(B>v)break;var U=w.transferSize,$=w.initiatorType;U&&B_($)&&(w=w.responseEnd,g+=U*(w<v?1:(v-B)/(w-B)))}if(--a,s+=8*(u+g)/(c.duration/1e3),t++,10<t)break}}if(0<t)return s/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var mh=null,vh=null;function ka(t){return t.nodeType===9?t:t.ownerDocument}function A_(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 z_(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 Sh(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 yh=null;function BS(){var t=window.event;return t&&t.type==="popstate"?t===yh?!1:(yh=t,!0):(yh=null,!1)}var O_=typeof setTimeout=="function"?setTimeout:void 0,AS=typeof clearTimeout=="function"?clearTimeout:void 0,L_=typeof Promise=="function"?Promise:void 0,zS=typeof queueMicrotask=="function"?queueMicrotask:typeof L_<"u"?function(t){return L_.resolve(null).then(t).catch(OS)}:O_;function OS(t){setTimeout(function(){throw t})}function ks(t){return t==="head"}function N_(t,s){var r=s,a=0;do{var c=r.nextSibling;if(t.removeChild(r),c&&c.nodeType===8)if(r=c.data,r==="/$"||r==="/&"){if(a===0){t.removeChild(c),Vr(s);return}a--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")a++;else if(r==="html")Kn(t.ownerDocument.documentElement);else if(r==="head"){r=t.ownerDocument.head,Kn(r);for(var u=r.firstChild;u;){var g=u.nextSibling,v=u.nodeName;u[an]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&u.rel.toLowerCase()==="stylesheet"||r.removeChild(u),u=g}}else r==="body"&&Kn(t.ownerDocument.body);r=c}while(r);Vr(s)}function j_(t,s){var r=t;t=0;do{var a=r.nextSibling;if(r.nodeType===1?s?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(s?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(t===0)break;t--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||t++;r=a}while(r)}function bh(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":bh(r),Eo(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}t.removeChild(r)}}function LS(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[an])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=hi(t.nextSibling),t===null)break}return null}function NS(t,s,r){if(s==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=hi(t.nextSibling),t===null))return null;return t}function H_(t,s){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=hi(t.nextSibling),t===null))return null;return t}function xh(t){return t.data==="$?"||t.data==="$~"}function wh(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function jS(t,s){var r=t.ownerDocument;if(t.data==="$~")t._reactRetry=s;else if(t.data!=="$?"||r.readyState!=="loading")s();else{var a=function(){s(),r.removeEventListener("DOMContentLoaded",a)};r.addEventListener("DOMContentLoaded",a),t._reactRetry=a}}function hi(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==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return t}var Ch=null;function U_(t){t=t.nextSibling;for(var s=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"||r==="/&"){if(s===0)return hi(t.nextSibling);s--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||s++}t=t.nextSibling}return null}function q_(t){t=t.previousSibling;for(var s=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(s===0)return t;s--}else r!=="/$"&&r!=="/&"||s++}t=t.previousSibling}return null}function W_(t,s,r){switch(s=ka(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 Kn(t){for(var s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Eo(t)}var ui=new Map,P_=new Set;function Ea(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var es=W.d;W.d={f:HS,r:US,D:qS,C:WS,L:PS,m:KS,X:$S,S:YS,M:IS};function HS(){var t=es.f(),s=ma();return t||s}function US(t){var s=pr(t);s!==null&&s.tag===5&&s.type==="form"?np(s):es.r(t)}var Ir=typeof document>"u"?null:document;function K_(t,s,r){var a=Ir;if(a&&typeof s=="string"&&s){var c=si(s);c='link[rel="'+t+'"][href="'+c+'"]',typeof r=="string"&&(c+='[crossorigin="'+r+'"]'),P_.has(c)||(P_.add(c),t={rel:t,crossOrigin:r,href:s},a.querySelector(c)===null&&(s=a.createElement("link"),Ct(s,"link",t),dt(s),a.head.appendChild(s)))}}function qS(t){es.D(t),K_("dns-prefetch",t,null)}function WS(t,s){es.C(t,s),K_("preconnect",t,s)}function PS(t,s,r){es.L(t,s,r);var a=Ir;if(a&&t&&s){var c='link[rel="preload"][as="'+si(s)+'"]';s==="image"&&r&&r.imageSrcSet?(c+='[imagesrcset="'+si(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(c+='[imagesizes="'+si(r.imageSizes)+'"]')):c+='[href="'+si(t)+'"]';var u=c;switch(s){case"style":u=Gr(t);break;case"script":u=Xr(t)}ui.has(u)||(t=S({rel:"preload",href:s==="image"&&r&&r.imageSrcSet?void 0:t,as:s},r),ui.set(u,t),a.querySelector(c)!==null||s==="style"&&a.querySelector(Yn(u))||s==="script"&&a.querySelector($n(u))||(s=a.createElement("link"),Ct(s,"link",t),dt(s),a.head.appendChild(s)))}}function KS(t,s){es.m(t,s);var r=Ir;if(r&&t){var a=s&&typeof s.as=="string"?s.as:"script",c='link[rel="modulepreload"][as="'+si(a)+'"][href="'+si(t)+'"]',u=c;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Xr(t)}if(!ui.has(u)&&(t=S({rel:"modulepreload",href:t},s),ui.set(u,t),r.querySelector(c)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector($n(u)))return}a=r.createElement("link"),Ct(a,"link",t),dt(a),r.head.appendChild(a)}}}function YS(t,s,r){es.S(t,s,r);var a=Ir;if(a&&t){var c=_r(a).hoistableStyles,u=Gr(t);s=s||"default";var g=c.get(u);if(!g){var v={loading:0,preload:null};if(g=a.querySelector(Yn(u)))v.loading=5;else{t=S({rel:"stylesheet",href:t,"data-precedence":s},r),(r=ui.get(u))&&kh(t,r);var w=g=a.createElement("link");dt(w),Ct(w,"link",t),w._p=new Promise(function(B,U){w.onload=B,w.onerror=U}),w.addEventListener("load",function(){v.loading|=1}),w.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Ta(g,s,a)}g={type:"stylesheet",instance:g,count:1,state:v},c.set(u,g)}}}function $S(t,s){es.X(t,s);var r=Ir;if(r&&t){var a=_r(r).hoistableScripts,c=Xr(t),u=a.get(c);u||(u=r.querySelector($n(c)),u||(t=S({src:t,async:!0},s),(s=ui.get(c))&&Eh(t,s),u=r.createElement("script"),dt(u),Ct(u,"link",t),r.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(c,u))}}function IS(t,s){es.M(t,s);var r=Ir;if(r&&t){var a=_r(r).hoistableScripts,c=Xr(t),u=a.get(c);u||(u=r.querySelector($n(c)),u||(t=S({src:t,async:!0,type:"module"},s),(s=ui.get(c))&&Eh(t,s),u=r.createElement("script"),dt(u),Ct(u,"link",t),r.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(c,u))}}function Y_(t,s,r,a){var c=(c=he.current)?Ea(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=Gr(r.href),r=_r(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=Gr(r.href);var u=_r(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(Yn(t)))&&!u._p&&(g.instance=u,g.state.loading=5),ui.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},ui.set(t,r),u||GS(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=Xr(r),r=_r(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 Gr(t){return'href="'+si(t)+'"'}function Yn(t){return'link[rel="stylesheet"]['+t+"]"}function $_(t){return S({},t,{"data-precedence":t.precedence,precedence:null})}function GS(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}),Ct(s,"link",r),dt(s),t.head.appendChild(s))}function Xr(t){return'[src="'+si(t)+'"]'}function $n(t){return"script[async]"+t}function I_(t,s,r){if(s.count++,s.instance===null)switch(s.type){case"style":var a=t.querySelector('style[data-href~="'+si(r.href)+'"]');if(a)return s.instance=a,dt(a),a;var c=S({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),dt(a),Ct(a,"style",c),Ta(a,r.precedence,t),s.instance=a;case"stylesheet":c=Gr(r.href);var u=t.querySelector(Yn(c));if(u)return s.state.loading|=4,s.instance=u,dt(u),u;a=$_(r),(c=ui.get(c))&&kh(a,c),u=(t.ownerDocument||t).createElement("link"),dt(u);var g=u;return g._p=new Promise(function(v,w){g.onload=v,g.onerror=w}),Ct(u,"link",a),s.state.loading|=4,Ta(u,r.precedence,t),s.instance=u;case"script":return u=Xr(r.src),(c=t.querySelector($n(u)))?(s.instance=c,dt(c),c):(a=r,(c=ui.get(u))&&(a=S({},r),Eh(a,c)),t=t.ownerDocument||t,c=t.createElement("script"),dt(c),Ct(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,Ta(a,r.precedence,t));return s.instance}function Ta(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 v=a[g];if(v.dataset.precedence===s)u=v;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 kh(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.title==null&&(t.title=s.title)}function Eh(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.integrity==null&&(t.integrity=s.integrity)}var Ra=null;function G_(t,s,r){if(Ra===null){var a=new Map,c=Ra=new Map;c.set(r,a)}else c=Ra,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[an]||u[yt]||t==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var g=u.getAttribute(s)||"";g=t+g;var v=a.get(g);v?v.push(u):a.set(g,[u])}}return a}function X_(t,s,r){t=t.ownerDocument||t,t.head.insertBefore(r,s==="title"?t.querySelector("head > title"):null)}function XS(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;return s.rel==="stylesheet"?(t=s.disabled,typeof s.precedence=="string"&&t==null):!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 V_(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function VS(t,s,r,a){if(r.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var c=Gr(a.href),u=s.querySelector(Yn(c));if(u){s=u._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(t.count++,t=Da.bind(t),s.then(t,t)),r.state.loading|=4,r.instance=u,dt(u);return}u=s.ownerDocument||s,a=$_(a),(c=ui.get(c))&&kh(a,c),u=u.createElement("link"),dt(u);var g=u;g._p=new Promise(function(v,w){g.onload=v,g.onerror=w}),Ct(u,"link",a),r.instance=u}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,s),(s=r.state.preload)&&(r.state.loading&3)===0&&(t.count++,r=Da.bind(t),s.addEventListener("load",r),s.addEventListener("error",r))}}var Th=0;function FS(t,s){return t.stylesheets&&t.count===0&&Ba(t,t.stylesheets),0<t.count||0<t.imgCount?function(r){var a=setTimeout(function(){if(t.stylesheets&&Ba(t,t.stylesheets),t.unsuspend){var u=t.unsuspend;t.unsuspend=null,u()}},6e4+s);0<t.imgBytes&&Th===0&&(Th=62500*MS());var c=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ba(t,t.stylesheets),t.unsuspend)){var u=t.unsuspend;t.unsuspend=null,u()}},(t.imgBytes>Th?50:800)+s);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(c)}}:null}function Da(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ba(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ma=null;function Ba(t,s){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ma=new Map,s.forEach(ZS,t),Ma=null,Da.call(t))}function ZS(t,s){if(!(s.state.loading&4)){var r=Ma.get(t);if(r)var a=r.get(null);else{r=new Map,Ma.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=Da.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 In={$$typeof:A,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function QS(t,s,r,a,c,u,g,v,w){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=xo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xo(0),this.hiddenUpdates=xo(null),this.identifierPrefix=a,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function F_(t,s,r,a,c,u,g,v,w,B,U,$){return t=new QS(t,s,r,g,w,B,U,$,v),s=1,u===!0&&(s|=24),u=It(3,null,null,s),t.current=u,u.stateNode=t,s=lc(),s.refCount++,t.pooledCache=s,s.refCount++,u.memoizedState={element:a,isDehydrated:r,cache:s},hc(u),t}function Z_(t){return t?(t=kr,t):kr}function Q_(t,s,r,a,c,u){c=Z_(c),a.context===null?a.context=c:a.pendingContext=c,a=ps(s),a.payload={element:r},u=u===void 0?null:u,u!==null&&(a.callback=u),r=_s(t,a,s),r!==null&&(qt(r,t,s),Cn(r,t,s))}function J_(t,s){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<s?r:s}}function Rh(t,s){J_(t,s),(t=t.alternate)&&J_(t,s)}function eg(t){if(t.tag===13||t.tag===31){var s=Ps(t,67108864);s!==null&&qt(s,t,67108864),Rh(t,67108864)}}function tg(t){if(t.tag===13||t.tag===31){var s=Zt();s=wo(s);var r=Ps(t,s);r!==null&&qt(r,t,s),Rh(t,s)}}var Aa=!0;function JS(t,s,r,a){var c=T.T;T.T=null;var u=W.p;try{W.p=2,Dh(t,s,r,a)}finally{W.p=u,T.T=c}}function ey(t,s,r,a){var c=T.T;T.T=null;var u=W.p;try{W.p=8,Dh(t,s,r,a)}finally{W.p=u,T.T=c}}function Dh(t,s,r,a){if(Aa){var c=Mh(a);if(c===null)_h(t,s,a,za,r),sg(t,a);else if(iy(c,t,s,r,a))a.stopPropagation();else if(sg(t,a),s&4&&-1<ty.indexOf(t)){for(;c!==null;){var u=pr(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var g=js(u.pendingLanes);if(g!==0){var v=u;for(v.pendingLanes|=2,v.entangledLanes|=2;g;){var w=1<<31-Yt(g);v.entanglements[1]|=w,g&=~w}Ri(u),(Be&6)===0&&(_a=Pt()+500,qn(0))}}break;case 31:case 13:v=Ps(u,2),v!==null&&qt(v,u,2),ma(),Rh(u,2)}if(u=Mh(a),u===null&&_h(t,s,a,za,r),u===c)break;c=u}c!==null&&a.stopPropagation()}else _h(t,s,a,null,r)}}function Mh(t){return t=Ao(t),Bh(t)}var za=null;function Bh(t){if(za=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===31){if(t=_(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 za=t,null}function ig(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(qv()){case cd:return 2;case hd:return 8;case xl:case Wv:return 32;case ud:return 268435456;default:return 32}default:return 32}}var Ah=!1,Es=null,Ts=null,Rs=null,Gn=new Map,Xn=new Map,Ds=[],ty="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 sg(t,s){switch(t){case"focusin":case"focusout":Es=null;break;case"dragenter":case"dragleave":Ts=null;break;case"mouseover":case"mouseout":Rs=null;break;case"pointerover":case"pointerout":Gn.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xn.delete(s.pointerId)}}function Vn(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=pr(s),s!==null&&eg(s)),t):(t.eventSystemFlags|=a,s=t.targetContainers,c!==null&&s.indexOf(c)===-1&&s.push(c),t)}function iy(t,s,r,a,c){switch(s){case"focusin":return Es=Vn(Es,t,s,r,a,c),!0;case"dragenter":return Ts=Vn(Ts,t,s,r,a,c),!0;case"mouseover":return Rs=Vn(Rs,t,s,r,a,c),!0;case"pointerover":var u=c.pointerId;return Gn.set(u,Vn(Gn.get(u)||null,t,s,r,a,c)),!0;case"gotpointercapture":return u=c.pointerId,Xn.set(u,Vn(Xn.get(u)||null,t,s,r,a,c)),!0}return!1}function rg(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,md(t.priority,function(){tg(r)});return}}else if(s===31){if(s=_(r),s!==null){t.blockedOn=s,md(t.priority,function(){tg(r)});return}}else if(s===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Oa(t){if(t.blockedOn!==null)return!1;for(var s=t.targetContainers;0<s.length;){var r=Mh(t.nativeEvent);if(r===null){r=t.nativeEvent;var a=new r.constructor(r.type,r);Bo=a,r.target.dispatchEvent(a),Bo=null}else return s=pr(r),s!==null&&eg(s),t.blockedOn=r,!1;s.shift()}return!0}function ng(t,s,r){Oa(t)&&r.delete(s)}function sy(){Ah=!1,Es!==null&&Oa(Es)&&(Es=null),Ts!==null&&Oa(Ts)&&(Ts=null),Rs!==null&&Oa(Rs)&&(Rs=null),Gn.forEach(ng),Xn.forEach(ng)}function La(t,s){t.blockedOn===s&&(t.blockedOn=null,Ah||(Ah=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,sy)))}var Na=null;function lg(t){Na!==t&&(Na=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Na===t&&(Na=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(Bh(a||r)===null)continue;break}var u=pr(r);u!==null&&(t.splice(s,3),s-=3,Mc(u,{pending:!0,data:c,method:r.method,action:a},a,c))}}))}function Vr(t){function s(w){return La(w,t)}Es!==null&&La(Es,t),Ts!==null&&La(Ts,t),Rs!==null&&La(Rs,t),Gn.forEach(s),Xn.forEach(s);for(var r=0;r<Ds.length;r++){var a=Ds[r];a.blockedOn===t&&(a.blockedOn=null)}for(;0<Ds.length&&(r=Ds[0],r.blockedOn===null);)rg(r),r.blockedOn===null&&Ds.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[Ot]||null;if(typeof u=="function")g||lg(r);else if(g){var v=null;if(u&&u.hasAttribute("formAction")){if(c=u,g=u[Ot]||null)v=g.formAction;else if(Bh(c)!==null)continue}else v=g.action;typeof v=="function"?r[a+1]=v:(r.splice(a,3),a-=3),lg(r)}}}function ag(){function t(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(g){return c=g})},focusReset:"manual",scroll:"manual"})}function s(){c!==null&&(c(),c=null),a||setTimeout(r,20)}function r(){if(!a&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,c=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(r,100),function(){a=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),c!==null&&(c(),c=null)}}}function zh(t){this._internalRoot=t}ja.prototype.render=zh.prototype.render=function(t){var s=this._internalRoot;if(s===null)throw Error(l(409));var r=s.current,a=Zt();Q_(r,a,t,s,null,null)},ja.prototype.unmount=zh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var s=t.containerInfo;Q_(t.current,2,null,t,null,null),ma(),s[dr]=null}};function ja(t){this._internalRoot=t}ja.prototype.unstable_scheduleHydration=function(t){if(t){var s=gd();t={blockedOn:null,target:t,priority:s};for(var r=0;r<Ds.length&&s!==0&&s<Ds[r].priority;r++);Ds.splice(r,0,t),r===0&&rg(t)}};var og=i.version;if(og!=="19.2.4")throw Error(l(527,og,"19.2.4"));W.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=f(s),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var ry={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ha=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ha.isDisabled&&Ha.supportsFiber)try{rn=Ha.inject(ry),Kt=Ha}catch{}}return Zn.createRoot=function(t,s){if(!o(t))throw Error(l(299));var r=!1,a="",c=_p,u=gp,g=mp;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=F_(t,1,!1,null,null,r,a,null,c,u,g,ag),t[dr]=s.current,ph(t),new zh(s)},Zn.hydrateRoot=function(t,s,r){if(!o(t))throw Error(l(299));var a=!1,c="",u=_p,g=gp,v=mp,w=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&&(v=r.onRecoverableError),r.formState!==void 0&&(w=r.formState)),s=F_(t,1,!0,s,r??null,a,c,w,u,g,v,ag),s.context=Z_(null),r=s.current,a=Zt(),a=wo(a),c=ps(a),c.callback=null,_s(r,c,a),r=a,s.current.lanes=r,ln(s,r),Ri(s),t[dr]=s.current,ph(t),new ja(s)},Zn.version="19.2.4",Zn}var vg;function py(){if(vg)return Nh.exports;vg=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(),Nh.exports=fy(),Nh.exports}var _y=py();const xm="claude-portal",Sg="greenhouse-setup",gy=10;function wm(){const e=localStorage.getItem(xm);if(e)try{return JSON.parse(e)}catch{}const i=localStorage.getItem(Sg);if(i)try{const n=JSON.parse(i),l={recentProjects:n.projectDir?[n.projectDir]:[],checklist:{},jobHistory:{}};return Cm(l),localStorage.removeItem(Sg),l}catch{}return{recentProjects:[],checklist:{},jobHistory:{}}}function Cm(e){localStorage.setItem(xm,JSON.stringify(e))}function km(){return wm().recentProjects}function my(e){const i=wm();return i.recentProjects=[e,...i.recentProjects.filter(n=>n!==e)].slice(0,gy),Cm(i),i.recentProjects}const Em=O.createContext(null);function vy({children:e}){const[i,n]=O.useState(null),[l,o]=O.useState(km),[h,d]=O.useState(null),[_,p]=O.useState(null),[f,y]=O.useState(!1),[S,x]=O.useState(!0),[C,b]=O.useState("developer"),R=O.useCallback(K=>{n(K),o(my(K)),d(null),p(null)},[]),j=O.useCallback(()=>{n(null),d(null),p(null),b("developer")},[]),X=O.useCallback((K,A)=>{d(K),p(A)},[]);return m.jsx(Em.Provider,{value:{path:i,recentProjects:l,gitBranch:h,gitRemote:_,terminalConnected:f,serverConnected:S,mode:C,setMode:b,setProjectPath:R,clearProject:j,setGitInfo:X,setTerminalConnected:y,setServerConnected:x},children:e})}function Rt(){const e=O.useContext(Em);if(!e)throw new Error("useProject must be used within ProjectProvider");return e}const Tm=O.createContext(null);function Sy(e){return e.replace(/\x1b\[[?>=!]?[0-9;]*[a-zA-Z]/g,"").replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g,"").replace(/\x1b[()][0-9A-Z]/g,"").replace(/\x1b./g,"").replace(/\r/g,"")}function yy({children:e}){const i=O.useRef(null),[n,l]=O.useState(!1),[o,h]=O.useState([]),d=O.useRef(!1),_=O.useRef(null),p=O.useRef(null),f=O.useRef(null),y=O.useRef(null),S=O.useRef(null),x=O.useRef(null),C=O.useRef(null),b=O.useCallback(H=>{h(Z=>{const F=[...Z,H];return F.length>100?F.slice(F.length-100):F})},[]),R=O.useCallback((H,Z)=>{x.current=H,C.current=Z},[]),j=O.useCallback(H=>{const Z=i.current;Z?.readyState===WebSocket.OPEN&&Z.send(JSON.stringify({type:"input",data:H}))},[]),X=O.useCallback(()=>{if(_.current){const H=_.current;_.current=null,setTimeout(()=>j(H+"\r"),300)}},[j]),K=O.useCallback(()=>{d.current||(d.current=!0,l(!0),f.current&&(clearTimeout(f.current),f.current=null),X())},[X]),A=O.useCallback(H=>{d.current?j(H+"\r"):_.current=H},[j]),L=O.useCallback(H=>{i.current&&i.current.close(),f.current&&(clearTimeout(f.current),f.current=null),d.current=!1,l(!1),p.current=null;const Z=location.protocol==="https:"?"wss:":"ws:",F=new WebSocket(`${Z}//${location.host}/terminal?cwd=${encodeURIComponent(H)}`);return i.current=F,F.onopen=()=>{x.current?.(),setTimeout(()=>{j("claude --dangerously-skip-permissions\r"),p.current=Date.now()},500),f.current=setTimeout(K,15e3)},F.onmessage=pe=>{let ke;try{ke=JSON.parse(pe.data)}catch{return}if(ke.type==="output"){if(ke.data&&y.current?.(ke.data),!d.current&&p.current&&Date.now()-p.current>2e3){const ue=Sy(ke.data||"");(/>\s*$/.test(ue)||ue.includes("What can I help"))&&K()}}else ke.type==="exit"?S.current?.():ke.type==="error"&&y.current?.(`\r
|
|
10
|
-
[Error: ${
|
|
11
|
-
`)},
|
|
8
|
+
`+a.stack}}var So=Object.prototype.hasOwnProperty,yo=e.unstable_scheduleCallback,bo=e.unstable_cancelCallback,Hv=e.unstable_shouldYield,Uv=e.unstable_requestPaint,Pt=e.unstable_now,qv=e.unstable_getCurrentPriorityLevel,cd=e.unstable_ImmediatePriority,hd=e.unstable_UserBlockingPriority,xl=e.unstable_NormalPriority,Wv=e.unstable_LowPriority,ud=e.unstable_IdlePriority,Pv=e.log,Kv=e.unstable_setDisableYieldValue,rn=null,Kt=null;function ls(t){if(typeof Pv=="function"&&Kv(t),Kt&&typeof Kt.setStrictMode=="function")try{Kt.setStrictMode(rn,t)}catch{}}var Yt=Math.clz32?Math.clz32:Iv,Yv=Math.log,$v=Math.LN2;function Iv(t){return t>>>=0,t===0?32:31-(Yv(t)/$v|0)|0}var wl=256,Cl=262144,kl=4194304;function js(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:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;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 El(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 v=a&134217727;return v!==0?(a=v&~u,a!==0?c=js(a):(g&=v,g!==0?c=js(g):r||(r=v&~t,r!==0&&(c=js(r))))):(v=a&~u,v!==0?c=js(v):g!==0?c=js(g):r||(r=a&~t,r!==0&&(c=js(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 nn(t,s){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&s)===0}function Gv(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 dd(){var t=kl;return kl<<=1,(kl&62914560)===0&&(kl=4194304),t}function xo(t){for(var s=[],r=0;31>r;r++)s.push(t);return s}function ln(t,s){t.pendingLanes|=s,s!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Xv(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 v=t.entanglements,w=t.expirationTimes,A=t.hiddenUpdates;for(r=g&~r;0<r;){var H=31-Yt(r),$=1<<H;v[H]=0,w[H]=-1;var z=A[H];if(z!==null)for(A[H]=null,H=0;H<z.length;H++){var j=z[H];j!==null&&(j.lane&=-536870913)}r&=~$}a!==0&&fd(t,a,0),u!==0&&c===0&&t.tag!==0&&(t.suspendedLanes|=u&~(g&~s))}function fd(t,s,r){t.pendingLanes|=s,t.suspendedLanes&=~s;var a=31-Yt(s);t.entangledLanes|=s,t.entanglements[a]=t.entanglements[a]|1073741824|r&261930}function pd(t,s){var r=t.entangledLanes|=s;for(t=t.entanglements;r;){var a=31-Yt(r),c=1<<a;c&s|t[a]&s&&(t[a]|=s),r&=~c}}function _d(t,s){var r=s&-s;return r=(r&42)!==0?1:wo(r),(r&(t.suspendedLanes|s))!==0?0:r}function wo(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 Co(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function gd(){var t=P.p;return t!==0?t:(t=window.event,t===void 0?32:ig(t.type))}function md(t,s){var r=P.p;try{return P.p=t,s()}finally{P.p=r}}var as=Math.random().toString(36).slice(2),yt="__reactFiber$"+as,Ot="__reactProps$"+as,dr="__reactContainer$"+as,ko="__reactEvents$"+as,Vv="__reactListeners$"+as,Fv="__reactHandles$"+as,vd="__reactResources$"+as,an="__reactMarker$"+as;function Eo(t){delete t[yt],delete t[Ot],delete t[ko],delete t[Vv],delete t[Fv]}function fr(t){var s=t[yt];if(s)return s;for(var r=t.parentNode;r;){if(s=r[dr]||r[yt]){if(r=s.alternate,s.child!==null||r!==null&&r.child!==null)for(t=q_(t);t!==null;){if(r=t[yt])return r;t=q_(t)}return s}t=r,r=t.parentNode}return null}function pr(t){if(t=t[yt]||t[dr]){var s=t.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return t}return null}function on(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t.stateNode;throw Error(l(33))}function _r(t){var s=t[vd];return s||(s=t[vd]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function ft(t){t[an]=!0}var Sd=new Set,yd={};function Hs(t,s){gr(t,s),gr(t+"Capture",s)}function gr(t,s){for(yd[t]=s,t=0;t<s.length;t++)Sd.add(s[t])}var Zv=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]*$"),bd={},xd={};function Qv(t){return So.call(xd,t)?!0:So.call(bd,t)?!1:Zv.test(t)?xd[t]=!0:(bd[t]=!0,!1)}function Tl(t,s,r){if(Qv(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 Rl(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 ji(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)}}function ii(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function wd(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Jv(t,s,r){var a=Object.getOwnPropertyDescriptor(t.constructor.prototype,s);if(!t.hasOwnProperty(s)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var c=a.get,u=a.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return c.call(this)},set:function(g){r=""+g,u.call(this,g)}}),Object.defineProperty(t,s,{enumerable:a.enumerable}),{getValue:function(){return r},setValue:function(g){r=""+g},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function To(t){if(!t._valueTracker){var s=wd(t)?"checked":"value";t._valueTracker=Jv(t,s,""+t[s])}}function Cd(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var r=s.getValue(),a="";return t&&(a=wd(t)?t.checked?"true":"false":t.value),t=a,t!==r?(s.setValue(t),!0):!1}function Dl(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 e0=/[\n"\\]/g;function si(t){return t.replace(e0,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Ro(t,s,r,a,c,u,g,v){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=""+ii(s)):t.value!==""+ii(s)&&(t.value=""+ii(s)):g!=="submit"&&g!=="reset"||t.removeAttribute("value"),s!=null?Do(t,g,ii(s)):r!=null?Do(t,g,ii(r)):a!=null&&t.removeAttribute("value"),c==null&&u!=null&&(t.defaultChecked=!!u),c!=null&&(t.checked=c&&typeof c!="function"&&typeof c!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.name=""+ii(v):t.removeAttribute("name")}function kd(t,s,r,a,c,u,g,v){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)){To(t);return}r=r!=null?""+ii(r):"",s=s!=null?""+ii(s):r,v||s===t.value||(t.value=s),t.defaultValue=s}a=a??c,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=v?t.checked:!!a,t.defaultChecked=!!a,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.name=g),To(t)}function Do(t,s,r){s==="number"&&Dl(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=""+ii(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 Ed(t,s,r){if(s!=null&&(s=""+ii(s),s!==t.value&&(t.value=s),r==null)){t.defaultValue!==s&&(t.defaultValue=s);return}t.defaultValue=r!=null?""+ii(r):""}function Td(t,s,r,a){if(s==null){if(a!=null){if(r!=null)throw Error(l(92));if(Q(a)){if(1<a.length)throw Error(l(93));a=a[0]}r=a}r==null&&(r=""),s=r}r=ii(s),t.defaultValue=r,a=t.textContent,a===r&&a!==""&&a!==null&&(t.value=a),To(t)}function vr(t,s){if(s){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=s;return}}t.textContent=s}var t0=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 Rd(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||t0.has(s)?s==="float"?t.cssFloat=r:t[s]=(""+r).trim():t[s]=r+"px"}function Dd(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&&Rd(t,c,a)}else for(var u in s)s.hasOwnProperty(u)&&Rd(t,u,s[u])}function Mo(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 i0=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"]]),s0=/^[\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 Ml(t){return s0.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Hi(){}var Bo=null;function Ao(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Sr=null,yr=null;function Md(t){var s=pr(t);if(s&&(t=s.stateNode)){var r=t[Ot]||null;e:switch(t=s.stateNode,s.type){case"input":if(Ro(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="'+si(""+s)+'"][type="radio"]'),s=0;s<r.length;s++){var a=r[s];if(a!==t&&a.form===t.form){var c=a[Ot]||null;if(!c)throw Error(l(90));Ro(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&&Cd(a)}break e;case"textarea":Ed(t,r.value,r.defaultValue);break e;case"select":s=r.value,s!=null&&mr(t,!!r.multiple,s,!1)}}}var zo=!1;function Bd(t,s,r){if(zo)return t(s,r);zo=!0;try{var a=t(s);return a}finally{if(zo=!1,(Sr!==null||yr!==null)&&(ma(),Sr&&(s=Sr,t=yr,yr=Sr=null,Md(s),t)))for(s=0;s<t.length;s++)Md(t[s])}}function cn(t,s){var r=t.stateNode;if(r===null)return null;var a=r[Ot]||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 Ui=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oo=!1;if(Ui)try{var hn={};Object.defineProperty(hn,"passive",{get:function(){Oo=!0}}),window.addEventListener("test",hn,hn),window.removeEventListener("test",hn,hn)}catch{Oo=!1}var os=null,Lo=null,Bl=null;function Ad(){if(Bl)return Bl;var t,s=Lo,r=s.length,a,c="value"in os?os.value:os.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 Bl=c.slice(t,1<a?1-a:void 0)}function Al(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 zl(){return!0}function zd(){return!1}function Lt(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 v in t)t.hasOwnProperty(v)&&(r=t[v],this[v]=r?r(u):u[v]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?zl:zd,this.isPropagationStopped=zd,this}return S(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=zl)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=zl)},persist:function(){},isPersistent:zl}),s}var Us={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ol=Lt(Us),un=S({},Us,{view:0,detail:0}),r0=Lt(un),No,jo,dn,Ll=S({},un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uo,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!==dn&&(dn&&t.type==="mousemove"?(No=t.screenX-dn.screenX,jo=t.screenY-dn.screenY):jo=No=0,dn=t),No)},movementY:function(t){return"movementY"in t?t.movementY:jo}}),Od=Lt(Ll),n0=S({},Ll,{dataTransfer:0}),l0=Lt(n0),a0=S({},un,{relatedTarget:0}),Ho=Lt(a0),o0=S({},Us,{animationName:0,elapsedTime:0,pseudoElement:0}),c0=Lt(o0),h0=S({},Us,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),u0=Lt(h0),d0=S({},Us,{data:0}),Ld=Lt(d0),f0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},p0={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"},_0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function g0(t){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(t):(t=_0[t])?!!s[t]:!1}function Uo(){return g0}var m0=S({},un,{key:function(t){if(t.key){var s=f0[t.key]||t.key;if(s!=="Unidentified")return s}return t.type==="keypress"?(t=Al(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?p0[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uo,charCode:function(t){return t.type==="keypress"?Al(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Al(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),v0=Lt(m0),S0=S({},Ll,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nd=Lt(S0),y0=S({},un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uo}),b0=Lt(y0),x0=S({},Us,{propertyName:0,elapsedTime:0,pseudoElement:0}),w0=Lt(x0),C0=S({},Ll,{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}),k0=Lt(C0),E0=S({},Us,{newState:0,oldState:0}),T0=Lt(E0),R0=[9,13,27,32],qo=Ui&&"CompositionEvent"in window,fn=null;Ui&&"documentMode"in document&&(fn=document.documentMode);var D0=Ui&&"TextEvent"in window&&!fn,jd=Ui&&(!qo||fn&&8<fn&&11>=fn),Hd=" ",Ud=!1;function qd(t,s){switch(t){case"keyup":return R0.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wd(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var br=!1;function M0(t,s){switch(t){case"compositionend":return Wd(s);case"keypress":return s.which!==32?null:(Ud=!0,Hd);case"textInput":return t=s.data,t===Hd&&Ud?null:t;default:return null}}function B0(t,s){if(br)return t==="compositionend"||!qo&&qd(t,s)?(t=Ad(),Bl=Lo=os=null,br=!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 jd&&s.locale!=="ko"?null:s.data;default:return null}}var A0={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 Pd(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s==="input"?!!A0[t.type]:s==="textarea"}function Kd(t,s,r,a){Sr?yr?yr.push(a):yr=[a]:Sr=a,s=Ca(s,"onChange"),0<s.length&&(r=new Ol("onChange","change",null,r,a),t.push({event:r,listeners:s}))}var pn=null,_n=null;function z0(t){E_(t,0)}function Nl(t){var s=on(t);if(Cd(s))return t}function Yd(t,s){if(t==="change")return s}var $d=!1;if(Ui){var Wo;if(Ui){var Po="oninput"in document;if(!Po){var Id=document.createElement("div");Id.setAttribute("oninput","return;"),Po=typeof Id.oninput=="function"}Wo=Po}else Wo=!1;$d=Wo&&(!document.documentMode||9<document.documentMode)}function Gd(){pn&&(pn.detachEvent("onpropertychange",Xd),_n=pn=null)}function Xd(t){if(t.propertyName==="value"&&Nl(_n)){var s=[];Kd(s,_n,t,Ao(t)),Bd(z0,s)}}function O0(t,s,r){t==="focusin"?(Gd(),pn=s,_n=r,pn.attachEvent("onpropertychange",Xd)):t==="focusout"&&Gd()}function L0(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Nl(_n)}function N0(t,s){if(t==="click")return Nl(s)}function j0(t,s){if(t==="input"||t==="change")return Nl(s)}function H0(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var $t=typeof Object.is=="function"?Object.is:H0;function gn(t,s){if($t(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(!So.call(s,c)||!$t(t[c],s[c]))return!1}return!0}function Vd(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Fd(t,s){var r=Vd(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=Vd(r)}}function Zd(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?Zd(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function Qd(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var s=Dl(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=Dl(t.document)}return s}function Ko(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 U0=Ui&&"documentMode"in document&&11>=document.documentMode,xr=null,Yo=null,mn=null,$o=!1;function Jd(t,s,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;$o||xr==null||xr!==Dl(a)||(a=xr,"selectionStart"in a&&Ko(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}),mn&&gn(mn,a)||(mn=a,a=Ca(Yo,"onSelect"),0<a.length&&(s=new Ol("onSelect","select",null,s,r),t.push({event:s,listeners:a}),s.target=xr)))}function qs(t,s){var r={};return r[t.toLowerCase()]=s.toLowerCase(),r["Webkit"+t]="webkit"+s,r["Moz"+t]="moz"+s,r}var wr={animationend:qs("Animation","AnimationEnd"),animationiteration:qs("Animation","AnimationIteration"),animationstart:qs("Animation","AnimationStart"),transitionrun:qs("Transition","TransitionRun"),transitionstart:qs("Transition","TransitionStart"),transitioncancel:qs("Transition","TransitionCancel"),transitionend:qs("Transition","TransitionEnd")},Io={},ef={};Ui&&(ef=document.createElement("div").style,"AnimationEvent"in window||(delete wr.animationend.animation,delete wr.animationiteration.animation,delete wr.animationstart.animation),"TransitionEvent"in window||delete wr.transitionend.transition);function Ws(t){if(Io[t])return Io[t];if(!wr[t])return t;var s=wr[t],r;for(r in s)if(s.hasOwnProperty(r)&&r in ef)return Io[t]=s[r];return t}var tf=Ws("animationend"),sf=Ws("animationiteration"),rf=Ws("animationstart"),q0=Ws("transitionrun"),W0=Ws("transitionstart"),P0=Ws("transitioncancel"),nf=Ws("transitionend"),lf=new Map,Go="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(" ");Go.push("scrollEnd");function vi(t,s){lf.set(t,s),Hs(s,[t])}var jl=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)},ri=[],Cr=0,Xo=0;function Hl(){for(var t=Cr,s=Xo=Cr=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&&af(r,c,u)}}function Ul(t,s,r,a){ri[Cr++]=t,ri[Cr++]=s,ri[Cr++]=r,ri[Cr++]=a,Xo|=a,t.lanes|=a,t=t.alternate,t!==null&&(t.lanes|=a)}function Vo(t,s,r,a){return Ul(t,s,r,a),ql(t)}function Ps(t,s){return Ul(t,null,null,s),ql(t)}function af(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-Yt(r),t=u.hiddenUpdates,a=t[c],a===null?t[c]=[s]:a.push(s),s.lane=r|536870912),u):null}function ql(t){if(50<Un)throw Un=0,rh=null,Error(l(185));for(var s=t.return;s!==null;)t=s,s=t.return;return t.tag===3?t.stateNode:null}var kr={};function K0(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 It(t,s,r,a){return new K0(t,s,r,a)}function Fo(t){return t=t.prototype,!(!t||!t.isReactComponent)}function qi(t,s){var r=t.alternate;return r===null?(r=It(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 of(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 Wl(t,s,r,a,c,u){var g=0;if(a=t,typeof t=="function")Fo(t)&&(g=1);else if(typeof t=="string")g=XS(t,r,ee.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case we:return t=It(31,r,s,c),t.elementType=we,t.lanes=u,t;case R:return Ks(r.children,c,u,s);case M:g=8,c|=24;break;case W:return t=It(12,r,s,c|2),t.elementType=W,t.lanes=u,t;case U:return t=It(13,r,s,c),t.elementType=U,t.lanes=u,t;case X:return t=It(19,r,s,c),t.elementType=X,t.lanes=u,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case N:g=10;break e;case te:g=9;break e;case L:g=11;break e;case J:g=14;break e;case ge:g=16,a=null;break e}g=29,r=Error(l(130,t===null?"null":typeof t,"")),a=null}return s=It(g,r,s,c),s.elementType=t,s.type=a,s.lanes=u,s}function Ks(t,s,r,a){return t=It(7,t,a,s),t.lanes=r,t}function Zo(t,s,r){return t=It(6,t,null,s),t.lanes=r,t}function cf(t){var s=It(18,null,null,0);return s.stateNode=t,s}function Qo(t,s,r){return s=It(4,t.children!==null?t.children:[],t.key,s),s.lanes=r,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}var hf=new WeakMap;function ni(t,s){if(typeof t=="object"&&t!==null){var r=hf.get(t);return r!==void 0?r:(s={value:t,source:s,stack:od(s)},hf.set(t,s),s)}return{value:t,source:s,stack:od(s)}}var Er=[],Tr=0,Pl=null,vn=0,li=[],ai=0,cs=null,ki=1,Ei="";function Wi(t,s){Er[Tr++]=vn,Er[Tr++]=Pl,Pl=t,vn=s}function uf(t,s,r){li[ai++]=ki,li[ai++]=Ei,li[ai++]=cs,cs=t;var a=ki;t=Ei;var c=32-Yt(a)-1;a&=~(1<<c),r+=1;var u=32-Yt(s)+c;if(30<u){var g=c-c%5;u=(a&(1<<g)-1).toString(32),a>>=g,c-=g,ki=1<<32-Yt(s)+c|r<<c|a,Ei=u+t}else ki=1<<u|r<<c|a,Ei=t}function Jo(t){t.return!==null&&(Wi(t,1),uf(t,1,0))}function ec(t){for(;t===Pl;)Pl=Er[--Tr],Er[Tr]=null,vn=Er[--Tr],Er[Tr]=null;for(;t===cs;)cs=li[--ai],li[ai]=null,Ei=li[--ai],li[ai]=null,ki=li[--ai],li[ai]=null}function df(t,s){li[ai++]=ki,li[ai++]=Ei,li[ai++]=cs,ki=s.id,Ei=s.overflow,cs=t}var bt=null,We=null,Ee=!1,hs=null,oi=!1,tc=Error(l(519));function us(t){var s=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Sn(ni(s,t)),tc}function ff(t){var s=t.stateNode,r=t.type,a=t.memoizedProps;switch(s[yt]=t,s[Ot]=a,r){case"dialog":xe("cancel",s),xe("close",s);break;case"iframe":case"object":case"embed":xe("load",s);break;case"video":case"audio":for(r=0;r<Wn.length;r++)xe(Wn[r],s);break;case"source":xe("error",s);break;case"img":case"image":case"link":xe("error",s),xe("load",s);break;case"details":xe("toggle",s);break;case"input":xe("invalid",s),kd(s,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":xe("invalid",s);break;case"textarea":xe("invalid",s),Td(s,a.value,a.defaultValue,a.children)}r=a.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||s.textContent===""+r||a.suppressHydrationWarning===!0||M_(s.textContent,r)?(a.popover!=null&&(xe("beforetoggle",s),xe("toggle",s)),a.onScroll!=null&&xe("scroll",s),a.onScrollEnd!=null&&xe("scrollend",s),a.onClick!=null&&(s.onclick=Hi),s=!0):s=!1,s||us(t,!0)}function pf(t){for(bt=t.return;bt;)switch(bt.tag){case 5:case 31:case 13:oi=!1;return;case 27:case 3:oi=!0;return;default:bt=bt.return}}function Rr(t){if(t!==bt)return!1;if(!Ee)return pf(t),Ee=!0,!1;var s=t.tag,r;if((r=s!==3&&s!==27)&&((r=s===5)&&(r=t.type,r=!(r!=="form"&&r!=="button")||Sh(t.type,t.memoizedProps)),r=!r),r&&We&&us(t),pf(t),s===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));We=U_(t)}else if(s===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));We=U_(t)}else s===27?(s=We,ks(t.type)?(t=Ch,Ch=null,We=t):We=s):We=bt?hi(t.stateNode.nextSibling):null;return!0}function Ys(){We=bt=null,Ee=!1}function ic(){var t=hs;return t!==null&&(Ut===null?Ut=t:Ut.push.apply(Ut,t),hs=null),t}function Sn(t){hs===null?hs=[t]:hs.push(t)}var sc=k(null),$s=null,Pi=null;function ds(t,s,r){Z(sc,s._currentValue),s._currentValue=r}function Ki(t){t._currentValue=sc.current,q(sc)}function rc(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 nc(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 v=u;u=c;for(var w=0;w<s.length;w++)if(v.context===s[w]){u.lanes|=r,v=u.alternate,v!==null&&(v.lanes|=r),rc(u.return,r,t),a||(g=null);break e}u=v.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),rc(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 Dr(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 v=c.type;$t(c.pendingProps.value,g.value)||(t!==null?t.push(v):t=[v])}}else if(c===ye.current){if(g=c.alternate,g===null)throw Error(l(387));g.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(t!==null?t.push(In):t=[In])}c=c.return}t!==null&&nc(s,t,r,a),s.flags|=262144}function Kl(t){for(t=t.firstContext;t!==null;){if(!$t(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Is(t){$s=t,Pi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function xt(t){return _f($s,t)}function Yl(t,s){return $s===null&&Is(t),_f(t,s)}function _f(t,s){var r=s._currentValue;if(s={context:s,memoizedValue:r,next:null},Pi===null){if(t===null)throw Error(l(308));Pi=s,t.dependencies={lanes:0,firstContext:s},t.flags|=524288}else Pi=Pi.next=s;return r}var Y0=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()})}},$0=e.unstable_scheduleCallback,I0=e.unstable_NormalPriority,it={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lc(){return{controller:new Y0,data:new Map,refCount:0}}function yn(t){t.refCount--,t.refCount===0&&$0(I0,function(){t.controller.abort()})}var bn=null,ac=0,Mr=0,Br=null;function G0(t,s){if(bn===null){var r=bn=[];ac=0,Mr=hh(),Br={status:"pending",value:void 0,then:function(a){r.push(a)}}}return ac++,s.then(gf,gf),s}function gf(){if(--ac===0&&bn!==null){Br!==null&&(Br.status="fulfilled");var t=bn;bn=null,Mr=0,Br=null;for(var s=0;s<t.length;s++)(0,t[s])()}}function X0(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 mf=T.S;T.S=function(t,s){e_=Pt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&G0(t,s),mf!==null&&mf(t,s)};var Gs=k(null);function oc(){var t=Gs.current;return t!==null?t:qe.pooledCache}function $l(t,s){s===null?Z(Gs,Gs.current):Z(Gs,s.pool)}function vf(){var t=oc();return t===null?null:{parent:it._currentValue,pool:t}}var Ar=Error(l(460)),cc=Error(l(474)),Il=Error(l(542)),Gl={then:function(){}};function Sf(t){return t=t.status,t==="fulfilled"||t==="rejected"}function yf(t,s,r){switch(r=t[r],r===void 0?t.push(s):r!==s&&(s.then(Hi,Hi),s=r),s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,xf(t),t;default:if(typeof s.status=="string")s.then(Hi,Hi);else{if(t=qe,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,xf(t),t}throw Vs=s,Ar}}function Xs(t){try{var s=t._init;return s(t._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Vs=r,Ar):r}}var Vs=null;function bf(){if(Vs===null)throw Error(l(459));var t=Vs;return Vs=null,t}function xf(t){if(t===Ar||t===Il)throw Error(l(483))}var zr=null,xn=0;function Xl(t){var s=xn;return xn+=1,zr===null&&(zr=[]),yf(zr,t,s)}function wn(t,s){s=s.props.ref,t.ref=s!==void 0?s:null}function Vl(t,s){throw s.$$typeof===x?Error(l(525)):(t=Object.prototype.toString.call(s),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":t)))}function wf(t){function s(D,E){if(t){var B=D.deletions;B===null?(D.deletions=[E],D.flags|=16):B.push(E)}}function r(D,E){if(!t)return null;for(;E!==null;)s(D,E),E=E.sibling;return null}function a(D){for(var E=new Map;D!==null;)D.key!==null?E.set(D.key,D):E.set(D.index,D),D=D.sibling;return E}function c(D,E){return D=qi(D,E),D.index=0,D.sibling=null,D}function u(D,E,B){return D.index=B,t?(B=D.alternate,B!==null?(B=B.index,B<E?(D.flags|=67108866,E):B):(D.flags|=67108866,E)):(D.flags|=1048576,E)}function g(D){return t&&D.alternate===null&&(D.flags|=67108866),D}function v(D,E,B,K){return E===null||E.tag!==6?(E=Zo(B,D.mode,K),E.return=D,E):(E=c(E,B),E.return=D,E)}function w(D,E,B,K){var le=B.type;return le===R?H(D,E,B.props.children,K,B.key):E!==null&&(E.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===ge&&Xs(le)===E.type)?(E=c(E,B.props),wn(E,B),E.return=D,E):(E=Wl(B.type,B.key,B.props,null,D.mode,K),wn(E,B),E.return=D,E)}function A(D,E,B,K){return E===null||E.tag!==4||E.stateNode.containerInfo!==B.containerInfo||E.stateNode.implementation!==B.implementation?(E=Qo(B,D.mode,K),E.return=D,E):(E=c(E,B.children||[]),E.return=D,E)}function H(D,E,B,K,le){return E===null||E.tag!==7?(E=Ks(B,D.mode,K,le),E.return=D,E):(E=c(E,B),E.return=D,E)}function $(D,E,B){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=Zo(""+E,D.mode,B),E.return=D,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case C:return B=Wl(E.type,E.key,E.props,null,D.mode,B),wn(B,E),B.return=D,B;case b:return E=Qo(E,D.mode,B),E.return=D,E;case ge:return E=Xs(E),$(D,E,B)}if(Q(E)||V(E))return E=Ks(E,D.mode,B,null),E.return=D,E;if(typeof E.then=="function")return $(D,Xl(E),B);if(E.$$typeof===N)return $(D,Yl(D,E),B);Vl(D,E)}return null}function z(D,E,B,K){var le=E!==null?E.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return le!==null?null:v(D,E,""+B,K);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case C:return B.key===le?w(D,E,B,K):null;case b:return B.key===le?A(D,E,B,K):null;case ge:return B=Xs(B),z(D,E,B,K)}if(Q(B)||V(B))return le!==null?null:H(D,E,B,K,null);if(typeof B.then=="function")return z(D,E,Xl(B),K);if(B.$$typeof===N)return z(D,E,Yl(D,B),K);Vl(D,B)}return null}function j(D,E,B,K,le){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return D=D.get(B)||null,v(E,D,""+K,le);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case C:return D=D.get(K.key===null?B:K.key)||null,w(E,D,K,le);case b:return D=D.get(K.key===null?B:K.key)||null,A(E,D,K,le);case ge:return K=Xs(K),j(D,E,B,K,le)}if(Q(K)||V(K))return D=D.get(B)||null,H(E,D,K,le,null);if(typeof K.then=="function")return j(D,E,B,Xl(K),le);if(K.$$typeof===N)return j(D,E,B,Yl(E,K),le);Vl(E,K)}return null}function re(D,E,B,K){for(var le=null,De=null,ne=E,me=E=0,ke=null;ne!==null&&me<B.length;me++){ne.index>me?(ke=ne,ne=null):ke=ne.sibling;var Me=z(D,ne,B[me],K);if(Me===null){ne===null&&(ne=ke);break}t&&ne&&Me.alternate===null&&s(D,ne),E=u(Me,E,me),De===null?le=Me:De.sibling=Me,De=Me,ne=ke}if(me===B.length)return r(D,ne),Ee&&Wi(D,me),le;if(ne===null){for(;me<B.length;me++)ne=$(D,B[me],K),ne!==null&&(E=u(ne,E,me),De===null?le=ne:De.sibling=ne,De=ne);return Ee&&Wi(D,me),le}for(ne=a(ne);me<B.length;me++)ke=j(ne,D,me,B[me],K),ke!==null&&(t&&ke.alternate!==null&&ne.delete(ke.key===null?me:ke.key),E=u(ke,E,me),De===null?le=ke:De.sibling=ke,De=ke);return t&&ne.forEach(function(Ms){return s(D,Ms)}),Ee&&Wi(D,me),le}function ce(D,E,B,K){if(B==null)throw Error(l(151));for(var le=null,De=null,ne=E,me=E=0,ke=null,Me=B.next();ne!==null&&!Me.done;me++,Me=B.next()){ne.index>me?(ke=ne,ne=null):ke=ne.sibling;var Ms=z(D,ne,Me.value,K);if(Ms===null){ne===null&&(ne=ke);break}t&&ne&&Ms.alternate===null&&s(D,ne),E=u(Ms,E,me),De===null?le=Ms:De.sibling=Ms,De=Ms,ne=ke}if(Me.done)return r(D,ne),Ee&&Wi(D,me),le;if(ne===null){for(;!Me.done;me++,Me=B.next())Me=$(D,Me.value,K),Me!==null&&(E=u(Me,E,me),De===null?le=Me:De.sibling=Me,De=Me);return Ee&&Wi(D,me),le}for(ne=a(ne);!Me.done;me++,Me=B.next())Me=j(ne,D,me,Me.value,K),Me!==null&&(t&&Me.alternate!==null&&ne.delete(Me.key===null?me:Me.key),E=u(Me,E,me),De===null?le=Me:De.sibling=Me,De=Me);return t&&ne.forEach(function(ny){return s(D,ny)}),Ee&&Wi(D,me),le}function He(D,E,B,K){if(typeof B=="object"&&B!==null&&B.type===R&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case C:e:{for(var le=B.key;E!==null;){if(E.key===le){if(le=B.type,le===R){if(E.tag===7){r(D,E.sibling),K=c(E,B.props.children),K.return=D,D=K;break e}}else if(E.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===ge&&Xs(le)===E.type){r(D,E.sibling),K=c(E,B.props),wn(K,B),K.return=D,D=K;break e}r(D,E);break}else s(D,E);E=E.sibling}B.type===R?(K=Ks(B.props.children,D.mode,K,B.key),K.return=D,D=K):(K=Wl(B.type,B.key,B.props,null,D.mode,K),wn(K,B),K.return=D,D=K)}return g(D);case b:e:{for(le=B.key;E!==null;){if(E.key===le)if(E.tag===4&&E.stateNode.containerInfo===B.containerInfo&&E.stateNode.implementation===B.implementation){r(D,E.sibling),K=c(E,B.children||[]),K.return=D,D=K;break e}else{r(D,E);break}else s(D,E);E=E.sibling}K=Qo(B,D.mode,K),K.return=D,D=K}return g(D);case ge:return B=Xs(B),He(D,E,B,K)}if(Q(B))return re(D,E,B,K);if(V(B)){if(le=V(B),typeof le!="function")throw Error(l(150));return B=le.call(B),ce(D,E,B,K)}if(typeof B.then=="function")return He(D,E,Xl(B),K);if(B.$$typeof===N)return He(D,E,Yl(D,B),K);Vl(D,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,E!==null&&E.tag===6?(r(D,E.sibling),K=c(E,B),K.return=D,D=K):(r(D,E),K=Zo(B,D.mode,K),K.return=D,D=K),g(D)):r(D,E)}return function(D,E,B,K){try{xn=0;var le=He(D,E,B,K);return zr=null,le}catch(ne){if(ne===Ar||ne===Il)throw ne;var De=It(29,ne,null,D.mode);return De.lanes=K,De.return=D,De}}}var Fs=wf(!0),Cf=wf(!1),fs=!1;function hc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uc(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 ps(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function _s(t,s,r){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(Be&2)!==0){var c=a.pending;return c===null?s.next=s:(s.next=c.next,c.next=s),a.pending=s,s=ql(t),af(t,null,r),s}return Ul(t,a,s,r),ql(t)}function Cn(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,pd(t,r)}}function dc(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 fc=!1;function kn(){if(fc){var t=Br;if(t!==null)throw t}}function En(t,s,r,a){fc=!1;var c=t.updateQueue;fs=!1;var u=c.firstBaseUpdate,g=c.lastBaseUpdate,v=c.shared.pending;if(v!==null){c.shared.pending=null;var w=v,A=w.next;w.next=null,g===null?u=A:g.next=A,g=w;var H=t.alternate;H!==null&&(H=H.updateQueue,v=H.lastBaseUpdate,v!==g&&(v===null?H.firstBaseUpdate=A:v.next=A,H.lastBaseUpdate=w))}if(u!==null){var $=c.baseState;g=0,H=A=w=null,v=u;do{var z=v.lane&-536870913,j=z!==v.lane;if(j?(Ce&z)===z:(a&z)===z){z!==0&&z===Mr&&(fc=!0),H!==null&&(H=H.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var re=t,ce=v;z=s;var He=r;switch(ce.tag){case 1:if(re=ce.payload,typeof re=="function"){$=re.call(He,$,z);break e}$=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=ce.payload,z=typeof re=="function"?re.call(He,$,z):re,z==null)break e;$=S({},$,z);break e;case 2:fs=!0}}z=v.callback,z!==null&&(t.flags|=64,j&&(t.flags|=8192),j=c.callbacks,j===null?c.callbacks=[z]:j.push(z))}else j={lane:z,tag:v.tag,payload:v.payload,callback:v.callback,next:null},H===null?(A=H=j,w=$):H=H.next=j,g|=z;if(v=v.next,v===null){if(v=c.shared.pending,v===null)break;j=v,v=j.next,j.next=null,c.lastBaseUpdate=j,c.shared.pending=null}}while(!0);H===null&&(w=$),c.baseState=w,c.firstBaseUpdate=A,c.lastBaseUpdate=H,u===null&&(c.shared.lanes=0),ys|=g,t.lanes=g,t.memoizedState=$}}function kf(t,s){if(typeof t!="function")throw Error(l(191,t));t.call(s)}function Ef(t,s){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;t<r.length;t++)kf(r[t],s)}var Or=k(null),Fl=k(0);function Tf(t,s){t=Qi,Z(Fl,t),Z(Or,s),Qi=t|s.baseLanes}function pc(){Z(Fl,Qi),Z(Or,Or.current)}function _c(){Qi=Fl.current,q(Or),q(Fl)}var Gt=k(null),ci=null;function gs(t){var s=t.alternate;Z(Je,Je.current&1),Z(Gt,t),ci===null&&(s===null||Or.current!==null||s.memoizedState!==null)&&(ci=t)}function gc(t){Z(Je,Je.current),Z(Gt,t),ci===null&&(ci=t)}function Rf(t){t.tag===22?(Z(Je,Je.current),Z(Gt,t),ci===null&&(ci=t)):ms()}function ms(){Z(Je,Je.current),Z(Gt,Gt.current)}function Xt(t){q(Gt),ci===t&&(ci=null),q(Je)}var Je=k(0);function Zl(t){for(var s=t;s!==null;){if(s.tag===13){var r=s.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||xh(r)||wh(r)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){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}var Yi=0,_e=null,Ne=null,st=null,Ql=!1,Lr=!1,Zs=!1,Jl=0,Tn=0,Nr=null,V0=0;function Xe(){throw Error(l(321))}function mc(t,s){if(s===null)return!1;for(var r=0;r<s.length&&r<t.length;r++)if(!$t(t[r],s[r]))return!1;return!0}function vc(t,s,r,a,c,u){return Yi=u,_e=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,T.H=t===null||t.memoizedState===null?up:zc,Zs=!1,u=r(a,c),Zs=!1,Lr&&(u=Mf(s,r,a,c)),Df(t),u}function Df(t){T.H=Mn;var s=Ne!==null&&Ne.next!==null;if(Yi=0,st=Ne=_e=null,Ql=!1,Tn=0,Nr=null,s)throw Error(l(300));t===null||rt||(t=t.dependencies,t!==null&&Kl(t)&&(rt=!0))}function Mf(t,s,r,a){_e=t;var c=0;do{if(Lr&&(Nr=null),Tn=0,Lr=!1,25<=c)throw Error(l(301));if(c+=1,st=Ne=null,t.updateQueue!=null){var u=t.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}T.H=dp,u=s(r,a)}while(Lr);return u}function F0(){var t=T.H,s=t.useState()[0];return s=typeof s.then=="function"?Rn(s):s,t=t.useState()[0],(Ne!==null?Ne.memoizedState:null)!==t&&(_e.flags|=1024),s}function Sc(){var t=Jl!==0;return Jl=0,t}function yc(t,s,r){s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~r}function bc(t){if(Ql){for(t=t.memoizedState;t!==null;){var s=t.queue;s!==null&&(s.pending=null),t=t.next}Ql=!1}Yi=0,st=Ne=_e=null,Lr=!1,Tn=Jl=0,Nr=null}function Dt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return st===null?_e.memoizedState=st=t:st=st.next=t,st}function et(){if(Ne===null){var t=_e.alternate;t=t!==null?t.memoizedState:null}else t=Ne.next;var s=st===null?_e.memoizedState:st.next;if(s!==null)st=s,Ne=t;else{if(t===null)throw _e.alternate===null?Error(l(467)):Error(l(310));Ne=t,t={memoizedState:Ne.memoizedState,baseState:Ne.baseState,baseQueue:Ne.baseQueue,queue:Ne.queue,next:null},st===null?_e.memoizedState=st=t:st=st.next=t}return st}function ea(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Rn(t){var s=Tn;return Tn+=1,Nr===null&&(Nr=[]),t=yf(Nr,t,s),s=_e,(st===null?s.memoizedState:st.next)===null&&(s=s.alternate,T.H=s===null||s.memoizedState===null?up:zc),t}function ta(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Rn(t);if(t.$$typeof===N)return xt(t)}throw Error(l(438,String(t)))}function xc(t){var s=null,r=_e.updateQueue;if(r!==null&&(s=r.memoCache),s==null){var a=_e.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=ea(),_e.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]=Qe;return s.index++,r}function $i(t,s){return typeof s=="function"?s(t):s}function ia(t){var s=et();return wc(s,Ne,t)}function wc(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 v=g=null,w=null,A=s,H=!1;do{var $=A.lane&-536870913;if($!==A.lane?(Ce&$)===$:(Yi&$)===$){var z=A.revertLane;if(z===0)w!==null&&(w=w.next={lane:0,revertLane:0,gesture:null,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null}),$===Mr&&(H=!0);else if((Yi&z)===z){A=A.next,z===Mr&&(H=!0);continue}else $={lane:0,revertLane:A.revertLane,gesture:null,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},w===null?(v=w=$,g=u):w=w.next=$,_e.lanes|=z,ys|=z;$=A.action,Zs&&r(u,$),u=A.hasEagerState?A.eagerState:r(u,$)}else z={lane:$,revertLane:A.revertLane,gesture:A.gesture,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},w===null?(v=w=z,g=u):w=w.next=z,_e.lanes|=$,ys|=$;A=A.next}while(A!==null&&A!==s);if(w===null?g=u:w.next=v,!$t(u,t.memoizedState)&&(rt=!0,H&&(r=Br,r!==null)))throw r;t.memoizedState=u,t.baseState=g,t.baseQueue=w,a.lastRenderedState=u}return c===null&&(a.lanes=0),[t.memoizedState,a.dispatch]}function Cc(t){var s=et(),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);$t(u,s.memoizedState)||(rt=!0),s.memoizedState=u,s.baseQueue===null&&(s.baseState=u),r.lastRenderedState=u}return[u,a]}function Bf(t,s,r){var a=_e,c=et(),u=Ee;if(u){if(r===void 0)throw Error(l(407));r=r()}else r=s();var g=!$t((Ne||c).memoizedState,r);if(g&&(c.memoizedState=r,rt=!0),c=c.queue,Tc(Of.bind(null,a,c,t),[t]),c.getSnapshot!==s||g||st!==null&&st.memoizedState.tag&1){if(a.flags|=2048,jr(9,{destroy:void 0},zf.bind(null,a,c,r,s),null),qe===null)throw Error(l(349));u||(Yi&127)!==0||Af(a,s,r)}return r}function Af(t,s,r){t.flags|=16384,t={getSnapshot:s,value:r},s=_e.updateQueue,s===null?(s=ea(),_e.updateQueue=s,s.stores=[t]):(r=s.stores,r===null?s.stores=[t]:r.push(t))}function zf(t,s,r,a){s.value=r,s.getSnapshot=a,Lf(s)&&Nf(t)}function Of(t,s,r){return r(function(){Lf(s)&&Nf(t)})}function Lf(t){var s=t.getSnapshot;t=t.value;try{var r=s();return!$t(t,r)}catch{return!0}}function Nf(t){var s=Ps(t,2);s!==null&&qt(s,t,2)}function kc(t){var s=Dt();if(typeof t=="function"){var r=t;if(t=r(),Zs){ls(!0);try{r()}finally{ls(!1)}}}return s.memoizedState=s.baseState=t,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:t},s}function jf(t,s,r,a){return t.baseState=r,wc(t,Ne,typeof a=="function"?a:$i)}function Z0(t,s,r,a,c){if(na(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)}};T.T!==null?r(!0):u.isTransition=!1,a(u),r=s.pending,r===null?(u.next=s.pending=u,Hf(s,u)):(u.next=r.next,s.pending=r.next=u)}}function Hf(t,s){var r=s.action,a=s.payload,c=t.state;if(s.isTransition){var u=T.T,g={};T.T=g;try{var v=r(c,a),w=T.S;w!==null&&w(g,v),Uf(t,s,v)}catch(A){Ec(t,s,A)}finally{u!==null&&g.types!==null&&(u.types=g.types),T.T=u}}else try{u=r(c,a),Uf(t,s,u)}catch(A){Ec(t,s,A)}}function Uf(t,s,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(a){qf(t,s,a)},function(a){return Ec(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,Hf(t,r)))}function Ec(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 Pf(t,s){return s}function Kf(t,s){if(Ee){var r=qe.formState;if(r!==null){e:{var a=_e;if(Ee){if(We){t:{for(var c=We,u=oi;c.nodeType!==8;){if(!u){c=null;break t}if(c=hi(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){We=hi(c.nextSibling),a=c.data==="F!";break e}}us(a)}a=!1}a&&(s=r[0])}}return r=Dt(),r.memoizedState=r.baseState=s,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pf,lastRenderedState:s},r.queue=a,r=op.bind(null,_e,a),a.dispatch=r,a=kc(!1),u=Ac.bind(null,_e,!1,a.queue),a=Dt(),c={state:s,dispatch:null,action:t,pending:null},a.queue=c,r=Z0.bind(null,_e,c,u,r),c.dispatch=r,a.memoizedState=t,[s,r,!1]}function Yf(t){var s=et();return $f(s,Ne,t)}function $f(t,s,r){if(s=wc(t,s,Pf)[0],t=ia($i)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var a=Rn(s)}catch(g){throw g===Ar?Il:g}else a=s;s=et();var c=s.queue,u=c.dispatch;return r!==s.memoizedState&&(_e.flags|=2048,jr(9,{destroy:void 0},Q0.bind(null,c,r),null)),[a,u,t]}function Q0(t,s){t.action=s}function If(t){var s=et(),r=Ne;if(r!==null)return $f(s,r,t);et(),s=s.memoizedState,r=et();var a=r.queue.dispatch;return r.memoizedState=t,[s,a,!1]}function jr(t,s,r,a){return t={tag:t,create:r,deps:a,inst:s,next:null},s=_e.updateQueue,s===null&&(s=ea(),_e.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 Gf(){return et().memoizedState}function sa(t,s,r,a){var c=Dt();_e.flags|=t,c.memoizedState=jr(1|s,{destroy:void 0},r,a===void 0?null:a)}function ra(t,s,r,a){var c=et();a=a===void 0?null:a;var u=c.memoizedState.inst;Ne!==null&&a!==null&&mc(a,Ne.memoizedState.deps)?c.memoizedState=jr(s,u,r,a):(_e.flags|=t,c.memoizedState=jr(1|s,u,r,a))}function Xf(t,s){sa(8390656,8,t,s)}function Tc(t,s){ra(2048,8,t,s)}function J0(t){_e.flags|=4;var s=_e.updateQueue;if(s===null)s=ea(),_e.updateQueue=s,s.events=[t];else{var r=s.events;r===null?s.events=[t]:r.push(t)}}function Vf(t){var s=et().memoizedState;return J0({ref:s,nextImpl:t}),function(){if((Be&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}function Ff(t,s){return ra(4,2,t,s)}function Zf(t,s){return ra(4,4,t,s)}function Qf(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 Jf(t,s,r){r=r!=null?r.concat([t]):null,ra(4,4,Qf.bind(null,s,t),r)}function Rc(){}function ep(t,s){var r=et();s=s===void 0?null:s;var a=r.memoizedState;return s!==null&&mc(s,a[1])?a[0]:(r.memoizedState=[t,s],t)}function tp(t,s){var r=et();s=s===void 0?null:s;var a=r.memoizedState;if(s!==null&&mc(s,a[1]))return a[0];if(a=t(),Zs){ls(!0);try{t()}finally{ls(!1)}}return r.memoizedState=[a,s],a}function Dc(t,s,r){return r===void 0||(Yi&1073741824)!==0&&(Ce&261930)===0?t.memoizedState=s:(t.memoizedState=r,t=i_(),_e.lanes|=t,ys|=t,r)}function ip(t,s,r,a){return $t(r,s)?r:Or.current!==null?(t=Dc(t,r,a),$t(t,s)||(rt=!0),t):(Yi&42)===0||(Yi&1073741824)!==0&&(Ce&261930)===0?(rt=!0,t.memoizedState=r):(t=i_(),_e.lanes|=t,ys|=t,s)}function sp(t,s,r,a,c){var u=P.p;P.p=u!==0&&8>u?u:8;var g=T.T,v={};T.T=v,Ac(t,!1,s,r);try{var w=c(),A=T.S;if(A!==null&&A(v,w),w!==null&&typeof w=="object"&&typeof w.then=="function"){var H=X0(w,a);Dn(t,s,H,Zt(t))}else Dn(t,s,a,Zt(t))}catch($){Dn(t,s,{then:function(){},status:"rejected",reason:$},Zt())}finally{P.p=u,g!==null&&v.types!==null&&(g.types=v.types),T.T=g}}function eS(){}function Mc(t,s,r,a){if(t.tag!==5)throw Error(l(476));var c=rp(t).queue;sp(t,c,s,Y,r===null?eS:function(){return np(t),r(a)})}function rp(t){var s=t.memoizedState;if(s!==null)return s;s={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:Y},next:null};var r={};return s.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:r},next:null},t.memoizedState=s,t=t.alternate,t!==null&&(t.memoizedState=s),s}function np(t){var s=rp(t);s.next===null&&(s=t.alternate.memoizedState),Dn(t,s.next.queue,{},Zt())}function Bc(){return xt(In)}function lp(){return et().memoizedState}function ap(){return et().memoizedState}function tS(t){for(var s=t.return;s!==null;){switch(s.tag){case 24:case 3:var r=Zt();t=ps(r);var a=_s(s,t,r);a!==null&&(qt(a,s,r),Cn(a,s,r)),s={cache:lc()},t.payload=s;return}s=s.return}}function iS(t,s,r){var a=Zt();r={lane:a,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},na(t)?cp(s,r):(r=Vo(t,s,r,a),r!==null&&(qt(r,t,a),hp(r,s,a)))}function op(t,s,r){var a=Zt();Dn(t,s,r,a)}function Dn(t,s,r,a){var c={lane:a,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(na(t))cp(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,v=u(g,r);if(c.hasEagerState=!0,c.eagerState=v,$t(v,g))return Ul(t,s,c,0),qe===null&&Hl(),!1}catch{}if(r=Vo(t,s,c,a),r!==null)return qt(r,t,a),hp(r,s,a),!0}return!1}function Ac(t,s,r,a){if(a={lane:2,revertLane:hh(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},na(t)){if(s)throw Error(l(479))}else s=Vo(t,r,a,2),s!==null&&qt(s,t,2)}function na(t){var s=t.alternate;return t===_e||s!==null&&s===_e}function cp(t,s){Lr=Ql=!0;var r=t.pending;r===null?s.next=s:(s.next=r.next,r.next=s),t.pending=s}function hp(t,s,r){if((r&4194048)!==0){var a=s.lanes;a&=t.pendingLanes,r|=a,s.lanes=r,pd(t,r)}}var Mn={readContext:xt,use:ta,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useLayoutEffect:Xe,useInsertionEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useSyncExternalStore:Xe,useId:Xe,useHostTransitionStatus:Xe,useFormState:Xe,useActionState:Xe,useOptimistic:Xe,useMemoCache:Xe,useCacheRefresh:Xe};Mn.useEffectEvent=Xe;var up={readContext:xt,use:ta,useCallback:function(t,s){return Dt().memoizedState=[t,s===void 0?null:s],t},useContext:xt,useEffect:Xf,useImperativeHandle:function(t,s,r){r=r!=null?r.concat([t]):null,sa(4194308,4,Qf.bind(null,s,t),r)},useLayoutEffect:function(t,s){return sa(4194308,4,t,s)},useInsertionEffect:function(t,s){sa(4,2,t,s)},useMemo:function(t,s){var r=Dt();s=s===void 0?null:s;var a=t();if(Zs){ls(!0);try{t()}finally{ls(!1)}}return r.memoizedState=[a,s],a},useReducer:function(t,s,r){var a=Dt();if(r!==void 0){var c=r(s);if(Zs){ls(!0);try{r(s)}finally{ls(!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=iS.bind(null,_e,t),[a.memoizedState,t]},useRef:function(t){var s=Dt();return t={current:t},s.memoizedState=t},useState:function(t){t=kc(t);var s=t.queue,r=op.bind(null,_e,s);return s.dispatch=r,[t.memoizedState,r]},useDebugValue:Rc,useDeferredValue:function(t,s){var r=Dt();return Dc(r,t,s)},useTransition:function(){var t=kc(!1);return t=sp.bind(null,_e,t.queue,!0,!1),Dt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,s,r){var a=_e,c=Dt();if(Ee){if(r===void 0)throw Error(l(407));r=r()}else{if(r=s(),qe===null)throw Error(l(349));(Ce&127)!==0||Af(a,s,r)}c.memoizedState=r;var u={value:r,getSnapshot:s};return c.queue=u,Xf(Of.bind(null,a,u,t),[t]),a.flags|=2048,jr(9,{destroy:void 0},zf.bind(null,a,u,r,s),null),r},useId:function(){var t=Dt(),s=qe.identifierPrefix;if(Ee){var r=Ei,a=ki;r=(a&~(1<<32-Yt(a)-1)).toString(32)+r,s="_"+s+"R_"+r,r=Jl++,0<r&&(s+="H"+r.toString(32)),s+="_"}else r=V0++,s="_"+s+"r_"+r.toString(32)+"_";return t.memoizedState=s},useHostTransitionStatus:Bc,useFormState:Kf,useActionState:Kf,useOptimistic:function(t){var s=Dt();s.memoizedState=s.baseState=t;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=r,s=Ac.bind(null,_e,!0,r),r.dispatch=s,[t,s]},useMemoCache:xc,useCacheRefresh:function(){return Dt().memoizedState=tS.bind(null,_e)},useEffectEvent:function(t){var s=Dt(),r={impl:t};return s.memoizedState=r,function(){if((Be&2)!==0)throw Error(l(440));return r.impl.apply(void 0,arguments)}}},zc={readContext:xt,use:ta,useCallback:ep,useContext:xt,useEffect:Tc,useImperativeHandle:Jf,useInsertionEffect:Ff,useLayoutEffect:Zf,useMemo:tp,useReducer:ia,useRef:Gf,useState:function(){return ia($i)},useDebugValue:Rc,useDeferredValue:function(t,s){var r=et();return ip(r,Ne.memoizedState,t,s)},useTransition:function(){var t=ia($i)[0],s=et().memoizedState;return[typeof t=="boolean"?t:Rn(t),s]},useSyncExternalStore:Bf,useId:lp,useHostTransitionStatus:Bc,useFormState:Yf,useActionState:Yf,useOptimistic:function(t,s){var r=et();return jf(r,Ne,t,s)},useMemoCache:xc,useCacheRefresh:ap};zc.useEffectEvent=Vf;var dp={readContext:xt,use:ta,useCallback:ep,useContext:xt,useEffect:Tc,useImperativeHandle:Jf,useInsertionEffect:Ff,useLayoutEffect:Zf,useMemo:tp,useReducer:Cc,useRef:Gf,useState:function(){return Cc($i)},useDebugValue:Rc,useDeferredValue:function(t,s){var r=et();return Ne===null?Dc(r,t,s):ip(r,Ne.memoizedState,t,s)},useTransition:function(){var t=Cc($i)[0],s=et().memoizedState;return[typeof t=="boolean"?t:Rn(t),s]},useSyncExternalStore:Bf,useId:lp,useHostTransitionStatus:Bc,useFormState:If,useActionState:If,useOptimistic:function(t,s){var r=et();return Ne!==null?jf(r,Ne,t,s):(r.baseState=t,[t,r.queue.dispatch])},useMemoCache:xc,useCacheRefresh:ap};dp.useEffectEvent=Vf;function Oc(t,s,r,a){s=t.memoizedState,r=r(a,s),r=r==null?s:S({},s,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var Lc={enqueueSetState:function(t,s,r){t=t._reactInternals;var a=Zt(),c=ps(a);c.payload=s,r!=null&&(c.callback=r),s=_s(t,c,a),s!==null&&(qt(s,t,a),Cn(s,t,a))},enqueueReplaceState:function(t,s,r){t=t._reactInternals;var a=Zt(),c=ps(a);c.tag=1,c.payload=s,r!=null&&(c.callback=r),s=_s(t,c,a),s!==null&&(qt(s,t,a),Cn(s,t,a))},enqueueForceUpdate:function(t,s){t=t._reactInternals;var r=Zt(),a=ps(r);a.tag=2,s!=null&&(a.callback=s),s=_s(t,a,r),s!==null&&(qt(s,t,r),Cn(s,t,r))}};function fp(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?!gn(r,a)||!gn(c,u):!0}function pp(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&&Lc.enqueueReplaceState(s,s.state,null)}function Qs(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=S({},r));for(var c in t)r[c]===void 0&&(r[c]=t[c])}return r}function _p(t){jl(t)}function gp(t){console.error(t)}function mp(t){jl(t)}function la(t,s){try{var r=t.onUncaughtError;r(s.value,{componentStack:s.stack})}catch(a){setTimeout(function(){throw a})}}function vp(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 Nc(t,s,r){return r=ps(r),r.tag=3,r.payload={element:null},r.callback=function(){la(t,s)},r}function Sp(t){return t=ps(t),t.tag=3,t}function yp(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(){vp(s,r,a)}}var g=r.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(t.callback=function(){vp(s,r,a),typeof c!="function"&&(bs===null?bs=new Set([this]):bs.add(this));var v=a.stack;this.componentDidCatch(a.value,{componentStack:v!==null?v:""})})}function sS(t,s,r,a,c){if(r.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(s=r.alternate,s!==null&&Dr(s,r,c,!0),r=Gt.current,r!==null){switch(r.tag){case 31:case 13:return ci===null?va():r.alternate===null&&Ve===0&&(Ve=3),r.flags&=-257,r.flags|=65536,r.lanes=c,a===Gl?r.flags|=16384:(s=r.updateQueue,s===null?r.updateQueue=new Set([a]):s.add(a),ah(t,a,c)),!1;case 22:return r.flags|=65536,a===Gl?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)),ah(t,a,c)),!1}throw Error(l(435,r.tag))}return ah(t,a,c),va(),!1}if(Ee)return s=Gt.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=c,a!==tc&&(t=Error(l(422),{cause:a}),Sn(ni(t,r)))):(a!==tc&&(s=Error(l(423),{cause:a}),Sn(ni(s,r))),t=t.current.alternate,t.flags|=65536,c&=-c,t.lanes|=c,a=ni(a,r),c=Nc(t.stateNode,a,c),dc(t,c),Ve!==4&&(Ve=2)),!1;var u=Error(l(520),{cause:a});if(u=ni(u,r),Hn===null?Hn=[u]:Hn.push(u),Ve!==4&&(Ve=2),s===null)return!0;a=ni(a,r),r=s;do{switch(r.tag){case 3:return r.flags|=65536,t=c&-c,r.lanes|=t,t=Nc(r.stateNode,a,t),dc(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"&&(bs===null||!bs.has(u))))return r.flags|=65536,c&=-c,r.lanes|=c,c=Sp(c),yp(c,t,r,a),dc(r,c),!1}r=r.return}while(r!==null);return!1}var jc=Error(l(461)),rt=!1;function wt(t,s,r,a){s.child=t===null?Cf(s,null,r,a):Fs(s,t.child,r,a)}function bp(t,s,r,a,c){r=r.render;var u=s.ref;if("ref"in a){var g={};for(var v in a)v!=="ref"&&(g[v]=a[v])}else g=a;return Is(s),a=vc(t,s,r,g,u,c),v=Sc(),t!==null&&!rt?(yc(t,s,c),Ii(t,s,c)):(Ee&&v&&Jo(s),s.flags|=1,wt(t,s,a,c),s.child)}function xp(t,s,r,a,c){if(t===null){var u=r.type;return typeof u=="function"&&!Fo(u)&&u.defaultProps===void 0&&r.compare===null?(s.tag=15,s.type=u,wp(t,s,u,a,c)):(t=Wl(r.type,null,a,s,s.mode,c),t.ref=s.ref,t.return=s,s.child=t)}if(u=t.child,!$c(t,c)){var g=u.memoizedProps;if(r=r.compare,r=r!==null?r:gn,r(g,a)&&t.ref===s.ref)return Ii(t,s,c)}return s.flags|=1,t=qi(u,a),t.ref=s.ref,t.return=s,s.child=t}function wp(t,s,r,a,c){if(t!==null){var u=t.memoizedProps;if(gn(u,a)&&t.ref===s.ref)if(rt=!1,s.pendingProps=a=u,$c(t,c))(t.flags&131072)!==0&&(rt=!0);else return s.lanes=t.lanes,Ii(t,s,c)}return Hc(t,s,r,a,c)}function Cp(t,s,r,a){var c=a.children,u=t!==null?t.memoizedState:null;if(t===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((s.flags&128)!==0){if(u=u!==null?u.baseLanes|r:r,t!==null){for(a=s.child=t.child,c=0;a!==null;)c=c|a.lanes|a.childLanes,a=a.sibling;a=c&~u}else a=0,s.child=null;return kp(t,s,u,r,a)}if((r&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},t!==null&&$l(s,u!==null?u.cachePool:null),u!==null?Tf(s,u):pc(),Rf(s);else return a=s.lanes=536870912,kp(t,s,u!==null?u.baseLanes|r:r,r,a)}else u!==null?($l(s,u.cachePool),Tf(s,u),ms(),s.memoizedState=null):(t!==null&&$l(s,null),pc(),ms());return wt(t,s,c,r),s.child}function Bn(t,s){return t!==null&&t.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function kp(t,s,r,a,c){var u=oc();return u=u===null?null:{parent:it._currentValue,pool:u},s.memoizedState={baseLanes:r,cachePool:u},t!==null&&$l(s,null),pc(),Rf(s),t!==null&&Dr(t,s,a,!0),s.childLanes=c,null}function aa(t,s){return s=ca({mode:s.mode,children:s.children},t.mode),s.ref=t.ref,t.child=s,s.return=t,s}function Ep(t,s,r){return Fs(s,t.child,null,r),t=aa(s,s.pendingProps),t.flags|=2,Xt(s),s.memoizedState=null,t}function rS(t,s,r){var a=s.pendingProps,c=(s.flags&128)!==0;if(s.flags&=-129,t===null){if(Ee){if(a.mode==="hidden")return t=aa(s,a),s.lanes=536870912,Bn(null,t);if(gc(s),(t=We)?(t=H_(t,oi),t=t!==null&&t.data==="&"?t:null,t!==null&&(s.memoizedState={dehydrated:t,treeContext:cs!==null?{id:ki,overflow:Ei}:null,retryLane:536870912,hydrationErrors:null},r=cf(t),r.return=s,s.child=r,bt=s,We=null)):t=null,t===null)throw us(s);return s.lanes=536870912,null}return aa(s,a)}var u=t.memoizedState;if(u!==null){var g=u.dehydrated;if(gc(s),c)if(s.flags&256)s.flags&=-257,s=Ep(t,s,r);else if(s.memoizedState!==null)s.child=t.child,s.flags|=128,s=null;else throw Error(l(558));else if(rt||Dr(t,s,r,!1),c=(r&t.childLanes)!==0,rt||c){if(a=qe,a!==null&&(g=_d(a,r),g!==0&&g!==u.retryLane))throw u.retryLane=g,Ps(t,g),qt(a,t,g),jc;va(),s=Ep(t,s,r)}else t=u.treeContext,We=hi(g.nextSibling),bt=s,Ee=!0,hs=null,oi=!1,t!==null&&df(s,t),s=aa(s,a),s.flags|=4096;return s}return t=qi(t.child,{mode:a.mode,children:a.children}),t.ref=s.ref,s.child=t,t.return=s,t}function oa(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 Hc(t,s,r,a,c){return Is(s),r=vc(t,s,r,a,void 0,c),a=Sc(),t!==null&&!rt?(yc(t,s,c),Ii(t,s,c)):(Ee&&a&&Jo(s),s.flags|=1,wt(t,s,r,c),s.child)}function Tp(t,s,r,a,c,u){return Is(s),s.updateQueue=null,r=Mf(s,a,r,c),Df(t),a=Sc(),t!==null&&!rt?(yc(t,s,u),Ii(t,s,u)):(Ee&&a&&Jo(s),s.flags|=1,wt(t,s,r,u),s.child)}function Rp(t,s,r,a,c){if(Is(s),s.stateNode===null){var u=kr,g=r.contextType;typeof g=="object"&&g!==null&&(u=xt(g)),u=new r(a,u),s.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Lc,s.stateNode=u,u._reactInternals=s,u=s.stateNode,u.props=a,u.state=s.memoizedState,u.refs={},hc(s),g=r.contextType,u.context=typeof g=="object"&&g!==null?xt(g):kr,u.state=s.memoizedState,g=r.getDerivedStateFromProps,typeof g=="function"&&(Oc(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&&Lc.enqueueReplaceState(u,u.state,null),En(s,a,u,c),kn(),u.state=s.memoizedState),typeof u.componentDidMount=="function"&&(s.flags|=4194308),a=!0}else if(t===null){u=s.stateNode;var v=s.memoizedProps,w=Qs(r,v);u.props=w;var A=u.context,H=r.contextType;g=kr,typeof H=="object"&&H!==null&&(g=xt(H));var $=r.getDerivedStateFromProps;H=typeof $=="function"||typeof u.getSnapshotBeforeUpdate=="function",v=s.pendingProps!==v,H||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(v||A!==g)&&pp(s,u,a,g),fs=!1;var z=s.memoizedState;u.state=z,En(s,a,u,c),kn(),A=s.memoizedState,v||z!==A||fs?(typeof $=="function"&&(Oc(s,r,$,a),A=s.memoizedState),(w=fs||fp(s,r,w,a,z,A,g))?(H||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=A),u.props=a,u.state=A,u.context=g,a=w):(typeof u.componentDidMount=="function"&&(s.flags|=4194308),a=!1)}else{u=s.stateNode,uc(t,s),g=s.memoizedProps,H=Qs(r,g),u.props=H,$=s.pendingProps,z=u.context,A=r.contextType,w=kr,typeof A=="object"&&A!==null&&(w=xt(A)),v=r.getDerivedStateFromProps,(A=typeof v=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g!==$||z!==w)&&pp(s,u,a,w),fs=!1,z=s.memoizedState,u.state=z,En(s,a,u,c),kn();var j=s.memoizedState;g!==$||z!==j||fs||t!==null&&t.dependencies!==null&&Kl(t.dependencies)?(typeof v=="function"&&(Oc(s,r,v,a),j=s.memoizedState),(H=fs||fp(s,r,H,a,z,j,w)||t!==null&&t.dependencies!==null&&Kl(t.dependencies))?(A||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,j,w),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,j,w)),typeof u.componentDidUpdate=="function"&&(s.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof u.componentDidUpdate!="function"||g===t.memoizedProps&&z===t.memoizedState||(s.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===t.memoizedProps&&z===t.memoizedState||(s.flags|=1024),s.memoizedProps=a,s.memoizedState=j),u.props=a,u.state=j,u.context=w,a=H):(typeof u.componentDidUpdate!="function"||g===t.memoizedProps&&z===t.memoizedState||(s.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===t.memoizedProps&&z===t.memoizedState||(s.flags|=1024),a=!1)}return u=a,oa(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=Fs(s,t.child,null,c),s.child=Fs(s,null,r,c)):wt(t,s,r,c),s.memoizedState=u.state,t=s.child):t=Ii(t,s,c),t}function Dp(t,s,r,a){return Ys(),s.flags|=256,wt(t,s,r,a),s.child}var Uc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(t){return{baseLanes:t,cachePool:vf()}}function Wc(t,s,r){return t=t!==null?t.childLanes&~r:0,s&&(t|=Ft),t}function Mp(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:(Je.current&2)!==0),g&&(c=!0,s.flags&=-129),g=(s.flags&32)!==0,s.flags&=-33,t===null){if(Ee){if(c?gs(s):ms(),(t=We)?(t=H_(t,oi),t=t!==null&&t.data!=="&"?t:null,t!==null&&(s.memoizedState={dehydrated:t,treeContext:cs!==null?{id:ki,overflow:Ei}:null,retryLane:536870912,hydrationErrors:null},r=cf(t),r.return=s,s.child=r,bt=s,We=null)):t=null,t===null)throw us(s);return wh(t)?s.lanes=32:s.lanes=536870912,null}var v=a.children;return a=a.fallback,c?(ms(),c=s.mode,v=ca({mode:"hidden",children:v},c),a=Ks(a,c,r,null),v.return=s,a.return=s,v.sibling=a,s.child=v,a=s.child,a.memoizedState=qc(r),a.childLanes=Wc(t,g,r),s.memoizedState=Uc,Bn(null,a)):(gs(s),Pc(s,v))}var w=t.memoizedState;if(w!==null&&(v=w.dehydrated,v!==null)){if(u)s.flags&256?(gs(s),s.flags&=-257,s=Kc(t,s,r)):s.memoizedState!==null?(ms(),s.child=t.child,s.flags|=128,s=null):(ms(),v=a.fallback,c=s.mode,a=ca({mode:"visible",children:a.children},c),v=Ks(v,c,r,null),v.flags|=2,a.return=s,v.return=s,a.sibling=v,s.child=a,Fs(s,t.child,null,r),a=s.child,a.memoizedState=qc(r),a.childLanes=Wc(t,g,r),s.memoizedState=Uc,s=Bn(null,a));else if(gs(s),wh(v)){if(g=v.nextSibling&&v.nextSibling.dataset,g)var A=g.dgst;g=A,a=Error(l(419)),a.stack="",a.digest=g,Sn({value:a,source:null,stack:null}),s=Kc(t,s,r)}else if(rt||Dr(t,s,r,!1),g=(r&t.childLanes)!==0,rt||g){if(g=qe,g!==null&&(a=_d(g,r),a!==0&&a!==w.retryLane))throw w.retryLane=a,Ps(t,a),qt(g,t,a),jc;xh(v)||va(),s=Kc(t,s,r)}else xh(v)?(s.flags|=192,s.child=t.child,s=null):(t=w.treeContext,We=hi(v.nextSibling),bt=s,Ee=!0,hs=null,oi=!1,t!==null&&df(s,t),s=Pc(s,a.children),s.flags|=4096);return s}return c?(ms(),v=a.fallback,c=s.mode,w=t.child,A=w.sibling,a=qi(w,{mode:"hidden",children:a.children}),a.subtreeFlags=w.subtreeFlags&65011712,A!==null?v=qi(A,v):(v=Ks(v,c,r,null),v.flags|=2),v.return=s,a.return=s,a.sibling=v,s.child=a,Bn(null,a),a=s.child,v=t.child.memoizedState,v===null?v=qc(r):(c=v.cachePool,c!==null?(w=it._currentValue,c=c.parent!==w?{parent:w,pool:w}:c):c=vf(),v={baseLanes:v.baseLanes|r,cachePool:c}),a.memoizedState=v,a.childLanes=Wc(t,g,r),s.memoizedState=Uc,Bn(t.child,a)):(gs(s),r=t.child,t=r.sibling,r=qi(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 Pc(t,s){return s=ca({mode:"visible",children:s},t.mode),s.return=t,t.child=s}function ca(t,s){return t=It(22,t,null,s),t.lanes=0,t}function Kc(t,s,r){return Fs(s,t.child,null,r),t=Pc(s,s.pendingProps.children),t.flags|=2,s.memoizedState=null,t}function Bp(t,s,r){t.lanes|=s;var a=t.alternate;a!==null&&(a.lanes|=s),rc(t.return,s,r)}function Yc(t,s,r,a,c,u){var g=t.memoizedState;g===null?t.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:a,tail:r,tailMode:c,treeForkCount:u}:(g.isBackwards=s,g.rendering=null,g.renderingStartTime=0,g.last=a,g.tail=r,g.tailMode=c,g.treeForkCount=u)}function Ap(t,s,r){var a=s.pendingProps,c=a.revealOrder,u=a.tail;a=a.children;var g=Je.current,v=(g&2)!==0;if(v?(g=g&1|2,s.flags|=128):g&=1,Z(Je,g),wt(t,s,a,r),a=Ee?vn:0,!v&&t!==null&&(t.flags&128)!==0)e:for(t=s.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Bp(t,r,s);else if(t.tag===19)Bp(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}switch(c){case"forwards":for(r=s.child,c=null;r!==null;)t=r.alternate,t!==null&&Zl(t)===null&&(c=r),r=r.sibling;r=c,r===null?(c=s.child,s.child=null):(c=r.sibling,r.sibling=null),Yc(s,!1,c,r,u,a);break;case"backwards":case"unstable_legacy-backwards":for(r=null,c=s.child,s.child=null;c!==null;){if(t=c.alternate,t!==null&&Zl(t)===null){s.child=c;break}t=c.sibling,c.sibling=r,r=c,c=t}Yc(s,!0,r,null,u,a);break;case"together":Yc(s,!1,null,null,void 0,a);break;default:s.memoizedState=null}return s.child}function Ii(t,s,r){if(t!==null&&(s.dependencies=t.dependencies),ys|=s.lanes,(r&s.childLanes)===0)if(t!==null){if(Dr(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=qi(t,t.pendingProps),s.child=r,r.return=s;t.sibling!==null;)t=t.sibling,r=r.sibling=qi(t,t.pendingProps),r.return=s;r.sibling=null}return s.child}function $c(t,s){return(t.lanes&s)!==0?!0:(t=t.dependencies,!!(t!==null&&Kl(t)))}function nS(t,s,r){switch(s.tag){case 3:ot(s,s.stateNode.containerInfo),ds(s,it,t.memoizedState.cache),Ys();break;case 27:case 5:wi(s);break;case 4:ot(s,s.stateNode.containerInfo);break;case 10:ds(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,gc(s),null;break;case 13:var a=s.memoizedState;if(a!==null)return a.dehydrated!==null?(gs(s),s.flags|=128,null):(r&s.child.childLanes)!==0?Mp(t,s,r):(gs(s),t=Ii(t,s,r),t!==null?t.sibling:null);gs(s);break;case 19:var c=(t.flags&128)!==0;if(a=(r&s.childLanes)!==0,a||(Dr(t,s,r,!1),a=(r&s.childLanes)!==0),c){if(a)return Ap(t,s,r);s.flags|=128}if(c=s.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Z(Je,Je.current),a)break;return null;case 22:return s.lanes=0,Cp(t,s,r,s.pendingProps);case 24:ds(s,it,t.memoizedState.cache)}return Ii(t,s,r)}function zp(t,s,r){if(t!==null)if(t.memoizedProps!==s.pendingProps)rt=!0;else{if(!$c(t,r)&&(s.flags&128)===0)return rt=!1,nS(t,s,r);rt=(t.flags&131072)!==0}else rt=!1,Ee&&(s.flags&1048576)!==0&&uf(s,vn,s.index);switch(s.lanes=0,s.tag){case 16:e:{var a=s.pendingProps;if(t=Xs(s.elementType),s.type=t,typeof t=="function")Fo(t)?(a=Qs(t,a),s.tag=1,s=Rp(null,s,t,a,r)):(s.tag=0,s=Hc(null,s,t,a,r));else{if(t!=null){var c=t.$$typeof;if(c===L){s.tag=11,s=bp(null,s,t,a,r);break e}else if(c===J){s.tag=14,s=xp(null,s,t,a,r);break e}}throw s=ie(t)||t,Error(l(306,s,""))}}return s;case 0:return Hc(t,s,s.type,s.pendingProps,r);case 1:return a=s.type,c=Qs(a,s.pendingProps),Rp(t,s,a,c,r);case 3:e:{if(ot(s,s.stateNode.containerInfo),t===null)throw Error(l(387));a=s.pendingProps;var u=s.memoizedState;c=u.element,uc(t,s),En(s,a,null,r);var g=s.memoizedState;if(a=g.cache,ds(s,it,a),a!==u.cache&&nc(s,[it],r,!0),kn(),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=Dp(t,s,a,r);break e}else if(a!==c){c=ni(Error(l(424)),s),Sn(c),s=Dp(t,s,a,r);break e}else for(t=s.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,We=hi(t.firstChild),bt=s,Ee=!0,hs=null,oi=!0,r=Cf(s,null,a,r),s.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ys(),a===c){s=Ii(t,s,r);break e}wt(t,s,a,r)}s=s.child}return s;case 26:return oa(t,s),t===null?(r=Y_(s.type,null,s.pendingProps,null))?s.memoizedState=r:Ee||(r=s.type,t=s.pendingProps,a=ka(he.current).createElement(r),a[yt]=s,a[Ot]=t,Ct(a,r,t),ft(a),s.stateNode=a):s.memoizedState=Y_(s.type,t.memoizedProps,s.pendingProps,t.memoizedState),null;case 27:return wi(s),t===null&&Ee&&(a=s.stateNode=W_(s.type,s.pendingProps,he.current),bt=s,oi=!0,c=We,ks(s.type)?(Ch=c,We=hi(a.firstChild)):We=c),wt(t,s,s.pendingProps.children,r),oa(t,s),t===null&&(s.flags|=4194304),s.child;case 5:return t===null&&Ee&&((c=a=We)&&(a=LS(a,s.type,s.pendingProps,oi),a!==null?(s.stateNode=a,bt=s,We=hi(a.firstChild),oi=!1,c=!0):c=!1),c||us(s)),wi(s),c=s.type,u=s.pendingProps,g=t!==null?t.memoizedProps:null,a=u.children,Sh(c,u)?a=null:g!==null&&Sh(c,g)&&(s.flags|=32),s.memoizedState!==null&&(c=vc(t,s,F0,null,null,r),In._currentValue=c),oa(t,s),wt(t,s,a,r),s.child;case 6:return t===null&&Ee&&((t=r=We)&&(r=NS(r,s.pendingProps,oi),r!==null?(s.stateNode=r,bt=s,We=null,t=!0):t=!1),t||us(s)),null;case 13:return Mp(t,s,r);case 4:return ot(s,s.stateNode.containerInfo),a=s.pendingProps,t===null?s.child=Fs(s,null,a,r):wt(t,s,a,r),s.child;case 11:return bp(t,s,s.type,s.pendingProps,r);case 7:return wt(t,s,s.pendingProps,r),s.child;case 8:return wt(t,s,s.pendingProps.children,r),s.child;case 12:return wt(t,s,s.pendingProps.children,r),s.child;case 10:return a=s.pendingProps,ds(s,s.type,a.value),wt(t,s,a.children,r),s.child;case 9:return c=s.type._context,a=s.pendingProps.children,Is(s),c=xt(c),a=a(c),s.flags|=1,wt(t,s,a,r),s.child;case 14:return xp(t,s,s.type,s.pendingProps,r);case 15:return wp(t,s,s.type,s.pendingProps,r);case 19:return Ap(t,s,r);case 31:return rS(t,s,r);case 22:return Cp(t,s,r,s.pendingProps);case 24:return Is(s),a=xt(it),t===null?(c=oc(),c===null&&(c=qe,u=lc(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=r),c=u),s.memoizedState={parent:a,cache:c},hc(s),ds(s,it,c)):((t.lanes&r)!==0&&(uc(t,s),En(s,null,null,r),kn()),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),ds(s,it,a)):(a=u.cache,ds(s,it,a),a!==c.cache&&nc(s,[it],r,!0))),wt(t,s,s.pendingProps.children,r),s.child;case 29:throw s.pendingProps}throw Error(l(156,s.tag))}function Gi(t){t.flags|=4}function Ic(t,s,r,a,c){if((s=(t.mode&32)!==0)&&(s=!1),s){if(t.flags|=16777216,(c&335544128)===c)if(t.stateNode.complete)t.flags|=8192;else if(l_())t.flags|=8192;else throw Vs=Gl,cc}else t.flags&=-16777217}function Op(t,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!V_(s))if(l_())t.flags|=8192;else throw Vs=Gl,cc}function ha(t,s){s!==null&&(t.flags|=4),t.flags&16384&&(s=t.tag!==22?dd():536870912,t.lanes|=s,Wr|=s)}function An(t,s){if(!Ee)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 Pe(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 lS(t,s,r){var a=s.pendingProps;switch(ec(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(s),null;case 1:return Pe(s),null;case 3:return r=s.stateNode,a=null,t!==null&&(a=t.memoizedState.cache),s.memoizedState.cache!==a&&(s.flags|=2048),Ki(it),Ae(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Rr(s)?Gi(s):t===null||t.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,ic())),Pe(s),null;case 26:var c=s.type,u=s.memoizedState;return t===null?(Gi(s),u!==null?(Pe(s),Op(s,u)):(Pe(s),Ic(s,c,null,a,r))):u?u!==t.memoizedState?(Gi(s),Pe(s),Op(s,u)):(Pe(s),s.flags&=-16777217):(t=t.memoizedProps,t!==a&&Gi(s),Pe(s),Ic(s,c,t,a,r)),null;case 27:if(Ci(s),r=he.current,c=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==a&&Gi(s);else{if(!a){if(s.stateNode===null)throw Error(l(166));return Pe(s),null}t=ee.current,Rr(s)?ff(s):(t=W_(c,a,r),s.stateNode=t,Gi(s))}return Pe(s),null;case 5:if(Ci(s),c=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==a&&Gi(s);else{if(!a){if(s.stateNode===null)throw Error(l(166));return Pe(s),null}if(u=ee.current,Rr(s))ff(s);else{var g=ka(he.current);switch(u){case 1:u=g.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=g.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=g.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=g.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=g.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?g.createElement("select",{is:a.is}):g.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?g.createElement(c,{is:a.is}):g.createElement(c)}}u[yt]=s,u[Ot]=a;e:for(g=s.child;g!==null;){if(g.tag===5||g.tag===6)u.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===s)break e;for(;g.sibling===null;){if(g.return===null||g.return===s)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}s.stateNode=u;e:switch(Ct(u,c,a),c){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Gi(s)}}return Pe(s),Ic(s,s.type,t===null?null:t.memoizedProps,s.pendingProps,r),null;case 6:if(t&&s.stateNode!=null)t.memoizedProps!==a&&Gi(s);else{if(typeof a!="string"&&s.stateNode===null)throw Error(l(166));if(t=he.current,Rr(s)){if(t=s.stateNode,r=s.memoizedProps,a=null,c=bt,c!==null)switch(c.tag){case 27:case 5:a=c.memoizedProps}t[yt]=s,t=!!(t.nodeValue===r||a!==null&&a.suppressHydrationWarning===!0||M_(t.nodeValue,r)),t||us(s,!0)}else t=ka(t).createTextNode(a),t[yt]=s,s.stateNode=t}return Pe(s),null;case 31:if(r=s.memoizedState,t===null||t.memoizedState!==null){if(a=Rr(s),r!==null){if(t===null){if(!a)throw Error(l(318));if(t=s.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[yt]=s}else Ys(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Pe(s),t=!1}else r=ic(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return s.flags&256?(Xt(s),s):(Xt(s),null);if((s.flags&128)!==0)throw Error(l(558))}return Pe(s),null;case 13:if(a=s.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(c=Rr(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[yt]=s}else Ys(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Pe(s),c=!1}else c=ic(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=c),c=!0;if(!c)return s.flags&256?(Xt(s),s):(Xt(s),null)}return Xt(s),(s.flags&128)!==0?(s.lanes=r,s):(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),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==c&&(a.flags|=2048)),r!==t&&r&&(s.child.flags|=8192),ha(s,s.updateQueue),Pe(s),null);case 4:return Ae(),t===null&&ph(s.stateNode.containerInfo),Pe(s),null;case 10:return Ki(s.type),Pe(s),null;case 19:if(q(Je),a=s.memoizedState,a===null)return Pe(s),null;if(c=(s.flags&128)!==0,u=a.rendering,u===null)if(c)An(a,!1);else{if(Ve!==0||t!==null&&(t.flags&128)!==0)for(t=s.child;t!==null;){if(u=Zl(t),u!==null){for(s.flags|=128,An(a,!1),t=u.updateQueue,s.updateQueue=t,ha(s,t),s.subtreeFlags=0,t=r,r=s.child;r!==null;)of(r,t),r=r.sibling;return Z(Je,Je.current&1|2),Ee&&Wi(s,a.treeForkCount),s.child}t=t.sibling}a.tail!==null&&Pt()>_a&&(s.flags|=128,c=!0,An(a,!1),s.lanes=4194304)}else{if(!c)if(t=Zl(u),t!==null){if(s.flags|=128,c=!0,t=t.updateQueue,s.updateQueue=t,ha(s,t),An(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!Ee)return Pe(s),null}else 2*Pt()-a.renderingStartTime>_a&&r!==536870912&&(s.flags|=128,c=!0,An(a,!1),s.lanes=4194304);a.isBackwards?(u.sibling=s.child,s.child=u):(t=a.last,t!==null?t.sibling=u:s.child=u,a.last=u)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Pt(),t.sibling=null,r=Je.current,Z(Je,c?r&1|2:r&1),Ee&&Wi(s,a.treeForkCount),t):(Pe(s),null);case 22:case 23:return Xt(s),_c(),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&&(Pe(s),s.subtreeFlags&6&&(s.flags|=8192)):Pe(s),r=s.updateQueue,r!==null&&ha(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&&q(Gs),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),s.memoizedState.cache!==r&&(s.flags|=2048),Ki(it),Pe(s),null;case 25:return null;case 30:return null}throw Error(l(156,s.tag))}function aS(t,s){switch(ec(s),s.tag){case 1:return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return Ki(it),Ae(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 26:case 27:case 5:return Ci(s),null;case 31:if(s.memoizedState!==null){if(Xt(s),s.alternate===null)throw Error(l(340));Ys()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 13:if(Xt(s),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(l(340));Ys()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return q(Je),null;case 4:return Ae(),null;case 10:return Ki(s.type),null;case 22:case 23:return Xt(s),_c(),t!==null&&q(Gs),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 24:return Ki(it),null;case 25:return null;default:return null}}function Lp(t,s){switch(ec(s),s.tag){case 3:Ki(it),Ae();break;case 26:case 27:case 5:Ci(s);break;case 4:Ae();break;case 31:s.memoizedState!==null&&Xt(s);break;case 13:Xt(s);break;case 19:q(Je);break;case 10:Ki(s.type);break;case 22:case 23:Xt(s),_c(),t!==null&&q(Gs);break;case 24:Ki(it)}}function zn(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(v){Oe(s,s.return,v)}}function vs(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,v=g.destroy;if(v!==void 0){g.destroy=void 0,c=s;var w=r,A=v;try{A()}catch(H){Oe(c,w,H)}}}a=a.next}while(a!==u)}}catch(H){Oe(s,s.return,H)}}function Np(t){var s=t.updateQueue;if(s!==null){var r=t.stateNode;try{Ef(s,r)}catch(a){Oe(t,t.return,a)}}}function jp(t,s,r){r.props=Qs(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(a){Oe(t,s,a)}}function On(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){Oe(t,s,c)}}function Ti(t,s){var r=t.ref,a=t.refCleanup;if(r!==null)if(typeof a=="function")try{a()}catch(c){Oe(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){Oe(t,s,c)}else r.current=null}function Hp(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){Oe(t,t.return,c)}}function Gc(t,s,r){try{var a=t.stateNode;DS(a,t.type,r,s),a[Ot]=s}catch(c){Oe(t,t.return,c)}}function Up(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ks(t.type)||t.tag===4}function Xc(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Up(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&&ks(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 Vc(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=Hi));else if(a!==4&&(a===27&&ks(t.type)&&(r=t.stateNode,s=null),t=t.child,t!==null))for(Vc(t,s,r),t=t.sibling;t!==null;)Vc(t,s,r),t=t.sibling}function ua(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&&ks(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(ua(t,s,r),t=t.sibling;t!==null;)ua(t,s,r),t=t.sibling}function qp(t){var s=t.stateNode,r=t.memoizedProps;try{for(var a=t.type,c=s.attributes;c.length;)s.removeAttributeNode(c[0]);Ct(s,a,r),s[yt]=t,s[Ot]=r}catch(u){Oe(t,t.return,u)}}var Xi=!1,nt=!1,Fc=!1,Wp=typeof WeakSet=="function"?WeakSet:Set,pt=null;function oS(t,s){if(t=t.containerInfo,mh=Aa,t=Qd(t),Ko(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,v=-1,w=-1,A=0,H=0,$=t,z=null;t:for(;;){for(var j;$!==r||c!==0&&$.nodeType!==3||(v=g+c),$!==u||a!==0&&$.nodeType!==3||(w=g+a),$.nodeType===3&&(g+=$.nodeValue.length),(j=$.firstChild)!==null;)z=$,$=j;for(;;){if($===t)break t;if(z===r&&++A===c&&(v=g),z===u&&++H===a&&(w=g),(j=$.nextSibling)!==null)break;$=z,z=$.parentNode}$=j}r=v===-1||w===-1?null:{start:v,end:w}}else r=null}r=r||{start:0,end:0}}else r=null;for(vh={focusedElem:t,selectionRange:r},Aa=!1,pt=s;pt!==null;)if(s=pt,t=s.child,(s.subtreeFlags&1028)!==0&&t!==null)t.return=s,pt=t;else for(;pt!==null;){switch(s=pt,u=s.alternate,t=s.flags,s.tag){case 0:if((t&4)!==0&&(t=s.updateQueue,t=t!==null?t.events:null,t!==null))for(r=0;r<t.length;r++)c=t[r],c.ref.impl=c.nextImpl;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 re=Qs(r.type,c);t=a.getSnapshotBeforeUpdate(re,u),a.__reactInternalSnapshotBeforeUpdate=t}catch(ce){Oe(r,r.return,ce)}}break;case 3:if((t&1024)!==0){if(t=s.stateNode.containerInfo,r=t.nodeType,r===9)bh(t);else if(r===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":bh(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,pt=t;break}pt=s.return}}function Pp(t,s,r){var a=r.flags;switch(r.tag){case 0:case 11:case 15:Fi(t,r),a&4&&zn(5,r);break;case 1:if(Fi(t,r),a&4)if(t=r.stateNode,s===null)try{t.componentDidMount()}catch(g){Oe(r,r.return,g)}else{var c=Qs(r.type,s.memoizedProps);s=s.memoizedState;try{t.componentDidUpdate(c,s,t.__reactInternalSnapshotBeforeUpdate)}catch(g){Oe(r,r.return,g)}}a&64&&Np(r),a&512&&On(r,r.return);break;case 3:if(Fi(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{Ef(t,s)}catch(g){Oe(r,r.return,g)}}break;case 27:s===null&&a&4&&qp(r);case 26:case 5:Fi(t,r),s===null&&a&4&&Hp(r),a&512&&On(r,r.return);break;case 12:Fi(t,r);break;case 31:Fi(t,r),a&4&&$p(t,r);break;case 13:Fi(t,r),a&4&&Ip(t,r),a&64&&(t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(r=mS.bind(null,r),jS(t,r))));break;case 22:if(a=r.memoizedState!==null||Xi,!a){s=s!==null&&s.memoizedState!==null||nt,c=Xi;var u=nt;Xi=a,(nt=s)&&!u?Zi(t,r,(r.subtreeFlags&8772)!==0):Fi(t,r),Xi=c,nt=u}break;case 30:break;default:Fi(t,r)}}function Kp(t){var s=t.alternate;s!==null&&(t.alternate=null,Kp(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&Eo(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 Ye=null,Nt=!1;function Vi(t,s,r){for(r=r.child;r!==null;)Yp(t,s,r),r=r.sibling}function Yp(t,s,r){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(rn,r)}catch{}switch(r.tag){case 26:nt||Ti(r,s),Vi(t,s,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:nt||Ti(r,s);var a=Ye,c=Nt;ks(r.type)&&(Ye=r.stateNode,Nt=!1),Vi(t,s,r),Kn(r.stateNode),Ye=a,Nt=c;break;case 5:nt||Ti(r,s);case 6:if(a=Ye,c=Nt,Ye=null,Vi(t,s,r),Ye=a,Nt=c,Ye!==null)if(Nt)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(r.stateNode)}catch(u){Oe(r,s,u)}else try{Ye.removeChild(r.stateNode)}catch(u){Oe(r,s,u)}break;case 18:Ye!==null&&(Nt?(t=Ye,N_(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,r.stateNode),Vr(t)):N_(Ye,r.stateNode));break;case 4:a=Ye,c=Nt,Ye=r.stateNode.containerInfo,Nt=!0,Vi(t,s,r),Ye=a,Nt=c;break;case 0:case 11:case 14:case 15:vs(2,r,s),nt||vs(4,r,s),Vi(t,s,r);break;case 1:nt||(Ti(r,s),a=r.stateNode,typeof a.componentWillUnmount=="function"&&jp(r,s,a)),Vi(t,s,r);break;case 21:Vi(t,s,r);break;case 22:nt=(a=nt)||r.memoizedState!==null,Vi(t,s,r),nt=a;break;default:Vi(t,s,r)}}function $p(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Vr(t)}catch(r){Oe(s,s.return,r)}}}function Ip(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Vr(t)}catch(r){Oe(s,s.return,r)}}function cS(t){switch(t.tag){case 31:case 13:case 19:var s=t.stateNode;return s===null&&(s=t.stateNode=new Wp),s;case 22:return t=t.stateNode,s=t._retryCache,s===null&&(s=t._retryCache=new Wp),s;default:throw Error(l(435,t.tag))}}function da(t,s){var r=cS(t);s.forEach(function(a){if(!r.has(a)){r.add(a);var c=vS.bind(null,t,a);a.then(c,c)}})}function jt(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,v=g;e:for(;v!==null;){switch(v.tag){case 27:if(ks(v.type)){Ye=v.stateNode,Nt=!1;break e}break;case 5:Ye=v.stateNode,Nt=!1;break e;case 3:case 4:Ye=v.stateNode.containerInfo,Nt=!0;break e}v=v.return}if(Ye===null)throw Error(l(160));Yp(u,g,c),Ye=null,Nt=!1,u=c.alternate,u!==null&&(u.return=null),c.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Gp(s,t),s=s.sibling}var Si=null;function Gp(t,s){var r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:jt(s,t),Ht(t),a&4&&(vs(3,t,t.return),zn(3,t),vs(5,t,t.return));break;case 1:jt(s,t),Ht(t),a&512&&(nt||r===null||Ti(r,r.return)),a&64&&Xi&&(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=Si;if(jt(s,t),Ht(t),a&512&&(nt||r===null||Ti(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[an]||u[yt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=c.createElement(a),c.head.insertBefore(u,c.querySelector("head > title"))),Ct(u,a,r),u[yt]=t,ft(u),a=u;break e;case"link":var g=G_("link","href",c).get(a+(r.href||""));if(g){for(var v=0;v<g.length;v++)if(u=g[v],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(v,1);break t}}u=c.createElement(a),Ct(u,a,r),c.head.appendChild(u);break;case"meta":if(g=G_("meta","content",c).get(a+(r.content||""))){for(v=0;v<g.length;v++)if(u=g[v],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(v,1);break t}}u=c.createElement(a),Ct(u,a,r),c.head.appendChild(u);break;default:throw Error(l(468,a))}u[yt]=t,ft(u),a=u}t.stateNode=a}else X_(c,t.type,t.stateNode);else t.stateNode=I_(c,a,t.memoizedProps);else u!==a?(u===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):u.count--,a===null?X_(c,t.type,t.stateNode):I_(c,a,t.memoizedProps)):a===null&&t.stateNode!==null&&Gc(t,t.memoizedProps,r.memoizedProps)}break;case 27:jt(s,t),Ht(t),a&512&&(nt||r===null||Ti(r,r.return)),r!==null&&a&4&&Gc(t,t.memoizedProps,r.memoizedProps);break;case 5:if(jt(s,t),Ht(t),a&512&&(nt||r===null||Ti(r,r.return)),t.flags&32){c=t.stateNode;try{vr(c,"")}catch(re){Oe(t,t.return,re)}}a&4&&t.stateNode!=null&&(c=t.memoizedProps,Gc(t,c,r!==null?r.memoizedProps:c)),a&1024&&(Fc=!0);break;case 6:if(jt(s,t),Ht(t),a&4){if(t.stateNode===null)throw Error(l(162));a=t.memoizedProps,r=t.stateNode;try{r.nodeValue=a}catch(re){Oe(t,t.return,re)}}break;case 3:if(Ra=null,c=Si,Si=Ea(s.containerInfo),jt(s,t),Si=c,Ht(t),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Vr(s.containerInfo)}catch(re){Oe(t,t.return,re)}Fc&&(Fc=!1,Xp(t));break;case 4:a=Si,Si=Ea(t.stateNode.containerInfo),jt(s,t),Ht(t),Si=a;break;case 12:jt(s,t),Ht(t);break;case 31:jt(s,t),Ht(t),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,da(t,a)));break;case 13:jt(s,t),Ht(t),t.child.flags&8192&&t.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(pa=Pt()),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,da(t,a)));break;case 22:c=t.memoizedState!==null;var w=r!==null&&r.memoizedState!==null,A=Xi,H=nt;if(Xi=A||c,nt=H||w,jt(s,t),nt=H,Xi=A,Ht(t),a&8192)e:for(s=t.stateNode,s._visibility=c?s._visibility&-2:s._visibility|1,c&&(r===null||w||Xi||nt||Js(t)),r=null,s=t;;){if(s.tag===5||s.tag===26){if(r===null){w=r=s;try{if(u=w.stateNode,c)g=u.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{v=w.stateNode;var $=w.memoizedProps.style,z=$!=null&&$.hasOwnProperty("display")?$.display:null;v.style.display=z==null||typeof z=="boolean"?"":(""+z).trim()}}catch(re){Oe(w,w.return,re)}}}else if(s.tag===6){if(r===null){w=s;try{w.stateNode.nodeValue=c?"":w.memoizedProps}catch(re){Oe(w,w.return,re)}}}else if(s.tag===18){if(r===null){w=s;try{var j=w.stateNode;c?j_(j,!0):j_(w.stateNode,!1)}catch(re){Oe(w,w.return,re)}}}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,da(t,r))));break;case 19:jt(s,t),Ht(t),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,da(t,a)));break;case 30:break;case 21:break;default:jt(s,t),Ht(t)}}function Ht(t){var s=t.flags;if(s&2){try{for(var r,a=t.return;a!==null;){if(Up(a)){r=a;break}a=a.return}if(r==null)throw Error(l(160));switch(r.tag){case 27:var c=r.stateNode,u=Xc(t);ua(t,u,c);break;case 5:var g=r.stateNode;r.flags&32&&(vr(g,""),r.flags&=-33);var v=Xc(t);ua(t,v,g);break;case 3:case 4:var w=r.stateNode.containerInfo,A=Xc(t);Vc(t,A,w);break;default:throw Error(l(161))}}catch(H){Oe(t,t.return,H)}t.flags&=-3}s&4096&&(t.flags&=-4097)}function Xp(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var s=t;Xp(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),t=t.sibling}}function Fi(t,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Pp(t,s.alternate,s),s=s.sibling}function Js(t){for(t=t.child;t!==null;){var s=t;switch(s.tag){case 0:case 11:case 14:case 15:vs(4,s,s.return),Js(s);break;case 1:Ti(s,s.return);var r=s.stateNode;typeof r.componentWillUnmount=="function"&&jp(s,s.return,r),Js(s);break;case 27:Kn(s.stateNode);case 26:case 5:Ti(s,s.return),Js(s);break;case 22:s.memoizedState===null&&Js(s);break;case 30:Js(s);break;default:Js(s)}t=t.sibling}}function Zi(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:Zi(c,u,r),zn(4,u);break;case 1:if(Zi(c,u,r),a=u,c=a.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(A){Oe(a,a.return,A)}if(a=u,c=a.updateQueue,c!==null){var v=a.stateNode;try{var w=c.shared.hiddenCallbacks;if(w!==null)for(c.shared.hiddenCallbacks=null,c=0;c<w.length;c++)kf(w[c],v)}catch(A){Oe(a,a.return,A)}}r&&g&64&&Np(u),On(u,u.return);break;case 27:qp(u);case 26:case 5:Zi(c,u,r),r&&a===null&&g&4&&Hp(u),On(u,u.return);break;case 12:Zi(c,u,r);break;case 31:Zi(c,u,r),r&&g&4&&$p(c,u);break;case 13:Zi(c,u,r),r&&g&4&&Ip(c,u);break;case 22:u.memoizedState===null&&Zi(c,u,r),On(u,u.return);break;case 30:break;default:Zi(c,u,r)}s=s.sibling}}function Zc(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&&yn(r))}function Qc(t,s){t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&yn(t))}function yi(t,s,r,a){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Vp(t,s,r,a),s=s.sibling}function Vp(t,s,r,a){var c=s.flags;switch(s.tag){case 0:case 11:case 15:yi(t,s,r,a),c&2048&&zn(9,s);break;case 1:yi(t,s,r,a);break;case 3:yi(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&&yn(t)));break;case 12:if(c&2048){yi(t,s,r,a),t=s.stateNode;try{var u=s.memoizedProps,g=u.id,v=u.onPostCommit;typeof v=="function"&&v(g,s.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(w){Oe(s,s.return,w)}}else yi(t,s,r,a);break;case 31:yi(t,s,r,a);break;case 13:yi(t,s,r,a);break;case 23:break;case 22:u=s.stateNode,g=s.alternate,s.memoizedState!==null?u._visibility&2?yi(t,s,r,a):Ln(t,s):u._visibility&2?yi(t,s,r,a):(u._visibility|=2,Hr(t,s,r,a,(s.subtreeFlags&10256)!==0||!1)),c&2048&&Zc(g,s);break;case 24:yi(t,s,r,a),c&2048&&Qc(s.alternate,s);break;default:yi(t,s,r,a)}}function Hr(t,s,r,a,c){for(c=c&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var u=t,g=s,v=r,w=a,A=g.flags;switch(g.tag){case 0:case 11:case 15:Hr(u,g,v,w,c),zn(8,g);break;case 23:break;case 22:var H=g.stateNode;g.memoizedState!==null?H._visibility&2?Hr(u,g,v,w,c):Ln(u,g):(H._visibility|=2,Hr(u,g,v,w,c)),c&&A&2048&&Zc(g.alternate,g);break;case 24:Hr(u,g,v,w,c),c&&A&2048&&Qc(g.alternate,g);break;default:Hr(u,g,v,w,c)}s=s.sibling}}function Ln(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:Ln(r,a),c&2048&&Zc(a.alternate,a);break;case 24:Ln(r,a),c&2048&&Qc(a.alternate,a);break;default:Ln(r,a)}s=s.sibling}}var Nn=8192;function Ur(t,s,r){if(t.subtreeFlags&Nn)for(t=t.child;t!==null;)Fp(t,s,r),t=t.sibling}function Fp(t,s,r){switch(t.tag){case 26:Ur(t,s,r),t.flags&Nn&&t.memoizedState!==null&&VS(r,Si,t.memoizedState,t.memoizedProps);break;case 5:Ur(t,s,r);break;case 3:case 4:var a=Si;Si=Ea(t.stateNode.containerInfo),Ur(t,s,r),Si=a;break;case 22:t.memoizedState===null&&(a=t.alternate,a!==null&&a.memoizedState!==null?(a=Nn,Nn=16777216,Ur(t,s,r),Nn=a):Ur(t,s,r));break;default:Ur(t,s,r)}}function Zp(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 jn(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];pt=a,Jp(a,t)}Zp(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Qp(t),t=t.sibling}function Qp(t){switch(t.tag){case 0:case 11:case 15:jn(t),t.flags&2048&&vs(9,t,t.return);break;case 3:jn(t);break;case 12:jn(t);break;case 22:var s=t.stateNode;t.memoizedState!==null&&s._visibility&2&&(t.return===null||t.return.tag!==13)?(s._visibility&=-3,fa(t)):jn(t);break;default:jn(t)}}function fa(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];pt=a,Jp(a,t)}Zp(t)}for(t=t.child;t!==null;){switch(s=t,s.tag){case 0:case 11:case 15:vs(8,s,s.return),fa(s);break;case 22:r=s.stateNode,r._visibility&2&&(r._visibility&=-3,fa(s));break;default:fa(s)}t=t.sibling}}function Jp(t,s){for(;pt!==null;){var r=pt;switch(r.tag){case 0:case 11:case 15:vs(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:yn(r.memoizedState.cache)}if(a=r.child,a!==null)a.return=r,pt=a;else e:for(r=t;pt!==null;){a=pt;var c=a.sibling,u=a.return;if(Kp(a),a===r){pt=null;break e}if(c!==null){c.return=u,pt=c;break e}pt=u}}}var hS={getCacheForType:function(t){var s=xt(it),r=s.data.get(t);return r===void 0&&(r=t(),s.data.set(t,r)),r},cacheSignal:function(){return xt(it).controller.signal}},uS=typeof WeakMap=="function"?WeakMap:Map,Be=0,qe=null,be=null,Ce=0,ze=0,Vt=null,Ss=!1,qr=!1,Jc=!1,Qi=0,Ve=0,ys=0,er=0,eh=0,Ft=0,Wr=0,Hn=null,Ut=null,th=!1,pa=0,e_=0,_a=1/0,ga=null,bs=null,ct=0,xs=null,Pr=null,Ji=0,ih=0,sh=null,t_=null,Un=0,rh=null;function Zt(){return(Be&2)!==0&&Ce!==0?Ce&-Ce:T.T!==null?hh():gd()}function i_(){if(Ft===0)if((Ce&536870912)===0||Ee){var t=Cl;Cl<<=1,(Cl&3932160)===0&&(Cl=262144),Ft=t}else Ft=536870912;return t=Gt.current,t!==null&&(t.flags|=32),Ft}function qt(t,s,r){(t===qe&&(ze===2||ze===9)||t.cancelPendingCommit!==null)&&(Kr(t,0),ws(t,Ce,Ft,!1)),ln(t,r),((Be&2)===0||t!==qe)&&(t===qe&&((Be&2)===0&&(er|=r),Ve===4&&ws(t,Ce,Ft,!1)),Ri(t))}function s_(t,s,r){if((Be&6)!==0)throw Error(l(327));var a=!r&&(s&127)===0&&(s&t.expiredLanes)===0||nn(t,s),c=a?pS(t,s):lh(t,s,!0),u=a;do{if(c===0){qr&&!a&&ws(t,s,0,!1);break}else{if(r=t.current.alternate,u&&!dS(r)){c=lh(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 v=t;c=Hn;var w=v.current.memoizedState.isDehydrated;if(w&&(Kr(v,g).flags|=256),g=lh(v,g,!1),g!==2){if(Jc&&!w){v.errorRecoveryDisabledLanes|=u,er|=u,c=4;break e}u=Ut,Ut=c,u!==null&&(Ut===null?Ut=u:Ut.push.apply(Ut,u))}c=g}if(u=!1,c!==2)continue}}if(c===1){Kr(t,0),ws(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:ws(a,s,Ft,!Ss);break e;case 2:Ut=null;break;case 3:case 5:break;default:throw Error(l(329))}if((s&62914560)===s&&(c=pa+300-Pt(),10<c)){if(ws(a,s,Ft,!Ss),El(a,0,!0)!==0)break e;Ji=s,a.timeoutHandle=O_(r_.bind(null,a,r,Ut,ga,th,s,Ft,er,Wr,Ss,u,"Throttled",-0,0),c);break e}r_(a,r,Ut,ga,th,s,Ft,er,Wr,Ss,u,null,-0,0)}}break}while(!0);Ri(t)}function r_(t,s,r,a,c,u,g,v,w,A,H,$,z,j){if(t.timeoutHandle=-1,$=s.subtreeFlags,$&8192||($&16785408)===16785408){$={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Hi},Fp(s,u,$);var re=(u&62914560)===u?pa-Pt():(u&4194048)===u?e_-Pt():0;if(re=FS($,re),re!==null){Ji=u,t.cancelPendingCommit=re(d_.bind(null,t,s,u,r,a,c,g,v,w,H,$,null,z,j)),ws(t,u,g,!A);return}}d_(t,s,u,r,a,c,g,v,w)}function dS(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(!$t(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 ws(t,s,r,a){s&=~eh,s&=~er,t.suspendedLanes|=s,t.pingedLanes&=~s,a&&(t.warmLanes|=s),a=t.expirationTimes;for(var c=s;0<c;){var u=31-Yt(c),g=1<<u;a[u]=-1,c&=~g}r!==0&&fd(t,r,s)}function ma(){return(Be&6)===0?(qn(0),!1):!0}function nh(){if(be!==null){if(ze===0)var t=be.return;else t=be,Pi=$s=null,bc(t),zr=null,xn=0,t=be;for(;t!==null;)Lp(t.alternate,t),t=t.return;be=null}}function Kr(t,s){var r=t.timeoutHandle;r!==-1&&(t.timeoutHandle=-1,AS(r)),r=t.cancelPendingCommit,r!==null&&(t.cancelPendingCommit=null,r()),Ji=0,nh(),qe=t,be=r=qi(t.current,null),Ce=s,ze=0,Vt=null,Ss=!1,qr=nn(t,s),Jc=!1,Wr=Ft=eh=er=ys=Ve=0,Ut=Hn=null,th=!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-Yt(a),u=1<<c;s|=t[c],a&=~u}return Qi=s,Hl(),r}function n_(t,s){_e=null,T.H=Mn,s===Ar||s===Il?(s=bf(),ze=3):s===cc?(s=bf(),ze=4):ze=s===jc?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Vt=s,be===null&&(Ve=1,la(t,ni(s,t.current)))}function l_(){var t=Gt.current;return t===null?!0:(Ce&4194048)===Ce?ci===null:(Ce&62914560)===Ce||(Ce&536870912)!==0?t===ci:!1}function a_(){var t=T.H;return T.H=Mn,t===null?Mn:t}function o_(){var t=T.A;return T.A=hS,t}function va(){Ve=4,Ss||(Ce&4194048)!==Ce&&Gt.current!==null||(qr=!0),(ys&134217727)===0&&(er&134217727)===0||qe===null||ws(qe,Ce,Ft,!1)}function lh(t,s,r){var a=Be;Be|=2;var c=a_(),u=o_();(qe!==t||Ce!==s)&&(ga=null,Kr(t,s)),s=!1;var g=Ve;e:do try{if(ze!==0&&be!==null){var v=be,w=Vt;switch(ze){case 8:nh(),g=6;break e;case 3:case 2:case 9:case 6:Gt.current===null&&(s=!0);var A=ze;if(ze=0,Vt=null,Yr(t,v,w,A),r&&qr){g=0;break e}break;default:A=ze,ze=0,Vt=null,Yr(t,v,w,A)}}fS(),g=Ve;break}catch(H){n_(t,H)}while(!0);return s&&t.shellSuspendCounter++,Pi=$s=null,Be=a,T.H=c,T.A=u,be===null&&(qe=null,Ce=0,Hl()),g}function fS(){for(;be!==null;)c_(be)}function pS(t,s){var r=Be;Be|=2;var a=a_(),c=o_();qe!==t||Ce!==s?(ga=null,_a=Pt()+500,Kr(t,s)):qr=nn(t,s);e:do try{if(ze!==0&&be!==null){s=be;var u=Vt;t:switch(ze){case 1:ze=0,Vt=null,Yr(t,s,u,1);break;case 2:case 9:if(Sf(u)){ze=0,Vt=null,h_(s);break}s=function(){ze!==2&&ze!==9||qe!==t||(ze=7),Ri(t)},u.then(s,s);break e;case 3:ze=7;break e;case 4:ze=5;break e;case 7:Sf(u)?(ze=0,Vt=null,h_(s)):(ze=0,Vt=null,Yr(t,s,u,7));break;case 5:var g=null;switch(be.tag){case 26:g=be.memoizedState;case 5:case 27:var v=be;if(g?V_(g):v.stateNode.complete){ze=0,Vt=null;var w=v.sibling;if(w!==null)be=w;else{var A=v.return;A!==null?(be=A,Sa(A)):be=null}break t}}ze=0,Vt=null,Yr(t,s,u,5);break;case 6:ze=0,Vt=null,Yr(t,s,u,6);break;case 8:nh(),Ve=6;break e;default:throw Error(l(462))}}_S();break}catch(H){n_(t,H)}while(!0);return Pi=$s=null,T.H=a,T.A=c,Be=r,be!==null?0:(qe=null,Ce=0,Hl(),Ve)}function _S(){for(;be!==null&&!Hv();)c_(be)}function c_(t){var s=zp(t.alternate,t,Qi);t.memoizedProps=t.pendingProps,s===null?Sa(t):be=s}function h_(t){var s=t,r=s.alternate;switch(s.tag){case 15:case 0:s=Tp(r,s,s.pendingProps,s.type,void 0,Ce);break;case 11:s=Tp(r,s,s.pendingProps,s.type.render,s.ref,Ce);break;case 5:bc(s);default:Lp(r,s),s=be=of(s,Qi),s=zp(r,s,Qi)}t.memoizedProps=t.pendingProps,s===null?Sa(t):be=s}function Yr(t,s,r,a){Pi=$s=null,bc(s),zr=null,xn=0;var c=s.return;try{if(sS(t,c,s,r,Ce)){Ve=1,la(t,ni(r,t.current)),be=null;return}}catch(u){if(c!==null)throw be=c,u;Ve=1,la(t,ni(r,t.current)),be=null;return}s.flags&32768?(Ee||a===1?t=!0:qr||(Ce&536870912)!==0?t=!1:(Ss=t=!0,(a===2||a===9||a===3||a===6)&&(a=Gt.current,a!==null&&a.tag===13&&(a.flags|=16384))),u_(s,t)):Sa(s)}function Sa(t){var s=t;do{if((s.flags&32768)!==0){u_(s,Ss);return}t=s.return;var r=lS(s.alternate,s,Qi);if(r!==null){be=r;return}if(s=s.sibling,s!==null){be=s;return}be=s=t}while(s!==null);Ve===0&&(Ve=5)}function u_(t,s){do{var r=aS(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);Ve=6,be=null}function d_(t,s,r,a,c,u,g,v,w){t.cancelPendingCommit=null;do ya();while(ct!==0);if((Be&6)!==0)throw Error(l(327));if(s!==null){if(s===t.current)throw Error(l(177));if(u=s.lanes|s.childLanes,u|=Xo,Xv(t,r,u,g,v,w),t===qe&&(be=qe=null,Ce=0),Pr=s,xs=t,Ji=r,ih=u,sh=c,t_=a,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,SS(xl,function(){return m_(),null})):(t.callbackNode=null,t.callbackPriority=0),a=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||a){a=T.T,T.T=null,c=P.p,P.p=2,g=Be,Be|=4;try{oS(t,s,r)}finally{Be=g,P.p=c,T.T=a}}ct=1,f_(),p_(),__()}}function f_(){if(ct===1){ct=0;var t=xs,s=Pr,r=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||r){r=T.T,T.T=null;var a=P.p;P.p=2;var c=Be;Be|=4;try{Gp(s,t);var u=vh,g=Qd(t.containerInfo),v=u.focusedElem,w=u.selectionRange;if(g!==v&&v&&v.ownerDocument&&Zd(v.ownerDocument.documentElement,v)){if(w!==null&&Ko(v)){var A=w.start,H=w.end;if(H===void 0&&(H=A),"selectionStart"in v)v.selectionStart=A,v.selectionEnd=Math.min(H,v.value.length);else{var $=v.ownerDocument||document,z=$&&$.defaultView||window;if(z.getSelection){var j=z.getSelection(),re=v.textContent.length,ce=Math.min(w.start,re),He=w.end===void 0?ce:Math.min(w.end,re);!j.extend&&ce>He&&(g=He,He=ce,ce=g);var D=Fd(v,ce),E=Fd(v,He);if(D&&E&&(j.rangeCount!==1||j.anchorNode!==D.node||j.anchorOffset!==D.offset||j.focusNode!==E.node||j.focusOffset!==E.offset)){var B=$.createRange();B.setStart(D.node,D.offset),j.removeAllRanges(),ce>He?(j.addRange(B),j.extend(E.node,E.offset)):(B.setEnd(E.node,E.offset),j.addRange(B))}}}}for($=[],j=v;j=j.parentNode;)j.nodeType===1&&$.push({element:j,left:j.scrollLeft,top:j.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<$.length;v++){var K=$[v];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}Aa=!!mh,vh=mh=null}finally{Be=c,P.p=a,T.T=r}}t.current=s,ct=2}}function p_(){if(ct===2){ct=0;var t=xs,s=Pr,r=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||r){r=T.T,T.T=null;var a=P.p;P.p=2;var c=Be;Be|=4;try{Pp(t,s.alternate,s)}finally{Be=c,P.p=a,T.T=r}}ct=3}}function __(){if(ct===4||ct===3){ct=0,Uv();var t=xs,s=Pr,r=Ji,a=t_;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?ct=5:(ct=0,Pr=xs=null,g_(t,t.pendingLanes));var c=t.pendingLanes;if(c===0&&(bs=null),Co(r),s=s.stateNode,Kt&&typeof Kt.onCommitFiberRoot=="function")try{Kt.onCommitFiberRoot(rn,s,void 0,(s.current.flags&128)===128)}catch{}if(a!==null){s=T.T,c=P.p,P.p=2,T.T=null;try{for(var u=t.onRecoverableError,g=0;g<a.length;g++){var v=a[g];u(v.value,{componentStack:v.stack})}}finally{T.T=s,P.p=c}}(Ji&3)!==0&&ya(),Ri(t),c=t.pendingLanes,(r&261930)!==0&&(c&42)!==0?t===rh?Un++:(Un=0,rh=t):Un=0,qn(0)}}function g_(t,s){(t.pooledCacheLanes&=s)===0&&(s=t.pooledCache,s!=null&&(t.pooledCache=null,yn(s)))}function ya(){return f_(),p_(),__(),m_()}function m_(){if(ct!==5)return!1;var t=xs,s=ih;ih=0;var r=Co(Ji),a=T.T,c=P.p;try{P.p=32>r?32:r,T.T=null,r=sh,sh=null;var u=xs,g=Ji;if(ct=0,Pr=xs=null,Ji=0,(Be&6)!==0)throw Error(l(331));var v=Be;if(Be|=4,Qp(u.current),Vp(u,u.current,g,r),Be=v,qn(0,!1),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(rn,u)}catch{}return!0}finally{P.p=c,T.T=a,g_(t,s)}}function v_(t,s,r){s=ni(r,s),s=Nc(t.stateNode,s,2),t=_s(t,s,2),t!==null&&(ln(t,2),Ri(t))}function Oe(t,s,r){if(t.tag===3)v_(t,t,r);else for(;s!==null;){if(s.tag===3){v_(s,t,r);break}else if(s.tag===1){var a=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(bs===null||!bs.has(a))){t=ni(r,t),r=Sp(2),a=_s(s,r,2),a!==null&&(yp(r,a,s,t),ln(a,2),Ri(a));break}}s=s.return}}function ah(t,s,r){var a=t.pingCache;if(a===null){a=t.pingCache=new uS;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)||(Jc=!0,c.add(r),t=gS.bind(null,t,s,r),s.then(t,t))}function gS(t,s,r){var a=t.pingCache;a!==null&&a.delete(s),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,qe===t&&(Ce&r)===r&&(Ve===4||Ve===3&&(Ce&62914560)===Ce&&300>Pt()-pa?(Be&2)===0&&Kr(t,0):eh|=r,Wr===Ce&&(Wr=0)),Ri(t)}function S_(t,s){s===0&&(s=dd()),t=Ps(t,s),t!==null&&(ln(t,s),Ri(t))}function mS(t){var s=t.memoizedState,r=0;s!==null&&(r=s.retryLane),S_(t,r)}function vS(t,s){var r=0;switch(t.tag){case 31: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),S_(t,r)}function SS(t,s){return yo(t,s)}var ba=null,$r=null,oh=!1,xa=!1,ch=!1,Cs=0;function Ri(t){t!==$r&&t.next===null&&($r===null?ba=$r=t:$r=$r.next=t),xa=!0,oh||(oh=!0,bS())}function qn(t,s){if(!ch&&xa){ch=!0;do for(var r=!1,a=ba;a!==null;){if(t!==0){var c=a.pendingLanes;if(c===0)var u=0;else{var g=a.suspendedLanes,v=a.pingedLanes;u=(1<<31-Yt(42|t)+1)-1,u&=c&~(g&~v),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(r=!0,w_(a,u))}else u=Ce,u=El(a,a===qe?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||nn(a,u)||(r=!0,w_(a,u));a=a.next}while(r);ch=!1}}function yS(){y_()}function y_(){xa=oh=!1;var t=0;Cs!==0&&BS()&&(t=Cs);for(var s=Pt(),r=null,a=ba;a!==null;){var c=a.next,u=b_(a,s);u===0?(a.next=null,r===null?ba=c:r.next=c,c===null&&($r=r)):(r=a,(t!==0||(u&3)!==0)&&(xa=!0)),a=c}ct!==0&&ct!==5||qn(t),Cs!==0&&(Cs=0)}function b_(t,s){for(var r=t.suspendedLanes,a=t.pingedLanes,c=t.expirationTimes,u=t.pendingLanes&-62914561;0<u;){var g=31-Yt(u),v=1<<g,w=c[g];w===-1?((v&r)===0||(v&a)!==0)&&(c[g]=Gv(v,s)):w<=s&&(t.expiredLanes|=v),u&=~v}if(s=qe,r=Ce,r=El(t,t===s?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a=t.callbackNode,r===0||t===s&&(ze===2||ze===9)||t.cancelPendingCommit!==null)return a!==null&&a!==null&&bo(a),t.callbackNode=null,t.callbackPriority=0;if((r&3)===0||nn(t,r)){if(s=r&-r,s===t.callbackPriority)return s;switch(a!==null&&bo(a),Co(r)){case 2:case 8:r=hd;break;case 32:r=xl;break;case 268435456:r=ud;break;default:r=xl}return a=x_.bind(null,t),r=yo(r,a),t.callbackPriority=s,t.callbackNode=r,s}return a!==null&&a!==null&&bo(a),t.callbackPriority=2,t.callbackNode=null,2}function x_(t,s){if(ct!==0&&ct!==5)return t.callbackNode=null,t.callbackPriority=0,null;var r=t.callbackNode;if(ya()&&t.callbackNode!==r)return null;var a=Ce;return a=El(t,t===qe?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a===0?null:(s_(t,a,s),b_(t,Pt()),t.callbackNode!=null&&t.callbackNode===r?x_.bind(null,t):null)}function w_(t,s){if(ya())return null;s_(t,s,!0)}function bS(){zS(function(){(Be&6)!==0?yo(cd,yS):y_()})}function hh(){if(Cs===0){var t=Mr;t===0&&(t=wl,wl<<=1,(wl&261888)===0&&(wl=256)),Cs=t}return Cs}function C_(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ml(""+t)}function k_(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 xS(t,s,r,a,c){if(s==="submit"&&r&&r.stateNode===c){var u=C_((c[Ot]||null).action),g=a.submitter;g&&(s=(s=g[Ot]||null)?C_(s.formAction):g.getAttribute("formAction"),s!==null&&(u=s,g=null));var v=new Ol("action","action",null,a,c);t.push({event:v,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Cs!==0){var w=g?k_(c,g):new FormData(c);Mc(r,{pending:!0,data:w,method:c.method,action:u},null,w)}}else typeof u=="function"&&(v.preventDefault(),w=g?k_(c,g):new FormData(c),Mc(r,{pending:!0,data:w,method:c.method,action:u},u,w))},currentTarget:c}]})}}for(var uh=0;uh<Go.length;uh++){var dh=Go[uh],wS=dh.toLowerCase(),CS=dh[0].toUpperCase()+dh.slice(1);vi(wS,"on"+CS)}vi(tf,"onAnimationEnd"),vi(sf,"onAnimationIteration"),vi(rf,"onAnimationStart"),vi("dblclick","onDoubleClick"),vi("focusin","onFocus"),vi("focusout","onBlur"),vi(q0,"onTransitionRun"),vi(W0,"onTransitionStart"),vi(P0,"onTransitionCancel"),vi(nf,"onTransitionEnd"),gr("onMouseEnter",["mouseout","mouseover"]),gr("onMouseLeave",["mouseout","mouseover"]),gr("onPointerEnter",["pointerout","pointerover"]),gr("onPointerLeave",["pointerout","pointerover"]),Hs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Hs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Hs("onBeforeInput",["compositionend","keypress","textInput","paste"]),Hs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Hs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Hs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wn="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(" "),kS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wn));function E_(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 v=a[g],w=v.instance,A=v.currentTarget;if(v=v.listener,w!==u&&c.isPropagationStopped())break e;u=v,c.currentTarget=A;try{u(c)}catch(H){jl(H)}c.currentTarget=null,u=w}else for(g=0;g<a.length;g++){if(v=a[g],w=v.instance,A=v.currentTarget,v=v.listener,w!==u&&c.isPropagationStopped())break e;u=v,c.currentTarget=A;try{u(c)}catch(H){jl(H)}c.currentTarget=null,u=w}}}}function xe(t,s){var r=s[ko];r===void 0&&(r=s[ko]=new Set);var a=t+"__bubble";r.has(a)||(T_(s,t,2,!1),r.add(a))}function fh(t,s,r){var a=0;s&&(a|=4),T_(r,t,a,s)}var wa="_reactListening"+Math.random().toString(36).slice(2);function ph(t){if(!t[wa]){t[wa]=!0,Sd.forEach(function(r){r!=="selectionchange"&&(kS.has(r)||fh(r,!1,t),fh(r,!0,t))});var s=t.nodeType===9?t:t.ownerDocument;s===null||s[wa]||(s[wa]=!0,fh("selectionchange",!1,s))}}function T_(t,s,r,a){switch(ig(s)){case 2:var c=JS;break;case 8:c=ey;break;default:c=Dh}r=c.bind(null,s,r,t),c=void 0,!Oo||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 _h(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 v=a.stateNode.containerInfo;if(v===c)break;if(g===4)for(g=a.return;g!==null;){var w=g.tag;if((w===3||w===4)&&g.stateNode.containerInfo===c)return;g=g.return}for(;v!==null;){if(g=fr(v),g===null)return;if(w=g.tag,w===5||w===6||w===26||w===27){a=u=g;continue e}v=v.parentNode}}a=a.return}Bd(function(){var A=u,H=Ao(r),$=[];e:{var z=lf.get(t);if(z!==void 0){var j=Ol,re=t;switch(t){case"keypress":if(Al(r)===0)break e;case"keydown":case"keyup":j=v0;break;case"focusin":re="focus",j=Ho;break;case"focusout":re="blur",j=Ho;break;case"beforeblur":case"afterblur":j=Ho;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":j=Od;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":j=l0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":j=b0;break;case tf:case sf:case rf:j=c0;break;case nf:j=w0;break;case"scroll":case"scrollend":j=r0;break;case"wheel":j=k0;break;case"copy":case"cut":case"paste":j=u0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":j=Nd;break;case"toggle":case"beforetoggle":j=T0}var ce=(s&4)!==0,He=!ce&&(t==="scroll"||t==="scrollend"),D=ce?z!==null?z+"Capture":null:z;ce=[];for(var E=A,B;E!==null;){var K=E;if(B=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||B===null||D===null||(K=cn(E,D),K!=null&&ce.push(Pn(E,K,B))),He)break;E=E.return}0<ce.length&&(z=new j(z,re,null,r,H),$.push({event:z,listeners:ce}))}}if((s&7)===0){e:{if(z=t==="mouseover"||t==="pointerover",j=t==="mouseout"||t==="pointerout",z&&r!==Bo&&(re=r.relatedTarget||r.fromElement)&&(fr(re)||re[dr]))break e;if((j||z)&&(z=H.window===H?H:(z=H.ownerDocument)?z.defaultView||z.parentWindow:window,j?(re=r.relatedTarget||r.toElement,j=A,re=re?fr(re):null,re!==null&&(He=h(re),ce=re.tag,re!==He||ce!==5&&ce!==27&&ce!==6)&&(re=null)):(j=null,re=A),j!==re)){if(ce=Od,K="onMouseLeave",D="onMouseEnter",E="mouse",(t==="pointerout"||t==="pointerover")&&(ce=Nd,K="onPointerLeave",D="onPointerEnter",E="pointer"),He=j==null?z:on(j),B=re==null?z:on(re),z=new ce(K,E+"leave",j,r,H),z.target=He,z.relatedTarget=B,K=null,fr(H)===A&&(ce=new ce(D,E+"enter",re,r,H),ce.target=B,ce.relatedTarget=He,K=ce),He=K,j&&re)t:{for(ce=ES,D=j,E=re,B=0,K=D;K;K=ce(K))B++;K=0;for(var le=E;le;le=ce(le))K++;for(;0<B-K;)D=ce(D),B--;for(;0<K-B;)E=ce(E),K--;for(;B--;){if(D===E||E!==null&&D===E.alternate){ce=D;break t}D=ce(D),E=ce(E)}ce=null}else ce=null;j!==null&&R_($,z,j,ce,!1),re!==null&&He!==null&&R_($,He,re,ce,!0)}}e:{if(z=A?on(A):window,j=z.nodeName&&z.nodeName.toLowerCase(),j==="select"||j==="input"&&z.type==="file")var De=Yd;else if(Pd(z))if($d)De=j0;else{De=L0;var ne=O0}else j=z.nodeName,!j||j.toLowerCase()!=="input"||z.type!=="checkbox"&&z.type!=="radio"?A&&Mo(A.elementType)&&(De=Yd):De=N0;if(De&&(De=De(t,A))){Kd($,De,r,H);break e}ne&&ne(t,z,A),t==="focusout"&&A&&z.type==="number"&&A.memoizedProps.value!=null&&Do(z,"number",z.value)}switch(ne=A?on(A):window,t){case"focusin":(Pd(ne)||ne.contentEditable==="true")&&(xr=ne,Yo=A,mn=null);break;case"focusout":mn=Yo=xr=null;break;case"mousedown":$o=!0;break;case"contextmenu":case"mouseup":case"dragend":$o=!1,Jd($,r,H);break;case"selectionchange":if(U0)break;case"keydown":case"keyup":Jd($,r,H)}var me;if(qo)e:{switch(t){case"compositionstart":var ke="onCompositionStart";break e;case"compositionend":ke="onCompositionEnd";break e;case"compositionupdate":ke="onCompositionUpdate";break e}ke=void 0}else br?qd(t,r)&&(ke="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(ke="onCompositionStart");ke&&(jd&&r.locale!=="ko"&&(br||ke!=="onCompositionStart"?ke==="onCompositionEnd"&&br&&(me=Ad()):(os=H,Lo="value"in os?os.value:os.textContent,br=!0)),ne=Ca(A,ke),0<ne.length&&(ke=new Ld(ke,t,null,r,H),$.push({event:ke,listeners:ne}),me?ke.data=me:(me=Wd(r),me!==null&&(ke.data=me)))),(me=D0?M0(t,r):B0(t,r))&&(ke=Ca(A,"onBeforeInput"),0<ke.length&&(ne=new Ld("onBeforeInput","beforeinput",null,r,H),$.push({event:ne,listeners:ke}),ne.data=me)),xS($,t,A,r,H)}E_($,s)})}function Pn(t,s,r){return{instance:t,listener:s,currentTarget:r}}function Ca(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=cn(t,r),c!=null&&a.unshift(Pn(t,c,u)),c=cn(t,s),c!=null&&a.push(Pn(t,c,u))),t.tag===3)return a;t=t.return}return[]}function ES(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function R_(t,s,r,a,c){for(var u=s._reactName,g=[];r!==null&&r!==a;){var v=r,w=v.alternate,A=v.stateNode;if(v=v.tag,w!==null&&w===a)break;v!==5&&v!==26&&v!==27||A===null||(w=A,c?(A=cn(r,u),A!=null&&g.unshift(Pn(r,A,w))):c||(A=cn(r,u),A!=null&&g.push(Pn(r,A,w)))),r=r.return}g.length!==0&&t.push({event:s,listeners:g})}var TS=/\r\n?/g,RS=/\u0000|\uFFFD/g;function D_(t){return(typeof t=="string"?t:""+t).replace(TS,`
|
|
9
|
+
`).replace(RS,"")}function M_(t,s){return s=D_(s),D_(t)===s}function je(t,s,r,a,c,u){switch(r){case"children":typeof a=="string"?s==="body"||s==="textarea"&&a===""||vr(t,a):(typeof a=="number"||typeof a=="bigint")&&s!=="body"&&vr(t,""+a);break;case"className":Rl(t,"class",a);break;case"tabIndex":Rl(t,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Rl(t,r,a);break;case"style":Dd(t,a,u);break;case"data":if(s!=="object"){Rl(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=Ml(""+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"&&je(t,s,"name",c.name,c,null),je(t,s,"formEncType",c.formEncType,c,null),je(t,s,"formMethod",c.formMethod,c,null),je(t,s,"formTarget",c.formTarget,c,null)):(je(t,s,"encType",c.encType,c,null),je(t,s,"method",c.method,c,null),je(t,s,"target",c.target,c,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(r);break}a=Ml(""+a),t.setAttribute(r,a);break;case"onClick":a!=null&&(t.onclick=Hi);break;case"onScroll":a!=null&&xe("scroll",t);break;case"onScrollEnd":a!=null&&xe("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=Ml(""+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":xe("beforetoggle",t),xe("toggle",t),Tl(t,"popover",a);break;case"xlinkActuate":ji(t,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":ji(t,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":ji(t,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":ji(t,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":ji(t,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":ji(t,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":ji(t,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":ji(t,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":ji(t,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Tl(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=i0.get(r)||r,Tl(t,r,a))}}function gh(t,s,r,a,c,u){switch(r){case"style":Dd(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"?vr(t,a):(typeof a=="number"||typeof a=="bigint")&&vr(t,""+a);break;case"onScroll":a!=null&&xe("scroll",t);break;case"onScrollEnd":a!=null&&xe("scrollend",t);break;case"onClick":a!=null&&(t.onclick=Hi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yd.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[Ot]||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,""):Tl(t,r,a)}}}function Ct(t,s,r){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xe("error",t),xe("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:je(t,s,u,g,r,null)}}c&&je(t,s,"srcSet",r.srcSet,r,null),a&&je(t,s,"src",r.src,r,null);return;case"input":xe("invalid",t);var v=u=g=c=null,w=null,A=null;for(a in r)if(r.hasOwnProperty(a)){var H=r[a];if(H!=null)switch(a){case"name":c=H;break;case"type":g=H;break;case"checked":w=H;break;case"defaultChecked":A=H;break;case"value":u=H;break;case"defaultValue":v=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(l(137,s));break;default:je(t,s,a,H,r,null)}}kd(t,u,v,w,A,g,c,!1);return;case"select":xe("invalid",t),a=g=u=null;for(c in r)if(r.hasOwnProperty(c)&&(v=r[c],v!=null))switch(c){case"value":u=v;break;case"defaultValue":g=v;break;case"multiple":a=v;default:je(t,s,c,v,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":xe("invalid",t),u=c=a=null;for(g in r)if(r.hasOwnProperty(g)&&(v=r[g],v!=null))switch(g){case"value":a=v;break;case"defaultValue":c=v;break;case"children":u=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(l(91));break;default:je(t,s,g,v,r,null)}Td(t,a,c,u);return;case"option":for(w in r)r.hasOwnProperty(w)&&(a=r[w],a!=null)&&(w==="selected"?t.selected=a&&typeof a!="function"&&typeof a!="symbol":je(t,s,w,a,r,null));return;case"dialog":xe("beforetoggle",t),xe("toggle",t),xe("cancel",t),xe("close",t);break;case"iframe":case"object":xe("load",t);break;case"video":case"audio":for(a=0;a<Wn.length;a++)xe(Wn[a],t);break;case"image":xe("error",t),xe("load",t);break;case"details":xe("toggle",t);break;case"embed":case"source":case"link":xe("error",t),xe("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(A in r)if(r.hasOwnProperty(A)&&(a=r[A],a!=null))switch(A){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,s));default:je(t,s,A,a,r,null)}return;default:if(Mo(s)){for(H in r)r.hasOwnProperty(H)&&(a=r[H],a!==void 0&&gh(t,s,H,a,r,void 0));return}}for(v in r)r.hasOwnProperty(v)&&(a=r[v],a!=null&&je(t,s,v,a,r,null))}function DS(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,v=null,w=null,A=null,H=null;for(j in r){var $=r[j];if(r.hasOwnProperty(j)&&$!=null)switch(j){case"checked":break;case"value":break;case"defaultValue":w=$;default:a.hasOwnProperty(j)||je(t,s,j,null,a,$)}}for(var z in a){var j=a[z];if($=r[z],a.hasOwnProperty(z)&&(j!=null||$!=null))switch(z){case"type":u=j;break;case"name":c=j;break;case"checked":A=j;break;case"defaultChecked":H=j;break;case"value":g=j;break;case"defaultValue":v=j;break;case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(l(137,s));break;default:j!==$&&je(t,s,z,j,a,$)}}Ro(t,g,v,w,A,H,u,c);return;case"select":j=g=v=z=null;for(u in r)if(w=r[u],r.hasOwnProperty(u)&&w!=null)switch(u){case"value":break;case"multiple":j=w;default:a.hasOwnProperty(u)||je(t,s,u,null,a,w)}for(c in a)if(u=a[c],w=r[c],a.hasOwnProperty(c)&&(u!=null||w!=null))switch(c){case"value":z=u;break;case"defaultValue":v=u;break;case"multiple":g=u;default:u!==w&&je(t,s,c,u,a,w)}s=v,r=g,a=j,z!=null?mr(t,!!r,z,!1):!!a!=!!r&&(s!=null?mr(t,!!r,s,!0):mr(t,!!r,r?[]:"",!1));return;case"textarea":j=z=null;for(v in r)if(c=r[v],r.hasOwnProperty(v)&&c!=null&&!a.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:je(t,s,v,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":z=c;break;case"defaultValue":j=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(l(91));break;default:c!==u&&je(t,s,g,c,a,u)}Ed(t,z,j);return;case"option":for(var re in r)z=r[re],r.hasOwnProperty(re)&&z!=null&&!a.hasOwnProperty(re)&&(re==="selected"?t.selected=!1:je(t,s,re,null,a,z));for(w in a)z=a[w],j=r[w],a.hasOwnProperty(w)&&z!==j&&(z!=null||j!=null)&&(w==="selected"?t.selected=z&&typeof z!="function"&&typeof z!="symbol":je(t,s,w,z,a,j));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 ce in r)z=r[ce],r.hasOwnProperty(ce)&&z!=null&&!a.hasOwnProperty(ce)&&je(t,s,ce,null,a,z);for(A in a)if(z=a[A],j=r[A],a.hasOwnProperty(A)&&z!==j&&(z!=null||j!=null))switch(A){case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(l(137,s));break;default:je(t,s,A,z,a,j)}return;default:if(Mo(s)){for(var He in r)z=r[He],r.hasOwnProperty(He)&&z!==void 0&&!a.hasOwnProperty(He)&&gh(t,s,He,void 0,a,z);for(H in a)z=a[H],j=r[H],!a.hasOwnProperty(H)||z===j||z===void 0&&j===void 0||gh(t,s,H,z,a,j);return}}for(var D in r)z=r[D],r.hasOwnProperty(D)&&z!=null&&!a.hasOwnProperty(D)&&je(t,s,D,null,a,z);for($ in a)z=a[$],j=r[$],!a.hasOwnProperty($)||z===j||z==null&&j==null||je(t,s,$,z,a,j)}function B_(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function MS(){if(typeof performance.getEntriesByType=="function"){for(var t=0,s=0,r=performance.getEntriesByType("resource"),a=0;a<r.length;a++){var c=r[a],u=c.transferSize,g=c.initiatorType,v=c.duration;if(u&&v&&B_(g)){for(g=0,v=c.responseEnd,a+=1;a<r.length;a++){var w=r[a],A=w.startTime;if(A>v)break;var H=w.transferSize,$=w.initiatorType;H&&B_($)&&(w=w.responseEnd,g+=H*(w<v?1:(v-A)/(w-A)))}if(--a,s+=8*(u+g)/(c.duration/1e3),t++,10<t)break}}if(0<t)return s/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var mh=null,vh=null;function ka(t){return t.nodeType===9?t:t.ownerDocument}function A_(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 z_(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 Sh(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 yh=null;function BS(){var t=window.event;return t&&t.type==="popstate"?t===yh?!1:(yh=t,!0):(yh=null,!1)}var O_=typeof setTimeout=="function"?setTimeout:void 0,AS=typeof clearTimeout=="function"?clearTimeout:void 0,L_=typeof Promise=="function"?Promise:void 0,zS=typeof queueMicrotask=="function"?queueMicrotask:typeof L_<"u"?function(t){return L_.resolve(null).then(t).catch(OS)}:O_;function OS(t){setTimeout(function(){throw t})}function ks(t){return t==="head"}function N_(t,s){var r=s,a=0;do{var c=r.nextSibling;if(t.removeChild(r),c&&c.nodeType===8)if(r=c.data,r==="/$"||r==="/&"){if(a===0){t.removeChild(c),Vr(s);return}a--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")a++;else if(r==="html")Kn(t.ownerDocument.documentElement);else if(r==="head"){r=t.ownerDocument.head,Kn(r);for(var u=r.firstChild;u;){var g=u.nextSibling,v=u.nodeName;u[an]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&u.rel.toLowerCase()==="stylesheet"||r.removeChild(u),u=g}}else r==="body"&&Kn(t.ownerDocument.body);r=c}while(r);Vr(s)}function j_(t,s){var r=t;t=0;do{var a=r.nextSibling;if(r.nodeType===1?s?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(s?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(t===0)break;t--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||t++;r=a}while(r)}function bh(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":bh(r),Eo(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}t.removeChild(r)}}function LS(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[an])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=hi(t.nextSibling),t===null)break}return null}function NS(t,s,r){if(s==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=hi(t.nextSibling),t===null))return null;return t}function H_(t,s){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=hi(t.nextSibling),t===null))return null;return t}function xh(t){return t.data==="$?"||t.data==="$~"}function wh(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function jS(t,s){var r=t.ownerDocument;if(t.data==="$~")t._reactRetry=s;else if(t.data!=="$?"||r.readyState!=="loading")s();else{var a=function(){s(),r.removeEventListener("DOMContentLoaded",a)};r.addEventListener("DOMContentLoaded",a),t._reactRetry=a}}function hi(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==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return t}var Ch=null;function U_(t){t=t.nextSibling;for(var s=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"||r==="/&"){if(s===0)return hi(t.nextSibling);s--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||s++}t=t.nextSibling}return null}function q_(t){t=t.previousSibling;for(var s=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(s===0)return t;s--}else r!=="/$"&&r!=="/&"||s++}t=t.previousSibling}return null}function W_(t,s,r){switch(s=ka(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 Kn(t){for(var s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Eo(t)}var ui=new Map,P_=new Set;function Ea(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var es=P.d;P.d={f:HS,r:US,D:qS,C:WS,L:PS,m:KS,X:$S,S:YS,M:IS};function HS(){var t=es.f(),s=ma();return t||s}function US(t){var s=pr(t);s!==null&&s.tag===5&&s.type==="form"?np(s):es.r(t)}var Ir=typeof document>"u"?null:document;function K_(t,s,r){var a=Ir;if(a&&typeof s=="string"&&s){var c=si(s);c='link[rel="'+t+'"][href="'+c+'"]',typeof r=="string"&&(c+='[crossorigin="'+r+'"]'),P_.has(c)||(P_.add(c),t={rel:t,crossOrigin:r,href:s},a.querySelector(c)===null&&(s=a.createElement("link"),Ct(s,"link",t),ft(s),a.head.appendChild(s)))}}function qS(t){es.D(t),K_("dns-prefetch",t,null)}function WS(t,s){es.C(t,s),K_("preconnect",t,s)}function PS(t,s,r){es.L(t,s,r);var a=Ir;if(a&&t&&s){var c='link[rel="preload"][as="'+si(s)+'"]';s==="image"&&r&&r.imageSrcSet?(c+='[imagesrcset="'+si(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(c+='[imagesizes="'+si(r.imageSizes)+'"]')):c+='[href="'+si(t)+'"]';var u=c;switch(s){case"style":u=Gr(t);break;case"script":u=Xr(t)}ui.has(u)||(t=S({rel:"preload",href:s==="image"&&r&&r.imageSrcSet?void 0:t,as:s},r),ui.set(u,t),a.querySelector(c)!==null||s==="style"&&a.querySelector(Yn(u))||s==="script"&&a.querySelector($n(u))||(s=a.createElement("link"),Ct(s,"link",t),ft(s),a.head.appendChild(s)))}}function KS(t,s){es.m(t,s);var r=Ir;if(r&&t){var a=s&&typeof s.as=="string"?s.as:"script",c='link[rel="modulepreload"][as="'+si(a)+'"][href="'+si(t)+'"]',u=c;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Xr(t)}if(!ui.has(u)&&(t=S({rel:"modulepreload",href:t},s),ui.set(u,t),r.querySelector(c)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector($n(u)))return}a=r.createElement("link"),Ct(a,"link",t),ft(a),r.head.appendChild(a)}}}function YS(t,s,r){es.S(t,s,r);var a=Ir;if(a&&t){var c=_r(a).hoistableStyles,u=Gr(t);s=s||"default";var g=c.get(u);if(!g){var v={loading:0,preload:null};if(g=a.querySelector(Yn(u)))v.loading=5;else{t=S({rel:"stylesheet",href:t,"data-precedence":s},r),(r=ui.get(u))&&kh(t,r);var w=g=a.createElement("link");ft(w),Ct(w,"link",t),w._p=new Promise(function(A,H){w.onload=A,w.onerror=H}),w.addEventListener("load",function(){v.loading|=1}),w.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Ta(g,s,a)}g={type:"stylesheet",instance:g,count:1,state:v},c.set(u,g)}}}function $S(t,s){es.X(t,s);var r=Ir;if(r&&t){var a=_r(r).hoistableScripts,c=Xr(t),u=a.get(c);u||(u=r.querySelector($n(c)),u||(t=S({src:t,async:!0},s),(s=ui.get(c))&&Eh(t,s),u=r.createElement("script"),ft(u),Ct(u,"link",t),r.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(c,u))}}function IS(t,s){es.M(t,s);var r=Ir;if(r&&t){var a=_r(r).hoistableScripts,c=Xr(t),u=a.get(c);u||(u=r.querySelector($n(c)),u||(t=S({src:t,async:!0,type:"module"},s),(s=ui.get(c))&&Eh(t,s),u=r.createElement("script"),ft(u),Ct(u,"link",t),r.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(c,u))}}function Y_(t,s,r,a){var c=(c=he.current)?Ea(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=Gr(r.href),r=_r(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=Gr(r.href);var u=_r(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(Yn(t)))&&!u._p&&(g.instance=u,g.state.loading=5),ui.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},ui.set(t,r),u||GS(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=Xr(r),r=_r(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 Gr(t){return'href="'+si(t)+'"'}function Yn(t){return'link[rel="stylesheet"]['+t+"]"}function $_(t){return S({},t,{"data-precedence":t.precedence,precedence:null})}function GS(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}),Ct(s,"link",r),ft(s),t.head.appendChild(s))}function Xr(t){return'[src="'+si(t)+'"]'}function $n(t){return"script[async]"+t}function I_(t,s,r){if(s.count++,s.instance===null)switch(s.type){case"style":var a=t.querySelector('style[data-href~="'+si(r.href)+'"]');if(a)return s.instance=a,ft(a),a;var c=S({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),ft(a),Ct(a,"style",c),Ta(a,r.precedence,t),s.instance=a;case"stylesheet":c=Gr(r.href);var u=t.querySelector(Yn(c));if(u)return s.state.loading|=4,s.instance=u,ft(u),u;a=$_(r),(c=ui.get(c))&&kh(a,c),u=(t.ownerDocument||t).createElement("link"),ft(u);var g=u;return g._p=new Promise(function(v,w){g.onload=v,g.onerror=w}),Ct(u,"link",a),s.state.loading|=4,Ta(u,r.precedence,t),s.instance=u;case"script":return u=Xr(r.src),(c=t.querySelector($n(u)))?(s.instance=c,ft(c),c):(a=r,(c=ui.get(u))&&(a=S({},r),Eh(a,c)),t=t.ownerDocument||t,c=t.createElement("script"),ft(c),Ct(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,Ta(a,r.precedence,t));return s.instance}function Ta(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 v=a[g];if(v.dataset.precedence===s)u=v;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 kh(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.title==null&&(t.title=s.title)}function Eh(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.integrity==null&&(t.integrity=s.integrity)}var Ra=null;function G_(t,s,r){if(Ra===null){var a=new Map,c=Ra=new Map;c.set(r,a)}else c=Ra,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[an]||u[yt]||t==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var g=u.getAttribute(s)||"";g=t+g;var v=a.get(g);v?v.push(u):a.set(g,[u])}}return a}function X_(t,s,r){t=t.ownerDocument||t,t.head.insertBefore(r,s==="title"?t.querySelector("head > title"):null)}function XS(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;return s.rel==="stylesheet"?(t=s.disabled,typeof s.precedence=="string"&&t==null):!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 V_(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function VS(t,s,r,a){if(r.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var c=Gr(a.href),u=s.querySelector(Yn(c));if(u){s=u._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(t.count++,t=Da.bind(t),s.then(t,t)),r.state.loading|=4,r.instance=u,ft(u);return}u=s.ownerDocument||s,a=$_(a),(c=ui.get(c))&&kh(a,c),u=u.createElement("link"),ft(u);var g=u;g._p=new Promise(function(v,w){g.onload=v,g.onerror=w}),Ct(u,"link",a),r.instance=u}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,s),(s=r.state.preload)&&(r.state.loading&3)===0&&(t.count++,r=Da.bind(t),s.addEventListener("load",r),s.addEventListener("error",r))}}var Th=0;function FS(t,s){return t.stylesheets&&t.count===0&&Ba(t,t.stylesheets),0<t.count||0<t.imgCount?function(r){var a=setTimeout(function(){if(t.stylesheets&&Ba(t,t.stylesheets),t.unsuspend){var u=t.unsuspend;t.unsuspend=null,u()}},6e4+s);0<t.imgBytes&&Th===0&&(Th=62500*MS());var c=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ba(t,t.stylesheets),t.unsuspend)){var u=t.unsuspend;t.unsuspend=null,u()}},(t.imgBytes>Th?50:800)+s);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(a),clearTimeout(c)}}:null}function Da(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ba(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ma=null;function Ba(t,s){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ma=new Map,s.forEach(ZS,t),Ma=null,Da.call(t))}function ZS(t,s){if(!(s.state.loading&4)){var r=Ma.get(t);if(r)var a=r.get(null);else{r=new Map,Ma.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=Da.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 In={$$typeof:N,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function QS(t,s,r,a,c,u,g,v,w){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=xo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xo(0),this.hiddenUpdates=xo(null),this.identifierPrefix=a,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function F_(t,s,r,a,c,u,g,v,w,A,H,$){return t=new QS(t,s,r,g,w,A,H,$,v),s=1,u===!0&&(s|=24),u=It(3,null,null,s),t.current=u,u.stateNode=t,s=lc(),s.refCount++,t.pooledCache=s,s.refCount++,u.memoizedState={element:a,isDehydrated:r,cache:s},hc(u),t}function Z_(t){return t?(t=kr,t):kr}function Q_(t,s,r,a,c,u){c=Z_(c),a.context===null?a.context=c:a.pendingContext=c,a=ps(s),a.payload={element:r},u=u===void 0?null:u,u!==null&&(a.callback=u),r=_s(t,a,s),r!==null&&(qt(r,t,s),Cn(r,t,s))}function J_(t,s){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<s?r:s}}function Rh(t,s){J_(t,s),(t=t.alternate)&&J_(t,s)}function eg(t){if(t.tag===13||t.tag===31){var s=Ps(t,67108864);s!==null&&qt(s,t,67108864),Rh(t,67108864)}}function tg(t){if(t.tag===13||t.tag===31){var s=Zt();s=wo(s);var r=Ps(t,s);r!==null&&qt(r,t,s),Rh(t,s)}}var Aa=!0;function JS(t,s,r,a){var c=T.T;T.T=null;var u=P.p;try{P.p=2,Dh(t,s,r,a)}finally{P.p=u,T.T=c}}function ey(t,s,r,a){var c=T.T;T.T=null;var u=P.p;try{P.p=8,Dh(t,s,r,a)}finally{P.p=u,T.T=c}}function Dh(t,s,r,a){if(Aa){var c=Mh(a);if(c===null)_h(t,s,a,za,r),sg(t,a);else if(iy(c,t,s,r,a))a.stopPropagation();else if(sg(t,a),s&4&&-1<ty.indexOf(t)){for(;c!==null;){var u=pr(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var g=js(u.pendingLanes);if(g!==0){var v=u;for(v.pendingLanes|=2,v.entangledLanes|=2;g;){var w=1<<31-Yt(g);v.entanglements[1]|=w,g&=~w}Ri(u),(Be&6)===0&&(_a=Pt()+500,qn(0))}}break;case 31:case 13:v=Ps(u,2),v!==null&&qt(v,u,2),ma(),Rh(u,2)}if(u=Mh(a),u===null&&_h(t,s,a,za,r),u===c)break;c=u}c!==null&&a.stopPropagation()}else _h(t,s,a,null,r)}}function Mh(t){return t=Ao(t),Bh(t)}var za=null;function Bh(t){if(za=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===31){if(t=_(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 za=t,null}function ig(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(qv()){case cd:return 2;case hd:return 8;case xl:case Wv:return 32;case ud:return 268435456;default:return 32}default:return 32}}var Ah=!1,Es=null,Ts=null,Rs=null,Gn=new Map,Xn=new Map,Ds=[],ty="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 sg(t,s){switch(t){case"focusin":case"focusout":Es=null;break;case"dragenter":case"dragleave":Ts=null;break;case"mouseover":case"mouseout":Rs=null;break;case"pointerover":case"pointerout":Gn.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xn.delete(s.pointerId)}}function Vn(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=pr(s),s!==null&&eg(s)),t):(t.eventSystemFlags|=a,s=t.targetContainers,c!==null&&s.indexOf(c)===-1&&s.push(c),t)}function iy(t,s,r,a,c){switch(s){case"focusin":return Es=Vn(Es,t,s,r,a,c),!0;case"dragenter":return Ts=Vn(Ts,t,s,r,a,c),!0;case"mouseover":return Rs=Vn(Rs,t,s,r,a,c),!0;case"pointerover":var u=c.pointerId;return Gn.set(u,Vn(Gn.get(u)||null,t,s,r,a,c)),!0;case"gotpointercapture":return u=c.pointerId,Xn.set(u,Vn(Xn.get(u)||null,t,s,r,a,c)),!0}return!1}function rg(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,md(t.priority,function(){tg(r)});return}}else if(s===31){if(s=_(r),s!==null){t.blockedOn=s,md(t.priority,function(){tg(r)});return}}else if(s===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Oa(t){if(t.blockedOn!==null)return!1;for(var s=t.targetContainers;0<s.length;){var r=Mh(t.nativeEvent);if(r===null){r=t.nativeEvent;var a=new r.constructor(r.type,r);Bo=a,r.target.dispatchEvent(a),Bo=null}else return s=pr(r),s!==null&&eg(s),t.blockedOn=r,!1;s.shift()}return!0}function ng(t,s,r){Oa(t)&&r.delete(s)}function sy(){Ah=!1,Es!==null&&Oa(Es)&&(Es=null),Ts!==null&&Oa(Ts)&&(Ts=null),Rs!==null&&Oa(Rs)&&(Rs=null),Gn.forEach(ng),Xn.forEach(ng)}function La(t,s){t.blockedOn===s&&(t.blockedOn=null,Ah||(Ah=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,sy)))}var Na=null;function lg(t){Na!==t&&(Na=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Na===t&&(Na=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(Bh(a||r)===null)continue;break}var u=pr(r);u!==null&&(t.splice(s,3),s-=3,Mc(u,{pending:!0,data:c,method:r.method,action:a},a,c))}}))}function Vr(t){function s(w){return La(w,t)}Es!==null&&La(Es,t),Ts!==null&&La(Ts,t),Rs!==null&&La(Rs,t),Gn.forEach(s),Xn.forEach(s);for(var r=0;r<Ds.length;r++){var a=Ds[r];a.blockedOn===t&&(a.blockedOn=null)}for(;0<Ds.length&&(r=Ds[0],r.blockedOn===null);)rg(r),r.blockedOn===null&&Ds.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[Ot]||null;if(typeof u=="function")g||lg(r);else if(g){var v=null;if(u&&u.hasAttribute("formAction")){if(c=u,g=u[Ot]||null)v=g.formAction;else if(Bh(c)!==null)continue}else v=g.action;typeof v=="function"?r[a+1]=v:(r.splice(a,3),a-=3),lg(r)}}}function ag(){function t(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(g){return c=g})},focusReset:"manual",scroll:"manual"})}function s(){c!==null&&(c(),c=null),a||setTimeout(r,20)}function r(){if(!a&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,c=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(r,100),function(){a=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),c!==null&&(c(),c=null)}}}function zh(t){this._internalRoot=t}ja.prototype.render=zh.prototype.render=function(t){var s=this._internalRoot;if(s===null)throw Error(l(409));var r=s.current,a=Zt();Q_(r,a,t,s,null,null)},ja.prototype.unmount=zh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var s=t.containerInfo;Q_(t.current,2,null,t,null,null),ma(),s[dr]=null}};function ja(t){this._internalRoot=t}ja.prototype.unstable_scheduleHydration=function(t){if(t){var s=gd();t={blockedOn:null,target:t,priority:s};for(var r=0;r<Ds.length&&s!==0&&s<Ds[r].priority;r++);Ds.splice(r,0,t),r===0&&rg(t)}};var og=i.version;if(og!=="19.2.4")throw Error(l(527,og,"19.2.4"));P.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=f(s),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var ry={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ha=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ha.isDisabled&&Ha.supportsFiber)try{rn=Ha.inject(ry),Kt=Ha}catch{}}return Zn.createRoot=function(t,s){if(!o(t))throw Error(l(299));var r=!1,a="",c=_p,u=gp,g=mp;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=F_(t,1,!1,null,null,r,a,null,c,u,g,ag),t[dr]=s.current,ph(t),new zh(s)},Zn.hydrateRoot=function(t,s,r){if(!o(t))throw Error(l(299));var a=!1,c="",u=_p,g=gp,v=mp,w=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&&(v=r.onRecoverableError),r.formState!==void 0&&(w=r.formState)),s=F_(t,1,!0,s,r??null,a,c,w,u,g,v,ag),s.context=Z_(null),r=s.current,a=Zt(),a=wo(a),c=ps(a),c.callback=null,_s(r,c,a),r=a,s.current.lanes=r,ln(s,r),Ri(s),t[dr]=s.current,ph(t),new ja(s)},Zn.version="19.2.4",Zn}var vg;function py(){if(vg)return Nh.exports;vg=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(),Nh.exports=fy(),Nh.exports}var _y=py();const xm="claude-portal",Sg="greenhouse-setup",gy=10;function wm(){const e=localStorage.getItem(xm);if(e)try{return JSON.parse(e)}catch{}const i=localStorage.getItem(Sg);if(i)try{const n=JSON.parse(i),l={recentProjects:n.projectDir?[n.projectDir]:[],checklist:{},jobHistory:{}};return Cm(l),localStorage.removeItem(Sg),l}catch{}return{recentProjects:[],checklist:{},jobHistory:{}}}function Cm(e){localStorage.setItem(xm,JSON.stringify(e))}function km(){return wm().recentProjects}function my(e){const i=wm();return i.recentProjects=[e,...i.recentProjects.filter(n=>n!==e)].slice(0,gy),Cm(i),i.recentProjects}const Em=O.createContext(null);function vy({children:e}){const[i,n]=O.useState(null),[l,o]=O.useState(km),[h,d]=O.useState(null),[_,p]=O.useState(null),[f,y]=O.useState(!1),[S,x]=O.useState(!0),[C,b]=O.useState("developer"),R=O.useCallback(te=>{n(te),o(my(te)),d(null),p(null)},[]),M=O.useCallback(()=>{n(null),d(null),p(null),b("developer")},[]),W=O.useCallback((te,N)=>{d(te),p(N)},[]);return m.jsx(Em.Provider,{value:{path:i,recentProjects:l,gitBranch:h,gitRemote:_,terminalConnected:f,serverConnected:S,mode:C,setMode:b,setProjectPath:R,clearProject:M,setGitInfo:W,setTerminalConnected:y,setServerConnected:x},children:e})}function Rt(){const e=O.useContext(Em);if(!e)throw new Error("useProject must be used within ProjectProvider");return e}const Tm=O.createContext(null);function Sy(e){return e.replace(/\x1b\[[?>=!]?[0-9;]*[a-zA-Z]/g,"").replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g,"").replace(/\x1b[()][0-9A-Z]/g,"").replace(/\x1b./g,"").replace(/\r/g,"")}function yy({children:e}){const i=O.useRef(null),[n,l]=O.useState(!1),[o,h]=O.useState([]),d=O.useRef(!1),_=O.useRef(null),p=O.useRef(null),f=O.useRef(null),y=O.useRef(null),S=O.useRef(null),x=O.useRef(null),C=O.useRef(null),b=O.useCallback(U=>{h(X=>{const J=[...X,U];return J.length>100?J.slice(J.length-100):J})},[]),R=O.useCallback((U,X)=>{x.current=U,C.current=X},[]),M=O.useCallback(U=>{const X=i.current;X?.readyState===WebSocket.OPEN&&X.send(JSON.stringify({type:"input",data:U}))},[]),W=O.useCallback(()=>{if(_.current){const U=_.current;_.current=null,setTimeout(()=>M(U+"\r"),300)}},[M]),te=O.useCallback(()=>{d.current||(d.current=!0,l(!0),f.current&&(clearTimeout(f.current),f.current=null),W())},[W]),N=O.useCallback(U=>{d.current?M(U+"\r"):_.current=U},[M]),L=O.useCallback(U=>{i.current&&i.current.close(),f.current&&(clearTimeout(f.current),f.current=null),d.current=!1,l(!1),p.current=null;const X=location.protocol==="https:"?"wss:":"ws:",J=new WebSocket(`${X}//${location.host}/terminal?cwd=${encodeURIComponent(U)}`);return i.current=J,J.onopen=()=>{x.current?.(),setTimeout(()=>{M("claude --dangerously-skip-permissions\r"),p.current=Date.now()},500),f.current=setTimeout(te,15e3)},J.onmessage=ge=>{let we;try{we=JSON.parse(ge.data)}catch{return}if(we.type==="output"){if(we.data&&y.current?.(we.data),!d.current&&p.current&&Date.now()-p.current>2e3){const ue=Sy(we.data||"");(/>\s*$/.test(ue)||ue.includes("What can I help"))&&te()}}else we.type==="exit"?S.current?.():we.type==="error"&&y.current?.(`\r
|
|
10
|
+
[Error: ${we.data||we.message||"Unknown error"}]\r
|
|
11
|
+
`)},J.onclose=()=>C.current?.(),J},[M,te]);return m.jsx(Tm.Provider,{value:{sendPrompt:N,isReady:n,connect:L,wsRef:i,onOutput:y,onExit:S,setConnectionCallbacks:R,outputLines:o,addOutputLine:b},children:e})}function en(){const e=O.useContext(Tm);if(!e)throw new Error("useTerminal must be used within TerminalProvider");return e}async function _i(e,i){try{const n=await fetch(e,i);return n.ok?await n.json():null}catch{return null}}function Rm(e,i){const n=new URL(e,window.location.origin);return i&&n.searchParams.set("projectPath",i),n.toString()}const oo=[{key:"summarize",name:"Summarize",emoji:"📝",description:"Key points & themes",format:"md",category:"understand",prompt:`create a comprehensive summary covering:
|
|
12
12
|
- Key findings and themes
|
|
13
13
|
- Important data points and numbers
|
|
14
14
|
- Decisions and action items mentioned
|
|
@@ -32,8 +32,8 @@ Present findings in a structured format with specific references.`},{key:"transf
|
|
|
32
32
|
Restructure and reformat the information while preserving all key content. If extracting to a table or spreadsheet format, use CSV with the first row as column headers.`}],by=[{key:"understand",label:"Understand",description:"Tell me what's in here"},{key:"create",label:"Create",description:"Make something from this"}],xy=`IMPORTANT: Do NOT modify, move, rename, or delete any of the original files. Only create new files in the output/ directory.
|
|
33
33
|
If you cannot read a file, note it as skipped in the output with the filename and reason.`,wy="If the folder has more files than you can process in one pass, focus on the most relevant files based on their names and types, and note which files were not reviewed.";function Cy(e){const{folderPath:i,templateKey:n,freeformText:l,context:o,fileCount:h}=e,d=n?oo.find(x=>x.key===n):null,_=d?.format||"md",p=new Date().toISOString().slice(0,10),f=d?.key||"output",y=`${i}/output/${f}-${p}.${_}`,S=[xy,""];return h>50&&S.push(wy,""),d&&S.push(`Scan all documents in ${i} and ${d.prompt}`),l&&S.push(d?`
|
|
34
34
|
Also: ${l}`:`Scan all documents in ${i} and ${l}`),o&&S.push("",`Additional instructions: ${o}`),e.styleReference&&(S.push("","Use the following document as a style, tone, and format reference. Match its structure, headings, voice, and level of detail:"),S.push("---BEGIN STYLE REFERENCE---"),S.push(e.styleReference.slice(0,8e3)),S.push("---END STYLE REFERENCE---")),S.push("",`Save the output to ${y}`),S.join(`
|
|
35
|
-
`)}function ky(e){const i=O.useRef(e);i.current=e;const n=O.useRef(null),l=O.useRef(null),o=O.useCallback(()=>{n.current?.close(),n.current=null,l.current&&(clearTimeout(l.current),l.current=null)},[]),h=O.useCallback((d,_)=>{o();const p=`/api/doc-events?folderPath=${encodeURIComponent(d)}`,f=new EventSource(p);n.current=f,f.addEventListener("output-created",y=>{i.current(JSON.parse(y.data)),o()}),l.current=setTimeout(()=>{o(),_()},600*1e3)},[o]);return O.useEffect(()=>o,[o]),{listen:h,close:o}}const Dm=O.createContext(null);function Ey({children:e}){const[i,n]=O.useState(null),[l,o]=O.useState(null),[h,d]=O.useState(!1),[_,p]=O.useState(null),[f,y]=O.useState(""),[S,x]=O.useState(""),[C,b]=O.useState({status:"empty"}),[R,
|
|
36
|
-
`);F=St.pop()??"";for(const ue of St)if(ue.startsWith("data: "))try{const V=JSON.parse(ue.slice(6));V.tool===K&&V.status==="done"&&(Z=!0),V.tool===K&&V.status==="error"&&(Z=!1,V.error&&h(G=>({...G,[K]:V.error})))}catch{}}}Z&&K==="claude"?(S(F=>({...F,[K]:"needs-auth"})),_(K)):S(F=>({...F,[K]:Z?"done":"error"}))}catch{S(A=>({...A,[K]:"error"}))}l(null)}async function b(K){f(K);try{(await fetch("/api/detect").then(H=>H.json())).tools?.find(H=>H.id===K)?.installed?(S(H=>({...H,[K]:"done"})),_(null)):h(H=>({...H,[K]:"Not detected yet — make sure you completed the setup"}))}catch{}f(null)}async function R(){try{await fetch("/api/launch-auth",{method:"POST"})}catch{}}const j=x.every(K=>y[K.id]==="done"),X=K=>{switch(K){case"done":return{symbol:"✓",color:"#22c55e"};case"error":return{symbol:"✗",color:"#ef4444"};case"installing":return{symbol:"⏳",color:"#f59e0b"};case"needs-auth":return{symbol:"🔑",color:"#f59e0b"};default:return{symbol:"○",color:"#9ca3af"}}};return m.jsxs("div",{className:"space-y-4",children:[m.jsx("h2",{style:{fontSize:"20px",fontWeight:600,color:"var(--text-primary)"},children:"Install missing tools"}),m.jsx("p",{style:{fontSize:"14px",color:"var(--text-secondary)",marginTop:"-8px"},children:"We'll help you get everything set up step by step."}),m.jsx("div",{className:"space-y-2",children:x.map(K=>{const A=Dy[K.id],L=X(y[K.id]),H=d===K.id;return m.jsxs("div",{children:[m.jsx("div",{style:{padding:"16px 20px",background:"var(--bg-secondary)",border:"1px solid var(--border)",borderRadius:H?"12px 12px 0 0":"12px",boxShadow:"0 2px 8px rgba(0,0,0,0.04)"},children:m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[m.jsx("span",{style:{color:L.color,fontSize:"16px"},children:L.symbol}),m.jsxs("div",{style:{flex:1},children:[m.jsx("span",{style:{color:"var(--text-primary)",fontSize:"15px",fontWeight:500},children:K.name}),y[K.id]==="needs-auth"&&m.jsx("div",{style:{fontSize:"12px",color:"#f59e0b",marginTop:"2px"},children:"Installed — needs sign-in to activate"})]}),y[K.id]==="pending"&&m.jsxs("div",{style:{display:"flex",gap:"6px"},children:[A&&m.jsx("button",{onClick:()=>_(H?null:K.id),style:{padding:"8px 12px",background:"transparent",color:"#6b7280",fontSize:"12px",fontWeight:500,borderRadius:"8px",border:"1px solid #e5e7eb",cursor:"pointer"},children:"Guide"}),m.jsx("button",{onClick:()=>C(K.id),disabled:n!==null,style:{padding:"8px 16px",background:"#22c55e",color:"#fff",fontSize:"13px",fontWeight:600,borderRadius:"8px",border:"none",cursor:"pointer",opacity:n?.5:1},children:"Install"})]}),y[K.id]==="error"&&m.jsx("button",{onClick:()=>C(K.id),disabled:n!==null,style:{padding:"8px 16px",background:"#ef4444",color:"#fff",fontSize:"13px",fontWeight:600,borderRadius:"8px",border:"none",cursor:"pointer"},children:"Retry"}),y[K.id]==="needs-auth"&&m.jsxs("div",{style:{display:"flex",gap:"6px"},children:[m.jsx("button",{onClick:R,style:{padding:"8px 14px",background:"#5e17eb",color:"#fff",fontSize:"13px",fontWeight:600,borderRadius:"8px",border:"none",cursor:"pointer"},children:"Sign in"}),m.jsx("button",{onClick:()=>b(K.id),disabled:p!==null,style:{padding:"8px 14px",background:"#f3f4f6",color:"#374151",fontSize:"13px",fontWeight:600,borderRadius:"8px",border:"1px solid #e5e7eb",cursor:"pointer"},children:p===K.id?"...":"Verify"})]}),y[K.id]==="installing"&&m.jsx("span",{style:{fontSize:"13px",color:"#f59e0b",fontWeight:500},children:"Installing..."})]})}),H&&A&&m.jsxs("div",{style:{padding:"16px 20px",background:"rgba(94, 23, 235, 0.03)",border:"1px solid var(--border)",borderTop:"none",borderRadius:"0 0 12px 12px"},children:[m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:A.steps.map((Z,F)=>m.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"flex-start"},children:[m.jsx("span",{style:{width:"20px",height:"20px",borderRadius:"50%",background:"#5e17eb",color:"#fff",fontSize:"11px",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:F+1}),m.jsx("span",{style:{fontSize:"13px",color:"var(--text-primary)",lineHeight:1.5},children:Z})]},F))}),A.link&&m.jsxs("a",{href:A.link,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",marginTop:"12px",padding:"8px 16px",background:"#5e17eb",color:"#fff",fontSize:"13px",fontWeight:600,borderRadius:"8px",textDecoration:"none"},children:[A.linkLabel||"Open"," →"]})]}),(y[K.id]==="error"||y[K.id]==="needs-auth")&&o[K.id]&&m.jsx("div",{style:{marginTop:"4px",padding:"8px 12px",background:"rgba(239, 68, 68, 0.08)",borderRadius:"8px",fontSize:"12px",color:"#ef4444",lineHeight:1.4,fontFamily:"monospace",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:o[K.id]})]},K.id)})}),j&&m.jsx("button",{onClick:i,style:{width:"100%",padding:"16px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",color:"#fff",borderRadius:"12px",fontSize:"16px",fontWeight:700,border:"none",cursor:"pointer",boxShadow:"0 4px 12px rgba(94,23,235,0.3)"},children:"Continue →"})]})}function By({onProjectSelected:e,mode:i="developer"}){const n=i==="document",[l,o]=O.useState(n?"open":"choose"),[h,d]=O.useState(""),[_,p]=O.useState(!1),[f,y]=O.useState(""),[S,x]=O.useState(""),[C,b]=O.useState(null),[R,j]=O.useState(!1),X=km();async function K(){if(!f.trim())return;j(!0),b(null);const H=await _i("/api/scaffold",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectName:f.trim()})});H?.projectDir?e(H.projectDir):b("Failed to create project"),j(!1)}async function A(){if(!S.trim())return;j(!0),b(null);const H=await _i("/api/scaffold",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectName:S.trim().split("/").pop()?.replace(/\.git$/,"")||"cloned-repo"})});H?.projectDir?e(H.projectDir):b("Failed to clone repository"),j(!1)}const L={padding:"36px",background:"var(--bg-secondary)",borderRadius:"24px",textAlign:"center",border:"1px solid var(--border)",boxShadow:"0 8px 24px rgba(0,0,0,0.08)",cursor:"pointer",transition:"all 0.3s ease"};return l==="choose"?m.jsxs("div",{className:"animate-in",children:[m.jsx("h2",{style:{fontSize:"28px",fontWeight:700,color:"var(--text-primary)",marginBottom:"8px",textAlign:"center"},children:"Choose a folder"}),m.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"17px",marginBottom:"48px",textAlign:"center"},children:"Where would you like to work?"}),X.length>0&&m.jsxs("div",{style:{marginBottom:"48px"},children:[m.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"16px"},children:"Recent"}),m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:X.map(H=>m.jsx("button",{onClick:()=>e(H),className:"transition-all duration-300 hover:-translate-y-0.5 active:scale-[0.98]",style:{width:"100%",textAlign:"left",padding:"20px 24px",background:"var(--bg-secondary)",borderRadius:"16px",color:"var(--text-primary)",fontSize:"15px",fontFamily:"'SF Mono', Menlo, monospace",border:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,0.06)",cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:H},H))})]}),m.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"20px"},children:[m.jsxs("button",{onClick:async()=>{p(!0);const H=await _i("/api/pick-folder");p(!1),H?.path&&e(H.path)},disabled:_,className:"transition-all duration-300 hover:-translate-y-1 active:scale-[0.97]",style:L,children:[m.jsx("div",{style:{fontSize:"44px",marginBottom:"16px"},children:_?"⏳":"📂"}),m.jsx("div",{style:{color:"var(--text-primary)",fontSize:"16px",fontWeight:700,marginBottom:"6px"},children:_?"Choosing...":"Open existing"}),m.jsx("div",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:"Browse in Finder"})]}),[{m:"create",icon:"✨",label:"Create new",desc:"Start from scratch"},{m:"clone",icon:"📦",label:"Clone repo",desc:"From GitHub"}].map(({m:H,icon:Z,label:F,desc:pe})=>m.jsxs("button",{onClick:()=>o(H),className:"transition-all duration-300 hover:-translate-y-1 active:scale-[0.97]",style:L,children:[m.jsx("div",{style:{fontSize:"44px",marginBottom:"16px"},children:Z}),m.jsx("div",{style:{color:"var(--text-primary)",fontSize:"16px",fontWeight:700,marginBottom:"6px"},children:F}),m.jsx("div",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:pe})]},H))]}),m.jsx("div",{style:{marginTop:"28px",textAlign:"center"},children:m.jsx("button",{onClick:()=>o("open"),className:"transition-colors",style:{color:"var(--text-secondary)",fontSize:"14px",background:"none",border:"none",cursor:"pointer"},children:"Or enter a path manually →"})})]}):m.jsxs("div",{className:"animate-in",children:[!n&&m.jsx("button",{onClick:()=>o("choose"),className:"text-[var(--text-secondary)] text-base hover:text-[var(--text-primary)] transition-colors mb-8 block",children:"← Back"}),l==="open"&&m.jsxs("div",{children:[m.jsx("h2",{style:{fontSize:"28px",fontWeight:700,color:"var(--text-primary)",marginBottom:"8px"},children:n?"What folder can Claude find your work?":"Open existing project"}),m.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"17px",marginBottom:"40px"},children:n?"Browse to the folder with your documents.":"Enter the path to your project."}),n?m.jsx("button",{onClick:async()=>{p(!0);const H=await _i("/api/pick-folder");p(!1),H?.path&&e(H.path)},disabled:_,className:"w-full hover:-translate-y-0.5 transition-all active:scale-[0.98]",style:{padding:"20px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",color:"white",borderRadius:"16px",fontSize:"18px",fontWeight:700,border:"none",cursor:"pointer",boxShadow:"0 4px 12px rgba(94,23,235,0.3)",marginBottom:"40px"},children:_?"⏳ Choosing...":"📂 Browse for folder"}):m.jsxs(m.Fragment,{children:[m.jsx("input",{type:"text",value:h,onChange:H=>d(H.target.value),placeholder:"/path/to/your/project",autoFocus:!0,className:"w-full focus:outline-none transition-all",style:{padding:"20px 24px",background:"var(--bg-secondary)",border:"1px solid var(--border)",borderRadius:"16px",color:"var(--text-primary)",fontFamily:"'SF Mono', Menlo, monospace",fontSize:"15px",boxShadow:"0 4px 12px rgba(0,0,0,0.06)",marginBottom:"16px"}}),m.jsx("button",{onClick:()=>h.trim()&&e(h.trim()),disabled:!h.trim(),className:"w-full hover:-translate-y-0.5 disabled:opacity-30 transition-all active:scale-[0.98]",style:{padding:"20px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",color:"white",borderRadius:"16px",fontSize:"18px",fontWeight:700,border:"none",cursor:"pointer",boxShadow:"0 4px 12px rgba(94,23,235,0.3)",marginBottom:"40px"},children:"Open project"})]}),n&&X.length>0&&m.jsxs("div",{style:{marginTop:n?"0":"40px"},children:[m.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"16px"},children:"Recent"}),m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:X.map(H=>m.jsx("button",{onClick:()=>e(H),className:"transition-all duration-200 hover:-translate-y-0.5 active:scale-[0.98]",style:{width:"100%",textAlign:"left",padding:"20px 24px",background:"var(--bg-secondary)",borderRadius:"16px",color:"var(--text-primary)",fontSize:"15px",fontFamily:"'SF Mono', Menlo, monospace",border:"1px solid var(--border)",cursor:"pointer",boxShadow:"0 4px 12px rgba(0,0,0,0.06)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:H},H))})]})]}),l==="create"&&m.jsxs("div",{className:"space-y-6",children:[m.jsx("h2",{className:"text-2xl font-bold text-[var(--text-primary)]",children:"Create new project"}),m.jsx("input",{type:"text",value:f,onChange:H=>y(H.target.value),placeholder:"my-app",autoFocus:!0,className:"w-full px-6 py-5 bg-[var(--bg-secondary)] border border-[var(--border)] rounded-xl text-[var(--text-primary)] font-mono text-base placeholder:text-[#86868b] focus:outline-none focus:border-[#5e17eb]/50 focus:ring-2 focus:ring-[#5e17eb]/10 transition-all",style:{boxShadow:"0 4px 12px rgba(0,0,0,0.06)"}}),m.jsx("button",{onClick:K,disabled:!f.trim()||R,className:"w-full py-5 bg-gradient-to-r from-[#5e17eb] to-[#8b5cf6] text-white rounded-xl text-lg font-bold hover:-translate-y-0.5 disabled:opacity-30 transition-all active:scale-[0.98]",style:{boxShadow:"0 4px 12px rgba(94,23,235,0.3)"},children:R?"Creating...":"Create project"})]}),l==="clone"&&m.jsxs("div",{className:"space-y-6",children:[m.jsx("h2",{className:"text-2xl font-bold text-[var(--text-primary)]",children:"Clone from GitHub"}),m.jsx("input",{type:"text",value:S,onChange:H=>x(H.target.value),placeholder:"https://github.com/user/repo",autoFocus:!0,className:"w-full px-6 py-5 bg-[var(--bg-secondary)] border border-[var(--border)] rounded-xl text-[var(--text-primary)] font-mono text-base placeholder:text-[#86868b] focus:outline-none focus:border-[#5e17eb]/50 focus:ring-2 focus:ring-[#5e17eb]/10 transition-all",style:{boxShadow:"0 4px 12px rgba(0,0,0,0.06)"}}),m.jsx("button",{onClick:A,disabled:!S.trim()||R,className:"w-full py-5 bg-gradient-to-r from-[#5e17eb] to-[#8b5cf6] text-white rounded-xl text-lg font-bold hover:-translate-y-0.5 disabled:opacity-30 transition-all active:scale-[0.98]",style:{boxShadow:"0 4px 12px rgba(94,23,235,0.3)"},children:R?"Cloning...":"Clone repository"})]}),C&&m.jsx("p",{className:"text-[#ff453a] text-base bg-[#ff453a]/10 px-6 py-4 rounded-xl mt-6",children:C})]})}const qh=[{type:"image-text",title:"Most people:",content:"See a terminal and think...",imageUrl:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExMG0wamx1NWUwOGcxN2F6ejBva3p3OW5peG5qdWlrcjI1d3JyM2l0dyZlcD12MV9naWZzX3NlYXJjaCZjdD1n/NRXleEopnqL3a/giphy.gif"},{type:"text",title:"What is a terminal?",content:"Terminal = using our computer without the mouse"},{type:"text",title:"The magic of Claude Code",content:`Once we set it up, we're no longer actually talking directly to our computer.
|
|
35
|
+
`)}function ky(e){const i=O.useRef(e);i.current=e;const n=O.useRef(null),l=O.useRef(null),o=O.useCallback(()=>{n.current?.close(),n.current=null,l.current&&(clearTimeout(l.current),l.current=null)},[]),h=O.useCallback((d,_)=>{o();const p=`/api/doc-events?folderPath=${encodeURIComponent(d)}`,f=new EventSource(p);n.current=f,f.addEventListener("output-created",y=>{i.current(JSON.parse(y.data)),o()}),l.current=setTimeout(()=>{o(),_()},600*1e3)},[o]);return O.useEffect(()=>o,[o]),{listen:h,close:o}}const Dm=O.createContext(null);function Ey({children:e}){const[i,n]=O.useState(null),[l,o]=O.useState(null),[h,d]=O.useState(!1),[_,p]=O.useState(null),[f,y]=O.useState(""),[S,x]=O.useState(""),[C,b]=O.useState({status:"empty"}),[R,M]=O.useState(null),[W,te]=O.useState(!1),{sendPrompt:N}=en(),{path:L,mode:U}=Rt(),X=O.useCallback(async ue=>{let V=await _i(`/api/read-output?path=${encodeURIComponent(ue)}`);V||(V=await _i(`/api/read-file?path=${encodeURIComponent(ue)}`)),V?(b({status:"complete",...V}),te(!1)):(b({status:"error",message:"Failed to load file"}),te(!1))},[]),J=ky(ue=>X(ue.path)),ge=O.useCallback(async ue=>{n(ue),d(!0);const V=await _i(`/api/folder-scan?folderPath=${encodeURIComponent(ue)}`);o(V||null),d(!1)},[]);O.useEffect(()=>{U==="document"&&L&&!i&&ge(L)},[U,L,i,ge]);const we=O.useCallback(()=>{n(null),o(null),b({status:"empty"}),te(!1),J.close()},[J]),Qe=O.useCallback(async()=>{if(W||!i||!_&&!f.trim())return;if(te(!0),!(await fetch(`/api/ensure-output-dir?folderPath=${encodeURIComponent(i)}`,{method:"POST"})).ok){b({status:"error",message:"Failed to create output directory"}),te(!1);return}const V=l?.summary.total||0,G=Cy({folderPath:i,templateKey:_||void 0,freeformText:f.trim()||void 0,context:S.trim()||void 0,styleReference:R||void 0,fileCount:V}),ie=_?oo.find(Q=>Q.key===_)?.name||_:"Custom";b({status:"processing",outcome:ie,fileCount:V}),J.listen(i,()=>{b({status:"error",message:"Timed out waiting for output. Check the terminal for details, or try again with fewer files."}),te(!1)}),N(G)},[W,i,_,f,S,R,l,N,J]);return m.jsx(Dm.Provider,{value:{folderPath:i,folderScan:l,scanLoading:h,scanFolder:ge,clearFolder:we,selectedOutcome:_,setSelectedOutcome:p,freeformText:f,setFreeformText:y,contextText:S,setContextText:x,styleExampleContent:R,setStyleExampleContent:M,output:C,run:Qe,loadOutput:X,canRun:!!i&&(!!_||!!f.trim())&&!W,isRunning:W},children:e})}function Ni(){const e=O.useContext(Dm);if(!e)throw new Error("useDocModeContext must be used within DocModeProvider");return e}function Ty(){const{path:e,setGitInfo:i}=Rt();O.useEffect(()=>{e&&_i(Rm("/api/project-info",e)).then(n=>{n&&i(n.gitBranch,n.gitRemote)})},[e,i])}function Ry({onAllReady:e,onNeedInstall:i}){const[n,l]=O.useState([]),[o,h]=O.useState(!0);O.useEffect(()=>{d()},[]);async function d(){h(!0);const _=await _i("/api/detect");_&&(l(_.tools),_.tools.filter(f=>f.required&&!f.installed).length===0?setTimeout(e,600):i(_.tools)),h(!1)}return m.jsxs("div",{className:"text-center",children:[m.jsx("h2",{className:"text-2xl font-bold text-[var(--text-primary)] mb-3",children:"Getting things ready..."}),m.jsx("p",{className:"text-[var(--text-secondary)] text-base mb-10",children:"Checking what's installed on your machine"}),o?m.jsxs("div",{className:"flex items-center justify-center gap-4 text-[var(--text-secondary)] text-base",children:[m.jsx("div",{className:"w-6 h-6 border-2 border-[#5e17eb]/30 border-t-[#5e17eb] rounded-full animate-spin"}),m.jsx("span",{children:"Scanning..."})]}):m.jsx("div",{className:"space-y-3 text-left",children:n.map(_=>m.jsxs("div",{className:"flex items-center gap-5 px-6 py-5 bg-[var(--bg-secondary)] rounded-2xl border border-[var(--border)]",style:{boxShadow:"0 4px 12px rgba(0,0,0,0.06)"},children:[m.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-base font-bold ${_.installed?"bg-[#30d158]/15 text-[#30d158]":"bg-[#ff453a]/15 text-[#ff453a]"}`,children:_.installed?"✓":"✗"}),m.jsx("span",{className:"text-[var(--text-primary)] text-lg font-semibold",children:_.name}),_.version&&m.jsx("span",{className:"text-[var(--text-secondary)] text-sm font-mono ml-auto",children:_.version})]},_.name))})]})}const Dy={node:{steps:["Download from nodejs.org (LTS recommended)","Run the installer and follow the prompts","Restart your terminal after installing"],link:"https://nodejs.org",linkLabel:"Download Node.js"},npm:{steps:["npm comes bundled with Node.js","Install Node.js first and npm will be included"]},claude:{steps:["Click Install below to download Claude Code","Once installed, you'll sign in when the terminal opens"]}};function My({tools:e,onDone:i}){const[n,l]=O.useState(null),[o,h]=O.useState({}),[d,_]=O.useState(null),[p,f]=O.useState(null),[y,S]=O.useState(()=>{const M={};for(const W of e)M[W.id]=W.installed?"done":"pending";return M}),x=e.filter(M=>!M.installed&&M.required);async function C(M){l(M),S(W=>({...W,[M]:"installing"})),h(W=>{const te={...W};return delete te[M],te});try{const W=await fetch(`/api/install/${encodeURIComponent(M)}`,{method:"POST"});if(!W.ok){const U=await W.text().catch(()=>"Server error");h(X=>({...X,[M]:`Install failed (${W.status}): ${U}`})),S(X=>({...X,[M]:"error"})),l(null);return}const te=W.body?.getReader(),N=new TextDecoder;let L=!1;if(te){let U="";for(;;){const{done:X,value:J}=await te.read();if(X)break;U+=N.decode(J,{stream:!0});const ge=U.split(`
|
|
36
|
+
`);U=ge.pop()??"";for(const we of ge)if(we.startsWith("data: "))try{const Qe=JSON.parse(we.slice(6));Qe.tool===M&&Qe.status==="done"&&(L=!0),Qe.tool===M&&Qe.status==="error"&&(L=!1,Qe.error&&h(ue=>({...ue,[M]:Qe.error})))}catch{}}}S(U=>({...U,[M]:L?"done":"error"}))}catch{S(W=>({...W,[M]:"error"}))}l(null)}const b=x.every(M=>y[M.id]==="done"),R=M=>{switch(M){case"done":return{symbol:"✓",color:"#22c55e"};case"error":return{symbol:"✗",color:"#ef4444"};case"installing":return{symbol:"⏳",color:"#f59e0b"};default:return{symbol:"○",color:"#9ca3af"}}};return m.jsxs("div",{className:"space-y-4",children:[m.jsx("h2",{style:{fontSize:"20px",fontWeight:600,color:"var(--text-primary)"},children:"Install missing tools"}),m.jsx("p",{style:{fontSize:"14px",color:"var(--text-secondary)",marginTop:"-8px"},children:"We'll help you get everything set up step by step."}),m.jsx("div",{className:"space-y-2",children:x.map(M=>{const W=Dy[M.id],te=R(y[M.id]),N=d===M.id;return m.jsxs("div",{children:[m.jsx("div",{style:{padding:"16px 20px",background:"var(--bg-secondary)",border:"1px solid var(--border)",borderRadius:N?"12px 12px 0 0":"12px",boxShadow:"0 2px 8px rgba(0,0,0,0.04)"},children:m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[m.jsx("span",{style:{color:te.color,fontSize:"16px"},children:te.symbol}),m.jsx("div",{style:{flex:1},children:m.jsx("span",{style:{color:"var(--text-primary)",fontSize:"15px",fontWeight:500},children:M.name})}),y[M.id]==="pending"&&m.jsxs("div",{style:{display:"flex",gap:"6px"},children:[W&&m.jsx("button",{onClick:()=>_(N?null:M.id),style:{padding:"8px 12px",background:"transparent",color:"#6b7280",fontSize:"12px",fontWeight:500,borderRadius:"8px",border:"1px solid #e5e7eb",cursor:"pointer"},children:"Guide"}),m.jsx("button",{onClick:()=>C(M.id),disabled:n!==null,style:{padding:"8px 16px",background:"#22c55e",color:"#fff",fontSize:"13px",fontWeight:600,borderRadius:"8px",border:"none",cursor:"pointer",opacity:n?.5:1},children:"Install"})]}),y[M.id]==="error"&&m.jsx("button",{onClick:()=>C(M.id),disabled:n!==null,style:{padding:"8px 16px",background:"#ef4444",color:"#fff",fontSize:"13px",fontWeight:600,borderRadius:"8px",border:"none",cursor:"pointer"},children:"Retry"}),y[M.id]==="installing"&&m.jsx("span",{style:{fontSize:"13px",color:"#f59e0b",fontWeight:500},children:"Installing..."})]})}),N&&W&&m.jsxs("div",{style:{padding:"16px 20px",background:"rgba(94, 23, 235, 0.03)",border:"1px solid var(--border)",borderTop:"none",borderRadius:"0 0 12px 12px"},children:[m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:W.steps.map((L,U)=>m.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"flex-start"},children:[m.jsx("span",{style:{width:"20px",height:"20px",borderRadius:"50%",background:"#5e17eb",color:"#fff",fontSize:"11px",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:U+1}),m.jsx("span",{style:{fontSize:"13px",color:"var(--text-primary)",lineHeight:1.5},children:L})]},U))}),W.link&&m.jsxs("a",{href:W.link,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",marginTop:"12px",padding:"8px 16px",background:"#5e17eb",color:"#fff",fontSize:"13px",fontWeight:600,borderRadius:"8px",textDecoration:"none"},children:[W.linkLabel||"Open"," →"]})]}),y[M.id]==="error"&&o[M.id]&&m.jsx("div",{style:{marginTop:"4px",padding:"8px 12px",background:"rgba(239, 68, 68, 0.08)",borderRadius:"8px",fontSize:"12px",color:"#ef4444",lineHeight:1.4,fontFamily:"monospace",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:o[M.id]})]},M.id)})}),b&&m.jsx("button",{onClick:i,style:{width:"100%",padding:"16px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",color:"#fff",borderRadius:"12px",fontSize:"16px",fontWeight:700,border:"none",cursor:"pointer",boxShadow:"0 4px 12px rgba(94,23,235,0.3)"},children:"Continue →"})]})}function By({onProjectSelected:e,mode:i="developer"}){const n=i==="document",[l,o]=O.useState(n?"open":"choose"),[h,d]=O.useState(""),[_,p]=O.useState(!1),[f,y]=O.useState(""),[S,x]=O.useState(""),[C,b]=O.useState(null),[R,M]=O.useState(!1),W=km();async function te(){if(!f.trim())return;M(!0),b(null);const U=await _i("/api/scaffold",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectName:f.trim()})});U?.projectDir?e(U.projectDir):b("Failed to create project"),M(!1)}async function N(){if(!S.trim())return;M(!0),b(null);const U=await _i("/api/scaffold",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectName:S.trim().split("/").pop()?.replace(/\.git$/,"")||"cloned-repo"})});U?.projectDir?e(U.projectDir):b("Failed to clone repository"),M(!1)}const L={padding:"36px",background:"var(--bg-secondary)",borderRadius:"24px",textAlign:"center",border:"1px solid var(--border)",boxShadow:"0 8px 24px rgba(0,0,0,0.08)",cursor:"pointer",transition:"all 0.3s ease"};return l==="choose"?m.jsxs("div",{className:"animate-in",children:[m.jsx("h2",{style:{fontSize:"28px",fontWeight:700,color:"var(--text-primary)",marginBottom:"8px",textAlign:"center"},children:"Choose a folder"}),m.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"17px",marginBottom:"48px",textAlign:"center"},children:"Where would you like to work?"}),W.length>0&&m.jsxs("div",{style:{marginBottom:"48px"},children:[m.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"16px"},children:"Recent"}),m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:W.map(U=>m.jsx("button",{onClick:()=>e(U),className:"transition-all duration-300 hover:-translate-y-0.5 active:scale-[0.98]",style:{width:"100%",textAlign:"left",padding:"20px 24px",background:"var(--bg-secondary)",borderRadius:"16px",color:"var(--text-primary)",fontSize:"15px",fontFamily:"'SF Mono', Menlo, monospace",border:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,0.06)",cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:U},U))})]}),m.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"20px"},children:[m.jsxs("button",{onClick:async()=>{p(!0);const U=await _i("/api/pick-folder");p(!1),U?.path&&e(U.path)},disabled:_,className:"transition-all duration-300 hover:-translate-y-1 active:scale-[0.97]",style:L,children:[m.jsx("div",{style:{fontSize:"44px",marginBottom:"16px"},children:_?"⏳":"📂"}),m.jsx("div",{style:{color:"var(--text-primary)",fontSize:"16px",fontWeight:700,marginBottom:"6px"},children:_?"Choosing...":"Open existing"}),m.jsx("div",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:"Browse in Finder"})]}),[{m:"create",icon:"✨",label:"Create new",desc:"Start from scratch"},{m:"clone",icon:"📦",label:"Clone repo",desc:"From GitHub"}].map(({m:U,icon:X,label:J,desc:ge})=>m.jsxs("button",{onClick:()=>o(U),className:"transition-all duration-300 hover:-translate-y-1 active:scale-[0.97]",style:L,children:[m.jsx("div",{style:{fontSize:"44px",marginBottom:"16px"},children:X}),m.jsx("div",{style:{color:"var(--text-primary)",fontSize:"16px",fontWeight:700,marginBottom:"6px"},children:J}),m.jsx("div",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:ge})]},U))]}),m.jsx("div",{style:{marginTop:"28px",textAlign:"center"},children:m.jsx("button",{onClick:()=>o("open"),className:"transition-colors",style:{color:"var(--text-secondary)",fontSize:"14px",background:"none",border:"none",cursor:"pointer"},children:"Or enter a path manually →"})})]}):m.jsxs("div",{className:"animate-in",children:[!n&&m.jsx("button",{onClick:()=>o("choose"),className:"text-[var(--text-secondary)] text-base hover:text-[var(--text-primary)] transition-colors mb-8 block",children:"← Back"}),l==="open"&&m.jsxs("div",{children:[m.jsx("h2",{style:{fontSize:"28px",fontWeight:700,color:"var(--text-primary)",marginBottom:"8px"},children:n?"What folder can Claude find your work?":"Open existing project"}),m.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"17px",marginBottom:"40px"},children:n?"Browse to the folder with your documents.":"Enter the path to your project."}),n?m.jsx("button",{onClick:async()=>{p(!0);const U=await _i("/api/pick-folder");p(!1),U?.path&&e(U.path)},disabled:_,className:"w-full hover:-translate-y-0.5 transition-all active:scale-[0.98]",style:{padding:"20px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",color:"white",borderRadius:"16px",fontSize:"18px",fontWeight:700,border:"none",cursor:"pointer",boxShadow:"0 4px 12px rgba(94,23,235,0.3)",marginBottom:"40px"},children:_?"⏳ Choosing...":"📂 Browse for folder"}):m.jsxs(m.Fragment,{children:[m.jsx("input",{type:"text",value:h,onChange:U=>d(U.target.value),placeholder:"/path/to/your/project",autoFocus:!0,className:"w-full focus:outline-none transition-all",style:{padding:"20px 24px",background:"var(--bg-secondary)",border:"1px solid var(--border)",borderRadius:"16px",color:"var(--text-primary)",fontFamily:"'SF Mono', Menlo, monospace",fontSize:"15px",boxShadow:"0 4px 12px rgba(0,0,0,0.06)",marginBottom:"16px"}}),m.jsx("button",{onClick:()=>h.trim()&&e(h.trim()),disabled:!h.trim(),className:"w-full hover:-translate-y-0.5 disabled:opacity-30 transition-all active:scale-[0.98]",style:{padding:"20px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",color:"white",borderRadius:"16px",fontSize:"18px",fontWeight:700,border:"none",cursor:"pointer",boxShadow:"0 4px 12px rgba(94,23,235,0.3)",marginBottom:"40px"},children:"Open project"})]}),n&&W.length>0&&m.jsxs("div",{style:{marginTop:n?"0":"40px"},children:[m.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"16px"},children:"Recent"}),m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:W.map(U=>m.jsx("button",{onClick:()=>e(U),className:"transition-all duration-200 hover:-translate-y-0.5 active:scale-[0.98]",style:{width:"100%",textAlign:"left",padding:"20px 24px",background:"var(--bg-secondary)",borderRadius:"16px",color:"var(--text-primary)",fontSize:"15px",fontFamily:"'SF Mono', Menlo, monospace",border:"1px solid var(--border)",cursor:"pointer",boxShadow:"0 4px 12px rgba(0,0,0,0.06)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:U},U))})]})]}),l==="create"&&m.jsxs("div",{className:"space-y-6",children:[m.jsx("h2",{className:"text-2xl font-bold text-[var(--text-primary)]",children:"Create new project"}),m.jsx("input",{type:"text",value:f,onChange:U=>y(U.target.value),placeholder:"my-app",autoFocus:!0,className:"w-full px-6 py-5 bg-[var(--bg-secondary)] border border-[var(--border)] rounded-xl text-[var(--text-primary)] font-mono text-base placeholder:text-[#86868b] focus:outline-none focus:border-[#5e17eb]/50 focus:ring-2 focus:ring-[#5e17eb]/10 transition-all",style:{boxShadow:"0 4px 12px rgba(0,0,0,0.06)"}}),m.jsx("button",{onClick:te,disabled:!f.trim()||R,className:"w-full py-5 bg-gradient-to-r from-[#5e17eb] to-[#8b5cf6] text-white rounded-xl text-lg font-bold hover:-translate-y-0.5 disabled:opacity-30 transition-all active:scale-[0.98]",style:{boxShadow:"0 4px 12px rgba(94,23,235,0.3)"},children:R?"Creating...":"Create project"})]}),l==="clone"&&m.jsxs("div",{className:"space-y-6",children:[m.jsx("h2",{className:"text-2xl font-bold text-[var(--text-primary)]",children:"Clone from GitHub"}),m.jsx("input",{type:"text",value:S,onChange:U=>x(U.target.value),placeholder:"https://github.com/user/repo",autoFocus:!0,className:"w-full px-6 py-5 bg-[var(--bg-secondary)] border border-[var(--border)] rounded-xl text-[var(--text-primary)] font-mono text-base placeholder:text-[#86868b] focus:outline-none focus:border-[#5e17eb]/50 focus:ring-2 focus:ring-[#5e17eb]/10 transition-all",style:{boxShadow:"0 4px 12px rgba(0,0,0,0.06)"}}),m.jsx("button",{onClick:N,disabled:!S.trim()||R,className:"w-full py-5 bg-gradient-to-r from-[#5e17eb] to-[#8b5cf6] text-white rounded-xl text-lg font-bold hover:-translate-y-0.5 disabled:opacity-30 transition-all active:scale-[0.98]",style:{boxShadow:"0 4px 12px rgba(94,23,235,0.3)"},children:R?"Cloning...":"Clone repository"})]}),C&&m.jsx("p",{className:"text-[#ff453a] text-base bg-[#ff453a]/10 px-6 py-4 rounded-xl mt-6",children:C})]})}const qh=[{type:"image-text",title:"Most people:",content:"See a terminal and think...",imageUrl:"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExMG0wamx1NWUwOGcxN2F6ejBva3p3OW5peG5qdWlrcjI1d3JyM2l0dyZlcD12MV9naWZzX3NlYXJjaCZjdD1n/NRXleEopnqL3a/giphy.gif"},{type:"text",title:"What is a terminal?",content:"Terminal = using our computer without the mouse"},{type:"text",title:"The magic of Claude Code",content:`Once we set it up, we're no longer actually talking directly to our computer.
|
|
37
37
|
|
|
38
38
|
We're talking to Claude.
|
|
39
39
|
|
|
@@ -48,27 +48,27 @@ Better inputs = Better outputs.
|
|
|
48
48
|
Claude Code enables you to provide better inputs faster by accessing the folder with your work.`}];function Mm({onClose:e}){const[i,n]=O.useState(0),l=qh[i],o=i===qh.length-1;return m.jsxs("div",{style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",animation:"fadeIn 0.3s ease"},onClick:e,children:[m.jsxs("div",{style:{width:"90%",maxWidth:"800px",maxHeight:"85vh",background:"#f5f5f5",borderRadius:"24px",overflow:"hidden",position:"relative",boxShadow:"0 24px 64px rgba(0,0,0,0.3)"},onClick:h=>h.stopPropagation(),children:[m.jsx("button",{onClick:e,style:{position:"absolute",top:"16px",right:"16px",zIndex:10,width:"36px",height:"36px",borderRadius:"50%",background:"rgba(0,0,0,0.08)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"18px",color:"#666",transition:"background 0.15s"},children:"✕"}),m.jsxs("div",{style:{padding:"60px 48px 40px",minHeight:"420px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"},children:[l.type==="image-text"&&m.jsxs(m.Fragment,{children:[m.jsx("h2",{style:{fontSize:"32px",fontWeight:800,color:"#212529",marginBottom:"32px"},children:l.title}),m.jsxs("div",{style:{display:"flex",gap:"24px",alignItems:"center",justifyContent:"center",flexWrap:"wrap"},children:[m.jsx("div",{style:{width:"280px",height:"200px",background:"#1a1a2e",borderRadius:"12px",display:"flex",alignItems:"flex-start",padding:"16px",fontFamily:"'SF Mono', Menlo, monospace",fontSize:"12px",color:"#888",boxShadow:"0 8px 24px rgba(0,0,0,0.15)"},children:m.jsxs("div",{children:[m.jsx("div",{style:{color:"#666",marginBottom:"4px"},children:"Last login: Mon Mar 9"}),m.jsxs("div",{style:{color:"#888"},children:["nichurrell ~ %",m.jsx("span",{style:{animation:"blink 1s infinite"},children:"▋"})]})]})}),m.jsx("img",{src:l.imageUrl,alt:"Reaction",style:{width:"240px",borderRadius:"12px",boxShadow:"0 8px 24px rgba(0,0,0,0.15)"}})]})]}),l.type==="text"&&m.jsxs(m.Fragment,{children:[m.jsx("h2",{style:{fontSize:"28px",fontWeight:800,color:"#212529",marginBottom:"28px"},children:l.title}),m.jsx("p",{style:{fontSize:"22px",fontWeight:700,color:"#212529",lineHeight:1.6,maxWidth:"600px",whiteSpace:"pre-line"},children:l.content})]}),l.type==="diagram"&&m.jsxs(m.Fragment,{children:[m.jsx("h2",{style:{fontSize:"28px",fontWeight:800,color:"#212529",marginBottom:"32px",fontStyle:"italic"},children:l.title}),m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px",marginBottom:"32px"},children:[m.jsx("div",{style:{width:"100px",height:"100px",borderRadius:"50%",border:"4px solid #212529",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"18px",fontWeight:800,color:"#212529"},children:"START"}),m.jsx("span",{style:{fontSize:"28px",color:"#212529"},children:"→"}),m.jsx("div",{style:{width:"120px",height:"80px",borderRadius:"12px",border:"4px solid #212529",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"24px",fontWeight:800,color:"#212529",background:"rgba(94,23,235,0.05)"},children:"AI"}),m.jsx("span",{style:{fontSize:"28px",color:"#212529"},children:"→"}),m.jsx("div",{style:{width:"100px",height:"100px",borderRadius:"50%",border:"4px solid #212529",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"18px",fontWeight:800,color:"#212529"},children:"END"})]}),m.jsx("p",{style:{fontSize:"22px",fontWeight:700,color:"#212529"},children:l.content})]})]}),m.jsxs("div",{style:{padding:"20px 48px 32px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[m.jsx("div",{style:{display:"flex",gap:"8px"},children:qh.map((h,d)=>m.jsx("button",{onClick:()=>n(d),style:{width:d===i?"24px":"8px",height:"8px",borderRadius:"4px",border:"none",cursor:"pointer",background:d===i?"#5e17eb":"#ddd",transition:"all 0.3s"}},d))}),m.jsxs("div",{style:{display:"flex",gap:"12px"},children:[i>0&&m.jsx("button",{onClick:()=>n(i-1),style:{padding:"12px 24px",borderRadius:"12px",background:"white",border:"1px solid #e9ecef",fontSize:"15px",fontWeight:600,color:"#495057",cursor:"pointer",transition:"all 0.2s"},children:"← Back"}),m.jsx("button",{onClick:()=>o?e():n(i+1),style:{padding:"12px 32px",borderRadius:"12px",background:o?"linear-gradient(135deg, #5e17eb, #8b5cf6)":"#212529",border:"none",fontSize:"15px",fontWeight:600,color:"white",cursor:"pointer",transition:"all 0.2s",boxShadow:o?"0 4px 12px rgba(94,23,235,0.3)":"none"},children:o?"Let's go! →":"Next →"})]})]})]}),m.jsx("style",{children:`
|
|
49
49
|
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
50
50
|
`})]})}function Ay({onProjectSelected:e}){const[i,n]=O.useState("detect"),[l,o]=O.useState([]),[h,d]=O.useState(!1),{setMode:_}=Rt(),[p,f]=O.useState("developer");function y(S){f(S),_(S),n("project")}return m.jsxs(m.Fragment,{children:[h&&m.jsx(Mm,{onClose:()=>d(!1)}),m.jsx("div",{className:"h-full flex items-center justify-center",style:{background:"var(--bg-primary)"},children:m.jsxs("div",{className:"w-full max-w-[600px] px-8 animate-in",children:[m.jsxs("div",{style:{marginBottom:"80px",textAlign:"center"},children:[m.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"16px",marginBottom:"12px"},children:[m.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"14px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 12px rgba(94,23,235,0.3)"},children:m.jsx("span",{style:{color:"white",fontSize:"24px",fontWeight:700},children:"C"})}),m.jsx("h1",{style:{fontSize:"40px",fontWeight:800,color:"var(--text-primary)",letterSpacing:"-0.02em"},children:"Claude Portal"})]}),m.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"20px"},children:"Get more done with AI"})]}),i==="detect"&&m.jsx(Ry,{onAllReady:()=>n("mode"),onNeedInstall:S=>{o(S),n("install")}}),i==="install"&&m.jsx(My,{tools:l,onDone:()=>n("mode")}),i==="mode"&&m.jsxs("div",{className:"animate-in",children:[m.jsx("div",{style:{textAlign:"center",marginBottom:"40px"},children:m.jsx("button",{onClick:()=>d(!0),style:{padding:"14px 28px",borderRadius:"14px",background:"linear-gradient(135deg, rgba(94,23,235,0.08), rgba(139,92,246,0.08))",border:"1px solid rgba(94,23,235,0.2)",color:"#8b5cf6",fontSize:"15px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",display:"inline-flex",alignItems:"center",gap:"8px"},children:"▶ How it works"})}),m.jsx("h2",{style:{fontSize:"28px",fontWeight:700,color:"var(--text-primary)",marginBottom:"8px",textAlign:"center"},children:"How can we help?"}),m.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"17px",marginBottom:"48px",textAlign:"center"},children:"Choose how you'd like to work today"}),m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"24px"},children:[m.jsx("button",{onClick:()=>y("developer"),className:"group transition-all duration-300 hover:-translate-y-1 active:scale-[0.98]",style:{width:"100%",padding:"40px",background:"var(--bg-secondary)",borderRadius:"24px",textAlign:"left",border:"1px solid var(--border)",boxShadow:"0 8px 24px rgba(0,0,0,0.08)",cursor:"pointer"},children:m.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"24px"},children:[m.jsx("div",{style:{width:"64px",height:"64px",borderRadius:"16px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 12px rgba(94,23,235,0.3)",flexShrink:0,fontSize:"32px"},children:"🔨"}),m.jsxs("div",{children:[m.jsx("div",{style:{color:"var(--text-primary)",fontSize:"22px",fontWeight:700,marginBottom:"8px"},children:"Build or improve a project"}),m.jsx("div",{style:{color:"var(--text-secondary)",fontSize:"16px",lineHeight:1.6},children:"Create new features, fix bugs, and get guided checklists to ship with confidence."})]})]})}),m.jsx("button",{onClick:()=>y("document"),className:"group transition-all duration-300 hover:-translate-y-1 active:scale-[0.98]",style:{width:"100%",padding:"40px",background:"var(--bg-secondary)",borderRadius:"24px",textAlign:"left",border:"1px solid var(--border)",boxShadow:"0 8px 24px rgba(0,0,0,0.08)",cursor:"pointer"},children:m.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"24px"},children:[m.jsx("div",{style:{width:"64px",height:"64px",borderRadius:"16px",background:"linear-gradient(135deg, #ffdd27, #ffc107)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 12px rgba(255,221,39,0.3)",flexShrink:0,fontSize:"32px"},children:"📄"}),m.jsxs("div",{children:[m.jsx("div",{style:{color:"var(--text-primary)",fontSize:"22px",fontWeight:700,marginBottom:"8px"},children:"Make your work faster"}),m.jsx("div",{style:{color:"var(--text-secondary)",fontSize:"16px",lineHeight:1.6},children:"Point AI at your documents and get summaries, reports, and analysis — no coding needed."})]})]})})]})]}),i==="project"&&m.jsx(By,{onProjectSelected:e,mode:p})]})})]})}function zy(){const{path:e,gitBranch:i,terminalConnected:n,clearProject:l,mode:o,setMode:h}=Rt(),d=o==="document",_=p=>({padding:"10px 20px",borderRadius:"10px",fontSize:"14px",fontWeight:500,border:"none",cursor:"pointer",transition:"all 0.2s",background:p?"white":"transparent",color:p?o==="document"?"#5856d6":"#1d1d1f":"#86868b",boxShadow:p?"0 1px 3px rgba(0,0,0,0.1)":"none"});return m.jsxs("div",{style:{height:"56px",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 24px",borderBottom:"1px solid #e5e7eb",background:"rgba(255,255,255,0.9)",backdropFilter:"blur(20px)",flexShrink:0,transition:"background 0.2s, border-color 0.2s"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px"},children:[d?m.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"10px",background:"linear-gradient(135deg, #5856d6, #af52de)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"15px",fontWeight:700},children:"C"}):m.jsx("div",{style:{width:"12px",height:"12px",borderRadius:"50%",background:"#30d158",boxShadow:"0 0 10px rgba(48,209,88,0.4)"}}),m.jsx("span",{style:{fontFamily:"'SF Mono', Menlo, monospace",fontSize:"13px",color:"#86868b",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e?.split("/").filter(Boolean).pop()||e})]}),m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"20px"},children:[m.jsxs("div",{style:{display:"flex",borderRadius:"12px",padding:"3px",gap:"2px",background:d?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.06)"},children:[m.jsx("button",{onClick:()=>h("developer"),style:_(o==="developer"),children:"🔨 Build"}),m.jsx("button",{onClick:()=>h("document"),style:_(o==="document"),children:"📄 Documents"})]}),i&&m.jsx("span",{style:{fontSize:"12px",fontFamily:"'SF Mono', Menlo, monospace",color:"#86868b"},children:i}),m.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"50%",background:n?"#30d158":"#ff453a",boxShadow:n?"0 0 6px rgba(48,209,88,0.4)":"none"}}),m.jsx("button",{onClick:l,style:{padding:"8px 16px",borderRadius:"8px",fontSize:"14px",fontWeight:500,border:"none",cursor:"pointer",color:"#86868b",background:"transparent",transition:"all 0.2s"},className:d?"hover:bg-black/[0.04]":"hover:bg-white/[0.06]",children:"Switch"})]})]})}function Oy(){const{serverConnected:e}=Rt();return e?null:m.jsxs("div",{className:"px-4 py-2 bg-red-500/10 border-b border-red-500/20 text-red-400 text-sm text-center shrink-0",children:["Server connection lost. Restart with ",m.jsx("code",{className:"mx-1 font-mono",children:"npm run dev"})]})}function Ly({open:e,onToggle:i}){const{mode:n}=Rt(),l=n==="document";return m.jsx("div",{style:{width:"52px",display:"flex",flexDirection:"column",alignItems:"center",paddingTop:"20px",borderRight:"1px solid #e5e7eb",background:"#fafafa",flexShrink:0,transition:"background 0.2s"},children:m.jsx("button",{onClick:i,title:"Toggle sidebar",style:{width:"36px",height:"36px",borderRadius:"10px",display:"flex",alignItems:"center",justifyContent:"center",border:"none",cursor:"pointer",transition:"all 0.2s",background:e?l?"rgba(88,86,214,0.1)":"rgba(48,209,88,0.1)":"transparent",color:e?l?"#5856d6":"#30d158":"#86868b"},className:"active:scale-90",children:m.jsx("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:m.jsx("path",{d:"M2 4h12M2 8h12M2 12h12"})})})})}function Ny(e){const{path:i,setServerConnected:n}=Rt(),l=O.useRef(e);l.current=e;const o=O.useRef(new Map),h=O.useCallback((d,_)=>{const p=o.current.get(d);p&&clearTimeout(p),o.current.set(d,setTimeout(()=>{l.current(d,_),o.current.delete(d)},400))},[]);O.useEffect(()=>{if(!i)return;const d=`/api/events?projectPath=${encodeURIComponent(i)}`,_=new EventSource(d);return _.addEventListener("health-changed",p=>h("health-changed",JSON.parse(p.data))),_.addEventListener("plan-changed",p=>h("plan-changed",JSON.parse(p.data))),_.addEventListener("push-detected",p=>h("push-detected",JSON.parse(p.data))),_.onopen=()=>n(!0),_.onerror=()=>n(!1),()=>{_.close();for(const p of o.current.values())clearTimeout(p);o.current.clear()}},[i,h,n])}function jy(){const{path:e}=Rt(),[i,n]=O.useState([]),[l,o]=O.useState(!1),h=O.useCallback(async()=>{if(!e)return;o(!0);const d=await _i(Rm("/api/health-scan",e));d&&n(d.checks),o(!1)},[e]);return O.useEffect(()=>{h()},[h]),Ny(d=>{d==="health-changed"&&h()}),{checks:i,loading:l,failCount:i.filter(d=>d.status==="fail").length,passCount:i.filter(d=>d.status==="pass").length,rescan:h}}function Hy({label:e,description:i,status:n,fixPrompt:l}){const{sendPrompt:o}=en(),[h,d]=O.useState(!1);if(n==="pass")return null;const _=()=>{!l||h||(o(l),d(!0),setTimeout(()=>d(!1),3e3))};return m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"10px 16px",borderRadius:"8px",transition:"background 0.15s"},children:[m.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",background:"#f59e0b",flexShrink:0}}),m.jsxs("div",{style:{flex:1},children:[m.jsxs("div",{style:{fontSize:"13px",color:"#374151"},children:[e," missing"]}),i&&m.jsx("div",{style:{fontSize:"11px",color:"#9ca3af",marginTop:"1px"},children:i})]}),l&&m.jsx("button",{onClick:_,style:{padding:"6px 14px",background:"#dcfce7",color:"#16a34a",fontSize:"12px",borderRadius:"8px",fontWeight:600,border:h?"1px solid #86efac":"none",cursor:h?"default":"pointer",flexShrink:0,transition:"all 0.15s"},children:h?"✓ Sent":"Fix →"})]})}function Uy(){const{checks:e,loading:i,failCount:n,passCount:l}=jy(),[o,h]=O.useState(!1);return m.jsxs("div",{style:{borderBottom:"1px solid #e5e7eb"},children:[m.jsxs("button",{onClick:()=>h(!o),style:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer",transition:"background 0.15s"},children:[m.jsxs("span",{style:{fontWeight:600,fontSize:"14px",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:o?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"Project Health"]}),i?m.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:m.jsx("span",{style:{fontSize:"12px",color:"#9ca3af"},children:"scanning..."})}):n>0?m.jsxs("span",{style:{background:"#fef3c7",color:"#d97706",fontSize:"12px",padding:"3px 10px",borderRadius:"12px",fontWeight:600},children:[n," issue",n!==1?"s":""]}):m.jsx("span",{style:{background:"#dcfce7",color:"#16a34a",fontSize:"12px",padding:"3px 10px",borderRadius:"12px",fontWeight:600},children:"all good"})]}),!o&&m.jsxs("div",{style:{padding:"0 12px 16px",display:"flex",flexDirection:"column",gap:"2px"},children:[e.filter(d=>d.status==="fail").map(d=>m.jsx(Hy,{label:d.label,description:d.description,status:d.status,fixPrompt:d.fixPrompt},d.id)),l>0&&m.jsxs("p",{style:{fontSize:"12px",color:"#9ca3af",paddingTop:"8px",paddingLeft:"16px"},children:[l," checks passing"]})]})]})}function qy(){const[e,i]=O.useState([]),[n,l]=O.useState(!0),[o,h]=O.useState(!1);O.useEffect(()=>{fetch("/api/cli-status").then(p=>p.json()).then(p=>{i(p.clis||[]),l(!1)}).catch(()=>l(!1))},[]);const d=e.filter(p=>p.connected).length,_=e.filter(p=>!p.connected).length;return m.jsxs("div",{style:{borderBottom:"1px solid #e5e7eb"},children:[m.jsxs("button",{onClick:()=>h(!o),style:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer",transition:"background 0.15s"},children:[m.jsxs("span",{style:{fontWeight:600,fontSize:"14px",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:o?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"CLI Connections"]}),n?m.jsx("span",{style:{fontSize:"12px",color:"#9ca3af"},children:"checking..."}):_>0?m.jsxs("span",{style:{background:"#fef3c7",color:"#d97706",fontSize:"12px",padding:"3px 10px",borderRadius:"12px",fontWeight:600},children:[_," disconnected"]}):m.jsx("span",{style:{background:"#dcfce7",color:"#16a34a",fontSize:"12px",padding:"3px 10px",borderRadius:"12px",fontWeight:600},children:"all connected"})]}),!o&&!n&&m.jsxs("div",{style:{padding:"0 12px 16px",display:"flex",flexDirection:"column",gap:"4px"},children:[e.map(p=>m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"8px 12px",borderRadius:"8px",background:p.connected?"rgba(22, 163, 74, 0.04)":"rgba(217, 119, 6, 0.04)"},children:[m.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",background:p.connected?"#16a34a":"#d97706",flexShrink:0}}),m.jsxs("div",{style:{flex:1,minWidth:0},children:[m.jsx("div",{style:{fontSize:"13px",fontWeight:600,color:"#374151"},children:p.label}),m.jsx("div",{style:{fontSize:"11px",color:p.connected?"#6b7280":"#d97706",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:p.detail})]})]},p.id)),d>0&&_===0&&m.jsx("p",{style:{fontSize:"12px",color:"#9ca3af",paddingTop:"4px",paddingLeft:"12px"},children:"All CLIs authenticated and ready"})]})]})}function Wy(){const{sendPrompt:e}=en(),[i,n]=O.useState(!1),[l,o]=O.useState(""),[h,d]=O.useState(""),[_,p]=O.useState(!1),f=l.trim().length>0,y=()=>{if(!f)return;const C=["I want to add a new feature to my app:","",`**What it does:** ${l.trim()}`];h.trim()&&C.push("",`**What success looks like:** ${h.trim()}`),C.push("","Please:","1. Create an implementation plan with numbered steps and files to create/modify","2. Save the plan as a markdown file in docs/plans/","3. Include a testing checklist at the end with specific items to verify","4. Then start building step 1");const b=C.join(`
|
|
51
|
-
`);if(e(b),h.trim()){const R=h.trim().split(/[.\n]/).map(j=>j.trim()).filter(j=>j.length>10);R.length>0&&window.dispatchEvent(new CustomEvent("claude-portal:test-items",{detail:{items:R,feature:l.trim().slice(0,40)}}))}p(!0),setTimeout(()=>{o(""),d(""),p(!1)},2e3)},S={width:"100%",padding:"8px 12px",border:"1px solid #e5e7eb",borderRadius:"8px",fontSize:"12px",fontFamily:"inherit",resize:"none",outline:"none",color:"#374151",background:"#fff",boxSizing:"border-box"},x={fontSize:"12px",fontWeight:500,color:"#6b7280",marginBottom:"4px"};return m.jsxs("div",{style:{borderBottom:"1px solid #e5e7eb"},children:[m.jsx("button",{onClick:()=>n(!i),style:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer"},children:m.jsxs("span",{style:{fontWeight:600,fontSize:"14px",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:i?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"Build a Feature"]})}),!i&&m.jsxs("div",{style:{padding:"0 20px 16px",display:"flex",flexDirection:"column",gap:"12px"},children:[m.jsxs("div",{children:[m.jsx("div",{style:x,children:"What do you want to build?"}),m.jsx("textarea",{value:l,onChange:C=>o(C.target.value),rows:3,placeholder:"e.g. A settings page where users can update their profile, change password, and toggle dark mode",style:S})]}),m.jsxs("div",{children:[m.jsxs("div",{style:x,children:["What does success look like? ",m.jsx("span",{style:{color:"#9ca3af",fontWeight:400},children:"(optional)"})]}),m.jsx("textarea",{value:h,onChange:C=>d(C.target.value),rows:3,placeholder:"e.g. The page has a form with current values pre-filled. Save button shows a success toast. Password change requires current password.",style:S})]}),m.jsx("button",{onClick:y,disabled:!f||_,style:{padding:"10px 16px",borderRadius:"10px",border:"none",background:_?"#dcfce7":f?"#22c55e":"#e5e7eb",color:_?"#16a34a":f?"#fff":"#9ca3af",fontSize:"13px",fontWeight:600,cursor:f&&!_?"pointer":"not-allowed",transition:"all 0.15s",width:"100%"},children:_?"✓ Sent to Claude":"Build with Claude Code →"})]})]})}function Bm(e){return`claude-portal-tests-${e}`}function Py(e){try{const i=localStorage.getItem(Bm(e));return i?JSON.parse(i):[]}catch{return[]}}function yg(e,i){localStorage.setItem(Bm(e),JSON.stringify(i))}function Ky(){const{path:e}=Rt(),[i,n]=O.useState(!1),[l,o]=O.useState([]),[h,d]=O.useState(!1),[_,p]=O.useState("");O.useEffect(()=>{e&&o(Py(e))},[e]),O.useEffect(()=>{const b=R=>{const{items:j,feature:X}=R.detail;if(!j?.length||!e)return;const K=j.map((A,L)=>({id:`auto-${Date.now()}-${L}`,label:A,checked:!1}));o(A=>{const L=[...A,...K];return yg(e,L),L}),n(!1)};return window.addEventListener("claude-portal:test-items",b),()=>window.removeEventListener("claude-portal:test-items",b)},[e]);const f=O.useCallback(b=>{o(R=>{const j=b(R);return e&&yg(e,j),j})},[e]),y=O.useCallback(b=>{f(R=>R.map(j=>j.id===b?{...j,checked:!j.checked}:j))},[f]),S=O.useCallback(b=>{f(R=>R.filter(j=>j.id!==b))},[f]),x=()=>{const b=_.trim();b&&(f(R=>[...R,{id:Date.now().toString(),label:b,checked:!1}]),p(""),d(!1))},C=l.filter(b=>b.checked).length;return m.jsxs("div",{style:{borderBottom:"1px solid #e5e7eb"},children:[m.jsxs("button",{onClick:()=>n(!i),style:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer"},children:[m.jsxs("span",{style:{fontWeight:600,fontSize:"14px",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:i?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"Feature Testing"]}),l.length>0&&m.jsxs("span",{style:{background:C===l.length?"#dcfce7":"#f3f4f6",color:C===l.length?"#16a34a":"#6b7280",fontSize:"12px",padding:"3px 10px",borderRadius:"12px",fontWeight:600},children:[C,"/",l.length," tested"]})]}),!i&&m.jsxs("div",{style:{padding:"0 20px 16px",display:"flex",flexDirection:"column",gap:"6px"},children:[l.length===0&&!h&&m.jsx("p",{style:{fontSize:"12px",color:"#9ca3af",lineHeight:"1.5",margin:0},children:"Test items will appear here when Claude creates a plan with a testing section."}),l.map(b=>m.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"6px 0",fontSize:"12px",color:"#374151"},children:[m.jsx("input",{type:"checkbox",checked:b.checked,onChange:()=>y(b.id),style:{marginTop:"2px",accentColor:"#22c55e",cursor:"pointer"}}),m.jsx("span",{onClick:()=>y(b.id),style:{flex:1,cursor:"pointer",textDecoration:b.checked?"line-through":"none",color:b.checked?"#9ca3af":"#374151"},children:b.label}),m.jsx("button",{onClick:()=>S(b.id),"aria-label":`Remove ${b.label}`,style:{background:"none",border:"none",color:"#d1d5db",cursor:"pointer",fontSize:"11px",padding:"0 2px",flexShrink:0,transition:"color 0.15s"},onMouseEnter:R=>R.currentTarget.style.color="#ef4444",onMouseLeave:R=>R.currentTarget.style.color="#d1d5db",children:"✕"})]},b.id)),h?m.jsxs("div",{style:{display:"flex",gap:"6px",marginTop:"4px"},children:[m.jsx("input",{autoFocus:!0,value:_,onChange:b=>p(b.target.value),onKeyDown:b=>{b.key==="Enter"&&x(),b.key==="Escape"&&(d(!1),p(""))},placeholder:"Describe the test...",style:{flex:1,padding:"6px 10px",border:"1px solid #e5e7eb",borderRadius:"6px",fontSize:"12px",outline:"none",color:"#374151"}}),m.jsx("button",{onClick:x,style:{padding:"6px 12px",background:"#22c55e",color:"#fff",border:"none",borderRadius:"6px",fontSize:"12px",fontWeight:600,cursor:"pointer"},children:"Add"})]}):m.jsx("button",{onClick:()=>d(!0),style:{padding:"6px 0",background:"none",border:"none",color:"#22c55e",fontSize:"12px",fontWeight:500,cursor:"pointer",textAlign:"left",marginTop:"4px"},children:"+ Add test item"})]})]})}const Qn=[{id:"bugs",label:"Check for bugs",prompt:"Review all files changed since the last commit for bugs, logic errors, and edge cases. Report what you find."},{id:"diff",label:"Review diff",prompt:"Show me a summary of all changes since the last push — what was added, modified, and removed."},{id:"tests",label:"Run tests",prompt:"Run the test suite and report results. If any tests fail, explain why."},{id:"console",label:"Check console.logs",prompt:"Find any console.log, console.warn, or console.error statements in the changed files that should be removed before pushing."},{id:"build",label:"Build succeeds",prompt:"Run the build command and report if it succeeds. If it fails, explain the errors."},{id:"security",label:"Security check",prompt:"Check the changed files for security issues: hardcoded secrets, SQL injection, XSS vulnerabilities, or exposed API keys."}];function Am(e){return`claude-portal-prepush-${e}`}function Yy(e){try{const i=localStorage.getItem(Am(e));return i?JSON.parse(i):{}}catch{return{}}}function $y(e,i){localStorage.setItem(Am(e),JSON.stringify(i))}function Iy(){const{path:e}=Rt(),{sendPrompt:i}=en(),[n,l]=O.useState(!1),[o,h]=O.useState({});O.useEffect(()=>{e&&h(Yy(e))},[e]);const d=O.useCallback(p=>{h(f=>{const y={...f,[p]:!f[p]};return e&&$y(e,y),y})},[e]),_=Qn.filter(p=>o[p.id]).length;return m.jsxs("div",{style:{borderBottom:"1px solid #e5e7eb"},children:[m.jsxs("button",{onClick:()=>l(!n),style:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer"},children:[m.jsxs("span",{style:{fontWeight:600,fontSize:"14px",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:n?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"Pre-Push"]}),m.jsxs("span",{style:{background:_===Qn.length?"#dcfce7":"#f3f4f6",color:_===Qn.length?"#16a34a":"#6b7280",fontSize:"12px",padding:"3px 10px",borderRadius:"12px",fontWeight:600},children:[_,"/",Qn.length]})]}),!n&&m.jsx("div",{style:{padding:"0 20px 16px",display:"flex",flexDirection:"column",gap:"4px"},children:Qn.map(p=>m.jsx(Gy,{label:p.label,prompt:p.prompt,isChecked:!!o[p.id],onToggle:()=>d(p.id),onRun:()=>i(p.prompt)},p.id))})]})}function Gy({label:e,prompt:i,isChecked:n,onToggle:l,onRun:o}){const[h,d]=O.useState(!1),_=()=>{h||(o(),d(!0),setTimeout(()=>d(!1),3e3))};return m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"8px 0"},children:[m.jsx("input",{type:"checkbox",checked:n,onChange:l,style:{accentColor:"#22c55e",flexShrink:0}}),m.jsx("span",{style:{flex:1,fontSize:"12px",color:n?"#9ca3af":"#374151",textDecoration:n?"line-through":"none"},children:e}),m.jsx("button",{onClick:_,style:{padding:"4px 10px",background:"#dcfce7",color:"#16a34a",fontSize:"11px",borderRadius:"6px",fontWeight:600,border:h?"1px solid #86efac":"none",cursor:h?"default":"pointer",flexShrink:0,transition:"all 0.15s"},children:h?"✓ Sent":"Run →"})]})}const tu="claude-portal-future-builds";function Xy(e){try{return JSON.parse(localStorage.getItem(tu)||"{}")[e]||[]}catch{return[]}}function Vy(e,i){try{const n=JSON.parse(localStorage.getItem(tu)||"{}");n[e]=i,localStorage.setItem(tu,JSON.stringify(n))}catch{}}function Fy(){const{path:e}=Rt(),[i,n]=O.useState([]),[l,o]=O.useState(!1),[h,d]=O.useState(""),[_,p]=O.useState(null),[f,y]=O.useState("");O.useEffect(()=>{e&&n(Xy(e))},[e]);const S=A=>{n(A),e&&Vy(e,A)},x=()=>{const A=h.trim();if(!A)return;const L={id:Date.now().toString(),text:A,done:!1,createdAt:Date.now()};S([...i,L]),d("")},C=A=>{S(i.map(L=>L.id===A?{...L,done:!L.done}:L))},b=A=>{S(i.filter(L=>L.id!==A))},R=A=>{p(A.id),y(A.text)},j=A=>{const L=f.trim();L&&(S(i.map(H=>H.id===A?{...H,text:L}:H)),p(null))},X=i.filter(A=>A.done).length,K=i.length;return m.jsxs("div",{style:{borderBottom:"1px solid #e5e7eb"},children:[m.jsxs("button",{onClick:()=>o(!l),style:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer"},children:[m.jsxs("span",{style:{fontWeight:600,fontSize:"14px",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:l?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"Future Builds"]}),K>0&&m.jsxs("span",{style:{background:X===K?"#dcfce7":"#f3f4f6",color:X===K?"#16a34a":"#6b7280",fontSize:"12px",padding:"3px 10px",borderRadius:"12px",fontWeight:600},children:[X,"/",K]})]}),!l&&m.jsxs("div",{style:{padding:"0 12px 16px",display:"flex",flexDirection:"column",gap:"4px"},children:[m.jsxs("div",{style:{display:"flex",gap:"6px",marginBottom:"8px"},children:[m.jsx("input",{value:h,onChange:A=>d(A.target.value),onKeyDown:A=>A.key==="Enter"&&x(),placeholder:"Add a feature or idea...",style:{flex:1,padding:"8px 12px",fontSize:"13px",border:"1px solid #e5e7eb",borderRadius:"8px",outline:"none",color:"#374151",background:"#fafafa"}}),m.jsx("button",{onClick:x,style:{padding:"8px 14px",background:"#5e17eb",color:"#fff",fontSize:"13px",fontWeight:600,borderRadius:"8px",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:"+"})]}),i.map(A=>m.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"8px 10px",borderRadius:"8px",background:A.done?"rgba(22,163,74,0.04)":"#fafafa",transition:"background 0.15s"},children:[m.jsx("input",{type:"checkbox",checked:A.done,onChange:()=>C(A.id),style:{marginTop:"3px",cursor:"pointer",accentColor:"#5e17eb"}}),_===A.id?m.jsx("input",{value:f,onChange:L=>y(L.target.value),onKeyDown:L=>{L.key==="Enter"&&j(A.id),L.key==="Escape"&&p(null)},onBlur:()=>j(A.id),autoFocus:!0,style:{flex:1,padding:"2px 6px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"4px",outline:"none"}}):m.jsx("span",{onDoubleClick:()=>R(A),style:{flex:1,fontSize:"13px",color:A.done?"#9ca3af":"#374151",textDecoration:A.done?"line-through":"none",cursor:"default",lineHeight:1.4},children:A.text}),m.jsx("button",{onClick:()=>b(A.id),style:{background:"none",border:"none",cursor:"pointer",color:"#d1d5db",fontSize:"14px",padding:"0 2px",lineHeight:1,transition:"color 0.15s"},onMouseEnter:L=>L.currentTarget.style.color="#ef4444",onMouseLeave:L=>L.currentTarget.style.color="#d1d5db",children:"×"})]},A.id)),i.length===0&&m.jsx("p",{style:{fontSize:"12px",color:"#9ca3af",textAlign:"center",padding:"12px"},children:"Track features, ideas, and things to build next"})]})]})}function Zy(){const{path:e,setProjectPath:i}=Rt(),n=e?e.split("/").filter(Boolean).pop():"Project",l=async()=>{const o=await _i("/api/pick-folder");o?.path&&i(o.path)};return m.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:"#fff"},children:[m.jsxs("div",{style:{padding:"20px 24px 16px",borderBottom:"1px solid #e5e7eb"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"6px"},children:[m.jsx("div",{style:{fontSize:"11px",textTransform:"uppercase",letterSpacing:"0.05em",color:"#9ca3af"},children:"Project"}),m.jsx("button",{onClick:l,style:{padding:"4px 10px",borderRadius:"6px",border:"1px solid #e5e7eb",background:"#fff",color:"#6b7280",fontSize:"11px",fontWeight:500,cursor:"pointer",transition:"all 0.15s"},children:"Change"})]}),m.jsx("div",{style:{fontSize:"14px",fontWeight:600,color:"#1a2233",wordBreak:"break-all"},children:n}),e&&m.jsx("div",{style:{fontSize:"11px",color:"#9ca3af",marginTop:"2px",wordBreak:"break-all"},children:e})]}),m.jsxs("div",{style:{flex:1,overflowY:"auto"},children:[m.jsx(Uy,{}),m.jsx(qy,{}),m.jsx(Wy,{}),m.jsx(Ky,{}),m.jsx(Iy,{}),m.jsx(Fy,{})]})]})}const Qy={pdf:"text-red-500",docx:"text-blue-500",doc:"text-blue-500",xlsx:"text-green-500",xls:"text-green-500",csv:"text-green-600",txt:"text-gray-400",md:"text-gray-400",json:"text-yellow-500",html:"text-orange-500",pptx:"text-pink-500"};function Jy(e){const i=e.split(".").pop()?.toLowerCase()||"";return Qy[i]||"text-gray-400"}function eb(e){return Object.entries(e).sort((i,n)=>n[1]-i[1]).map(([i,n])=>`${n} ${i}`).join(", ")}function tb(){const{folderPath:e,folderScan:i,scanLoading:n,scanFolder:l,clearFolder:o}=Ni(),[h,d]=O.useState(""),[_,p]=O.useState(!1),[f,y]=O.useState(!1),[S,x]=O.useState(!1);async function C(){y(!0);const L=await _i("/api/pick-folder");y(!1),L?.path&&l(L.path)}function b(){const L=h.trim();L&&l(L)}function R(L){L.key==="Enter"&&b()}const j=i?.files||[],X=i?.summary.total||0,K=i?.summary.byType||{},A=j.slice(0,20);return m.jsxs("div",{style:{padding:"16px 20px",display:"flex",flexDirection:"column",gap:"10px",borderBottom:"1px solid var(--border)"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[m.jsx("div",{style:{width:"24px",height:"24px",borderRadius:"8px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"11px",fontWeight:700,flexShrink:0},children:"1"}),m.jsx("h3",{style:{fontSize:"13px",fontWeight:700,color:"var(--text-primary)"},children:"Choose folder"})]}),e?m.jsxs("div",{className:"rounded-lg border",style:{background:"var(--bg-secondary)",borderColor:"var(--border)",padding:"10px 12px"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[m.jsx("span",{style:{fontSize:"14px",flexShrink:0},children:"📁"}),m.jsx("span",{style:{fontSize:"13px",fontWeight:600,color:"var(--text-primary)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e?.split("/").filter(Boolean).pop()||e}),m.jsxs("span",{style:{fontSize:"11px",padding:"2px 8px",borderRadius:"100px",background:"#eef2ff",color:"#6366f1",fontWeight:600,flexShrink:0,whiteSpace:"nowrap"},children:[X," files"]}),m.jsx("button",{onClick:o,style:{fontSize:"11px",padding:"2px 8px",borderRadius:"100px",border:"1px solid var(--border)",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",flexShrink:0,whiteSpace:"nowrap"},children:"Change"})]}),Object.keys(K).length>0&&m.jsx("p",{style:{fontSize:"11px",color:"var(--text-secondary)",marginTop:"4px"},children:eb(K)}),X>50&&m.jsxs("p",{className:"text-xs text-amber-500 bg-amber-500/10 rounded px-2 py-1",children:["Large folder — processing may take longer for ",X," files."]}),j.length>0&&m.jsxs("div",{children:[m.jsx("button",{onClick:()=>p(L=>!L),className:"text-xs transition-colors",style:{color:"var(--text-secondary)"},children:_?"▲ Hide files":`▼ Show files (${Math.min(20,j.length)} of ${X})`}),_&&m.jsx("ul",{className:"mt-2 space-y-1 max-h-48 overflow-y-auto",children:A.map((L,H)=>m.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[m.jsx("span",{className:`font-mono font-semibold ${Jy(L.name)}`,children:L.name.split(".").pop()?.toLowerCase()}),m.jsx("span",{style:{color:"var(--text-primary)"},children:L.name})]},H))})]})]}):m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[m.jsx("button",{onClick:C,disabled:f||n,style:{width:"100%",padding:"16px 20px",borderRadius:"14px",fontSize:"15px",fontWeight:600,background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",color:"white",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",boxShadow:"0 4px 12px rgba(94,23,235,0.3)",opacity:f||n?.5:1,transition:"all 0.2s"},children:f?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Waiting for selection..."]}):m.jsx(m.Fragment,{children:"📂 Browse for folder"})}),S?m.jsxs("div",{className:"flex gap-2",children:[m.jsx("input",{type:"text",value:h,onChange:L=>d(L.target.value),onKeyDown:R,placeholder:"/path/to/documents",autoFocus:!0,className:"flex-1 px-3 py-2.5 rounded-lg text-sm border outline-none focus:ring-2 focus:ring-indigo-400",style:{background:"var(--bg-secondary)",borderColor:"var(--border)",color:"var(--text-primary)"}}),m.jsx("button",{onClick:b,disabled:!h.trim()||n,className:"px-4 py-2.5 rounded-lg text-sm font-medium bg-indigo-500 text-white hover:bg-indigo-600 disabled:opacity-50 transition-colors",children:n?"...":"Scan"})]}):m.jsx("button",{onClick:()=>x(!0),style:{fontSize:"13px",color:"var(--text-secondary)",background:"none",border:"none",cursor:"pointer",margin:"0 auto",display:"block"},children:"Or enter path manually →"})]})]})}function ib(){const{selectedOutcome:e,setSelectedOutcome:i,freeformText:n,setFreeformText:l}=Ni();return m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-2",style:{marginBottom:"12px"},children:[m.jsx("div",{style:{width:"24px",height:"24px",borderRadius:"8px",background:"linear-gradient(135deg, #6366f1, #a855f7)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"11px",fontWeight:700,flexShrink:0},children:"2"}),m.jsx("h3",{style:{fontSize:"13px",fontWeight:700,color:"var(--text-primary)"},children:"Choose outcome"})]}),by.map(o=>{const h=oo.filter(d=>d.category===o.key);return m.jsxs("div",{style:{marginBottom:"12px"},children:[m.jsxs("div",{style:{fontSize:"11px",fontWeight:600,color:"#9ca3af",marginBottom:"6px",textTransform:"uppercase",letterSpacing:"0.04em"},children:[o.label," ",m.jsxs("span",{style:{fontWeight:400,textTransform:"none",letterSpacing:0},children:["— ",o.description]})]}),m.jsx("div",{className:"grid grid-cols-2",style:{gap:"6px"},children:h.map(d=>{const _=e===d.key;return m.jsxs("button",{onClick:()=>i(_?null:d.key),style:{padding:"8px 10px",borderRadius:"10px",border:_?"2px solid #818cf8":"1.5px solid var(--border)",background:_?"#eef2ff":"var(--bg-secondary, #fff)",cursor:"pointer",boxShadow:_?"0 0 0 3px rgba(99,102,241,0.08)":"none",display:"flex",alignItems:"center",gap:"8px",textAlign:"left",transition:"all 0.15s"},children:[m.jsx("span",{style:{fontSize:"15px",flexShrink:0},children:d.emoji}),m.jsxs("div",{style:{minWidth:0},children:[m.jsx("div",{style:{fontSize:"12px",fontWeight:700,color:_?"#4338ca":"var(--text-primary)"},children:d.name}),m.jsx("div",{style:{fontSize:"10px",color:"var(--text-secondary)",lineHeight:1.2},children:d.description})]})]},d.key)})})]},o.key)}),m.jsxs("div",{style:{marginTop:"8px"},children:[m.jsx("div",{style:{fontSize:"11px",fontWeight:500,color:"var(--text-secondary)",marginBottom:"4px"},children:"Or describe what you need:"}),m.jsx("textarea",{value:n,onChange:o=>l(o.target.value),placeholder:"e.g. Find all contract expiry dates and list them by client",rows:2,className:"w-full rounded-lg border outline-none resize-none",style:{padding:"10px 14px",fontSize:"12px",lineHeight:"1.5",background:"var(--bg-secondary)",borderColor:"var(--border)",color:"var(--text-primary)"}})]})]})}const zm="claude-portal-style-templates",Om=()=>{try{return JSON.parse(localStorage.getItem(zm)||"[]")}catch{return[]}},sb=e=>localStorage.setItem(zm,JSON.stringify(e)),rb=e=>Om().filter(i=>i.outcomeKey===e);function nb(e){const i=Om();i.push(e);const n=new Map;for(const o of i){const h=n.get(o.outcomeKey)||[];h.push(o),n.set(o.outcomeKey,h)}const l=[];for(const o of n.values())l.push(...o.slice(-10));sb(l)}const lb={pdf:"📄",md:"📝",docx:"📘",doc:"📘",txt:"📃"},ab=".md,.txt,.csv,.json,.html",Wh=3;function ob(e){return e.split(".").pop()?.toLowerCase()||""}function cb({outcomeKey:e,onContentChange:i}){const[n,l]=O.useState([]),[o,h]=O.useState(null),[d,_]=O.useState(!1),[p,f]=O.useState([]),y=O.useRef(null);O.useEffect(()=>{f(e?rb(e):[]),h(null)},[e]);const S=O.useCallback((A,L)=>{if(L){const H=p.find(Z=>Z.id===L);if(H){i(H.content);return}}if(A.length>0){const H=A.map(Z=>Z.content).join(`
|
|
51
|
+
`);if(e(b),h.trim()){const R=h.trim().split(/[.\n]/).map(M=>M.trim()).filter(M=>M.length>10);R.length>0&&window.dispatchEvent(new CustomEvent("claude-portal:test-items",{detail:{items:R,feature:l.trim().slice(0,40)}}))}p(!0),setTimeout(()=>{o(""),d(""),p(!1)},2e3)},S={width:"100%",padding:"8px 12px",border:"1px solid #e5e7eb",borderRadius:"8px",fontSize:"12px",fontFamily:"inherit",resize:"none",outline:"none",color:"#374151",background:"#fff",boxSizing:"border-box"},x={fontSize:"12px",fontWeight:500,color:"#6b7280",marginBottom:"4px"};return m.jsxs("div",{style:{borderBottom:"1px solid #e5e7eb"},children:[m.jsx("button",{onClick:()=>n(!i),style:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer"},children:m.jsxs("span",{style:{fontWeight:600,fontSize:"14px",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:i?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"Build a Feature"]})}),!i&&m.jsxs("div",{style:{padding:"0 20px 16px",display:"flex",flexDirection:"column",gap:"12px"},children:[m.jsxs("div",{children:[m.jsx("div",{style:x,children:"What do you want to build?"}),m.jsx("textarea",{value:l,onChange:C=>o(C.target.value),rows:3,placeholder:"e.g. A settings page where users can update their profile, change password, and toggle dark mode",style:S})]}),m.jsxs("div",{children:[m.jsxs("div",{style:x,children:["What does success look like? ",m.jsx("span",{style:{color:"#9ca3af",fontWeight:400},children:"(optional)"})]}),m.jsx("textarea",{value:h,onChange:C=>d(C.target.value),rows:3,placeholder:"e.g. The page has a form with current values pre-filled. Save button shows a success toast. Password change requires current password.",style:S})]}),m.jsx("button",{onClick:y,disabled:!f||_,style:{padding:"10px 16px",borderRadius:"10px",border:"none",background:_?"#dcfce7":f?"#22c55e":"#e5e7eb",color:_?"#16a34a":f?"#fff":"#9ca3af",fontSize:"13px",fontWeight:600,cursor:f&&!_?"pointer":"not-allowed",transition:"all 0.15s",width:"100%"},children:_?"✓ Sent to Claude":"Build with Claude Code →"})]})]})}function Bm(e){return`claude-portal-tests-${e}`}function Py(e){try{const i=localStorage.getItem(Bm(e));return i?JSON.parse(i):[]}catch{return[]}}function yg(e,i){localStorage.setItem(Bm(e),JSON.stringify(i))}function Ky(){const{path:e}=Rt(),[i,n]=O.useState(!1),[l,o]=O.useState([]),[h,d]=O.useState(!1),[_,p]=O.useState("");O.useEffect(()=>{e&&o(Py(e))},[e]),O.useEffect(()=>{const b=R=>{const{items:M,feature:W}=R.detail;if(!M?.length||!e)return;const te=M.map((N,L)=>({id:`auto-${Date.now()}-${L}`,label:N,checked:!1}));o(N=>{const L=[...N,...te];return yg(e,L),L}),n(!1)};return window.addEventListener("claude-portal:test-items",b),()=>window.removeEventListener("claude-portal:test-items",b)},[e]);const f=O.useCallback(b=>{o(R=>{const M=b(R);return e&&yg(e,M),M})},[e]),y=O.useCallback(b=>{f(R=>R.map(M=>M.id===b?{...M,checked:!M.checked}:M))},[f]),S=O.useCallback(b=>{f(R=>R.filter(M=>M.id!==b))},[f]),x=()=>{const b=_.trim();b&&(f(R=>[...R,{id:Date.now().toString(),label:b,checked:!1}]),p(""),d(!1))},C=l.filter(b=>b.checked).length;return m.jsxs("div",{style:{borderBottom:"1px solid #e5e7eb"},children:[m.jsxs("button",{onClick:()=>n(!i),style:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer"},children:[m.jsxs("span",{style:{fontWeight:600,fontSize:"14px",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:i?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"Feature Testing"]}),l.length>0&&m.jsxs("span",{style:{background:C===l.length?"#dcfce7":"#f3f4f6",color:C===l.length?"#16a34a":"#6b7280",fontSize:"12px",padding:"3px 10px",borderRadius:"12px",fontWeight:600},children:[C,"/",l.length," tested"]})]}),!i&&m.jsxs("div",{style:{padding:"0 20px 16px",display:"flex",flexDirection:"column",gap:"6px"},children:[l.length===0&&!h&&m.jsx("p",{style:{fontSize:"12px",color:"#9ca3af",lineHeight:"1.5",margin:0},children:"Test items will appear here when Claude creates a plan with a testing section."}),l.map(b=>m.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"6px 0",fontSize:"12px",color:"#374151"},children:[m.jsx("input",{type:"checkbox",checked:b.checked,onChange:()=>y(b.id),style:{marginTop:"2px",accentColor:"#22c55e",cursor:"pointer"}}),m.jsx("span",{onClick:()=>y(b.id),style:{flex:1,cursor:"pointer",textDecoration:b.checked?"line-through":"none",color:b.checked?"#9ca3af":"#374151"},children:b.label}),m.jsx("button",{onClick:()=>S(b.id),"aria-label":`Remove ${b.label}`,style:{background:"none",border:"none",color:"#d1d5db",cursor:"pointer",fontSize:"11px",padding:"0 2px",flexShrink:0,transition:"color 0.15s"},onMouseEnter:R=>R.currentTarget.style.color="#ef4444",onMouseLeave:R=>R.currentTarget.style.color="#d1d5db",children:"✕"})]},b.id)),h?m.jsxs("div",{style:{display:"flex",gap:"6px",marginTop:"4px"},children:[m.jsx("input",{autoFocus:!0,value:_,onChange:b=>p(b.target.value),onKeyDown:b=>{b.key==="Enter"&&x(),b.key==="Escape"&&(d(!1),p(""))},placeholder:"Describe the test...",style:{flex:1,padding:"6px 10px",border:"1px solid #e5e7eb",borderRadius:"6px",fontSize:"12px",outline:"none",color:"#374151"}}),m.jsx("button",{onClick:x,style:{padding:"6px 12px",background:"#22c55e",color:"#fff",border:"none",borderRadius:"6px",fontSize:"12px",fontWeight:600,cursor:"pointer"},children:"Add"})]}):m.jsx("button",{onClick:()=>d(!0),style:{padding:"6px 0",background:"none",border:"none",color:"#22c55e",fontSize:"12px",fontWeight:500,cursor:"pointer",textAlign:"left",marginTop:"4px"},children:"+ Add test item"})]})]})}const Qn=[{id:"bugs",label:"Check for bugs",prompt:"Review all files changed since the last commit for bugs, logic errors, and edge cases. Report what you find."},{id:"diff",label:"Review diff",prompt:"Show me a summary of all changes since the last push — what was added, modified, and removed."},{id:"tests",label:"Run tests",prompt:"Run the test suite and report results. If any tests fail, explain why."},{id:"console",label:"Check console.logs",prompt:"Find any console.log, console.warn, or console.error statements in the changed files that should be removed before pushing."},{id:"build",label:"Build succeeds",prompt:"Run the build command and report if it succeeds. If it fails, explain the errors."},{id:"security",label:"Security check",prompt:"Check the changed files for security issues: hardcoded secrets, SQL injection, XSS vulnerabilities, or exposed API keys."}];function Am(e){return`claude-portal-prepush-${e}`}function Yy(e){try{const i=localStorage.getItem(Am(e));return i?JSON.parse(i):{}}catch{return{}}}function $y(e,i){localStorage.setItem(Am(e),JSON.stringify(i))}function Iy(){const{path:e}=Rt(),{sendPrompt:i}=en(),[n,l]=O.useState(!1),[o,h]=O.useState({});O.useEffect(()=>{e&&h(Yy(e))},[e]);const d=O.useCallback(p=>{h(f=>{const y={...f,[p]:!f[p]};return e&&$y(e,y),y})},[e]),_=Qn.filter(p=>o[p.id]).length;return m.jsxs("div",{style:{borderBottom:"1px solid #e5e7eb"},children:[m.jsxs("button",{onClick:()=>l(!n),style:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer"},children:[m.jsxs("span",{style:{fontWeight:600,fontSize:"14px",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:n?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"Pre-Push"]}),m.jsxs("span",{style:{background:_===Qn.length?"#dcfce7":"#f3f4f6",color:_===Qn.length?"#16a34a":"#6b7280",fontSize:"12px",padding:"3px 10px",borderRadius:"12px",fontWeight:600},children:[_,"/",Qn.length]})]}),!n&&m.jsx("div",{style:{padding:"0 20px 16px",display:"flex",flexDirection:"column",gap:"4px"},children:Qn.map(p=>m.jsx(Gy,{label:p.label,prompt:p.prompt,isChecked:!!o[p.id],onToggle:()=>d(p.id),onRun:()=>i(p.prompt)},p.id))})]})}function Gy({label:e,prompt:i,isChecked:n,onToggle:l,onRun:o}){const[h,d]=O.useState(!1),_=()=>{h||(o(),d(!0),setTimeout(()=>d(!1),3e3))};return m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"8px 0"},children:[m.jsx("input",{type:"checkbox",checked:n,onChange:l,style:{accentColor:"#22c55e",flexShrink:0}}),m.jsx("span",{style:{flex:1,fontSize:"12px",color:n?"#9ca3af":"#374151",textDecoration:n?"line-through":"none"},children:e}),m.jsx("button",{onClick:_,style:{padding:"4px 10px",background:"#dcfce7",color:"#16a34a",fontSize:"11px",borderRadius:"6px",fontWeight:600,border:h?"1px solid #86efac":"none",cursor:h?"default":"pointer",flexShrink:0,transition:"all 0.15s"},children:h?"✓ Sent":"Run →"})]})}const tu="claude-portal-future-builds";function Xy(e){try{return JSON.parse(localStorage.getItem(tu)||"{}")[e]||[]}catch{return[]}}function Vy(e,i){try{const n=JSON.parse(localStorage.getItem(tu)||"{}");n[e]=i,localStorage.setItem(tu,JSON.stringify(n))}catch{}}function Fy(){const{path:e}=Rt(),[i,n]=O.useState([]),[l,o]=O.useState(!1),[h,d]=O.useState(""),[_,p]=O.useState(null),[f,y]=O.useState("");O.useEffect(()=>{e&&n(Xy(e))},[e]);const S=N=>{n(N),e&&Vy(e,N)},x=()=>{const N=h.trim();if(!N)return;const L={id:Date.now().toString(),text:N,done:!1,createdAt:Date.now()};S([...i,L]),d("")},C=N=>{S(i.map(L=>L.id===N?{...L,done:!L.done}:L))},b=N=>{S(i.filter(L=>L.id!==N))},R=N=>{p(N.id),y(N.text)},M=N=>{const L=f.trim();L&&(S(i.map(U=>U.id===N?{...U,text:L}:U)),p(null))},W=i.filter(N=>N.done).length,te=i.length;return m.jsxs("div",{style:{borderBottom:"1px solid #e5e7eb"},children:[m.jsxs("button",{onClick:()=>o(!l),style:{width:"100%",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer"},children:[m.jsxs("span",{style:{fontWeight:600,fontSize:"14px",color:"#374151",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:l?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"Future Builds"]}),te>0&&m.jsxs("span",{style:{background:W===te?"#dcfce7":"#f3f4f6",color:W===te?"#16a34a":"#6b7280",fontSize:"12px",padding:"3px 10px",borderRadius:"12px",fontWeight:600},children:[W,"/",te]})]}),!l&&m.jsxs("div",{style:{padding:"0 12px 16px",display:"flex",flexDirection:"column",gap:"4px"},children:[m.jsxs("div",{style:{display:"flex",gap:"6px",marginBottom:"8px"},children:[m.jsx("input",{value:h,onChange:N=>d(N.target.value),onKeyDown:N=>N.key==="Enter"&&x(),placeholder:"Add a feature or idea...",style:{flex:1,padding:"8px 12px",fontSize:"13px",border:"1px solid #e5e7eb",borderRadius:"8px",outline:"none",color:"#374151",background:"#fafafa"}}),m.jsx("button",{onClick:x,style:{padding:"8px 14px",background:"#5e17eb",color:"#fff",fontSize:"13px",fontWeight:600,borderRadius:"8px",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:"+"})]}),i.map(N=>m.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"8px 10px",borderRadius:"8px",background:N.done?"rgba(22,163,74,0.04)":"#fafafa",transition:"background 0.15s"},children:[m.jsx("input",{type:"checkbox",checked:N.done,onChange:()=>C(N.id),style:{marginTop:"3px",cursor:"pointer",accentColor:"#5e17eb"}}),_===N.id?m.jsx("input",{value:f,onChange:L=>y(L.target.value),onKeyDown:L=>{L.key==="Enter"&&M(N.id),L.key==="Escape"&&p(null)},onBlur:()=>M(N.id),autoFocus:!0,style:{flex:1,padding:"2px 6px",fontSize:"13px",border:"1px solid #d1d5db",borderRadius:"4px",outline:"none"}}):m.jsx("span",{onDoubleClick:()=>R(N),style:{flex:1,fontSize:"13px",color:N.done?"#9ca3af":"#374151",textDecoration:N.done?"line-through":"none",cursor:"default",lineHeight:1.4},children:N.text}),m.jsx("button",{onClick:()=>b(N.id),style:{background:"none",border:"none",cursor:"pointer",color:"#d1d5db",fontSize:"14px",padding:"0 2px",lineHeight:1,transition:"color 0.15s"},onMouseEnter:L=>L.currentTarget.style.color="#ef4444",onMouseLeave:L=>L.currentTarget.style.color="#d1d5db",children:"×"})]},N.id)),i.length===0&&m.jsx("p",{style:{fontSize:"12px",color:"#9ca3af",textAlign:"center",padding:"12px"},children:"Track features, ideas, and things to build next"})]})]})}function Zy(){const{path:e,setProjectPath:i}=Rt(),n=e?e.split("/").filter(Boolean).pop():"Project",l=async()=>{const o=await _i("/api/pick-folder");o?.path&&i(o.path)};return m.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:"#fff"},children:[m.jsxs("div",{style:{padding:"20px 24px 16px",borderBottom:"1px solid #e5e7eb"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"6px"},children:[m.jsx("div",{style:{fontSize:"11px",textTransform:"uppercase",letterSpacing:"0.05em",color:"#9ca3af"},children:"Project"}),m.jsx("button",{onClick:l,style:{padding:"4px 10px",borderRadius:"6px",border:"1px solid #e5e7eb",background:"#fff",color:"#6b7280",fontSize:"11px",fontWeight:500,cursor:"pointer",transition:"all 0.15s"},children:"Change"})]}),m.jsx("div",{style:{fontSize:"14px",fontWeight:600,color:"#1a2233",wordBreak:"break-all"},children:n}),e&&m.jsx("div",{style:{fontSize:"11px",color:"#9ca3af",marginTop:"2px",wordBreak:"break-all"},children:e})]}),m.jsxs("div",{style:{flex:1,overflowY:"auto"},children:[m.jsx(Uy,{}),m.jsx(qy,{}),m.jsx(Wy,{}),m.jsx(Ky,{}),m.jsx(Iy,{}),m.jsx(Fy,{})]})]})}const Qy={pdf:"text-red-500",docx:"text-blue-500",doc:"text-blue-500",xlsx:"text-green-500",xls:"text-green-500",csv:"text-green-600",txt:"text-gray-400",md:"text-gray-400",json:"text-yellow-500",html:"text-orange-500",pptx:"text-pink-500"};function Jy(e){const i=e.split(".").pop()?.toLowerCase()||"";return Qy[i]||"text-gray-400"}function eb(e){return Object.entries(e).sort((i,n)=>n[1]-i[1]).map(([i,n])=>`${n} ${i}`).join(", ")}function tb(){const{folderPath:e,folderScan:i,scanLoading:n,scanFolder:l,clearFolder:o}=Ni(),[h,d]=O.useState(""),[_,p]=O.useState(!1),[f,y]=O.useState(!1),[S,x]=O.useState(!1);async function C(){y(!0);const L=await _i("/api/pick-folder");y(!1),L?.path&&l(L.path)}function b(){const L=h.trim();L&&l(L)}function R(L){L.key==="Enter"&&b()}const M=i?.files||[],W=i?.summary.total||0,te=i?.summary.byType||{},N=M.slice(0,20);return m.jsxs("div",{style:{padding:"16px 20px",display:"flex",flexDirection:"column",gap:"10px",borderBottom:"1px solid var(--border)"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[m.jsx("div",{style:{width:"24px",height:"24px",borderRadius:"8px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"11px",fontWeight:700,flexShrink:0},children:"1"}),m.jsx("h3",{style:{fontSize:"13px",fontWeight:700,color:"var(--text-primary)"},children:"Choose folder"})]}),e?m.jsxs("div",{className:"rounded-lg border",style:{background:"var(--bg-secondary)",borderColor:"var(--border)",padding:"10px 12px"},children:[m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[m.jsx("span",{style:{fontSize:"14px",flexShrink:0},children:"📁"}),m.jsx("span",{style:{fontSize:"13px",fontWeight:600,color:"var(--text-primary)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e?.split("/").filter(Boolean).pop()||e}),m.jsxs("span",{style:{fontSize:"11px",padding:"2px 8px",borderRadius:"100px",background:"#eef2ff",color:"#6366f1",fontWeight:600,flexShrink:0,whiteSpace:"nowrap"},children:[W," files"]}),m.jsx("button",{onClick:o,style:{fontSize:"11px",padding:"2px 8px",borderRadius:"100px",border:"1px solid var(--border)",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",flexShrink:0,whiteSpace:"nowrap"},children:"Change"})]}),Object.keys(te).length>0&&m.jsx("p",{style:{fontSize:"11px",color:"var(--text-secondary)",marginTop:"4px"},children:eb(te)}),W>50&&m.jsxs("p",{className:"text-xs text-amber-500 bg-amber-500/10 rounded px-2 py-1",children:["Large folder — processing may take longer for ",W," files."]}),M.length>0&&m.jsxs("div",{children:[m.jsx("button",{onClick:()=>p(L=>!L),className:"text-xs transition-colors",style:{color:"var(--text-secondary)"},children:_?"▲ Hide files":`▼ Show files (${Math.min(20,M.length)} of ${W})`}),_&&m.jsx("ul",{className:"mt-2 space-y-1 max-h-48 overflow-y-auto",children:N.map((L,U)=>m.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[m.jsx("span",{className:`font-mono font-semibold ${Jy(L.name)}`,children:L.name.split(".").pop()?.toLowerCase()}),m.jsx("span",{style:{color:"var(--text-primary)"},children:L.name})]},U))})]})]}):m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[m.jsx("button",{onClick:C,disabled:f||n,style:{width:"100%",padding:"16px 20px",borderRadius:"14px",fontSize:"15px",fontWeight:600,background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",color:"white",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",boxShadow:"0 4px 12px rgba(94,23,235,0.3)",opacity:f||n?.5:1,transition:"all 0.2s"},children:f?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Waiting for selection..."]}):m.jsx(m.Fragment,{children:"📂 Browse for folder"})}),S?m.jsxs("div",{className:"flex gap-2",children:[m.jsx("input",{type:"text",value:h,onChange:L=>d(L.target.value),onKeyDown:R,placeholder:"/path/to/documents",autoFocus:!0,className:"flex-1 px-3 py-2.5 rounded-lg text-sm border outline-none focus:ring-2 focus:ring-indigo-400",style:{background:"var(--bg-secondary)",borderColor:"var(--border)",color:"var(--text-primary)"}}),m.jsx("button",{onClick:b,disabled:!h.trim()||n,className:"px-4 py-2.5 rounded-lg text-sm font-medium bg-indigo-500 text-white hover:bg-indigo-600 disabled:opacity-50 transition-colors",children:n?"...":"Scan"})]}):m.jsx("button",{onClick:()=>x(!0),style:{fontSize:"13px",color:"var(--text-secondary)",background:"none",border:"none",cursor:"pointer",margin:"0 auto",display:"block"},children:"Or enter path manually →"})]})]})}function ib(){const{selectedOutcome:e,setSelectedOutcome:i,freeformText:n,setFreeformText:l}=Ni();return m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-2",style:{marginBottom:"12px"},children:[m.jsx("div",{style:{width:"24px",height:"24px",borderRadius:"8px",background:"linear-gradient(135deg, #6366f1, #a855f7)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"11px",fontWeight:700,flexShrink:0},children:"2"}),m.jsx("h3",{style:{fontSize:"13px",fontWeight:700,color:"var(--text-primary)"},children:"Choose outcome"})]}),by.map(o=>{const h=oo.filter(d=>d.category===o.key);return m.jsxs("div",{style:{marginBottom:"12px"},children:[m.jsxs("div",{style:{fontSize:"11px",fontWeight:600,color:"#9ca3af",marginBottom:"6px",textTransform:"uppercase",letterSpacing:"0.04em"},children:[o.label," ",m.jsxs("span",{style:{fontWeight:400,textTransform:"none",letterSpacing:0},children:["— ",o.description]})]}),m.jsx("div",{className:"grid grid-cols-2",style:{gap:"6px"},children:h.map(d=>{const _=e===d.key;return m.jsxs("button",{onClick:()=>i(_?null:d.key),style:{padding:"8px 10px",borderRadius:"10px",border:_?"2px solid #818cf8":"1.5px solid var(--border)",background:_?"#eef2ff":"var(--bg-secondary, #fff)",cursor:"pointer",boxShadow:_?"0 0 0 3px rgba(99,102,241,0.08)":"none",display:"flex",alignItems:"center",gap:"8px",textAlign:"left",transition:"all 0.15s"},children:[m.jsx("span",{style:{fontSize:"15px",flexShrink:0},children:d.emoji}),m.jsxs("div",{style:{minWidth:0},children:[m.jsx("div",{style:{fontSize:"12px",fontWeight:700,color:_?"#4338ca":"var(--text-primary)"},children:d.name}),m.jsx("div",{style:{fontSize:"10px",color:"var(--text-secondary)",lineHeight:1.2},children:d.description})]})]},d.key)})})]},o.key)}),m.jsxs("div",{style:{marginTop:"8px"},children:[m.jsx("div",{style:{fontSize:"11px",fontWeight:500,color:"var(--text-secondary)",marginBottom:"4px"},children:"Or describe what you need:"}),m.jsx("textarea",{value:n,onChange:o=>l(o.target.value),placeholder:"e.g. Find all contract expiry dates and list them by client",rows:2,className:"w-full rounded-lg border outline-none resize-none",style:{padding:"10px 14px",fontSize:"12px",lineHeight:"1.5",background:"var(--bg-secondary)",borderColor:"var(--border)",color:"var(--text-primary)"}})]})]})}const zm="claude-portal-style-templates",Om=()=>{try{return JSON.parse(localStorage.getItem(zm)||"[]")}catch{return[]}},sb=e=>localStorage.setItem(zm,JSON.stringify(e)),rb=e=>Om().filter(i=>i.outcomeKey===e);function nb(e){const i=Om();i.push(e);const n=new Map;for(const o of i){const h=n.get(o.outcomeKey)||[];h.push(o),n.set(o.outcomeKey,h)}const l=[];for(const o of n.values())l.push(...o.slice(-10));sb(l)}const lb={pdf:"📄",md:"📝",docx:"📘",doc:"📘",txt:"📃"},ab=".md,.txt,.csv,.json,.html",Wh=3;function ob(e){return e.split(".").pop()?.toLowerCase()||""}function cb({outcomeKey:e,onContentChange:i}){const[n,l]=O.useState([]),[o,h]=O.useState(null),[d,_]=O.useState(!1),[p,f]=O.useState([]),y=O.useRef(null);O.useEffect(()=>{f(e?rb(e):[]),h(null)},[e]);const S=O.useCallback((N,L)=>{if(L){const U=p.find(X=>X.id===L);if(U){i(U.content);return}}if(N.length>0){const U=N.map(X=>X.content).join(`
|
|
52
52
|
|
|
53
53
|
---
|
|
54
54
|
|
|
55
|
-
`);i(H)}else i(null)},[i,p]),x=O.useRef(!1);O.useEffect(()=>{if(!x.current){x.current=!0;return}S(n,o)},[n,o,S]);const C=O.useCallback(async A=>{const L=Array.from(A),H=[];for(const Z of L){const F=Z.name.split(".").pop()?.toLowerCase()||"";if(["pdf","docx","doc"].includes(F))continue;const pe=await Z.text();H.push({name:Z.name,content:pe})}H.length!==0&&(l(Z=>{const F=Wh-Z.length;return F<=0?Z:[...Z,...H.slice(0,F)]}),h(null))},[]),b=O.useCallback(A=>{A.preventDefault(),_(!1),A.dataTransfer.files.length>0&&C(A.dataTransfer.files)},[C]),R=O.useCallback(A=>{A.target.files&&A.target.files.length>0&&C(A.target.files),A.target.value=""},[C]),j=O.useCallback(A=>{l(L=>L.filter((H,Z)=>Z!==A))},[]),X=O.useCallback(A=>{h(L=>L===A?null:A),l([])},[]),K=n.length>0||o!==null;return m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center gap-2",style:{marginBottom:"8px"},children:[m.jsx("div",{className:"flex items-center justify-center text-white text-xs font-bold flex-shrink-0",style:{width:"24px",height:"24px",borderRadius:"8px",background:"linear-gradient(135deg, #6366f1, #a855f7)"},children:"✦"}),m.jsx("h3",{className:"text-sm font-semibold",style:{color:"var(--text-primary)"},children:"Show Claude an example"}),m.jsx("span",{className:"text-xs italic",style:{color:"var(--text-secondary)"},children:"optional"})]}),n.map((A,L)=>{const H=ob(A.name),Z=lb[H]||"📄",F=A.content.slice(0,80).replace(/\n/g," "),pe={pdf:"#fef2f2",md:"#f0f9ff",docx:"#eff6ff",doc:"#eff6ff",txt:"#f8fafc"};return m.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border",style:{padding:"10px 12px",background:"var(--bg-secondary)",borderColor:"var(--border)"},children:[m.jsx("div",{className:"flex items-center justify-center flex-shrink-0",style:{width:"32px",height:"32px",borderRadius:"8px",background:pe[H]||"#f8fafc",fontSize:"16px"},children:Z}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-xs font-semibold truncate",style:{color:"var(--text-primary)"},children:A.name}),m.jsx("div",{className:"text-xs truncate",style:{color:"var(--text-secondary)",fontSize:"10px",marginTop:"1px"},children:F})]}),m.jsx("button",{onClick:()=>j(L),"aria-label":`Remove ${A.name}`,className:"flex items-center justify-center flex-shrink-0 border rounded-md transition-colors hover:bg-red-50 hover:border-red-300 hover:text-red-600",style:{width:"20px",height:"20px",borderColor:"var(--border)",color:"var(--text-secondary)",background:"transparent",cursor:"pointer",fontSize:"10px"},children:"✕"})]},L)}),n.length<Wh&&m.jsxs("div",{onDragOver:A=>{A.preventDefault(),_(!0)},onDragLeave:()=>_(!1),onDrop:b,onClick:()=>y.current?.click(),className:"relative text-center cursor-pointer transition-all rounded-xl",style:{border:`2px dashed ${d?"#818cf8":"#c7d2fe"}`,borderRadius:"10px",padding:"12px",background:d?"#eef2ff":"transparent"},children:[m.jsx("input",{ref:y,type:"file",multiple:!0,accept:ab,onChange:R,style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}}),m.jsx("div",{style:{fontSize:"18px",marginBottom:"4px",opacity:.7},children:"📎"}),m.jsxs("div",{style:{fontSize:"11px",color:"#64748b",fontWeight:500,lineHeight:1.4},children:[m.jsx("strong",{style:{color:"#6366f1"},children:"Drop a document"})," to use as a style reference"]}),m.jsx("div",{style:{fontSize:"10px",color:"#94a3b8",marginTop:"2px"},children:"MD, TXT, CSV, JSON, HTML — up to 3"})]}),n.length>0&&m.jsxs("div",{className:"text-right",style:{fontSize:"10px",color:"#94a3b8"},children:[n.length," of ",Wh," examples attached"]}),p.length>0&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-center gap-2",style:{margin:"12px 0 8px"},children:[m.jsx("div",{className:"flex-1",style:{height:"1px",background:"var(--border)"}}),m.jsx("span",{style:{fontSize:"10px",color:"#94a3b8",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",whiteSpace:"nowrap"},children:"or use a saved style"}),m.jsx("div",{className:"flex-1",style:{height:"1px",background:"var(--border)"}})]}),m.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(A=>{const L=o===A.id;return m.jsxs("button",{onClick:()=>X(A.id),className:"inline-flex items-center gap-1 rounded-lg text-xs transition-colors",style:{padding:"5px 10px",border:`1px solid ${L?"#818cf8":"var(--border)"}`,background:L?"#eef2ff":"transparent",color:L?"#4338ca":"var(--text-secondary)",cursor:"pointer",fontWeight:500},children:[m.jsx("span",{style:{fontSize:"12px"},children:"⭐"})," ",A.name]},A.id)})})]}),K&&m.jsx("div",{className:"rounded-lg",style:{fontSize:"10px",color:"#6366f1",background:"#eef2ff",border:"1px solid #e0e7ff",borderRadius:"8px",padding:"6px 10px"},children:"✨ Claude will match the tone, structure, and formatting of your example"})]})}function hb(){const{contextText:e,setContextText:i,canRun:n,run:l,selectedOutcome:o,folderScan:h,isRunning:d}=Ni(),_=o?oo.find(f=>f.key===o)?.name||o:"Custom",p=h?.summary.total||0;return m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex items-center gap-2",style:{marginBottom:"8px"},children:[m.jsx("div",{className:"flex-shrink-0",style:{width:"24px",height:"24px",borderRadius:"8px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"11px",fontWeight:700},children:"3"}),m.jsx("h3",{style:{fontSize:"13px",fontWeight:700,color:"var(--text-primary)"},children:"Additional context"})]}),m.jsx("textarea",{value:e,onChange:f=>i(f.target.value),placeholder:"Any extra instructions, e.g. focus on Q4, ignore drafts, output in French…",rows:2,className:"w-full rounded-lg border outline-none focus:ring-2 focus:ring-indigo-400 resize-none",style:{padding:"10px 14px",fontSize:"12px",lineHeight:"1.5",background:"var(--bg-secondary)",borderColor:"var(--border)",color:"var(--text-primary)"}}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx("button",{onClick:l,disabled:!n,className:"w-full rounded-lg text-sm font-semibold text-white shadow-lg disabled:opacity-40 disabled:cursor-not-allowed transition-all",style:{padding:"12px 16px",background:"linear-gradient(135deg, #7c3aed, #a855f7)"},children:d?"⏳ Working...":`✨ Go — ${_} ${p} documents`}),m.jsx("p",{className:"text-xs text-center",style:{color:"var(--text-secondary)"},children:"Claude will scan your files and create the output"})]})]})}function ub(){const{selectedOutcome:e}=Ni(),[i,n]=O.useState([]),[l,o]=O.useState(!0),[h,d]=O.useState(!0);O.useEffect(()=>{const S=e?`/api/mcp-status?outcome=${e}`:"/api/mcp-status";fetch(S).then(x=>x.json()).then(x=>{n(x.mcps||[]),o(!1)}).catch(()=>o(!1))},[e]);const _=i.filter(S=>S.relevant),p=_.filter(S=>S.installed).length,f=_.length,y={};for(const S of _)y[S.category]||(y[S.category]=[]),y[S.category].push(S);return m.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)"},children:[m.jsxs("button",{onClick:()=>d(!h),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer",padding:0},children:[m.jsxs("span",{style:{fontWeight:600,fontSize:"13px",color:"var(--text-primary)",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:h?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"Superpowers (MCPs)"]}),l?m.jsx("span",{style:{fontSize:"11px",color:"#9ca3af"},children:"checking..."}):m.jsxs("span",{style:{background:p===f?"rgba(22,163,74,0.1)":"rgba(139,92,246,0.1)",color:p===f?"#16a34a":"#8b5cf6",fontSize:"11px",padding:"2px 8px",borderRadius:"10px",fontWeight:600},children:[p,"/",f," active"]})]}),!h&&!l&&m.jsxs("div",{style:{marginTop:"12px",display:"flex",flexDirection:"column",gap:"12px"},children:[Object.entries(y).map(([S,x])=>m.jsxs("div",{children:[m.jsx("div",{style:{fontSize:"10px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",color:"#9ca3af",marginBottom:"6px"},children:x[0].categoryLabel}),m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:x.map(C=>m.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"8px 10px",borderRadius:"8px",background:C.installed?"rgba(22, 163, 74, 0.04)":"rgba(0, 0, 0, 0.02)"},children:[m.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",marginTop:"4px",background:C.installed?"#16a34a":"#d4d4d8",flexShrink:0}}),m.jsxs("div",{style:{flex:1,minWidth:0},children:[m.jsx("div",{style:{fontSize:"12px",fontWeight:600,color:C.installed?"var(--text-primary)":"#6b7280"},children:C.name}),m.jsx("div",{style:{fontSize:"11px",color:"#9ca3af",marginTop:"1px"},children:C.description}),!C.installed&&C.installHint&&m.jsx("div",{style:{fontSize:"10px",color:"#8b5cf6",marginTop:"4px",fontFamily:"'SF Mono', monospace",background:"rgba(139,92,246,0.06)",padding:"3px 6px",borderRadius:"4px",wordBreak:"break-all"},children:C.installHint})]})]},C.id))})]},S)),_.length===0&&m.jsx("p",{style:{fontSize:"12px",color:"#9ca3af",textAlign:"center",padding:"8px"},children:"Select an outcome to see recommended MCPs"})]})]})}function db(){const{folderPath:e,selectedOutcome:i,setStyleExampleContent:n}=Ni(),[l,o]=O.useState(!1);return m.jsxs("div",{className:"h-full overflow-y-auto",style:{background:"var(--bg-sidebar)"},children:[l&&m.jsx(Mm,{onClose:()=>o(!1)}),m.jsx("div",{style:{padding:"20px 28px 0"},children:m.jsx("button",{onClick:()=>o(!0),style:{width:"100%",padding:"12px 20px",borderRadius:"12px",background:"linear-gradient(135deg, rgba(94,23,235,0.06), rgba(139,92,246,0.06))",border:"1px solid rgba(94,23,235,0.15)",color:"#8b5cf6",fontSize:"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:"▶ How it works"})}),m.jsx(tb,{}),e&&m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)"},children:m.jsx(ib,{})}),m.jsx("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)"},children:m.jsx(cb,{outcomeKey:i,onContentChange:n})}),m.jsx(ub,{}),m.jsx("div",{style:{padding:"16px 20px",paddingBottom:"24px"},children:m.jsx(hb,{})})]})]})}function fb({open:e}){const{mode:i}=Rt(),n=i==="document";return m.jsx("div",{style:{width:e?"340px":"0px",overflow:e?"auto":"hidden",borderRight:"1px solid #e5e7eb",background:"#fff",flexShrink:0,transition:"width 0.2s ease"},children:m.jsx("div",{style:{width:"340px",height:"100%"},children:n?m.jsx(db,{}):m.jsx(Zy,{})})})}var Lm=Object.defineProperty,pb=Object.getOwnPropertyDescriptor,_b=(e,i)=>{for(var n in i)Lm(e,n,{get:i[n],enumerable:!0})},Ze=(e,i,n,l)=>{for(var o=l>1?void 0:l?pb(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&&Lm(i,n,o),o},se=(e,i)=>(n,l)=>i(n,l,e),bg="Terminal input",iu={get:()=>bg,set:e=>bg=e},xg="Too much output to announce, navigate to rows manually to read",su={get:()=>xg,set:e=>xg=e};function gb(e){return e.replace(/\r?\n/g,"\r")}function mb(e,i){return i?"\x1B[200~"+e+"\x1B[201~":e}function vb(e,i){e.clipboardData&&e.clipboardData.setData("text/plain",i.selectionText),e.preventDefault()}function Sb(e,i,n,l){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");Nm(o,i,n,l)}}function Nm(e,i,n,l){e=gb(e),e=mb(e,n.decPrivateModes.bracketedPasteMode&&l.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),i.value=""}function jm(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 wg(e,i,n,l,o){jm(e,i,n),o&&l.rightClickSelect(e),i.value=l.selectionText,i.select()}function Os(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function co(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 yb=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}},bb=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,_,p=0,f=0;if(this.interim[0]){let x=!1,C=this.interim[0];C&=(C&224)===192?31:(C&240)===224?15:7;let b=0,R;for(;(R=this.interim[++b]&63)&&b<4;)C<<=6,C|=R;let j=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,X=j-b;for(;f<X;){if(f>=n)return 0;if(R=e[f++],(R&192)!==128){f--,x=!0;break}else this.interim[b++]=R,C<<=6,C|=R&63}x||(j===2?C<128?f--:i[l++]=C:j===3?C<2048||C>=55296&&C<=57343||C===65279||(i[l++]=C):C<65536||C>1114111||(i[l++]=C)),this.interim.fill(0)}let y=n-4,S=f;for(;S<n;){for(;S<y&&!((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(p=(o&31)<<6|h&63,p<128){S--;continue}i[l++]=p}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(p=(o&15)<<12|(h&63)<<6|d&63,p<2048||p>=55296&&p<=57343||p===65279)continue;i[l++]=p}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(p=(o&7)<<18|(h&63)<<12|(d&63)<<6|_&63,p<65536||p>1114111)continue;i[l++]=p}}return l}},Hm="",Ls=" ",ml=class Um{constructor(){this.fg=0,this.bg=0,this.extended=new Ja}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 Um;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}},Ja=class qm{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 qm(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},gi=class Wm extends ml{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ja,this.combinedData=""}static fromCharData(i){let n=new Wm;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?Os(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()]}},Cg="di$target",ru="di$dependencies",Ph=new Map;function xb(e){return e[ru]||[]}function vt(e){if(Ph.has(e))return Ph.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");wb(i,n,o)};return i._id=e,Ph.set(e,i),i}function wb(e,i,n){i[Cg]===i?i[ru].push({id:e,index:n}):(i[ru]=[{id:e,index:n}],i[Cg]=i)}var At=vt("BufferService"),Pm=vt("CoreMouseService"),hr=vt("CoreService"),Cb=vt("CharsetService"),Ku=vt("InstantiationService"),Km=vt("LogService"),zt=vt("OptionsService"),Ym=vt("OscLinkService"),kb=vt("UnicodeService"),vl=vt("DecorationService"),nu=class{constructor(e,i,n){this._bufferService=e,this._optionsService=i,this._oscLinkService=n}provideLinks(e,i){let n=this._bufferService.buffer.lines.get(e-1);if(!n){i(void 0);return}let l=[],o=this._optionsService.rawOptions.linkHandler,h=new gi,d=n.getTrimmedLength(),_=-1,p=-1,f=!1;for(let y=0;y<d;y++)if(!(p===-1&&!n.hasContent(y))){if(n.loadCell(y,h),h.hasExtendedAttrs()&&h.extended.urlId)if(p===-1){p=y,_=h.extended.urlId;continue}else f=h.extended.urlId!==_;else p!==-1&&(f=!0);if(f||p!==-1&&y===d-1){let S=this._oscLinkService.getLinkData(_)?.uri;if(S){let x={start:{x:p+1,y:e},end:{x:y+(!f&&y===d-1?1:0),y:e}},C=!1;if(!o?.allowNonHttpProtocols)try{let b=new URL(S);["http:","https:"].includes(b.protocol)||(C=!0)}catch{C=!0}C||l.push({text:S,range:x,activate:(b,R)=>o?o.activate(b,R,x):Eb(b,R),hover:(b,R)=>o?.hover?.(b,R,x),leave:(b,R)=>o?.leave?.(b,R,x)})}f=!1,h.hasExtendedAttrs()&&h.extended.urlId?(p=y,_=h.extended.urlId):(p=-1,_=-1)}}i(l)}};nu=Ze([se(0,At),se(1,zt),se(2,Ym)],nu);function Eb(e,i){if(confirm(`Do you want to navigate to ${i}?
|
|
55
|
+
`);i(U)}else i(null)},[i,p]),x=O.useRef(!1);O.useEffect(()=>{if(!x.current){x.current=!0;return}S(n,o)},[n,o,S]);const C=O.useCallback(async N=>{const L=Array.from(N),U=[];for(const X of L){const J=X.name.split(".").pop()?.toLowerCase()||"";if(["pdf","docx","doc"].includes(J))continue;const ge=await X.text();U.push({name:X.name,content:ge})}U.length!==0&&(l(X=>{const J=Wh-X.length;return J<=0?X:[...X,...U.slice(0,J)]}),h(null))},[]),b=O.useCallback(N=>{N.preventDefault(),_(!1),N.dataTransfer.files.length>0&&C(N.dataTransfer.files)},[C]),R=O.useCallback(N=>{N.target.files&&N.target.files.length>0&&C(N.target.files),N.target.value=""},[C]),M=O.useCallback(N=>{l(L=>L.filter((U,X)=>X!==N))},[]),W=O.useCallback(N=>{h(L=>L===N?null:N),l([])},[]),te=n.length>0||o!==null;return m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center gap-2",style:{marginBottom:"8px"},children:[m.jsx("div",{className:"flex items-center justify-center text-white text-xs font-bold flex-shrink-0",style:{width:"24px",height:"24px",borderRadius:"8px",background:"linear-gradient(135deg, #6366f1, #a855f7)"},children:"✦"}),m.jsx("h3",{className:"text-sm font-semibold",style:{color:"var(--text-primary)"},children:"Show Claude an example"}),m.jsx("span",{className:"text-xs italic",style:{color:"var(--text-secondary)"},children:"optional"})]}),n.map((N,L)=>{const U=ob(N.name),X=lb[U]||"📄",J=N.content.slice(0,80).replace(/\n/g," "),ge={pdf:"#fef2f2",md:"#f0f9ff",docx:"#eff6ff",doc:"#eff6ff",txt:"#f8fafc"};return m.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border",style:{padding:"10px 12px",background:"var(--bg-secondary)",borderColor:"var(--border)"},children:[m.jsx("div",{className:"flex items-center justify-center flex-shrink-0",style:{width:"32px",height:"32px",borderRadius:"8px",background:ge[U]||"#f8fafc",fontSize:"16px"},children:X}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-xs font-semibold truncate",style:{color:"var(--text-primary)"},children:N.name}),m.jsx("div",{className:"text-xs truncate",style:{color:"var(--text-secondary)",fontSize:"10px",marginTop:"1px"},children:J})]}),m.jsx("button",{onClick:()=>M(L),"aria-label":`Remove ${N.name}`,className:"flex items-center justify-center flex-shrink-0 border rounded-md transition-colors hover:bg-red-50 hover:border-red-300 hover:text-red-600",style:{width:"20px",height:"20px",borderColor:"var(--border)",color:"var(--text-secondary)",background:"transparent",cursor:"pointer",fontSize:"10px"},children:"✕"})]},L)}),n.length<Wh&&m.jsxs("div",{onDragOver:N=>{N.preventDefault(),_(!0)},onDragLeave:()=>_(!1),onDrop:b,onClick:()=>y.current?.click(),className:"relative text-center cursor-pointer transition-all rounded-xl",style:{border:`2px dashed ${d?"#818cf8":"#c7d2fe"}`,borderRadius:"10px",padding:"12px",background:d?"#eef2ff":"transparent"},children:[m.jsx("input",{ref:y,type:"file",multiple:!0,accept:ab,onChange:R,style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}}),m.jsx("div",{style:{fontSize:"18px",marginBottom:"4px",opacity:.7},children:"📎"}),m.jsxs("div",{style:{fontSize:"11px",color:"#64748b",fontWeight:500,lineHeight:1.4},children:[m.jsx("strong",{style:{color:"#6366f1"},children:"Drop a document"})," to use as a style reference"]}),m.jsx("div",{style:{fontSize:"10px",color:"#94a3b8",marginTop:"2px"},children:"MD, TXT, CSV, JSON, HTML — up to 3"})]}),n.length>0&&m.jsxs("div",{className:"text-right",style:{fontSize:"10px",color:"#94a3b8"},children:[n.length," of ",Wh," examples attached"]}),p.length>0&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-center gap-2",style:{margin:"12px 0 8px"},children:[m.jsx("div",{className:"flex-1",style:{height:"1px",background:"var(--border)"}}),m.jsx("span",{style:{fontSize:"10px",color:"#94a3b8",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",whiteSpace:"nowrap"},children:"or use a saved style"}),m.jsx("div",{className:"flex-1",style:{height:"1px",background:"var(--border)"}})]}),m.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(N=>{const L=o===N.id;return m.jsxs("button",{onClick:()=>W(N.id),className:"inline-flex items-center gap-1 rounded-lg text-xs transition-colors",style:{padding:"5px 10px",border:`1px solid ${L?"#818cf8":"var(--border)"}`,background:L?"#eef2ff":"transparent",color:L?"#4338ca":"var(--text-secondary)",cursor:"pointer",fontWeight:500},children:[m.jsx("span",{style:{fontSize:"12px"},children:"⭐"})," ",N.name]},N.id)})})]}),te&&m.jsx("div",{className:"rounded-lg",style:{fontSize:"10px",color:"#6366f1",background:"#eef2ff",border:"1px solid #e0e7ff",borderRadius:"8px",padding:"6px 10px"},children:"✨ Claude will match the tone, structure, and formatting of your example"})]})}function hb(){const{contextText:e,setContextText:i,canRun:n,run:l,selectedOutcome:o,folderScan:h,isRunning:d}=Ni(),_=o?oo.find(f=>f.key===o)?.name||o:"Custom",p=h?.summary.total||0;return m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex items-center gap-2",style:{marginBottom:"8px"},children:[m.jsx("div",{className:"flex-shrink-0",style:{width:"24px",height:"24px",borderRadius:"8px",background:"linear-gradient(135deg, #5e17eb, #8b5cf6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:"11px",fontWeight:700},children:"3"}),m.jsx("h3",{style:{fontSize:"13px",fontWeight:700,color:"var(--text-primary)"},children:"Additional context"})]}),m.jsx("textarea",{value:e,onChange:f=>i(f.target.value),placeholder:"Any extra instructions, e.g. focus on Q4, ignore drafts, output in French…",rows:2,className:"w-full rounded-lg border outline-none focus:ring-2 focus:ring-indigo-400 resize-none",style:{padding:"10px 14px",fontSize:"12px",lineHeight:"1.5",background:"var(--bg-secondary)",borderColor:"var(--border)",color:"var(--text-primary)"}}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsx("button",{onClick:l,disabled:!n,className:"w-full rounded-lg text-sm font-semibold text-white shadow-lg disabled:opacity-40 disabled:cursor-not-allowed transition-all",style:{padding:"12px 16px",background:"linear-gradient(135deg, #7c3aed, #a855f7)"},children:d?"⏳ Working...":`✨ Go — ${_} ${p} documents`}),m.jsx("p",{className:"text-xs text-center",style:{color:"var(--text-secondary)"},children:"Claude will scan your files and create the output"})]})]})}function ub(){const{selectedOutcome:e}=Ni(),[i,n]=O.useState([]),[l,o]=O.useState(!0),[h,d]=O.useState(!0);O.useEffect(()=>{const S=e?`/api/mcp-status?outcome=${e}`:"/api/mcp-status";fetch(S).then(x=>x.json()).then(x=>{n(x.mcps||[]),o(!1)}).catch(()=>o(!1))},[e]);const _=i.filter(S=>S.relevant),p=_.filter(S=>S.installed).length,f=_.length,y={};for(const S of _)y[S.category]||(y[S.category]=[]),y[S.category].push(S);return m.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)"},children:[m.jsxs("button",{onClick:()=>d(!h),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",background:"none",border:"none",cursor:"pointer",padding:0},children:[m.jsxs("span",{style:{fontWeight:600,fontSize:"13px",color:"var(--text-primary)",display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{fontSize:"10px",color:"#9ca3af",transform:h?"rotate(0deg)":"rotate(90deg)",transition:"transform 0.15s",display:"inline-block"},children:"▶"}),"Superpowers (MCPs)"]}),l?m.jsx("span",{style:{fontSize:"11px",color:"#9ca3af"},children:"checking..."}):m.jsxs("span",{style:{background:p===f?"rgba(22,163,74,0.1)":"rgba(139,92,246,0.1)",color:p===f?"#16a34a":"#8b5cf6",fontSize:"11px",padding:"2px 8px",borderRadius:"10px",fontWeight:600},children:[p,"/",f," active"]})]}),!h&&!l&&m.jsxs("div",{style:{marginTop:"12px",display:"flex",flexDirection:"column",gap:"12px"},children:[Object.entries(y).map(([S,x])=>m.jsxs("div",{children:[m.jsx("div",{style:{fontSize:"10px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",color:"#9ca3af",marginBottom:"6px"},children:x[0].categoryLabel}),m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:x.map(C=>m.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"8px 10px",borderRadius:"8px",background:C.installed?"rgba(22, 163, 74, 0.04)":"rgba(0, 0, 0, 0.02)"},children:[m.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",marginTop:"4px",background:C.installed?"#16a34a":"#d4d4d8",flexShrink:0}}),m.jsxs("div",{style:{flex:1,minWidth:0},children:[m.jsx("div",{style:{fontSize:"12px",fontWeight:600,color:C.installed?"var(--text-primary)":"#6b7280"},children:C.name}),m.jsx("div",{style:{fontSize:"11px",color:"#9ca3af",marginTop:"1px"},children:C.description}),!C.installed&&C.installHint&&m.jsx("div",{style:{fontSize:"10px",color:"#8b5cf6",marginTop:"4px",fontFamily:"'SF Mono', monospace",background:"rgba(139,92,246,0.06)",padding:"3px 6px",borderRadius:"4px",wordBreak:"break-all"},children:C.installHint})]})]},C.id))})]},S)),_.length===0&&m.jsx("p",{style:{fontSize:"12px",color:"#9ca3af",textAlign:"center",padding:"8px"},children:"Select an outcome to see recommended MCPs"})]})]})}function db(){const{folderPath:e,selectedOutcome:i,setStyleExampleContent:n}=Ni(),[l,o]=O.useState(!1);return m.jsxs("div",{className:"h-full overflow-y-auto",style:{background:"var(--bg-sidebar)"},children:[l&&m.jsx(Mm,{onClose:()=>o(!1)}),m.jsx("div",{style:{padding:"20px 28px 0"},children:m.jsx("button",{onClick:()=>o(!0),style:{width:"100%",padding:"12px 20px",borderRadius:"12px",background:"linear-gradient(135deg, rgba(94,23,235,0.06), rgba(139,92,246,0.06))",border:"1px solid rgba(94,23,235,0.15)",color:"#8b5cf6",fontSize:"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:"▶ How it works"})}),m.jsx(tb,{}),e&&m.jsxs(m.Fragment,{children:[m.jsx("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)"},children:m.jsx(ib,{})}),m.jsx("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)"},children:m.jsx(cb,{outcomeKey:i,onContentChange:n})}),m.jsx(ub,{}),m.jsx("div",{style:{padding:"16px 20px",paddingBottom:"24px"},children:m.jsx(hb,{})})]})]})}function fb({open:e}){const{mode:i}=Rt(),n=i==="document";return m.jsx("div",{style:{width:e?"340px":"0px",overflow:e?"auto":"hidden",borderRight:"1px solid #e5e7eb",background:"#fff",flexShrink:0,transition:"width 0.2s ease"},children:m.jsx("div",{style:{width:"340px",height:"100%"},children:n?m.jsx(db,{}):m.jsx(Zy,{})})})}var Lm=Object.defineProperty,pb=Object.getOwnPropertyDescriptor,_b=(e,i)=>{for(var n in i)Lm(e,n,{get:i[n],enumerable:!0})},Ze=(e,i,n,l)=>{for(var o=l>1?void 0:l?pb(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&&Lm(i,n,o),o},se=(e,i)=>(n,l)=>i(n,l,e),bg="Terminal input",iu={get:()=>bg,set:e=>bg=e},xg="Too much output to announce, navigate to rows manually to read",su={get:()=>xg,set:e=>xg=e};function gb(e){return e.replace(/\r?\n/g,"\r")}function mb(e,i){return i?"\x1B[200~"+e+"\x1B[201~":e}function vb(e,i){e.clipboardData&&e.clipboardData.setData("text/plain",i.selectionText),e.preventDefault()}function Sb(e,i,n,l){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");Nm(o,i,n,l)}}function Nm(e,i,n,l){e=gb(e),e=mb(e,n.decPrivateModes.bracketedPasteMode&&l.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),i.value=""}function jm(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 wg(e,i,n,l,o){jm(e,i,n),o&&l.rightClickSelect(e),i.value=l.selectionText,i.select()}function Os(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function co(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 yb=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}},bb=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,_,p=0,f=0;if(this.interim[0]){let x=!1,C=this.interim[0];C&=(C&224)===192?31:(C&240)===224?15:7;let b=0,R;for(;(R=this.interim[++b]&63)&&b<4;)C<<=6,C|=R;let M=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,W=M-b;for(;f<W;){if(f>=n)return 0;if(R=e[f++],(R&192)!==128){f--,x=!0;break}else this.interim[b++]=R,C<<=6,C|=R&63}x||(M===2?C<128?f--:i[l++]=C:M===3?C<2048||C>=55296&&C<=57343||C===65279||(i[l++]=C):C<65536||C>1114111||(i[l++]=C)),this.interim.fill(0)}let y=n-4,S=f;for(;S<n;){for(;S<y&&!((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(p=(o&31)<<6|h&63,p<128){S--;continue}i[l++]=p}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(p=(o&15)<<12|(h&63)<<6|d&63,p<2048||p>=55296&&p<=57343||p===65279)continue;i[l++]=p}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(p=(o&7)<<18|(h&63)<<12|(d&63)<<6|_&63,p<65536||p>1114111)continue;i[l++]=p}}return l}},Hm="",Ls=" ",ml=class Um{constructor(){this.fg=0,this.bg=0,this.extended=new Ja}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 Um;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}},Ja=class qm{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 qm(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},gi=class Wm extends ml{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ja,this.combinedData=""}static fromCharData(i){let n=new Wm;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?Os(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()]}},Cg="di$target",ru="di$dependencies",Ph=new Map;function xb(e){return e[ru]||[]}function St(e){if(Ph.has(e))return Ph.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");wb(i,n,o)};return i._id=e,Ph.set(e,i),i}function wb(e,i,n){i[Cg]===i?i[ru].push({id:e,index:n}):(i[ru]=[{id:e,index:n}],i[Cg]=i)}var At=St("BufferService"),Pm=St("CoreMouseService"),hr=St("CoreService"),Cb=St("CharsetService"),Ku=St("InstantiationService"),Km=St("LogService"),zt=St("OptionsService"),Ym=St("OscLinkService"),kb=St("UnicodeService"),vl=St("DecorationService"),nu=class{constructor(e,i,n){this._bufferService=e,this._optionsService=i,this._oscLinkService=n}provideLinks(e,i){let n=this._bufferService.buffer.lines.get(e-1);if(!n){i(void 0);return}let l=[],o=this._optionsService.rawOptions.linkHandler,h=new gi,d=n.getTrimmedLength(),_=-1,p=-1,f=!1;for(let y=0;y<d;y++)if(!(p===-1&&!n.hasContent(y))){if(n.loadCell(y,h),h.hasExtendedAttrs()&&h.extended.urlId)if(p===-1){p=y,_=h.extended.urlId;continue}else f=h.extended.urlId!==_;else p!==-1&&(f=!0);if(f||p!==-1&&y===d-1){let S=this._oscLinkService.getLinkData(_)?.uri;if(S){let x={start:{x:p+1,y:e},end:{x:y+(!f&&y===d-1?1:0),y:e}},C=!1;if(!o?.allowNonHttpProtocols)try{let b=new URL(S);["http:","https:"].includes(b.protocol)||(C=!0)}catch{C=!0}C||l.push({text:S,range:x,activate:(b,R)=>o?o.activate(b,R,x):Eb(b,R),hover:(b,R)=>o?.hover?.(b,R,x),leave:(b,R)=>o?.leave?.(b,R,x)})}f=!1,h.hasExtendedAttrs()&&h.extended.urlId?(p=y,_=h.extended.urlId):(p=-1,_=-1)}}i(l)}};nu=Ze([se(0,At),se(1,zt),se(2,Ym)],nu);function Eb(e,i){if(confirm(`Do you want to navigate to ${i}?
|
|
56
56
|
|
|
57
|
-
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 ho=
|
|
57
|
+
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 ho=St("CharSizeService"),rs=St("CoreBrowserService"),Yu=St("MouseService"),ns=St("RenderService"),Tb=St("SelectionService"),$m=St("CharacterJoinerService"),tn=St("ThemeService"),Im=St("LinkProviderService"),Rb=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?kg.isErrorNoTelemetry(e)?new kg(e.message+`
|
|
58
58
|
|
|
59
59
|
`+e.stack):new Error(e.message+`
|
|
60
60
|
|
|
61
|
-
`+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)}},Db=new Rb;function Ia(e){Mb(e)||Db.onUnexpectedError(e)}var lu="Canceled";function Mb(e){return e instanceof Bb?!0:e instanceof Error&&e.name===lu&&e.message===lu}var Bb=class extends Error{constructor(){super(lu),this.name=this.message}};function Ab(e){return new Error(`Illegal argument: ${e}`)}var kg=class au extends Error{constructor(i){super(i),this.name="CodeExpectedError"}static fromError(i){if(i instanceof au)return i;let n=new au;return n.message=i.message,n.stack=i.stack,n}static isErrorNoTelemetry(i){return i.name==="CodeExpectedError"}},ou=class Gm extends Error{constructor(i){super(i||"An unexpected bug occurred."),Object.setPrototypeOf(this,Gm.prototype)}};function Qt(e,i=0){return e[e.length-(1+i)]}var zb;(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})(zb||={});function Ob(e,i){let n=this,l=!1,o;return function(){return l||(l=!0,i||(o=e.apply(n,arguments))),o}}var Xm;(e=>{function i(L){return L&&typeof L=="object"&&typeof L[Symbol.iterator]=="function"}e.is=i;let n=Object.freeze([]);function l(){return n}e.empty=l;function*o(L){yield L}e.single=o;function h(L){return i(L)?L:o(L)}e.wrap=h;function d(L){return L||n}e.from=d;function*_(L){for(let H=L.length-1;H>=0;H--)yield L[H]}e.reverse=_;function p(L){return!L||L[Symbol.iterator]().next().done===!0}e.isEmpty=p;function f(L){return L[Symbol.iterator]().next().value}e.first=f;function y(L,H){let Z=0;for(let F of L)if(H(F,Z++))return!0;return!1}e.some=y;function S(L,H){for(let Z of L)if(H(Z))return Z}e.find=S;function*x(L,H){for(let Z of L)H(Z)&&(yield Z)}e.filter=x;function*C(L,H){let Z=0;for(let F of L)yield H(F,Z++)}e.map=C;function*b(L,H){let Z=0;for(let F of L)yield*H(F,Z++)}e.flatMap=b;function*R(...L){for(let H of L)yield*H}e.concat=R;function j(L,H,Z){let F=Z;for(let pe of L)F=H(F,pe);return F}e.reduce=j;function*X(L,H,Z=L.length){for(H<0&&(H+=L.length),Z<0?Z+=L.length:Z>L.length&&(Z=L.length);H<Z;H++)yield L[H]}e.slice=X;function K(L,H=Number.POSITIVE_INFINITY){let Z=[];if(H===0)return[Z,L];let F=L[Symbol.iterator]();for(let pe=0;pe<H;pe++){let ke=F.next();if(ke.done)return[Z,e.empty()];Z.push(ke.value)}return[Z,{[Symbol.iterator](){return F}}]}e.consume=K;async function A(L){let H=[];for await(let Z of L)H.push(Z);return Promise.resolve(H)}e.asyncToArray=A})(Xm||={});function ar(e){if(Xm.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 Lb(...e){return $e(()=>ar(e))}function $e(e){return{dispose:Ob(()=>{e()})}}var Vm=class Fm{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?Fm.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)}};Vm.DISABLE_DISPOSED_WARNING=!1;var Ns=Vm,Se=class{constructor(){this._store=new Ns,this._store}dispose(){this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}};Se.None=Object.freeze({dispose(){}});var Jr=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(i){this._isDisposed||i===this._value||(this._value?.dispose(),this._value=i)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let i=this._value;return this._value=void 0,i}},ss=typeof window=="object"?window:globalThis,cu=class hu{constructor(i){this.element=i,this.next=hu.Undefined,this.prev=hu.Undefined}};cu.Undefined=new cu(void 0);var Ie=cu,Eg=class{constructor(){this._first=Ie.Undefined,this._last=Ie.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ie.Undefined}clear(){let e=this._first;for(;e!==Ie.Undefined;){let i=e.next;e.prev=Ie.Undefined,e.next=Ie.Undefined,e=i}this._first=Ie.Undefined,this._last=Ie.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,i){let n=new Ie(e);if(this._first===Ie.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!==Ie.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ie.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ie.Undefined&&e.next!==Ie.Undefined){let i=e.prev;i.next=e.next,e.next.prev=i}else e.prev===Ie.Undefined&&e.next===Ie.Undefined?(this._first=Ie.Undefined,this._last=Ie.Undefined):e.next===Ie.Undefined?(this._last=this._last.prev,this._last.next=Ie.Undefined):e.prev===Ie.Undefined&&(this._first=this._first.next,this._first.prev=Ie.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ie.Undefined;)yield e.element,e=e.next}},Nb=globalThis.performance&&typeof globalThis.performance.now=="function",jb=class Zm{static create(i){return new Zm(i)}constructor(i){this._now=Nb&&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}},kt;(e=>{e.None=()=>Se.None;function i(V,G){return S(V,()=>{},0,void 0,!0,void 0,G)}e.defer=i;function n(V){return(G,ie=null,ee)=>{let T=!1,W;return W=V(Y=>{if(!T)return W?W.dispose():T=!0,G.call(ie,Y)},null,ee),T&&W.dispose(),W}}e.once=n;function l(V,G,ie){return f((ee,T=null,W)=>V(Y=>ee.call(T,G(Y)),null,W),ie)}e.map=l;function o(V,G,ie){return f((ee,T=null,W)=>V(Y=>{G(Y),ee.call(T,Y)},null,W),ie)}e.forEach=o;function h(V,G,ie){return f((ee,T=null,W)=>V(Y=>G(Y)&&ee.call(T,Y),null,W),ie)}e.filter=h;function d(V){return V}e.signal=d;function _(...V){return(G,ie=null,ee)=>{let T=Lb(...V.map(W=>W(Y=>G.call(ie,Y))));return y(T,ee)}}e.any=_;function p(V,G,ie,ee){let T=ie;return l(V,W=>(T=G(T,W),T),ee)}e.reduce=p;function f(V,G){let ie,ee={onWillAddFirstListener(){ie=V(T.fire,T)},onDidRemoveLastListener(){ie?.dispose()}},T=new Q(ee);return G?.add(T),T.event}function y(V,G){return G instanceof Array?G.push(V):G&&G.add(V),V}function S(V,G,ie=100,ee=!1,T=!1,W,Y){let ae,fe,k,q=0,J,te={leakWarningThreshold:W,onWillAddFirstListener(){ae=V(he=>{q++,fe=G(fe,he),ee&&!k&&(oe.fire(fe),fe=void 0),J=()=>{let ye=fe;fe=void 0,k=void 0,(!ee||q>1)&&oe.fire(ye),q=0},typeof ie=="number"?(clearTimeout(k),k=setTimeout(J,ie)):k===void 0&&(k=0,queueMicrotask(J))})},onWillRemoveListener(){T&&q>0&&J?.()},onDidRemoveLastListener(){J=void 0,ae.dispose()}},oe=new Q(te);return Y?.add(oe),oe.event}e.debounce=S;function x(V,G=0,ie){return e.debounce(V,(ee,T)=>ee?(ee.push(T),ee):[T],G,void 0,!0,void 0,ie)}e.accumulate=x;function C(V,G=(ee,T)=>ee===T,ie){let ee=!0,T;return h(V,W=>{let Y=ee||!G(W,T);return ee=!1,T=W,Y},ie)}e.latch=C;function b(V,G,ie){return[e.filter(V,G,ie),e.filter(V,ee=>!G(ee),ie)]}e.split=b;function R(V,G=!1,ie=[],ee){let T=ie.slice(),W=V(fe=>{T?T.push(fe):ae.fire(fe)});ee&&ee.add(W);let Y=()=>{T?.forEach(fe=>ae.fire(fe)),T=null},ae=new Q({onWillAddFirstListener(){W||(W=V(fe=>ae.fire(fe)),ee&&ee.add(W))},onDidAddFirstListener(){T&&(G?setTimeout(Y):Y())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return ee&&ee.add(ae),ae.event}e.buffer=R;function j(V,G){return(ie,ee,T)=>{let W=G(new K);return V(function(Y){let ae=W.evaluate(Y);ae!==X&&ie.call(ee,ae)},void 0,T)}}e.chain=j;let X=Symbol("HaltChainable");class K{constructor(){this.steps=[]}map(G){return this.steps.push(G),this}forEach(G){return this.steps.push(ie=>(G(ie),ie)),this}filter(G){return this.steps.push(ie=>G(ie)?ie:X),this}reduce(G,ie){let ee=ie;return this.steps.push(T=>(ee=G(ee,T),ee)),this}latch(G=(ie,ee)=>ie===ee){let ie=!0,ee;return this.steps.push(T=>{let W=ie||!G(T,ee);return ie=!1,ee=T,W?T:X}),this}evaluate(G){for(let ie of this.steps)if(G=ie(G),G===X)break;return G}}function A(V,G,ie=ee=>ee){let ee=(...ae)=>Y.fire(ie(...ae)),T=()=>V.on(G,ee),W=()=>V.removeListener(G,ee),Y=new Q({onWillAddFirstListener:T,onDidRemoveLastListener:W});return Y.event}e.fromNodeEventEmitter=A;function L(V,G,ie=ee=>ee){let ee=(...ae)=>Y.fire(ie(...ae)),T=()=>V.addEventListener(G,ee),W=()=>V.removeEventListener(G,ee),Y=new Q({onWillAddFirstListener:T,onDidRemoveLastListener:W});return Y.event}e.fromDOMEventEmitter=L;function H(V){return new Promise(G=>n(V)(G))}e.toPromise=H;function Z(V){let G=new Q;return V.then(ie=>{G.fire(ie)},()=>{G.fire(void 0)}).finally(()=>{G.dispose()}),G.event}e.fromPromise=Z;function F(V,G){return V(ie=>G.fire(ie))}e.forward=F;function pe(V,G,ie){return G(ie),V(ee=>G(ee))}e.runAndSubscribe=pe;class ke{constructor(G,ie){this._observable=G,this._counter=0,this._hasChanged=!1;let ee={onWillAddFirstListener:()=>{G.addObserver(this)},onDidRemoveLastListener:()=>{G.removeObserver(this)}};this.emitter=new Q(ee),ie&&ie.add(this.emitter)}beginUpdate(G){this._counter++}handlePossibleChange(G){}handleChange(G,ie){this._hasChanged=!0}endUpdate(G){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function St(V,G){return new ke(V,G).emitter.event}e.fromObservable=St;function ue(V){return(G,ie,ee)=>{let T=0,W=!1,Y={beginUpdate(){T++},endUpdate(){T--,T===0&&(V.reportChanges(),W&&(W=!1,G.call(ie)))},handlePossibleChange(){},handleChange(){W=!0}};V.addObserver(Y),V.reportChanges();let ae={dispose(){V.removeObserver(Y)}};return ee instanceof Ns?ee.add(ae):Array.isArray(ee)&&ee.push(ae),ae}}e.fromObservableLight=ue})(kt||={});var uu=class du{constructor(i){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${i}_${du._idPool++}`,du.all.add(this)}start(i){this._stopWatch=new jb,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}}};uu.all=new Set,uu._idPool=0;var Hb=uu,Ub=-1,Qm=class Jm{constructor(i,n,l=(Jm._idPool++).toString(16).padStart(3,"0")){this._errorHandler=i,this.threshold=n,this.name=l,this._warnCountdown=0}dispose(){this._stacks?.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 p=new Pb(_,h);this._errorHandler(p)}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}};Qm._idPool=1;var qb=Qm,Wb=class ev{constructor(i){this.value=i}static create(){let i=new Error;return new ev(i.stack??"")}print(){console.warn(this.value.split(`
|
|
61
|
+
`+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)}},Db=new Rb;function Ia(e){Mb(e)||Db.onUnexpectedError(e)}var lu="Canceled";function Mb(e){return e instanceof Bb?!0:e instanceof Error&&e.name===lu&&e.message===lu}var Bb=class extends Error{constructor(){super(lu),this.name=this.message}};function Ab(e){return new Error(`Illegal argument: ${e}`)}var kg=class au extends Error{constructor(i){super(i),this.name="CodeExpectedError"}static fromError(i){if(i instanceof au)return i;let n=new au;return n.message=i.message,n.stack=i.stack,n}static isErrorNoTelemetry(i){return i.name==="CodeExpectedError"}},ou=class Gm extends Error{constructor(i){super(i||"An unexpected bug occurred."),Object.setPrototypeOf(this,Gm.prototype)}};function Qt(e,i=0){return e[e.length-(1+i)]}var zb;(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})(zb||={});function Ob(e,i){let n=this,l=!1,o;return function(){return l||(l=!0,i||(o=e.apply(n,arguments))),o}}var Xm;(e=>{function i(L){return L&&typeof L=="object"&&typeof L[Symbol.iterator]=="function"}e.is=i;let n=Object.freeze([]);function l(){return n}e.empty=l;function*o(L){yield L}e.single=o;function h(L){return i(L)?L:o(L)}e.wrap=h;function d(L){return L||n}e.from=d;function*_(L){for(let U=L.length-1;U>=0;U--)yield L[U]}e.reverse=_;function p(L){return!L||L[Symbol.iterator]().next().done===!0}e.isEmpty=p;function f(L){return L[Symbol.iterator]().next().value}e.first=f;function y(L,U){let X=0;for(let J of L)if(U(J,X++))return!0;return!1}e.some=y;function S(L,U){for(let X of L)if(U(X))return X}e.find=S;function*x(L,U){for(let X of L)U(X)&&(yield X)}e.filter=x;function*C(L,U){let X=0;for(let J of L)yield U(J,X++)}e.map=C;function*b(L,U){let X=0;for(let J of L)yield*U(J,X++)}e.flatMap=b;function*R(...L){for(let U of L)yield*U}e.concat=R;function M(L,U,X){let J=X;for(let ge of L)J=U(J,ge);return J}e.reduce=M;function*W(L,U,X=L.length){for(U<0&&(U+=L.length),X<0?X+=L.length:X>L.length&&(X=L.length);U<X;U++)yield L[U]}e.slice=W;function te(L,U=Number.POSITIVE_INFINITY){let X=[];if(U===0)return[X,L];let J=L[Symbol.iterator]();for(let ge=0;ge<U;ge++){let we=J.next();if(we.done)return[X,e.empty()];X.push(we.value)}return[X,{[Symbol.iterator](){return J}}]}e.consume=te;async function N(L){let U=[];for await(let X of L)U.push(X);return Promise.resolve(U)}e.asyncToArray=N})(Xm||={});function ar(e){if(Xm.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 Lb(...e){return $e(()=>ar(e))}function $e(e){return{dispose:Ob(()=>{e()})}}var Vm=class Fm{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?Fm.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)}};Vm.DISABLE_DISPOSED_WARNING=!1;var Ns=Vm,Se=class{constructor(){this._store=new Ns,this._store}dispose(){this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}};Se.None=Object.freeze({dispose(){}});var Jr=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(i){this._isDisposed||i===this._value||(this._value?.dispose(),this._value=i)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let i=this._value;return this._value=void 0,i}},ss=typeof window=="object"?window:globalThis,cu=class hu{constructor(i){this.element=i,this.next=hu.Undefined,this.prev=hu.Undefined}};cu.Undefined=new cu(void 0);var Ie=cu,Eg=class{constructor(){this._first=Ie.Undefined,this._last=Ie.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ie.Undefined}clear(){let e=this._first;for(;e!==Ie.Undefined;){let i=e.next;e.prev=Ie.Undefined,e.next=Ie.Undefined,e=i}this._first=Ie.Undefined,this._last=Ie.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,i){let n=new Ie(e);if(this._first===Ie.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!==Ie.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ie.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ie.Undefined&&e.next!==Ie.Undefined){let i=e.prev;i.next=e.next,e.next.prev=i}else e.prev===Ie.Undefined&&e.next===Ie.Undefined?(this._first=Ie.Undefined,this._last=Ie.Undefined):e.next===Ie.Undefined?(this._last=this._last.prev,this._last.next=Ie.Undefined):e.prev===Ie.Undefined&&(this._first=this._first.next,this._first.prev=Ie.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ie.Undefined;)yield e.element,e=e.next}},Nb=globalThis.performance&&typeof globalThis.performance.now=="function",jb=class Zm{static create(i){return new Zm(i)}constructor(i){this._now=Nb&&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}},kt;(e=>{e.None=()=>Se.None;function i(V,G){return S(V,()=>{},0,void 0,!0,void 0,G)}e.defer=i;function n(V){return(G,ie=null,Q)=>{let T=!1,P;return P=V(Y=>{if(!T)return P?P.dispose():T=!0,G.call(ie,Y)},null,Q),T&&P.dispose(),P}}e.once=n;function l(V,G,ie){return f((Q,T=null,P)=>V(Y=>Q.call(T,G(Y)),null,P),ie)}e.map=l;function o(V,G,ie){return f((Q,T=null,P)=>V(Y=>{G(Y),Q.call(T,Y)},null,P),ie)}e.forEach=o;function h(V,G,ie){return f((Q,T=null,P)=>V(Y=>G(Y)&&Q.call(T,Y),null,P),ie)}e.filter=h;function d(V){return V}e.signal=d;function _(...V){return(G,ie=null,Q)=>{let T=Lb(...V.map(P=>P(Y=>G.call(ie,Y))));return y(T,Q)}}e.any=_;function p(V,G,ie,Q){let T=ie;return l(V,P=>(T=G(T,P),T),Q)}e.reduce=p;function f(V,G){let ie,Q={onWillAddFirstListener(){ie=V(T.fire,T)},onDidRemoveLastListener(){ie?.dispose()}},T=new F(Q);return G?.add(T),T.event}function y(V,G){return G instanceof Array?G.push(V):G&&G.add(V),V}function S(V,G,ie=100,Q=!1,T=!1,P,Y){let ae,fe,k,q=0,Z,ee={leakWarningThreshold:P,onWillAddFirstListener(){ae=V(he=>{q++,fe=G(fe,he),Q&&!k&&(oe.fire(fe),fe=void 0),Z=()=>{let ye=fe;fe=void 0,k=void 0,(!Q||q>1)&&oe.fire(ye),q=0},typeof ie=="number"?(clearTimeout(k),k=setTimeout(Z,ie)):k===void 0&&(k=0,queueMicrotask(Z))})},onWillRemoveListener(){T&&q>0&&Z?.()},onDidRemoveLastListener(){Z=void 0,ae.dispose()}},oe=new F(ee);return Y?.add(oe),oe.event}e.debounce=S;function x(V,G=0,ie){return e.debounce(V,(Q,T)=>Q?(Q.push(T),Q):[T],G,void 0,!0,void 0,ie)}e.accumulate=x;function C(V,G=(Q,T)=>Q===T,ie){let Q=!0,T;return h(V,P=>{let Y=Q||!G(P,T);return Q=!1,T=P,Y},ie)}e.latch=C;function b(V,G,ie){return[e.filter(V,G,ie),e.filter(V,Q=>!G(Q),ie)]}e.split=b;function R(V,G=!1,ie=[],Q){let T=ie.slice(),P=V(fe=>{T?T.push(fe):ae.fire(fe)});Q&&Q.add(P);let Y=()=>{T?.forEach(fe=>ae.fire(fe)),T=null},ae=new F({onWillAddFirstListener(){P||(P=V(fe=>ae.fire(fe)),Q&&Q.add(P))},onDidAddFirstListener(){T&&(G?setTimeout(Y):Y())},onDidRemoveLastListener(){P&&P.dispose(),P=null}});return Q&&Q.add(ae),ae.event}e.buffer=R;function M(V,G){return(ie,Q,T)=>{let P=G(new te);return V(function(Y){let ae=P.evaluate(Y);ae!==W&&ie.call(Q,ae)},void 0,T)}}e.chain=M;let W=Symbol("HaltChainable");class te{constructor(){this.steps=[]}map(G){return this.steps.push(G),this}forEach(G){return this.steps.push(ie=>(G(ie),ie)),this}filter(G){return this.steps.push(ie=>G(ie)?ie:W),this}reduce(G,ie){let Q=ie;return this.steps.push(T=>(Q=G(Q,T),Q)),this}latch(G=(ie,Q)=>ie===Q){let ie=!0,Q;return this.steps.push(T=>{let P=ie||!G(T,Q);return ie=!1,Q=T,P?T:W}),this}evaluate(G){for(let ie of this.steps)if(G=ie(G),G===W)break;return G}}function N(V,G,ie=Q=>Q){let Q=(...ae)=>Y.fire(ie(...ae)),T=()=>V.on(G,Q),P=()=>V.removeListener(G,Q),Y=new F({onWillAddFirstListener:T,onDidRemoveLastListener:P});return Y.event}e.fromNodeEventEmitter=N;function L(V,G,ie=Q=>Q){let Q=(...ae)=>Y.fire(ie(...ae)),T=()=>V.addEventListener(G,Q),P=()=>V.removeEventListener(G,Q),Y=new F({onWillAddFirstListener:T,onDidRemoveLastListener:P});return Y.event}e.fromDOMEventEmitter=L;function U(V){return new Promise(G=>n(V)(G))}e.toPromise=U;function X(V){let G=new F;return V.then(ie=>{G.fire(ie)},()=>{G.fire(void 0)}).finally(()=>{G.dispose()}),G.event}e.fromPromise=X;function J(V,G){return V(ie=>G.fire(ie))}e.forward=J;function ge(V,G,ie){return G(ie),V(Q=>G(Q))}e.runAndSubscribe=ge;class we{constructor(G,ie){this._observable=G,this._counter=0,this._hasChanged=!1;let Q={onWillAddFirstListener:()=>{G.addObserver(this)},onDidRemoveLastListener:()=>{G.removeObserver(this)}};this.emitter=new F(Q),ie&&ie.add(this.emitter)}beginUpdate(G){this._counter++}handlePossibleChange(G){}handleChange(G,ie){this._hasChanged=!0}endUpdate(G){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Qe(V,G){return new we(V,G).emitter.event}e.fromObservable=Qe;function ue(V){return(G,ie,Q)=>{let T=0,P=!1,Y={beginUpdate(){T++},endUpdate(){T--,T===0&&(V.reportChanges(),P&&(P=!1,G.call(ie)))},handlePossibleChange(){},handleChange(){P=!0}};V.addObserver(Y),V.reportChanges();let ae={dispose(){V.removeObserver(Y)}};return Q instanceof Ns?Q.add(ae):Array.isArray(Q)&&Q.push(ae),ae}}e.fromObservableLight=ue})(kt||={});var uu=class du{constructor(i){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${i}_${du._idPool++}`,du.all.add(this)}start(i){this._stopWatch=new jb,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}}};uu.all=new Set,uu._idPool=0;var Hb=uu,Ub=-1,Qm=class Jm{constructor(i,n,l=(Jm._idPool++).toString(16).padStart(3,"0")){this._errorHandler=i,this.threshold=n,this.name=l,this._warnCountdown=0}dispose(){this._stacks?.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 p=new Pb(_,h);this._errorHandler(p)}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}};Qm._idPool=1;var qb=Qm,Wb=class ev{constructor(i){this.value=i}static create(){let i=new Error;return new ev(i.stack??"")}print(){console.warn(this.value.split(`
|
|
62
62
|
`).slice(2).join(`
|
|
63
|
-
`))}},Pb=class extends Error{constructor(e,i){super(e),this.name="ListenerLeakError",this.stack=i}},Kb=class extends Error{constructor(e,i){super(e),this.name="ListenerRefusalError",this.stack=i}},Yb=0,Kh=class{constructor(e){this.value=e,this.id=Yb++}},$b=2,Ib,Q=class{constructor(i){this._size=0,this._options=i,this._leakageMon=this._options?.leakWarningThreshold?new qb(i?.onListenerError??Ia,this._options?.leakWarningThreshold??Ub):void 0,this._perfMon=this._options?._profName?new Hb(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(i,n,l)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let _=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(_);let p=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new Kb(`${_}. HINT: Stack shows most frequent listener (${p[1]}-times)`,p[0]);return(this._options?.onListenerError||Ia)(f),Se.None}if(this._disposed)return Se.None;n&&(i=i.bind(n));let o=new Kh(i),h;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Wb.create(),h=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof Kh?(this._deliveryQueue??=new Gb,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._size++;let d=$e(()=>{h?.(),this._removeListener(o)});return l instanceof Ns?l.add(d):Array.isArray(l)&&l.push(d),d},this._event}_removeListener(i){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(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*$b<=n.length){let h=0;for(let d=0;d<n.length;d++)n[d]?n[h++]=n[d]:o&&(this._deliveryQueue.end--,h<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=h}}_deliver(i,n){if(!i)return;let l=this._options?.onListenerError||Ia;if(!l){i.value(n);return}try{i.value(n)}catch(o){l(o)}}_deliverQueue(i){let n=i.current._listeners;for(;i.i<i.end;)this._deliver(n[i.i++],i.value);i.reset()}fire(i){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Kh)this._deliver(this._listeners,i);else{let n=this._deliveryQueue;n.enqueue(this,i,this._listeners.length),this._deliverQueue(n)}this._perfMon?.stop()}hasListeners(){return this._size>0}},Gb=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}},fu=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}};fu.INSTANCE=new fu;var $u=fu;function Xb(e,i,n){typeof i=="string"&&(i=e.matchMedia(i)),i.addEventListener("change",n)}$u.INSTANCE.onDidChangeZoomLevel;function Vb(e){return $u.INSTANCE.getZoomFactor(e)}$u.INSTANCE.onDidChangeFullscreen;var sn=typeof navigator=="object"?navigator.userAgent:"",pu=sn.indexOf("Firefox")>=0,Fb=sn.indexOf("AppleWebKit")>=0,Iu=sn.indexOf("Chrome")>=0,Zb=!Iu&&sn.indexOf("Safari")>=0;sn.indexOf("Electron/")>=0;sn.indexOf("Android")>=0;var Yh=!1;if(typeof ss.matchMedia=="function"){let e=ss.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),i=ss.matchMedia("(display-mode: fullscreen)");Yh=e.matches,Xb(ss,e,({matches:n})=>{Yh&&i.matches||(Yh=n)})}var Qr="en",_u=!1,gu=!1,Ga=!1,tv=!1,Ua,Xa=Qr,Tg=Qr,Qb,is,lr=globalThis,ei;typeof lr.vscode<"u"&&typeof lr.vscode.process<"u"?ei=lr.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(ei=process);var Jb=typeof ei?.versions?.electron=="string",e1=Jb&&ei?.type==="renderer";if(typeof ei=="object"){_u=ei.platform==="win32",gu=ei.platform==="darwin",Ga=ei.platform==="linux",Ga&&ei.env.SNAP&&ei.env.SNAP_REVISION,ei.env.CI||ei.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ua=Qr,Xa=Qr;let e=ei.env.VSCODE_NLS_CONFIG;if(e)try{let i=JSON.parse(e);Ua=i.userLocale,Tg=i.osLocale,Xa=i.resolvedLanguage||Qr,Qb=i.languagePack?.translationsConfigFile}catch{}tv=!0}else typeof navigator=="object"&&!e1?(is=navigator.userAgent,_u=is.indexOf("Windows")>=0,gu=is.indexOf("Macintosh")>=0,(is.indexOf("Macintosh")>=0||is.indexOf("iPad")>=0||is.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Ga=is.indexOf("Linux")>=0,is?.indexOf("Mobi")>=0,Xa=globalThis._VSCODE_NLS_LANGUAGE||Qr,Ua=navigator.language.toLowerCase(),Tg=Ua):console.error("Unable to resolve platform.");var iv=_u,Oi=gu,t1=Ga,Rg=tv,Li=is,Bs=Xa,i1;(e=>{function i(){return Bs}e.value=i;function n(){return Bs.length===2?Bs==="en":Bs.length>=3?Bs[0]==="e"&&Bs[1]==="n"&&Bs[2]==="-":!1}e.isDefaultVariant=n;function l(){return Bs==="en"}e.isDefault=l})(i1||={});var s1=typeof lr.postMessage=="function"&&!lr.importScripts;(()=>{if(s1){let e=[];lr.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}),lr.postMessage({vscodeScheduleAsyncWork:l},"*")}}return e=>setTimeout(e)})();var r1=!!(Li&&Li.indexOf("Chrome")>=0);Li&&Li.indexOf("Firefox")>=0;!r1&&Li&&Li.indexOf("Safari")>=0;Li&&Li.indexOf("Edg/")>=0;Li&&Li.indexOf("Android")>=0;var Fr=typeof navigator=="object"?navigator:{};Rg||document.queryCommandSupported&&document.queryCommandSupported("copy")||Fr&&Fr.clipboard&&Fr.clipboard.writeText,Rg||Fr&&Fr.clipboard&&Fr.clipboard.readText;var Gu=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}},$h=new Gu,Dg=new Gu,Mg=new Gu,n1=new Array(230),sv;(e=>{function i(_){return $h.keyCodeToStr(_)}e.toString=i;function n(_){return $h.strToKeyCode(_)}e.fromString=n;function l(_){return Dg.keyCodeToStr(_)}e.toUserSettingsUS=l;function o(_){return Mg.keyCodeToStr(_)}e.toUserSettingsGeneral=o;function h(_){return Dg.strToKeyCode(_)||Mg.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 $h.keyCodeToStr(_)}e.toElectronAccelerator=d})(sv||={});var l1=class rv{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 rv&&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 a1([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},a1=class{constructor(e){if(e.length===0)throw Ab("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 o1(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return sv.fromString(n)}let i=e.keyCode;if(i===3)return 7;if(pu)switch(i){case 59:return 85;case 60:if(t1)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Oi)return 57;break}else if(Fb&&(Oi&&i===93||!Oi&&i===92))return 57;return n1[i]||0}var c1=Oi?256:2048,h1=512,u1=1024,d1=Oi?2048:256,Bg=class{constructor(e){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=i.getModifierState?.("AltGraph"),this.keyCode=o1(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|=c1),this.altKey&&(i|=h1),this.shiftKey&&(i|=u1),this.metaKey&&(i|=d1),i|=e,i}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new l1(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Ag=new WeakMap;function f1(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 p1=class{static getSameOriginWindowChain(e){let i=Ag.get(e);if(!i){i=[],Ag.set(e,i);let n=e,l;do l=f1(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?.scrollY??0,l+=d?.scrollX??0,d===i||!h.iframeElement)break;let _=h.iframeElement.getBoundingClientRect();n+=_.top,l+=_.left}return{top:n,left:l}}},qa=class{constructor(i,n){this.timestamp=Date.now(),this.browserEvent=n,this.leftButton=n.button===0,this.middleButton=n.button===1,this.rightButton=n.button===2,this.buttons=n.buttons,this.target=n.target,this.detail=n.detail||1,n.type==="dblclick"&&(this.detail=2),this.ctrlKey=n.ctrlKey,this.shiftKey=n.shiftKey,this.altKey=n.altKey,this.metaKey=n.metaKey,typeof n.pageX=="number"?(this.posx=n.pageX,this.posy=n.pageY):(this.posx=n.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=n.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let l=p1.getPositionOfChildWindowRelativeToAncestorWindow(i,n.view);this.posx-=l.left,this.posy-=l.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},zg=class{constructor(e,i=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=i;let l=!1;if(Iu){let o=navigator.userAgent.match(/Chrome\/(\d+)/);l=(o?parseInt(o[1]):123)<=122}if(e){let o=e,h=e,d=e.view?.devicePixelRatio||1;if(typeof o.wheelDeltaY<"u")l?this.deltaY=o.wheelDeltaY/(120*d):this.deltaY=o.wheelDeltaY/120;else if(typeof h.VERTICAL_AXIS<"u"&&h.axis===h.VERTICAL_AXIS)this.deltaY=-h.detail/3;else if(e.type==="wheel"){let _=e;_.deltaMode===_.DOM_DELTA_LINE?pu&&!Oi?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")Zb&&iv?this.deltaX=-(o.wheelDeltaX/120):l?this.deltaX=o.wheelDeltaX/(120*d):this.deltaX=o.wheelDeltaX/120;else if(typeof h.HORIZONTAL_AXIS<"u"&&h.axis===h.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let _=e;_.deltaMode===_.DOM_DELTA_LINE?pu&&!Oi?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*d):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},nv=Object.freeze(function(e,i){let n=setTimeout(e.bind(i),0);return{dispose(){clearTimeout(n)}}}),_1;(e=>{function i(n){return n===e.None||n===e.Cancelled||n instanceof g1?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=i,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:kt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:nv})})(_1||={});var g1=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?nv:(this._emitter||(this._emitter=new Q),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Xu=class{constructor(i,n){this._isDisposed=!1,this._token=-1,typeof i=="function"&&typeof n=="number"&&this.setIfNotSet(i,n)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(i,n){if(this._isDisposed)throw new ou("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,i()},n)}setIfNotSet(i,n){if(this._isDisposed)throw new ou("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,i()},n))}},m1=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,i,n=globalThis){if(this.isDisposed)throw new ou("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let l=n.setInterval(()=>{e()},i);this.disposable=$e(()=>{n.clearInterval(l),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},v1;(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})(v1||={});var Og=class fi{static fromArray(i){return new fi(n=>{n.emitMany(i)})}static fromPromise(i){return new fi(async n=>{n.emitMany(await i)})}static fromPromises(i){return new fi(async n=>{await Promise.all(i.map(async l=>n.emitOne(await l)))})}static merge(i){return new fi(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 kt.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(i,n){return new fi(async l=>{for await(let o of i)l.emitOne(n(o))})}map(i){return fi.map(this,i)}static filter(i,n){return new fi(async l=>{for await(let o of i)n(o)&&l.emitOne(o)})}filter(i){return fi.filter(this,i)}static coalesce(i){return fi.filter(i,n=>!!n)}coalesce(){return fi.coalesce(this)}static async toPromise(i){let n=[];for await(let l of i)n.push(l);return n}toPromise(){return fi.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())}};Og.EMPTY=Og.fromArray([]);var{getWindow:zi,getWindowId:S1,onDidRegisterWindow:y1}=(function(){let e=new Map,i={window:ss,disposables:new Ns};e.set(ss.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 Ns,p={window:d,disposables:_.add(new Ns)};return e.set(d.vscodeWindowId,p),_.add($e(()=>{e.delete(d.vscodeWindowId),l.fire(d)})),_.add(de(d,pt.BEFORE_UNLOAD,()=>{o.fire(d)})),n.fire(p),_},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(d){return d.vscodeWindowId},hasWindow(d){return e.has(d)},getWindowById:h,getWindow(d){let _=d;if(_?.ownerDocument?.defaultView)return _.ownerDocument.defaultView.window;let p=d;return p?.view?p.view.window:ss},getDocument(d){return zi(d).document}}})(),b1=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 de(e,i,n,l){return new b1(e,i,n,l)}var Lg=function(e,i,n,l){return de(e,i,n,l)},Vu,x1=class extends m1{constructor(e){super(),this.defaultTarget=e&&zi(e)}cancelAndSet(e,i,n){return super.cancelAndSet(e,i,n??this.defaultTarget)}},Ng=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){Ia(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(Ng.sort),d.shift().execute();l.set(h,!1)};Vu=(h,d,_=0)=>{let p=S1(h),f=new Ng(d,_),y=e.get(p);return y||(y=[],e.set(p,y)),y.push(f),n.get(p)||(n.set(p,!0),h.requestAnimationFrame(()=>o(p))),f}})();function w1(e){let i=e.getBoundingClientRect(),n=zi(e);return{left:i.left+n.scrollX,top:i.top+n.scrollY,width:i.width,height:i.height}}var pt={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"},C1=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=Wt(e);this._maxWidth!==i&&(this._maxWidth=i,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let i=Wt(e);this._width!==i&&(this._width=i,this.domNode.style.width=this._width)}setHeight(e){let i=Wt(e);this._height!==i&&(this._height=i,this.domNode.style.height=this._height)}setTop(e){let i=Wt(e);this._top!==i&&(this._top=i,this.domNode.style.top=this._top)}setLeft(e){let i=Wt(e);this._left!==i&&(this._left=i,this.domNode.style.left=this._left)}setBottom(e){let i=Wt(e);this._bottom!==i&&(this._bottom=i,this.domNode.style.bottom=this._bottom)}setRight(e){let i=Wt(e);this._right!==i&&(this._right=i,this.domNode.style.right=this._right)}setPaddingTop(e){let i=Wt(e);this._paddingTop!==i&&(this._paddingTop=i,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let i=Wt(e);this._paddingLeft!==i&&(this._paddingLeft=i,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let i=Wt(e);this._paddingBottom!==i&&(this._paddingBottom=i,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let i=Wt(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=Wt(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=Wt(e);this._lineHeight!==i&&(this._lineHeight=i,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let i=Wt(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 Wt(e){return typeof e=="number"?`${e}px`:e}function fl(e){return new C1(e)}var lv=class{constructor(){this._hooks=new Ns,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($e(()=>{try{e.releasePointerCapture(i)}catch{}}))}catch{h=zi(e)}this._hooks.add(de(h,pt.POINTER_MOVE,d=>{if(d.buttons!==n){this.stopMonitoring(!0);return}d.preventDefault(),this._pointerMoveCallback(d)})),this._hooks.add(de(h,pt.POINTER_UP,d=>this.stopMonitoring(!0)))}};function k1(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 Bi;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Bi||={});var al=class Tt extends Se{constructor(){super(),this.dispatched=!1,this.targets=new Eg,this.ignoreTargets=new Eg,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(kt.runAndSubscribe(y1,({window:i,disposables:n})=>{n.add(de(i.document,"touchstart",l=>this.onTouchStart(l),{passive:!1})),n.add(de(i.document,"touchend",l=>this.onTouchEnd(i,l))),n.add(de(i.document,"touchmove",l=>this.onTouchMove(l),{passive:!1}))},{window:ss,disposables:this._store}))}static addTarget(i){if(!Tt.isTouchDevice())return Se.None;Tt.INSTANCE||(Tt.INSTANCE=new Tt);let n=Tt.INSTANCE.targets.push(i);return $e(n)}static ignoreTarget(i){if(!Tt.isTouchDevice())return Se.None;Tt.INSTANCE||(Tt.INSTANCE=new Tt);let n=Tt.INSTANCE.ignoreTargets.push(i);return $e(n)}static isTouchDevice(){return"ontouchstart"in ss||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(Bi.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 p=this.activeTouches[_.identifier],f=Date.now()-p.initialTimeStamp;if(f<Tt.HOLD_DELAY&&Math.abs(p.initialPageX-Qt(p.rollingPageX))<30&&Math.abs(p.initialPageY-Qt(p.rollingPageY))<30){let y=this.newGestureEvent(Bi.Tap,p.initialTarget);y.pageX=Qt(p.rollingPageX),y.pageY=Qt(p.rollingPageY),this.dispatchEvent(y)}else if(f>=Tt.HOLD_DELAY&&Math.abs(p.initialPageX-Qt(p.rollingPageX))<30&&Math.abs(p.initialPageY-Qt(p.rollingPageY))<30){let y=this.newGestureEvent(Bi.Contextmenu,p.initialTarget);y.pageX=Qt(p.rollingPageX),y.pageY=Qt(p.rollingPageY),this.dispatchEvent(y)}else if(o===1){let y=Qt(p.rollingPageX),S=Qt(p.rollingPageY),x=Qt(p.rollingTimestamps)-p.rollingTimestamps[0],C=y-p.rollingPageX[0],b=S-p.rollingPageY[0],R=[...this.targets].filter(j=>p.initialTarget instanceof Node&&j.contains(p.initialTarget));this.inertia(i,R,l,Math.abs(C)/x,C>0?1:-1,y,Math.abs(b)/x,b>0?1:-1,S)}this.dispatchEvent(this.newGestureEvent(Bi.End,p.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===Bi.Tap){let n=new Date().getTime(),l=0;n-this._lastSetTapCountTime>Tt.CLEAR_TAP_COUNT_TIME?l=1:l=2,this._lastSetTapCountTime=n,i.tapCount=l}else(i.type===Bi.Change||i.type===Bi.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,_,p,f){this.handle=Vu(i,()=>{let y=Date.now(),S=y-l,x=0,C=0,b=!0;o+=Tt.SCROLL_FRICTION*S,_+=Tt.SCROLL_FRICTION*S,o>0&&(b=!1,x=h*o*S),_>0&&(b=!1,C=p*_*S);let R=this.newGestureEvent(Bi.Change);R.translationX=x,R.translationY=C,n.forEach(j=>j.dispatchEvent(R)),b||this.inertia(i,n,y,o,h,d+x,_,p,f+C)})}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(Bi.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)}};al.SCROLL_FRICTION=-.005,al.HOLD_DELAY=700,al.CLEAR_TAP_COUNT_TIME=400,Ze([k1],al,"isTouchDevice",1);var E1=al,Fu=class extends Se{onclick(e,i){this._register(de(e,pt.CLICK,n=>i(new qa(zi(e),n))))}onmousedown(e,i){this._register(de(e,pt.MOUSE_DOWN,n=>i(new qa(zi(e),n))))}onmouseover(e,i){this._register(de(e,pt.MOUSE_OVER,n=>i(new qa(zi(e),n))))}onmouseleave(e,i){this._register(de(e,pt.MOUSE_LEAVE,n=>i(new qa(zi(e),n))))}onkeydown(e,i){this._register(de(e,pt.KEY_DOWN,n=>i(new Bg(n))))}onkeyup(e,i){this._register(de(e,pt.KEY_UP,n=>i(new Bg(n))))}oninput(e,i){this._register(de(e,pt.INPUT,i))}onblur(e,i){this._register(de(e,pt.BLUR,i))}onfocus(e,i){this._register(de(e,pt.FOCUS,i))}onchange(e,i){this._register(de(e,pt.CHANGE,i))}ignoreGesture(e){return E1.ignoreTarget(e)}},jg=11,T1=class extends Fu{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=jg+"px",this.domNode.style.height=jg+"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 lv),this._register(Lg(this.bgDomNode,pt.POINTER_DOWN,i=>this._arrowPointerDown(i))),this._register(Lg(this.domNode,pt.POINTER_DOWN,i=>this._arrowPointerDown(i))),this._pointerdownRepeatTimer=this._register(new x1),this._pointerdownScheduleRepeatTimer=this._register(new Xu)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,zi(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()}},R1=class mu{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 mu(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 mu(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,p=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:p}}},D1=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 R1(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){let n=this._state.withScrollDimensions(e,i);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.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 Ug(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=Ug.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)))}},Hg=class{constructor(e,i,n){this.scrollLeft=e,this.scrollTop=i,this.isDone=n}};function Ih(e,i){let n=i-e;return function(l){return e+n*A1(l)}}function M1(e,i,n){return function(l){return l<n?e(l/n):i((l-n)/(1-n))}}var Ug=class vu{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),M1(Ih(i,o),Ih(h,n),.33)}return Ih(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 Hg(l,o,!1)}return new Hg(this.to.scrollLeft,this.to.scrollTop,!0)}combine(i,n,l){return vu.start(i,n,l)}static start(i,n,l){l=l+10;let o=Date.now()-10;return new vu(i,n,o,l)}};function B1(e){return Math.pow(e,3)}function A1(e){return 1-B1(1-e)}var z1=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 Xu)}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(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},O1=140,av=class extends Fu{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 z1(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new lv),this._shouldRender=!0,this.domNode=fl(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(de(this.domNode.domNode,pt.POINTER_DOWN,i=>this._domNodePointerDown(i)))}_createArrow(e){let i=this._register(new T1(e));this.domNode.domNode.appendChild(i.bgDomNode),this.domNode.domNode.appendChild(i.domNode)}_createSlider(e,i,n,l){this.slider=fl(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(de(this.slider.domNode,pt.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=w1(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(iv&&d>O1){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()}},ov=class Su{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 Su(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),p=o>0&&o>l;if(!p)return{computedAvailableSize:Math.round(d),computedIsNeeded:p,computedSliderSize:Math.round(_),computedSliderRatio:0,computedSliderPosition:0};let f=Math.round(Math.max(20,Math.floor(l*_/o))),y=(_-f)/(o-l),S=h*y;return{computedAvailableSize:Math.round(d),computedIsNeeded:p,computedSliderSize:Math.round(f),computedSliderRatio:y,computedSliderPosition:Math.round(S)}}_refreshComputedValues(){let i=Su._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)}},L1=class extends av{constructor(e,i,n){let l=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new ov(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}},N1=class extends av{constructor(e,i,n){let l=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new ov(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}},j1=500,qg=50,H1=class{constructor(e,i,n){this.timestamp=e,this.deltaX=i,this.deltaY=n,this.score=0}},yu=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(Iu){let n=zi(i.browserEvent),l=Vb(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 H1(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),p=Math.max(Math.min(o,d),1),f=Math.max(Math.min(h,_),1),y=Math.max(o,d),S=Math.max(h,_);y%p===0&&S%f===0&&(l-=.5)}return Math.min(Math.max(l,0),1)}_isAlmostInt(i){return Math.abs(Math.round(i)-i)<.01}};yu.INSTANCE=new yu;var U1=yu,q1=class extends Fu{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=P1(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 N1(this._scrollable,this._options,l)),this._horizontalScrollbar=this._register(new L1(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=fl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=fl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=fl(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 Xu),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,Oi&&(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 zg(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=ar(this._mouseWheelToDispose),e)){let i=n=>{this._onMouseWheel(new zg(n))};this._mouseWheelToDispose.push(de(this._listenOnDomNode,pt.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let i=U1.INSTANCE;i.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,h=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&h+o===0?h=o=0:Math.abs(o)>=Math.abs(h)?h=0:o=0),this._options.flipAxes&&([o,h]=[h,o]);let d=!Oi&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||d)&&!h&&(h=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(h=h*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);let _=this._scrollable.getFutureScrollPosition(),p={};if(o){let f=qg*o,y=_.scrollTop-(f<0?Math.floor(f):Math.ceil(f));this._verticalScrollbar.writeScrollPosition(p,y)}if(h){let f=qg*h,y=_.scrollLeft-(f<0?Math.floor(f):Math.ceil(f));this._horizontalScrollbar.writeScrollPosition(p,y)}p=this._scrollable.validateScrollPosition(p),(_.scrollLeft!==p.scrollLeft||_.scrollTop!==p.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(p):this._scrollable.setScrollPositionNow(p),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(),j1)}},W1=class extends q1{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 P1(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,Oi&&(i.className+=" mac"),i}var bu=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 p=this._register(new D1({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:f=>Vu(l.window,f)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{p.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new W1(i,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},p)),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(kt.runAndSubscribe(h.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=h.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register($e(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=l.mainDocument.createElement("style"),i.appendChild(this._styleElement),this._register($e(()=>this._styleElement.remove())),this._register(kt.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(`
|
|
63
|
+
`))}},Pb=class extends Error{constructor(e,i){super(e),this.name="ListenerLeakError",this.stack=i}},Kb=class extends Error{constructor(e,i){super(e),this.name="ListenerRefusalError",this.stack=i}},Yb=0,Kh=class{constructor(e){this.value=e,this.id=Yb++}},$b=2,Ib,F=class{constructor(i){this._size=0,this._options=i,this._leakageMon=this._options?.leakWarningThreshold?new qb(i?.onListenerError??Ia,this._options?.leakWarningThreshold??Ub):void 0,this._perfMon=this._options?._profName?new Hb(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(i,n,l)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let _=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(_);let p=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new Kb(`${_}. HINT: Stack shows most frequent listener (${p[1]}-times)`,p[0]);return(this._options?.onListenerError||Ia)(f),Se.None}if(this._disposed)return Se.None;n&&(i=i.bind(n));let o=new Kh(i),h;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Wb.create(),h=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof Kh?(this._deliveryQueue??=new Gb,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._size++;let d=$e(()=>{h?.(),this._removeListener(o)});return l instanceof Ns?l.add(d):Array.isArray(l)&&l.push(d),d},this._event}_removeListener(i){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(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*$b<=n.length){let h=0;for(let d=0;d<n.length;d++)n[d]?n[h++]=n[d]:o&&(this._deliveryQueue.end--,h<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=h}}_deliver(i,n){if(!i)return;let l=this._options?.onListenerError||Ia;if(!l){i.value(n);return}try{i.value(n)}catch(o){l(o)}}_deliverQueue(i){let n=i.current._listeners;for(;i.i<i.end;)this._deliver(n[i.i++],i.value);i.reset()}fire(i){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Kh)this._deliver(this._listeners,i);else{let n=this._deliveryQueue;n.enqueue(this,i,this._listeners.length),this._deliverQueue(n)}this._perfMon?.stop()}hasListeners(){return this._size>0}},Gb=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}},fu=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new F,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new F,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}};fu.INSTANCE=new fu;var $u=fu;function Xb(e,i,n){typeof i=="string"&&(i=e.matchMedia(i)),i.addEventListener("change",n)}$u.INSTANCE.onDidChangeZoomLevel;function Vb(e){return $u.INSTANCE.getZoomFactor(e)}$u.INSTANCE.onDidChangeFullscreen;var sn=typeof navigator=="object"?navigator.userAgent:"",pu=sn.indexOf("Firefox")>=0,Fb=sn.indexOf("AppleWebKit")>=0,Iu=sn.indexOf("Chrome")>=0,Zb=!Iu&&sn.indexOf("Safari")>=0;sn.indexOf("Electron/")>=0;sn.indexOf("Android")>=0;var Yh=!1;if(typeof ss.matchMedia=="function"){let e=ss.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),i=ss.matchMedia("(display-mode: fullscreen)");Yh=e.matches,Xb(ss,e,({matches:n})=>{Yh&&i.matches||(Yh=n)})}var Qr="en",_u=!1,gu=!1,Ga=!1,tv=!1,Ua,Xa=Qr,Tg=Qr,Qb,is,lr=globalThis,ei;typeof lr.vscode<"u"&&typeof lr.vscode.process<"u"?ei=lr.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(ei=process);var Jb=typeof ei?.versions?.electron=="string",e1=Jb&&ei?.type==="renderer";if(typeof ei=="object"){_u=ei.platform==="win32",gu=ei.platform==="darwin",Ga=ei.platform==="linux",Ga&&ei.env.SNAP&&ei.env.SNAP_REVISION,ei.env.CI||ei.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ua=Qr,Xa=Qr;let e=ei.env.VSCODE_NLS_CONFIG;if(e)try{let i=JSON.parse(e);Ua=i.userLocale,Tg=i.osLocale,Xa=i.resolvedLanguage||Qr,Qb=i.languagePack?.translationsConfigFile}catch{}tv=!0}else typeof navigator=="object"&&!e1?(is=navigator.userAgent,_u=is.indexOf("Windows")>=0,gu=is.indexOf("Macintosh")>=0,(is.indexOf("Macintosh")>=0||is.indexOf("iPad")>=0||is.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Ga=is.indexOf("Linux")>=0,is?.indexOf("Mobi")>=0,Xa=globalThis._VSCODE_NLS_LANGUAGE||Qr,Ua=navigator.language.toLowerCase(),Tg=Ua):console.error("Unable to resolve platform.");var iv=_u,Oi=gu,t1=Ga,Rg=tv,Li=is,Bs=Xa,i1;(e=>{function i(){return Bs}e.value=i;function n(){return Bs.length===2?Bs==="en":Bs.length>=3?Bs[0]==="e"&&Bs[1]==="n"&&Bs[2]==="-":!1}e.isDefaultVariant=n;function l(){return Bs==="en"}e.isDefault=l})(i1||={});var s1=typeof lr.postMessage=="function"&&!lr.importScripts;(()=>{if(s1){let e=[];lr.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}),lr.postMessage({vscodeScheduleAsyncWork:l},"*")}}return e=>setTimeout(e)})();var r1=!!(Li&&Li.indexOf("Chrome")>=0);Li&&Li.indexOf("Firefox")>=0;!r1&&Li&&Li.indexOf("Safari")>=0;Li&&Li.indexOf("Edg/")>=0;Li&&Li.indexOf("Android")>=0;var Fr=typeof navigator=="object"?navigator:{};Rg||document.queryCommandSupported&&document.queryCommandSupported("copy")||Fr&&Fr.clipboard&&Fr.clipboard.writeText,Rg||Fr&&Fr.clipboard&&Fr.clipboard.readText;var Gu=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}},$h=new Gu,Dg=new Gu,Mg=new Gu,n1=new Array(230),sv;(e=>{function i(_){return $h.keyCodeToStr(_)}e.toString=i;function n(_){return $h.strToKeyCode(_)}e.fromString=n;function l(_){return Dg.keyCodeToStr(_)}e.toUserSettingsUS=l;function o(_){return Mg.keyCodeToStr(_)}e.toUserSettingsGeneral=o;function h(_){return Dg.strToKeyCode(_)||Mg.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 $h.keyCodeToStr(_)}e.toElectronAccelerator=d})(sv||={});var l1=class rv{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 rv&&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 a1([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},a1=class{constructor(e){if(e.length===0)throw Ab("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 o1(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return sv.fromString(n)}let i=e.keyCode;if(i===3)return 7;if(pu)switch(i){case 59:return 85;case 60:if(t1)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Oi)return 57;break}else if(Fb&&(Oi&&i===93||!Oi&&i===92))return 57;return n1[i]||0}var c1=Oi?256:2048,h1=512,u1=1024,d1=Oi?2048:256,Bg=class{constructor(e){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=i.getModifierState?.("AltGraph"),this.keyCode=o1(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|=c1),this.altKey&&(i|=h1),this.shiftKey&&(i|=u1),this.metaKey&&(i|=d1),i|=e,i}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new l1(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Ag=new WeakMap;function f1(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 p1=class{static getSameOriginWindowChain(e){let i=Ag.get(e);if(!i){i=[],Ag.set(e,i);let n=e,l;do l=f1(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?.scrollY??0,l+=d?.scrollX??0,d===i||!h.iframeElement)break;let _=h.iframeElement.getBoundingClientRect();n+=_.top,l+=_.left}return{top:n,left:l}}},qa=class{constructor(i,n){this.timestamp=Date.now(),this.browserEvent=n,this.leftButton=n.button===0,this.middleButton=n.button===1,this.rightButton=n.button===2,this.buttons=n.buttons,this.target=n.target,this.detail=n.detail||1,n.type==="dblclick"&&(this.detail=2),this.ctrlKey=n.ctrlKey,this.shiftKey=n.shiftKey,this.altKey=n.altKey,this.metaKey=n.metaKey,typeof n.pageX=="number"?(this.posx=n.pageX,this.posy=n.pageY):(this.posx=n.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=n.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let l=p1.getPositionOfChildWindowRelativeToAncestorWindow(i,n.view);this.posx-=l.left,this.posy-=l.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},zg=class{constructor(e,i=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=i;let l=!1;if(Iu){let o=navigator.userAgent.match(/Chrome\/(\d+)/);l=(o?parseInt(o[1]):123)<=122}if(e){let o=e,h=e,d=e.view?.devicePixelRatio||1;if(typeof o.wheelDeltaY<"u")l?this.deltaY=o.wheelDeltaY/(120*d):this.deltaY=o.wheelDeltaY/120;else if(typeof h.VERTICAL_AXIS<"u"&&h.axis===h.VERTICAL_AXIS)this.deltaY=-h.detail/3;else if(e.type==="wheel"){let _=e;_.deltaMode===_.DOM_DELTA_LINE?pu&&!Oi?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")Zb&&iv?this.deltaX=-(o.wheelDeltaX/120):l?this.deltaX=o.wheelDeltaX/(120*d):this.deltaX=o.wheelDeltaX/120;else if(typeof h.HORIZONTAL_AXIS<"u"&&h.axis===h.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let _=e;_.deltaMode===_.DOM_DELTA_LINE?pu&&!Oi?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*d):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},nv=Object.freeze(function(e,i){let n=setTimeout(e.bind(i),0);return{dispose(){clearTimeout(n)}}}),_1;(e=>{function i(n){return n===e.None||n===e.Cancelled||n instanceof g1?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=i,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:kt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:nv})})(_1||={});var g1=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?nv:(this._emitter||(this._emitter=new F),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Xu=class{constructor(i,n){this._isDisposed=!1,this._token=-1,typeof i=="function"&&typeof n=="number"&&this.setIfNotSet(i,n)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(i,n){if(this._isDisposed)throw new ou("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,i()},n)}setIfNotSet(i,n){if(this._isDisposed)throw new ou("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,i()},n))}},m1=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,i,n=globalThis){if(this.isDisposed)throw new ou("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let l=n.setInterval(()=>{e()},i);this.disposable=$e(()=>{n.clearInterval(l),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},v1;(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})(v1||={});var Og=class fi{static fromArray(i){return new fi(n=>{n.emitMany(i)})}static fromPromise(i){return new fi(async n=>{n.emitMany(await i)})}static fromPromises(i){return new fi(async n=>{await Promise.all(i.map(async l=>n.emitOne(await l)))})}static merge(i){return new fi(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 F,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 kt.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(i,n){return new fi(async l=>{for await(let o of i)l.emitOne(n(o))})}map(i){return fi.map(this,i)}static filter(i,n){return new fi(async l=>{for await(let o of i)n(o)&&l.emitOne(o)})}filter(i){return fi.filter(this,i)}static coalesce(i){return fi.filter(i,n=>!!n)}coalesce(){return fi.coalesce(this)}static async toPromise(i){let n=[];for await(let l of i)n.push(l);return n}toPromise(){return fi.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())}};Og.EMPTY=Og.fromArray([]);var{getWindow:zi,getWindowId:S1,onDidRegisterWindow:y1}=(function(){let e=new Map,i={window:ss,disposables:new Ns};e.set(ss.vscodeWindowId,i);let n=new F,l=new F,o=new F;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 Ns,p={window:d,disposables:_.add(new Ns)};return e.set(d.vscodeWindowId,p),_.add($e(()=>{e.delete(d.vscodeWindowId),l.fire(d)})),_.add(de(d,_t.BEFORE_UNLOAD,()=>{o.fire(d)})),n.fire(p),_},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(d){return d.vscodeWindowId},hasWindow(d){return e.has(d)},getWindowById:h,getWindow(d){let _=d;if(_?.ownerDocument?.defaultView)return _.ownerDocument.defaultView.window;let p=d;return p?.view?p.view.window:ss},getDocument(d){return zi(d).document}}})(),b1=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 de(e,i,n,l){return new b1(e,i,n,l)}var Lg=function(e,i,n,l){return de(e,i,n,l)},Vu,x1=class extends m1{constructor(e){super(),this.defaultTarget=e&&zi(e)}cancelAndSet(e,i,n){return super.cancelAndSet(e,i,n??this.defaultTarget)}},Ng=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){Ia(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(Ng.sort),d.shift().execute();l.set(h,!1)};Vu=(h,d,_=0)=>{let p=S1(h),f=new Ng(d,_),y=e.get(p);return y||(y=[],e.set(p,y)),y.push(f),n.get(p)||(n.set(p,!0),h.requestAnimationFrame(()=>o(p))),f}})();function w1(e){let i=e.getBoundingClientRect(),n=zi(e);return{left:i.left+n.scrollX,top:i.top+n.scrollY,width:i.width,height:i.height}}var _t={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"},C1=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=Wt(e);this._maxWidth!==i&&(this._maxWidth=i,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let i=Wt(e);this._width!==i&&(this._width=i,this.domNode.style.width=this._width)}setHeight(e){let i=Wt(e);this._height!==i&&(this._height=i,this.domNode.style.height=this._height)}setTop(e){let i=Wt(e);this._top!==i&&(this._top=i,this.domNode.style.top=this._top)}setLeft(e){let i=Wt(e);this._left!==i&&(this._left=i,this.domNode.style.left=this._left)}setBottom(e){let i=Wt(e);this._bottom!==i&&(this._bottom=i,this.domNode.style.bottom=this._bottom)}setRight(e){let i=Wt(e);this._right!==i&&(this._right=i,this.domNode.style.right=this._right)}setPaddingTop(e){let i=Wt(e);this._paddingTop!==i&&(this._paddingTop=i,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let i=Wt(e);this._paddingLeft!==i&&(this._paddingLeft=i,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let i=Wt(e);this._paddingBottom!==i&&(this._paddingBottom=i,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let i=Wt(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=Wt(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=Wt(e);this._lineHeight!==i&&(this._lineHeight=i,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let i=Wt(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 Wt(e){return typeof e=="number"?`${e}px`:e}function fl(e){return new C1(e)}var lv=class{constructor(){this._hooks=new Ns,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($e(()=>{try{e.releasePointerCapture(i)}catch{}}))}catch{h=zi(e)}this._hooks.add(de(h,_t.POINTER_MOVE,d=>{if(d.buttons!==n){this.stopMonitoring(!0);return}d.preventDefault(),this._pointerMoveCallback(d)})),this._hooks.add(de(h,_t.POINTER_UP,d=>this.stopMonitoring(!0)))}};function k1(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 Bi;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Bi||={});var al=class Tt extends Se{constructor(){super(),this.dispatched=!1,this.targets=new Eg,this.ignoreTargets=new Eg,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(kt.runAndSubscribe(y1,({window:i,disposables:n})=>{n.add(de(i.document,"touchstart",l=>this.onTouchStart(l),{passive:!1})),n.add(de(i.document,"touchend",l=>this.onTouchEnd(i,l))),n.add(de(i.document,"touchmove",l=>this.onTouchMove(l),{passive:!1}))},{window:ss,disposables:this._store}))}static addTarget(i){if(!Tt.isTouchDevice())return Se.None;Tt.INSTANCE||(Tt.INSTANCE=new Tt);let n=Tt.INSTANCE.targets.push(i);return $e(n)}static ignoreTarget(i){if(!Tt.isTouchDevice())return Se.None;Tt.INSTANCE||(Tt.INSTANCE=new Tt);let n=Tt.INSTANCE.ignoreTargets.push(i);return $e(n)}static isTouchDevice(){return"ontouchstart"in ss||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(Bi.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 p=this.activeTouches[_.identifier],f=Date.now()-p.initialTimeStamp;if(f<Tt.HOLD_DELAY&&Math.abs(p.initialPageX-Qt(p.rollingPageX))<30&&Math.abs(p.initialPageY-Qt(p.rollingPageY))<30){let y=this.newGestureEvent(Bi.Tap,p.initialTarget);y.pageX=Qt(p.rollingPageX),y.pageY=Qt(p.rollingPageY),this.dispatchEvent(y)}else if(f>=Tt.HOLD_DELAY&&Math.abs(p.initialPageX-Qt(p.rollingPageX))<30&&Math.abs(p.initialPageY-Qt(p.rollingPageY))<30){let y=this.newGestureEvent(Bi.Contextmenu,p.initialTarget);y.pageX=Qt(p.rollingPageX),y.pageY=Qt(p.rollingPageY),this.dispatchEvent(y)}else if(o===1){let y=Qt(p.rollingPageX),S=Qt(p.rollingPageY),x=Qt(p.rollingTimestamps)-p.rollingTimestamps[0],C=y-p.rollingPageX[0],b=S-p.rollingPageY[0],R=[...this.targets].filter(M=>p.initialTarget instanceof Node&&M.contains(p.initialTarget));this.inertia(i,R,l,Math.abs(C)/x,C>0?1:-1,y,Math.abs(b)/x,b>0?1:-1,S)}this.dispatchEvent(this.newGestureEvent(Bi.End,p.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===Bi.Tap){let n=new Date().getTime(),l=0;n-this._lastSetTapCountTime>Tt.CLEAR_TAP_COUNT_TIME?l=1:l=2,this._lastSetTapCountTime=n,i.tapCount=l}else(i.type===Bi.Change||i.type===Bi.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,_,p,f){this.handle=Vu(i,()=>{let y=Date.now(),S=y-l,x=0,C=0,b=!0;o+=Tt.SCROLL_FRICTION*S,_+=Tt.SCROLL_FRICTION*S,o>0&&(b=!1,x=h*o*S),_>0&&(b=!1,C=p*_*S);let R=this.newGestureEvent(Bi.Change);R.translationX=x,R.translationY=C,n.forEach(M=>M.dispatchEvent(R)),b||this.inertia(i,n,y,o,h,d+x,_,p,f+C)})}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(Bi.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)}};al.SCROLL_FRICTION=-.005,al.HOLD_DELAY=700,al.CLEAR_TAP_COUNT_TIME=400,Ze([k1],al,"isTouchDevice",1);var E1=al,Fu=class extends Se{onclick(e,i){this._register(de(e,_t.CLICK,n=>i(new qa(zi(e),n))))}onmousedown(e,i){this._register(de(e,_t.MOUSE_DOWN,n=>i(new qa(zi(e),n))))}onmouseover(e,i){this._register(de(e,_t.MOUSE_OVER,n=>i(new qa(zi(e),n))))}onmouseleave(e,i){this._register(de(e,_t.MOUSE_LEAVE,n=>i(new qa(zi(e),n))))}onkeydown(e,i){this._register(de(e,_t.KEY_DOWN,n=>i(new Bg(n))))}onkeyup(e,i){this._register(de(e,_t.KEY_UP,n=>i(new Bg(n))))}oninput(e,i){this._register(de(e,_t.INPUT,i))}onblur(e,i){this._register(de(e,_t.BLUR,i))}onfocus(e,i){this._register(de(e,_t.FOCUS,i))}onchange(e,i){this._register(de(e,_t.CHANGE,i))}ignoreGesture(e){return E1.ignoreTarget(e)}},jg=11,T1=class extends Fu{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=jg+"px",this.domNode.style.height=jg+"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 lv),this._register(Lg(this.bgDomNode,_t.POINTER_DOWN,i=>this._arrowPointerDown(i))),this._register(Lg(this.domNode,_t.POINTER_DOWN,i=>this._arrowPointerDown(i))),this._pointerdownRepeatTimer=this._register(new x1),this._pointerdownScheduleRepeatTimer=this._register(new Xu)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,zi(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()}},R1=class mu{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 mu(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 mu(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,p=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:p}}},D1=class extends Se{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new F),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new R1(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){let n=this._state.withScrollDimensions(e,i);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.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 Ug(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=Ug.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)))}},Hg=class{constructor(e,i,n){this.scrollLeft=e,this.scrollTop=i,this.isDone=n}};function Ih(e,i){let n=i-e;return function(l){return e+n*A1(l)}}function M1(e,i,n){return function(l){return l<n?e(l/n):i((l-n)/(1-n))}}var Ug=class vu{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),M1(Ih(i,o),Ih(h,n),.33)}return Ih(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 Hg(l,o,!1)}return new Hg(this.to.scrollLeft,this.to.scrollTop,!0)}combine(i,n,l){return vu.start(i,n,l)}static start(i,n,l){l=l+10;let o=Date.now()-10;return new vu(i,n,o,l)}};function B1(e){return Math.pow(e,3)}function A1(e){return 1-B1(1-e)}var z1=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 Xu)}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(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},O1=140,av=class extends Fu{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 z1(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new lv),this._shouldRender=!0,this.domNode=fl(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(de(this.domNode.domNode,_t.POINTER_DOWN,i=>this._domNodePointerDown(i)))}_createArrow(e){let i=this._register(new T1(e));this.domNode.domNode.appendChild(i.bgDomNode),this.domNode.domNode.appendChild(i.domNode)}_createSlider(e,i,n,l){this.slider=fl(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(de(this.slider.domNode,_t.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=w1(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(iv&&d>O1){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()}},ov=class Su{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 Su(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),p=o>0&&o>l;if(!p)return{computedAvailableSize:Math.round(d),computedIsNeeded:p,computedSliderSize:Math.round(_),computedSliderRatio:0,computedSliderPosition:0};let f=Math.round(Math.max(20,Math.floor(l*_/o))),y=(_-f)/(o-l),S=h*y;return{computedAvailableSize:Math.round(d),computedIsNeeded:p,computedSliderSize:Math.round(f),computedSliderRatio:y,computedSliderPosition:Math.round(S)}}_refreshComputedValues(){let i=Su._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)}},L1=class extends av{constructor(e,i,n){let l=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new ov(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}},N1=class extends av{constructor(e,i,n){let l=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new ov(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}},j1=500,qg=50,H1=class{constructor(e,i,n){this.timestamp=e,this.deltaX=i,this.deltaY=n,this.score=0}},yu=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(Iu){let n=zi(i.browserEvent),l=Vb(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 H1(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),p=Math.max(Math.min(o,d),1),f=Math.max(Math.min(h,_),1),y=Math.max(o,d),S=Math.max(h,_);y%p===0&&S%f===0&&(l-=.5)}return Math.min(Math.max(l,0),1)}_isAlmostInt(i){return Math.abs(Math.round(i)-i)<.01}};yu.INSTANCE=new yu;var U1=yu,q1=class extends Fu{constructor(e,i,n){super(),this._onScroll=this._register(new F),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new F),this.onWillScroll=this._onWillScroll.event,this._options=P1(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 N1(this._scrollable,this._options,l)),this._horizontalScrollbar=this._register(new L1(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=fl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=fl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=fl(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 Xu),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,Oi&&(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 zg(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=ar(this._mouseWheelToDispose),e)){let i=n=>{this._onMouseWheel(new zg(n))};this._mouseWheelToDispose.push(de(this._listenOnDomNode,_t.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let i=U1.INSTANCE;i.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,h=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&h+o===0?h=o=0:Math.abs(o)>=Math.abs(h)?h=0:o=0),this._options.flipAxes&&([o,h]=[h,o]);let d=!Oi&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||d)&&!h&&(h=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(h=h*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);let _=this._scrollable.getFutureScrollPosition(),p={};if(o){let f=qg*o,y=_.scrollTop-(f<0?Math.floor(f):Math.ceil(f));this._verticalScrollbar.writeScrollPosition(p,y)}if(h){let f=qg*h,y=_.scrollLeft-(f<0?Math.floor(f):Math.ceil(f));this._horizontalScrollbar.writeScrollPosition(p,y)}p=this._scrollable.validateScrollPosition(p),(_.scrollLeft!==p.scrollLeft||_.scrollTop!==p.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(p):this._scrollable.setScrollPositionNow(p),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(),j1)}},W1=class extends q1{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 P1(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,Oi&&(i.className+=" mac"),i}var bu=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 F),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let p=this._register(new D1({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:f=>Vu(l.window,f)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{p.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new W1(i,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},p)),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(kt.runAndSubscribe(h.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=h.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register($e(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=l.mainDocument.createElement("style"),i.appendChild(this._styleElement),this._register($e(()=>this._styleElement.remove())),this._register(kt.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(`
|
|
64
64
|
`)})),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(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.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}};bu=Ze([se(2,At),se(3,rs),se(4,Pm),se(5,tn),se(6,zt),se(7,ns)],bu);var xu=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($e(()=>{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){let i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",e?.options?.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){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};xu=Ze([se(1,At),se(2,rs),se(3,vl),se(4,ns)],xu);var K1=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)}},Di={full:0,left:0,center:0,right:0},As={full:0,left:0,center:0,right:0},Jn={full:0,left:0,center:0,right:0},eo=class extends Se{constructor(e,i,n,l,o,h,d,_){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 K1,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register($e(()=>this._canvas?.remove()));let p=this._canvas.getContext("2d");if(p)this._ctx=p;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(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),i=Math.ceil((this._canvas.width-1)/3);As.full=this._canvas.width,As.left=e,As.center=i,As.right=e,this._refreshDrawHeightConstants(),Jn.full=1,Jn.left=1,Jn.center=1+As.left,Jn.right=1+As.left+As.center}_refreshDrawHeightConstants(){Di.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);Di.left=i,Di.center=i,Di.right=i}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Di.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Di.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Di.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Di.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(Jn[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Di[e.position||"full"]/2),As[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Di[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}))}};eo=Ze([se(2,At),se(3,vl),se(4,ns),se(5,zt),se(6,tn),se(7,rs)],eo);var I;(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=`
|
|
65
|
-
`,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=""))(I||={});var Va;(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=""))(Va||={});var cv;(e=>e.ST=`${I.ESC}\\`)(cv||={});var wu=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(`${I.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)}}};wu=Ze([se(2,At),se(3,zt),se(4,hr),se(5,ns)],wu);var _t=0,gt=0,mt=0,Fe=0,Wg={css:"#00000000",rgba:0},lt;(e=>{function i(o,h,d,_){return _!==void 0?`#${tr(o)}${tr(h)}${tr(d)}${tr(_)}`:`#${tr(o)}${tr(h)}${tr(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})(lt||={});var Ke;(e=>{function i(p,f){if(Fe=(f.rgba&255)/255,Fe===1)return{css:f.css,rgba:f.rgba};let y=f.rgba>>24&255,S=f.rgba>>16&255,x=f.rgba>>8&255,C=p.rgba>>24&255,b=p.rgba>>16&255,R=p.rgba>>8&255;_t=C+Math.round((y-C)*Fe),gt=b+Math.round((S-b)*Fe),mt=R+Math.round((x-R)*Fe);let j=lt.toCss(_t,gt,mt),X=lt.toRgba(_t,gt,mt);return{css:j,rgba:X}}e.blend=i;function n(p){return(p.rgba&255)===255}e.isOpaque=n;function l(p,f,y){let S=Fa.ensureContrastRatio(p.rgba,f.rgba,y);if(S)return lt.toColor(S>>24&255,S>>16&255,S>>8&255)}e.ensureContrastRatio=l;function o(p){let f=(p.rgba|255)>>>0;return[_t,gt,mt]=Fa.toChannels(f),{css:lt.toCss(_t,gt,mt),rgba:f}}e.opaque=o;function h(p,f){return Fe=Math.round(f*255),[_t,gt,mt]=Fa.toChannels(p.rgba),{css:lt.toCss(_t,gt,mt,Fe),rgba:lt.toRgba(_t,gt,mt,Fe)}}e.opacity=h;function d(p,f){return Fe=p.rgba&255,h(p,Fe*f/255)}e.multiplyOpacity=d;function _(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}e.toColorRGB=_})(Ke||={});var Ge;(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 _t=parseInt(o.slice(1,2).repeat(2),16),gt=parseInt(o.slice(2,3).repeat(2),16),mt=parseInt(o.slice(3,4).repeat(2),16),lt.toColor(_t,gt,mt);case 5:return _t=parseInt(o.slice(1,2).repeat(2),16),gt=parseInt(o.slice(2,3).repeat(2),16),mt=parseInt(o.slice(3,4).repeat(2),16),Fe=parseInt(o.slice(4,5).repeat(2),16),lt.toColor(_t,gt,mt,Fe);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 _t=parseInt(h[1]),gt=parseInt(h[2]),mt=parseInt(h[3]),Fe=Math.round((h[5]===void 0?1:parseFloat(h[5]))*255),lt.toColor(_t,gt,mt,Fe);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),[_t,gt,mt,Fe]=i.getImageData(0,0,1,1).data,Fe!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:lt.toRgba(_t,gt,mt,Fe),css:o}}e.toColor=l})(Ge||={});var Mt;(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,p=h/255,f=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4),y=_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4),S=p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4);return f*.2126+y*.7152+S*.0722}e.relativeLuminance2=n})(Mt||={});var Fa;(e=>{function i(d,_){if(Fe=(_&255)/255,Fe===1)return _;let p=_>>24&255,f=_>>16&255,y=_>>8&255,S=d>>24&255,x=d>>16&255,C=d>>8&255;return _t=S+Math.round((p-S)*Fe),gt=x+Math.round((f-x)*Fe),mt=C+Math.round((y-C)*Fe),lt.toRgba(_t,gt,mt)}e.blend=i;function n(d,_,p){let f=Mt.relativeLuminance(d>>8),y=Mt.relativeLuminance(_>>8);if(ts(f,y)<p){if(y<f){let C=l(d,_,p),b=ts(f,Mt.relativeLuminance(C>>8));if(b<p){let R=o(d,_,p),j=ts(f,Mt.relativeLuminance(R>>8));return b>j?C:R}return C}let S=o(d,_,p),x=ts(f,Mt.relativeLuminance(S>>8));if(x<p){let C=l(d,_,p),b=ts(f,Mt.relativeLuminance(C>>8));return x>b?S:C}return S}}e.ensureContrastRatio=n;function l(d,_,p){let f=d>>24&255,y=d>>16&255,S=d>>8&255,x=_>>24&255,C=_>>16&255,b=_>>8&255,R=ts(Mt.relativeLuminance2(x,C,b),Mt.relativeLuminance2(f,y,S));for(;R<p&&(x>0||C>0||b>0);)x-=Math.max(0,Math.ceil(x*.1)),C-=Math.max(0,Math.ceil(C*.1)),b-=Math.max(0,Math.ceil(b*.1)),R=ts(Mt.relativeLuminance2(x,C,b),Mt.relativeLuminance2(f,y,S));return(x<<24|C<<16|b<<8|255)>>>0}e.reduceLuminance=l;function o(d,_,p){let f=d>>24&255,y=d>>16&255,S=d>>8&255,x=_>>24&255,C=_>>16&255,b=_>>8&255,R=ts(Mt.relativeLuminance2(x,C,b),Mt.relativeLuminance2(f,y,S));for(;R<p&&(x<255||C<255||b<255);)x=Math.min(255,x+Math.ceil((255-x)*.1)),C=Math.min(255,C+Math.ceil((255-C)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),R=ts(Mt.relativeLuminance2(x,C,b),Mt.relativeLuminance2(f,y,S));return(x<<24|C<<16|b<<8|255)>>>0}e.increaseLuminance=o;function h(d){return[d>>24&255,d>>16&255,d>>8&255,d&255]}e.toChannels=h})(Fa||={});function tr(e){let i=e.toString(16);return i.length<2?"0"+i:i}function ts(e,i){return e<i?(i+.05)/(e+.05):(e+.05)/(i+.05)}var Y1=class extends ml{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()]}},to=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new gi}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),p=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!==p){if(f-o>1){let y=this._getJoinedRanges(l,d,h,i,o);for(let S=0;S<y.length;S++)n.push(y[S])}o=f,d=h,_=this._workCell.fg,p=this._workCell.bg}h+=this._workCell.getChars().length||Ls.length}if(this._bufferService.cols-o>1){let f=this._getJoinedRanges(l,d,h,i,o);for(let y=0;y<f.length;y++)n.push(f[y])}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 p=this._characterJoiners[_].handler(h);for(let f=0;f<p.length;f++)to._mergeRanges(d,p[f])}catch(p){console.error(p)}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 p=i.getWidth(_),f=i.getString(_).length||Ls.length;if(p!==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}};to=Ze([se(0,At)],to);function $1(e){return 57508<=e&&e<=57558}function I1(e){return 9472<=e&&e<=9631}function G1(e){return $1(e)||I1(e)}function X1(){return{css:{canvas:Wa(),cell:Wa()},device:{canvas:Wa(),cell:Wa(),char:{width:0,height:0,left:0,top:0}}}}function Wa(){return{width:0,height:0}}var Cu=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 gi,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,_,p,f,y){let S=[],x=this._characterJoinerService.getJoinedCharacters(i),C=this._themeService.colors,b=e.getNoBgTrimmedLength();n&&b<h+1&&(b=h+1);let R,j=0,X="",K=0,A=0,L=0,H=0,Z=!1,F=0,pe=!1,ke=0,St=0,ue=[],V=f!==-1&&y!==-1;for(let G=0;G<b;G++){e.loadCell(G,this._workCell);let ie=this._workCell.getWidth();if(ie===0)continue;let ee=!1,T=G>=St,W=G,Y=this._workCell;if(x.length>0&&G===x[0][0]&&T){let Re=x.shift(),mi=this._isCellInSelection(Re[0],i);for(K=Re[0]+1;K<Re[1];K++)T&&=mi===this._isCellInSelection(K,i);T&&=!n||h<Re[0]||h>=Re[1],T?(ee=!0,Y=new Y1(this._workCell,e.translateToString(!0,Re[0],Re[1]),Re[1]-Re[0]),W=Re[1]-1,ie=Y.getWidth()):St=Re[1]}let ae=this._isCellInSelection(G,i),fe=n&&G===h,k=V&&G>=f&&G<=y,q=!1;this._decorationService.forEachDecorationAtCell(G,i,void 0,Re=>{q=!0});let J=Y.getChars()||Ls;if(J===" "&&(Y.isUnderline()||Y.isOverline())&&(J=" "),ke=ie*_-p.get(J,Y.isBold(),Y.isItalic()),!R)R=this._document.createElement("span");else if(j&&(ae&&pe||!ae&&!pe&&Y.bg===A)&&(ae&&pe&&C.selectionForeground||Y.fg===L)&&Y.extended.ext===H&&k===Z&&ke===F&&!fe&&!ee&&!q&&T){Y.isInvisible()?X+=Ls:X+=J,j++;continue}else j&&(R.textContent=X),R=this._document.createElement("span"),j=0,X="";if(A=Y.bg,L=Y.fg,H=Y.extended.ext,Z=k,F=ke,pe=ae,ee&&h>=G&&h<=W&&(h=G),!this._coreService.isCursorHidden&&fe&&this._coreService.isCursorInitialized){if(ue.push("xterm-cursor"),this._coreBrowserService.isFocused)d&&ue.push("xterm-cursor-blink"),ue.push(l==="bar"?"xterm-cursor-bar":l==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":ue.push("xterm-cursor-outline");break;case"block":ue.push("xterm-cursor-block");break;case"bar":ue.push("xterm-cursor-bar");break;case"underline":ue.push("xterm-cursor-underline");break}}if(Y.isBold()&&ue.push("xterm-bold"),Y.isItalic()&&ue.push("xterm-italic"),Y.isDim()&&ue.push("xterm-dim"),Y.isInvisible()?X=Ls:X=Y.getChars()||Ls,Y.isUnderline()&&(ue.push(`xterm-underline-${Y.extended.underlineStyle}`),X===" "&&(X=" "),!Y.isUnderlineColorDefault()))if(Y.isUnderlineColorRGB())R.style.textDecorationColor=`rgb(${ml.toColorRGB(Y.getUnderlineColor()).join(",")})`;else{let Re=Y.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Y.isBold()&&Re<8&&(Re+=8),R.style.textDecorationColor=C.ansi[Re].css}Y.isOverline()&&(ue.push("xterm-overline"),X===" "&&(X=" ")),Y.isStrikethrough()&&ue.push("xterm-strikethrough"),k&&(R.style.textDecoration="underline");let te=Y.getFgColor(),oe=Y.getFgColorMode(),he=Y.getBgColor(),ye=Y.getBgColorMode(),at=!!Y.isInverse();if(at){let Re=te;te=he,he=Re;let mi=oe;oe=ye,ye=mi}let Ae,wi,Ci=!1;this._decorationService.forEachDecorationAtCell(G,i,void 0,Re=>{Re.options.layer!=="top"&&Ci||(Re.backgroundColorRGB&&(ye=50331648,he=Re.backgroundColorRGB.rgba>>8&16777215,Ae=Re.backgroundColorRGB),Re.foregroundColorRGB&&(oe=50331648,te=Re.foregroundColorRGB.rgba>>8&16777215,wi=Re.foregroundColorRGB),Ci=Re.options.layer==="top")}),!Ci&&ae&&(Ae=this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque,he=Ae.rgba>>8&16777215,ye=50331648,Ci=!0,C.selectionForeground&&(oe=50331648,te=C.selectionForeground.rgba>>8&16777215,wi=C.selectionForeground)),Ci&&ue.push("xterm-decoration-top");let ti;switch(ye){case 16777216:case 33554432:ti=C.ansi[he],ue.push(`xterm-bg-${he}`);break;case 50331648:ti=lt.toColor(he>>16,he>>8&255,he&255),this._addStyle(R,`background-color:#${Pg((he>>>0).toString(16),"0",6)}`);break;default:at?(ti=C.foreground,ue.push("xterm-bg-257")):ti=C.background}switch(Ae||Y.isDim()&&(Ae=Ke.multiplyOpacity(ti,.5)),oe){case 16777216:case 33554432:Y.isBold()&&te<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(te+=8),this._applyMinimumContrast(R,ti,C.ansi[te],Y,Ae,void 0)||ue.push(`xterm-fg-${te}`);break;case 50331648:let Re=lt.toColor(te>>16&255,te>>8&255,te&255);this._applyMinimumContrast(R,ti,Re,Y,Ae,wi)||this._addStyle(R,`color:#${Pg(te.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(R,ti,C.foreground,Y,Ae,wi)||at&&ue.push("xterm-fg-257")}ue.length&&(R.className=ue.join(" "),ue.length=0),!fe&&!ee&&!q&&T?j++:R.textContent=X,ke!==this.defaultSpacing&&(R.style.letterSpacing=`${ke}px`),S.push(R),G=W}return R&&j&&(R.textContent=X),S}_applyMinimumContrast(e,i,n,l,o,h){if(this._optionsService.rawOptions.minimumContrastRatio===1||G1(l.getCode()))return!1;let d=this._getContrastCache(l),_;if(!o&&!h&&(_=d.getColor(i.rgba,n.rgba)),_===void 0){let p=this._optionsService.rawOptions.minimumContrastRatio/(l.isDim()?2:1);_=Ke.ensureContrastRatio(o||i,h||n,p),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]}};Cu=Ze([se(1,$m),se(2,zt),se(3,rs),se(4,hr),se(5,vl),se(6,tn)],Cu);function Pg(e,i,n){for(;e.length<n;)e=i+e;return e}var V1=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}},F1=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),p=Math.min(d,e.rows-1);if(_>=e.rows||p<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=l,this.viewportStartRow=h,this.viewportEndRow=d,this.viewportCappedStartRow=_,this.viewportCappedEndRow=p,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 Z1(){return new F1}var Gh="xterm-dom-renderer-owner-",di="xterm-rows",Pa="xterm-fg-",Kg="xterm-bg-",el="xterm-focus",Ka="xterm-selection",Q1=1,ku=class extends Se{constructor(e,i,n,l,o,h,d,_,p,f,y,S,x,C){super(),this._terminal=e,this._document=i,this._element=n,this._screenElement=l,this._viewportElement=o,this._helperContainer=h,this._linkifier2=d,this._charSizeService=p,this._optionsService=f,this._bufferService=y,this._coreService=S,this._coreBrowserService=x,this._themeService=C,this._terminalClass=Q1++,this._rowElements=[],this._selectionRenderModel=Z1(),this.onRequestRedraw=this._register(new Q).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(di),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(Ka),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=X1(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(b=>this._injectCss(b))),this._injectCss(this._themeService.colors),this._rowFactory=_.createInstance(Cu,document),this._element.classList.add(Gh+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(b=>this._handleLinkHover(b))),this._register(this._linkifier2.onHideLinkUnderline(b=>this._handleLinkLeave(b))),this._register($e(()=>{this._element.classList.remove(Gh+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new V1(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} .${di} 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} .${di} { 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} .${di} .xterm-dim { color: ${Ke.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} .${di}.${el} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${di}.${el} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${l} 1s step-end infinite;}${this._terminalSelector} .${di}.${el} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${di} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${di} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${di} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${di} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${di} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,i+=`${this._terminalSelector} .${Ka} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Ka} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Ka} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[h,d]of e.ansi.entries())i+=`${this._terminalSelector} .${Pa}${h} { color: ${d.css}; }${this._terminalSelector} .${Pa}${h}.xterm-dim { color: ${Ke.multiplyOpacity(d,.5).css}; }${this._terminalSelector} .${Kg}${h} { background-color: ${d.css}; }`;i+=`${this._terminalSelector} .${Pa}257 { color: ${Ke.opaque(e.background).css}; }${this._terminalSelector} .${Pa}257.xterm-dim { color: ${Ke.multiplyOpacity(Ke.opaque(e.background),.5).css}; }${this._terminalSelector} .${Kg}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(el),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(el),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 p=e[0]>i[0];_.appendChild(this._createSelectionElement(h,p?i[0]:e[0],p?e[0]:i[0],d-h+1))}else{let p=l===h?e[0]:0,f=h===o?i[0]:this._bufferService.cols;_.appendChild(this._createSelectionElement(h,p,f));let y=d-h-1;if(_.appendChild(this._createSelectionElement(h+1,0,this._bufferService.cols,y)),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 p=e;p<=i;p++){let f=p+n.ydisp,y=this._rowElements[p],S=n.lines.get(f);if(!y||!S)break;y.replaceChildren(...this._rowFactory.createRow(S,f,f===l,d,_,o,h,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Gh}${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,p=_.ybase+_.y,f=Math.min(_.x,o-1),y=this._optionsService.rawOptions.cursorBlink,S=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;for(let C=n;C<=l;++C){let b=C+_.ydisp,R=this._rowElements[C],j=_.lines.get(b);if(!R||!j)break;R.replaceChildren(...this._rowFactory.createRow(j,b,b===p,S,x,f,y,this.dimensions.css.cell.width,this._widthCache,h?C===n?e:0:-1,h?(C===l?i:o)-1:-1))}}};ku=Ze([se(7,Ku),se(8,ho),se(9,zt),se(10,At),se(11,hr),se(12,rs),se(13,tn)],ku);var Eu=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 ex(this._optionsService))}catch{this._measureStrategy=this._register(new J1(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())}};Eu=Ze([se(2,zt)],Eu);var hv=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)}},J1=class extends hv{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}},ex=class extends hv{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}},tx=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 ix(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(kt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(de(this._textarea,"focus",()=>this._isFocused=!0)),this._register(de(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}},ix=class extends Se{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Jr),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($e(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=de(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},sx=class extends Se{constructor(){super(),this.linkProviders=[],this._register($e(()=>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 Zu(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 rx(e,i,n,l,o,h,d,_,p){if(!h)return;let f=Zu(e,i,n);if(f)return f[0]=Math.ceil((f[0]+(p?d/2:0))/d),f[1]=Math.ceil(f[1]/_),f[0]=Math.min(Math.max(f[0],1),l+(p?1:0)),f[1]=Math.min(Math.max(f[1],1),o),f}var Tu=class{constructor(e,i){this._renderService=e,this._charSizeService=i}getCoords(e,i,n,l,o){return rx(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=Zu(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])}}};Tu=Ze([se(0,ns),se(1,ho)],Tu);var nx=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=[]}},uv={};_b(uv,{getSafariVersion:()=>ax,isChromeOS:()=>_v,isFirefox:()=>dv,isIpad:()=>ox,isIphone:()=>cx,isLegacyEdge:()=>lx,isLinux:()=>Qu,isMac:()=>io,isNode:()=>uo,isSafari:()=>fv,isWindows:()=>pv});var uo=typeof process<"u"&&"title"in process,Sl=uo?"node":navigator.userAgent,yl=uo?"node":navigator.platform,dv=Sl.includes("Firefox"),lx=Sl.includes("Edge"),fv=/^((?!chrome|android).)*safari/i.test(Sl);function ax(){if(!fv)return 0;let e=Sl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var io=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(yl),ox=yl==="iPad",cx=yl==="iPhone",pv=["Windows","Win16","Win32","WinCE"].includes(yl),Qu=yl.indexOf("Linux")>=0,_v=/\bCrOS\b/.test(Sl),gv=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()}},hx=class extends gv{_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())}}},ux=class extends gv{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},so=!uo&&"requestIdleCallback"in window?ux:hx,dx=class{constructor(){this._queue=new so}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Ru=class extends Se{constructor(e,i,n,l,o,h,d,_,p){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=l,this._coreService=o,this._coreBrowserService=_,this._renderer=this._register(new Jr),this._pausedResizeTask=new dx,this._observerDisposable=this._register(new Jr),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 nx((f,y)=>this._renderRows(f,y),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new fx(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register($e(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(d.onResize(()=>this._fullRefresh())),this._register(d.buffers.onBufferActivate(()=>this._renderer.value?.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(p.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=$e(()=>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(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,i)):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,i,n){this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,i,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};Ru=Ze([se(2,zt),se(3,ho),se(4,hr),se(5,vl),se(6,At),se(7,rs),se(8,tn)],Ru);var fx=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 px(e,i,n,l){let o=n.buffer.x,h=n.buffer.y;if(!n.buffer.hasScrollback)return mx(o,h,e,i,n,l)+fo(h,i,n,l)+vx(o,h,e,i,n,l);let d;if(h===i)return d=o>e?"D":"C",_l(Math.abs(o-e),pl(d,l));d=h>i?"D":"C";let _=Math.abs(h-i),p=gx(h>i?e:o,n)+(_-1)*n.cols+1+_x(h>i?o:e);return _l(p,pl(d,l))}function _x(e,i){return e-1}function gx(e,i){return i.cols-e}function mx(e,i,n,l,o,h){return fo(i,l,o,h).length===0?"":_l(vv(e,i,e,i-or(i,o),!1,o).length,pl("D",h))}function fo(e,i,n,l){let o=e-or(e,n),h=i-or(i,n),d=Math.abs(o-h)-Sx(e,i,n);return _l(d,pl(mv(e,i),l))}function vx(e,i,n,l,o,h){let d;fo(i,l,o,h).length>0?d=l-or(l,o):d=i;let _=l,p=yx(e,i,n,l,o,h);return _l(vv(e,d,n,_,p==="C",o).length,pl(p,h))}function Sx(e,i,n){let l=0,o=e-or(e,n),h=i-or(i,n);for(let d=0;d<Math.abs(o-h);d++){let _=mv(e,i)==="A"?-1:1;n.buffer.lines.get(o+_*d)?.isWrapped&&l++}return l}function or(e,i){let n=0,l=i.buffer.lines.get(e),o=l?.isWrapped;for(;o&&e>=0&&e<i.rows;)n++,l=i.buffer.lines.get(--e),o=l?.isWrapped;return n}function yx(e,i,n,l,o,h){let d;return fo(n,l,o,h).length>0?d=l-or(l,o):d=i,e<n&&d<=l||e>=n&&d<l?"C":"D"}function mv(e,i){return e>i?"A":"B"}function vv(e,i,n,l,o,h){let d=e,_=i,p="";for(;(d!==n||_!==l)&&_>=0&&_<h.buffer.lines.length;)d+=o?1:-1,o&&d>h.cols-1?(p+=h.buffer.translateBufferLineToString(_,!1,e,d),d=0,e=0,_++):!o&&d<0&&(p+=h.buffer.translateBufferLineToString(_,!1,0,e+1),d=h.cols-1,e=d,_--);return p+h.buffer.translateBufferLineToString(_,!1,e,d)}function pl(e,i){let n=i?"O":"[";return I.ESC+n+e}function _l(e,i){e=Math.floor(e);let n="";for(let l=0;l<e;l++)n+=i;return n}var bx=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 Yg(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 Xh=50,xx=15,wx=50,Cx=500,kx=" ",Ex=new RegExp(kx,"g"),Du=class extends Se{constructor(e,i,n,l,o,h,d,_,p){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=p,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new gi,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 bx(this._bufferService),this._activeSelectionMode=0,this._register($e(()=>{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?.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(Ex," ")).join(pv?`\r
|
|
65
|
+
`,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=""))(I||={});var Va;(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=""))(Va||={});var cv;(e=>e.ST=`${I.ESC}\\`)(cv||={});var wu=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(`${I.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)}}};wu=Ze([se(2,At),se(3,zt),se(4,hr),se(5,ns)],wu);var gt=0,mt=0,vt=0,Fe=0,Wg={css:"#00000000",rgba:0},at;(e=>{function i(o,h,d,_){return _!==void 0?`#${tr(o)}${tr(h)}${tr(d)}${tr(_)}`:`#${tr(o)}${tr(h)}${tr(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})(at||={});var Ke;(e=>{function i(p,f){if(Fe=(f.rgba&255)/255,Fe===1)return{css:f.css,rgba:f.rgba};let y=f.rgba>>24&255,S=f.rgba>>16&255,x=f.rgba>>8&255,C=p.rgba>>24&255,b=p.rgba>>16&255,R=p.rgba>>8&255;gt=C+Math.round((y-C)*Fe),mt=b+Math.round((S-b)*Fe),vt=R+Math.round((x-R)*Fe);let M=at.toCss(gt,mt,vt),W=at.toRgba(gt,mt,vt);return{css:M,rgba:W}}e.blend=i;function n(p){return(p.rgba&255)===255}e.isOpaque=n;function l(p,f,y){let S=Fa.ensureContrastRatio(p.rgba,f.rgba,y);if(S)return at.toColor(S>>24&255,S>>16&255,S>>8&255)}e.ensureContrastRatio=l;function o(p){let f=(p.rgba|255)>>>0;return[gt,mt,vt]=Fa.toChannels(f),{css:at.toCss(gt,mt,vt),rgba:f}}e.opaque=o;function h(p,f){return Fe=Math.round(f*255),[gt,mt,vt]=Fa.toChannels(p.rgba),{css:at.toCss(gt,mt,vt,Fe),rgba:at.toRgba(gt,mt,vt,Fe)}}e.opacity=h;function d(p,f){return Fe=p.rgba&255,h(p,Fe*f/255)}e.multiplyOpacity=d;function _(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}e.toColorRGB=_})(Ke||={});var Ge;(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),mt=parseInt(o.slice(2,3).repeat(2),16),vt=parseInt(o.slice(3,4).repeat(2),16),at.toColor(gt,mt,vt);case 5:return gt=parseInt(o.slice(1,2).repeat(2),16),mt=parseInt(o.slice(2,3).repeat(2),16),vt=parseInt(o.slice(3,4).repeat(2),16),Fe=parseInt(o.slice(4,5).repeat(2),16),at.toColor(gt,mt,vt,Fe);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]),mt=parseInt(h[2]),vt=parseInt(h[3]),Fe=Math.round((h[5]===void 0?1:parseFloat(h[5]))*255),at.toColor(gt,mt,vt,Fe);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,mt,vt,Fe]=i.getImageData(0,0,1,1).data,Fe!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:at.toRgba(gt,mt,vt,Fe),css:o}}e.toColor=l})(Ge||={});var Mt;(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,p=h/255,f=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4),y=_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4),S=p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4);return f*.2126+y*.7152+S*.0722}e.relativeLuminance2=n})(Mt||={});var Fa;(e=>{function i(d,_){if(Fe=(_&255)/255,Fe===1)return _;let p=_>>24&255,f=_>>16&255,y=_>>8&255,S=d>>24&255,x=d>>16&255,C=d>>8&255;return gt=S+Math.round((p-S)*Fe),mt=x+Math.round((f-x)*Fe),vt=C+Math.round((y-C)*Fe),at.toRgba(gt,mt,vt)}e.blend=i;function n(d,_,p){let f=Mt.relativeLuminance(d>>8),y=Mt.relativeLuminance(_>>8);if(ts(f,y)<p){if(y<f){let C=l(d,_,p),b=ts(f,Mt.relativeLuminance(C>>8));if(b<p){let R=o(d,_,p),M=ts(f,Mt.relativeLuminance(R>>8));return b>M?C:R}return C}let S=o(d,_,p),x=ts(f,Mt.relativeLuminance(S>>8));if(x<p){let C=l(d,_,p),b=ts(f,Mt.relativeLuminance(C>>8));return x>b?S:C}return S}}e.ensureContrastRatio=n;function l(d,_,p){let f=d>>24&255,y=d>>16&255,S=d>>8&255,x=_>>24&255,C=_>>16&255,b=_>>8&255,R=ts(Mt.relativeLuminance2(x,C,b),Mt.relativeLuminance2(f,y,S));for(;R<p&&(x>0||C>0||b>0);)x-=Math.max(0,Math.ceil(x*.1)),C-=Math.max(0,Math.ceil(C*.1)),b-=Math.max(0,Math.ceil(b*.1)),R=ts(Mt.relativeLuminance2(x,C,b),Mt.relativeLuminance2(f,y,S));return(x<<24|C<<16|b<<8|255)>>>0}e.reduceLuminance=l;function o(d,_,p){let f=d>>24&255,y=d>>16&255,S=d>>8&255,x=_>>24&255,C=_>>16&255,b=_>>8&255,R=ts(Mt.relativeLuminance2(x,C,b),Mt.relativeLuminance2(f,y,S));for(;R<p&&(x<255||C<255||b<255);)x=Math.min(255,x+Math.ceil((255-x)*.1)),C=Math.min(255,C+Math.ceil((255-C)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),R=ts(Mt.relativeLuminance2(x,C,b),Mt.relativeLuminance2(f,y,S));return(x<<24|C<<16|b<<8|255)>>>0}e.increaseLuminance=o;function h(d){return[d>>24&255,d>>16&255,d>>8&255,d&255]}e.toChannels=h})(Fa||={});function tr(e){let i=e.toString(16);return i.length<2?"0"+i:i}function ts(e,i){return e<i?(i+.05)/(e+.05):(e+.05)/(i+.05)}var Y1=class extends ml{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()]}},to=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new gi}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),p=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!==p){if(f-o>1){let y=this._getJoinedRanges(l,d,h,i,o);for(let S=0;S<y.length;S++)n.push(y[S])}o=f,d=h,_=this._workCell.fg,p=this._workCell.bg}h+=this._workCell.getChars().length||Ls.length}if(this._bufferService.cols-o>1){let f=this._getJoinedRanges(l,d,h,i,o);for(let y=0;y<f.length;y++)n.push(f[y])}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 p=this._characterJoiners[_].handler(h);for(let f=0;f<p.length;f++)to._mergeRanges(d,p[f])}catch(p){console.error(p)}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 p=i.getWidth(_),f=i.getString(_).length||Ls.length;if(p!==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}};to=Ze([se(0,At)],to);function $1(e){return 57508<=e&&e<=57558}function I1(e){return 9472<=e&&e<=9631}function G1(e){return $1(e)||I1(e)}function X1(){return{css:{canvas:Wa(),cell:Wa()},device:{canvas:Wa(),cell:Wa(),char:{width:0,height:0,left:0,top:0}}}}function Wa(){return{width:0,height:0}}var Cu=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 gi,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,_,p,f,y){let S=[],x=this._characterJoinerService.getJoinedCharacters(i),C=this._themeService.colors,b=e.getNoBgTrimmedLength();n&&b<h+1&&(b=h+1);let R,M=0,W="",te=0,N=0,L=0,U=0,X=!1,J=0,ge=!1,we=0,Qe=0,ue=[],V=f!==-1&&y!==-1;for(let G=0;G<b;G++){e.loadCell(G,this._workCell);let ie=this._workCell.getWidth();if(ie===0)continue;let Q=!1,T=G>=Qe,P=G,Y=this._workCell;if(x.length>0&&G===x[0][0]&&T){let Re=x.shift(),mi=this._isCellInSelection(Re[0],i);for(te=Re[0]+1;te<Re[1];te++)T&&=mi===this._isCellInSelection(te,i);T&&=!n||h<Re[0]||h>=Re[1],T?(Q=!0,Y=new Y1(this._workCell,e.translateToString(!0,Re[0],Re[1]),Re[1]-Re[0]),P=Re[1]-1,ie=Y.getWidth()):Qe=Re[1]}let ae=this._isCellInSelection(G,i),fe=n&&G===h,k=V&&G>=f&&G<=y,q=!1;this._decorationService.forEachDecorationAtCell(G,i,void 0,Re=>{q=!0});let Z=Y.getChars()||Ls;if(Z===" "&&(Y.isUnderline()||Y.isOverline())&&(Z=" "),we=ie*_-p.get(Z,Y.isBold(),Y.isItalic()),!R)R=this._document.createElement("span");else if(M&&(ae&&ge||!ae&&!ge&&Y.bg===N)&&(ae&&ge&&C.selectionForeground||Y.fg===L)&&Y.extended.ext===U&&k===X&&we===J&&!fe&&!Q&&!q&&T){Y.isInvisible()?W+=Ls:W+=Z,M++;continue}else M&&(R.textContent=W),R=this._document.createElement("span"),M=0,W="";if(N=Y.bg,L=Y.fg,U=Y.extended.ext,X=k,J=we,ge=ae,Q&&h>=G&&h<=P&&(h=G),!this._coreService.isCursorHidden&&fe&&this._coreService.isCursorInitialized){if(ue.push("xterm-cursor"),this._coreBrowserService.isFocused)d&&ue.push("xterm-cursor-blink"),ue.push(l==="bar"?"xterm-cursor-bar":l==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":ue.push("xterm-cursor-outline");break;case"block":ue.push("xterm-cursor-block");break;case"bar":ue.push("xterm-cursor-bar");break;case"underline":ue.push("xterm-cursor-underline");break}}if(Y.isBold()&&ue.push("xterm-bold"),Y.isItalic()&&ue.push("xterm-italic"),Y.isDim()&&ue.push("xterm-dim"),Y.isInvisible()?W=Ls:W=Y.getChars()||Ls,Y.isUnderline()&&(ue.push(`xterm-underline-${Y.extended.underlineStyle}`),W===" "&&(W=" "),!Y.isUnderlineColorDefault()))if(Y.isUnderlineColorRGB())R.style.textDecorationColor=`rgb(${ml.toColorRGB(Y.getUnderlineColor()).join(",")})`;else{let Re=Y.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Y.isBold()&&Re<8&&(Re+=8),R.style.textDecorationColor=C.ansi[Re].css}Y.isOverline()&&(ue.push("xterm-overline"),W===" "&&(W=" ")),Y.isStrikethrough()&&ue.push("xterm-strikethrough"),k&&(R.style.textDecoration="underline");let ee=Y.getFgColor(),oe=Y.getFgColorMode(),he=Y.getBgColor(),ye=Y.getBgColorMode(),ot=!!Y.isInverse();if(ot){let Re=ee;ee=he,he=Re;let mi=oe;oe=ye,ye=mi}let Ae,wi,Ci=!1;this._decorationService.forEachDecorationAtCell(G,i,void 0,Re=>{Re.options.layer!=="top"&&Ci||(Re.backgroundColorRGB&&(ye=50331648,he=Re.backgroundColorRGB.rgba>>8&16777215,Ae=Re.backgroundColorRGB),Re.foregroundColorRGB&&(oe=50331648,ee=Re.foregroundColorRGB.rgba>>8&16777215,wi=Re.foregroundColorRGB),Ci=Re.options.layer==="top")}),!Ci&&ae&&(Ae=this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque,he=Ae.rgba>>8&16777215,ye=50331648,Ci=!0,C.selectionForeground&&(oe=50331648,ee=C.selectionForeground.rgba>>8&16777215,wi=C.selectionForeground)),Ci&&ue.push("xterm-decoration-top");let ti;switch(ye){case 16777216:case 33554432:ti=C.ansi[he],ue.push(`xterm-bg-${he}`);break;case 50331648:ti=at.toColor(he>>16,he>>8&255,he&255),this._addStyle(R,`background-color:#${Pg((he>>>0).toString(16),"0",6)}`);break;default:ot?(ti=C.foreground,ue.push("xterm-bg-257")):ti=C.background}switch(Ae||Y.isDim()&&(Ae=Ke.multiplyOpacity(ti,.5)),oe){case 16777216:case 33554432:Y.isBold()&&ee<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ee+=8),this._applyMinimumContrast(R,ti,C.ansi[ee],Y,Ae,void 0)||ue.push(`xterm-fg-${ee}`);break;case 50331648:let Re=at.toColor(ee>>16&255,ee>>8&255,ee&255);this._applyMinimumContrast(R,ti,Re,Y,Ae,wi)||this._addStyle(R,`color:#${Pg(ee.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(R,ti,C.foreground,Y,Ae,wi)||ot&&ue.push("xterm-fg-257")}ue.length&&(R.className=ue.join(" "),ue.length=0),!fe&&!Q&&!q&&T?M++:R.textContent=W,we!==this.defaultSpacing&&(R.style.letterSpacing=`${we}px`),S.push(R),G=P}return R&&M&&(R.textContent=W),S}_applyMinimumContrast(e,i,n,l,o,h){if(this._optionsService.rawOptions.minimumContrastRatio===1||G1(l.getCode()))return!1;let d=this._getContrastCache(l),_;if(!o&&!h&&(_=d.getColor(i.rgba,n.rgba)),_===void 0){let p=this._optionsService.rawOptions.minimumContrastRatio/(l.isDim()?2:1);_=Ke.ensureContrastRatio(o||i,h||n,p),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]}};Cu=Ze([se(1,$m),se(2,zt),se(3,rs),se(4,hr),se(5,vl),se(6,tn)],Cu);function Pg(e,i,n){for(;e.length<n;)e=i+e;return e}var V1=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}},F1=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),p=Math.min(d,e.rows-1);if(_>=e.rows||p<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=l,this.viewportStartRow=h,this.viewportEndRow=d,this.viewportCappedStartRow=_,this.viewportCappedEndRow=p,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 Z1(){return new F1}var Gh="xterm-dom-renderer-owner-",di="xterm-rows",Pa="xterm-fg-",Kg="xterm-bg-",el="xterm-focus",Ka="xterm-selection",Q1=1,ku=class extends Se{constructor(e,i,n,l,o,h,d,_,p,f,y,S,x,C){super(),this._terminal=e,this._document=i,this._element=n,this._screenElement=l,this._viewportElement=o,this._helperContainer=h,this._linkifier2=d,this._charSizeService=p,this._optionsService=f,this._bufferService=y,this._coreService=S,this._coreBrowserService=x,this._themeService=C,this._terminalClass=Q1++,this._rowElements=[],this._selectionRenderModel=Z1(),this.onRequestRedraw=this._register(new F).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(di),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(Ka),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=X1(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(b=>this._injectCss(b))),this._injectCss(this._themeService.colors),this._rowFactory=_.createInstance(Cu,document),this._element.classList.add(Gh+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(b=>this._handleLinkHover(b))),this._register(this._linkifier2.onHideLinkUnderline(b=>this._handleLinkLeave(b))),this._register($e(()=>{this._element.classList.remove(Gh+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new V1(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} .${di} 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} .${di} { 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} .${di} .xterm-dim { color: ${Ke.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} .${di}.${el} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${di}.${el} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${l} 1s step-end infinite;}${this._terminalSelector} .${di}.${el} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${di} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${di} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${di} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${di} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${di} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,i+=`${this._terminalSelector} .${Ka} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Ka} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Ka} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[h,d]of e.ansi.entries())i+=`${this._terminalSelector} .${Pa}${h} { color: ${d.css}; }${this._terminalSelector} .${Pa}${h}.xterm-dim { color: ${Ke.multiplyOpacity(d,.5).css}; }${this._terminalSelector} .${Kg}${h} { background-color: ${d.css}; }`;i+=`${this._terminalSelector} .${Pa}257 { color: ${Ke.opaque(e.background).css}; }${this._terminalSelector} .${Pa}257.xterm-dim { color: ${Ke.multiplyOpacity(Ke.opaque(e.background),.5).css}; }${this._terminalSelector} .${Kg}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(el),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(el),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 p=e[0]>i[0];_.appendChild(this._createSelectionElement(h,p?i[0]:e[0],p?e[0]:i[0],d-h+1))}else{let p=l===h?e[0]:0,f=h===o?i[0]:this._bufferService.cols;_.appendChild(this._createSelectionElement(h,p,f));let y=d-h-1;if(_.appendChild(this._createSelectionElement(h+1,0,this._bufferService.cols,y)),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 p=e;p<=i;p++){let f=p+n.ydisp,y=this._rowElements[p],S=n.lines.get(f);if(!y||!S)break;y.replaceChildren(...this._rowFactory.createRow(S,f,f===l,d,_,o,h,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Gh}${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,p=_.ybase+_.y,f=Math.min(_.x,o-1),y=this._optionsService.rawOptions.cursorBlink,S=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;for(let C=n;C<=l;++C){let b=C+_.ydisp,R=this._rowElements[C],M=_.lines.get(b);if(!R||!M)break;R.replaceChildren(...this._rowFactory.createRow(M,b,b===p,S,x,f,y,this.dimensions.css.cell.width,this._widthCache,h?C===n?e:0:-1,h?(C===l?i:o)-1:-1))}}};ku=Ze([se(7,Ku),se(8,ho),se(9,zt),se(10,At),se(11,hr),se(12,rs),se(13,tn)],ku);var Eu=class extends Se{constructor(e,i,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new F),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new ex(this._optionsService))}catch{this._measureStrategy=this._register(new J1(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())}};Eu=Ze([se(2,zt)],Eu);var hv=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)}},J1=class extends hv{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}},ex=class extends hv{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}},tx=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 ix(this._window)),this._onDprChange=this._register(new F),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new F),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(l=>this._screenDprMonitor.setWindow(l))),this._register(kt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(de(this._textarea,"focus",()=>this._isFocused=!0)),this._register(de(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}},ix=class extends Se{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Jr),this._onDprChange=this._register(new F),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register($e(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=de(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},sx=class extends Se{constructor(){super(),this.linkProviders=[],this._register($e(()=>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 Zu(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 rx(e,i,n,l,o,h,d,_,p){if(!h)return;let f=Zu(e,i,n);if(f)return f[0]=Math.ceil((f[0]+(p?d/2:0))/d),f[1]=Math.ceil(f[1]/_),f[0]=Math.min(Math.max(f[0],1),l+(p?1:0)),f[1]=Math.min(Math.max(f[1],1),o),f}var Tu=class{constructor(e,i){this._renderService=e,this._charSizeService=i}getCoords(e,i,n,l,o){return rx(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=Zu(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])}}};Tu=Ze([se(0,ns),se(1,ho)],Tu);var nx=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=[]}},uv={};_b(uv,{getSafariVersion:()=>ax,isChromeOS:()=>_v,isFirefox:()=>dv,isIpad:()=>ox,isIphone:()=>cx,isLegacyEdge:()=>lx,isLinux:()=>Qu,isMac:()=>io,isNode:()=>uo,isSafari:()=>fv,isWindows:()=>pv});var uo=typeof process<"u"&&"title"in process,Sl=uo?"node":navigator.userAgent,yl=uo?"node":navigator.platform,dv=Sl.includes("Firefox"),lx=Sl.includes("Edge"),fv=/^((?!chrome|android).)*safari/i.test(Sl);function ax(){if(!fv)return 0;let e=Sl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var io=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(yl),ox=yl==="iPad",cx=yl==="iPhone",pv=["Windows","Win16","Win32","WinCE"].includes(yl),Qu=yl.indexOf("Linux")>=0,_v=/\bCrOS\b/.test(Sl),gv=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()}},hx=class extends gv{_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())}}},ux=class extends gv{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},so=!uo&&"requestIdleCallback"in window?ux:hx,dx=class{constructor(){this._queue=new so}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Ru=class extends Se{constructor(e,i,n,l,o,h,d,_,p){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=l,this._coreService=o,this._coreBrowserService=_,this._renderer=this._register(new Jr),this._pausedResizeTask=new dx,this._observerDisposable=this._register(new Jr),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 F),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new F),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new F),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new F),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new nx((f,y)=>this._renderRows(f,y),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new fx(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register($e(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(d.onResize(()=>this._fullRefresh())),this._register(d.buffers.onBufferActivate(()=>this._renderer.value?.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(p.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=$e(()=>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(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,i)):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,i,n){this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,i,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};Ru=Ze([se(2,zt),se(3,ho),se(4,hr),se(5,vl),se(6,At),se(7,rs),se(8,tn)],Ru);var fx=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 px(e,i,n,l){let o=n.buffer.x,h=n.buffer.y;if(!n.buffer.hasScrollback)return mx(o,h,e,i,n,l)+fo(h,i,n,l)+vx(o,h,e,i,n,l);let d;if(h===i)return d=o>e?"D":"C",_l(Math.abs(o-e),pl(d,l));d=h>i?"D":"C";let _=Math.abs(h-i),p=gx(h>i?e:o,n)+(_-1)*n.cols+1+_x(h>i?o:e);return _l(p,pl(d,l))}function _x(e,i){return e-1}function gx(e,i){return i.cols-e}function mx(e,i,n,l,o,h){return fo(i,l,o,h).length===0?"":_l(vv(e,i,e,i-or(i,o),!1,o).length,pl("D",h))}function fo(e,i,n,l){let o=e-or(e,n),h=i-or(i,n),d=Math.abs(o-h)-Sx(e,i,n);return _l(d,pl(mv(e,i),l))}function vx(e,i,n,l,o,h){let d;fo(i,l,o,h).length>0?d=l-or(l,o):d=i;let _=l,p=yx(e,i,n,l,o,h);return _l(vv(e,d,n,_,p==="C",o).length,pl(p,h))}function Sx(e,i,n){let l=0,o=e-or(e,n),h=i-or(i,n);for(let d=0;d<Math.abs(o-h);d++){let _=mv(e,i)==="A"?-1:1;n.buffer.lines.get(o+_*d)?.isWrapped&&l++}return l}function or(e,i){let n=0,l=i.buffer.lines.get(e),o=l?.isWrapped;for(;o&&e>=0&&e<i.rows;)n++,l=i.buffer.lines.get(--e),o=l?.isWrapped;return n}function yx(e,i,n,l,o,h){let d;return fo(n,l,o,h).length>0?d=l-or(l,o):d=i,e<n&&d<=l||e>=n&&d<l?"C":"D"}function mv(e,i){return e>i?"A":"B"}function vv(e,i,n,l,o,h){let d=e,_=i,p="";for(;(d!==n||_!==l)&&_>=0&&_<h.buffer.lines.length;)d+=o?1:-1,o&&d>h.cols-1?(p+=h.buffer.translateBufferLineToString(_,!1,e,d),d=0,e=0,_++):!o&&d<0&&(p+=h.buffer.translateBufferLineToString(_,!1,0,e+1),d=h.cols-1,e=d,_--);return p+h.buffer.translateBufferLineToString(_,!1,e,d)}function pl(e,i){let n=i?"O":"[";return I.ESC+n+e}function _l(e,i){e=Math.floor(e);let n="";for(let l=0;l<e;l++)n+=i;return n}var bx=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 Yg(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 Xh=50,xx=15,wx=50,Cx=500,kx=" ",Ex=new RegExp(kx,"g"),Du=class extends Se{constructor(e,i,n,l,o,h,d,_,p){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=p,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new gi,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new F),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new F),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new F),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new F),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 bx(this._bufferService),this._activeSelectionMode=0,this._register($e(()=>{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?.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(Ex," ")).join(pv?`\r
|
|
66
66
|
`:`
|
|
67
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Qu&&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){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=Yg(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=Zu(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,-Xh),Xh),i/=Xh,i/Math.abs(i)+Math.round(i*(xx-1)))}shouldForceSelection(e){return io?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(),wx)}_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&&!(io&&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<Cx&&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=px(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]),p=_,f=e[0]-_,y=0,S=0,x=0,C=0;if(d.charAt(_)===" "){for(;_>0&&d.charAt(_-1)===" ";)_--;for(;p<d.length&&d.charAt(p+1)===" ";)p++}else{let j=e[0],X=e[0];h.getWidth(j)===0&&(y++,j--),h.getWidth(X)===2&&(S++,X++);let K=h.getString(X).length;for(K>1&&(C+=K-1,p+=K-1);j>0&&_>0&&!this._isCharWordSeparator(h.loadCell(j-1,this._workCell));){h.loadCell(j-1,this._workCell);let A=this._workCell.getChars().length;this._workCell.getWidth()===0?(y++,j--):A>1&&(x+=A-1,_-=A-1),_--,j--}for(;X<h.length&&p+1<d.length&&!this._isCharWordSeparator(h.loadCell(X+1,this._workCell));){h.loadCell(X+1,this._workCell);let A=this._workCell.getChars().length;this._workCell.getWidth()===2?(S++,X++):A>1&&(C+=A-1,p+=A-1),p++,X++}}p++;let b=_+f-y+x,R=Math.min(this._bufferService.cols,p-_+y+S-x-C);if(!(!i&&d.slice(_,p).trim()==="")){if(n&&b===0&&h.getCodePoint(0)!==32){let j=o.lines.get(e[1]-1);if(j&&h.isWrapped&&j.getCodePoint(this._bufferService.cols-1)!==32){let X=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(X){let K=this._bufferService.cols-X.start;b-=K,R+=K}}}if(l&&b+R===this._bufferService.cols&&h.getCodePoint(this._bufferService.cols-1)!==32){let j=o.lines.get(e[1]+1);if(j?.isWrapped&&j.getCodePoint(0)!==32){let X=this._getWordAt([0,e[1]+1],!1,!1,!0);X&&(R+=X.length)}}return{start:b,length:R}}}_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=Yg(n,this._bufferService.cols)}};Du=Ze([se(3,At),se(4,hr),se(5,Yu),se(6,zt),se(7,ns),se(8,rs)],Du);var $g=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={}}},Ig=class{constructor(){this._color=new $g,this._css=new $g}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()}},ct=Object.freeze((()=>{let e=[Ge.toColor("#2e3436"),Ge.toColor("#cc0000"),Ge.toColor("#4e9a06"),Ge.toColor("#c4a000"),Ge.toColor("#3465a4"),Ge.toColor("#75507b"),Ge.toColor("#06989a"),Ge.toColor("#d3d7cf"),Ge.toColor("#555753"),Ge.toColor("#ef2929"),Ge.toColor("#8ae234"),Ge.toColor("#fce94f"),Ge.toColor("#729fcf"),Ge.toColor("#ad7fa8"),Ge.toColor("#34e2e2"),Ge.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:lt.toCss(l,o,h),rgba:lt.toRgba(l,o,h)})}for(let n=0;n<24;n++){let l=8+n*10;e.push({css:lt.toCss(l,l,l),rgba:lt.toRgba(l,l,l)})}return e})()),ir=Ge.toColor("#ffffff"),ol=Ge.toColor("#000000"),Gg=Ge.toColor("#ffffff"),Xg=ol,tl={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},Tx=ir,Mu=class extends Se{constructor(e){super(),this._optionsService=e,this._contrastCache=new Ig,this._halfContrastCache=new Ig,this._onChangeColors=this._register(new Q),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:ir,background:ol,cursor:Gg,cursorAccent:Xg,selectionForeground:void 0,selectionBackgroundTransparent:tl,selectionBackgroundOpaque:Ke.blend(ol,tl),selectionInactiveBackgroundTransparent:tl,selectionInactiveBackgroundOpaque:Ke.blend(ol,tl),scrollbarSliderBackground:Ke.opacity(ir,.2),scrollbarSliderHoverBackground:Ke.opacity(ir,.4),scrollbarSliderActiveBackground:Ke.opacity(ir,.5),overviewRulerBorder:ir,ansi:ct.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=Ue(e.foreground,ir),i.background=Ue(e.background,ol),i.cursor=Ke.blend(i.background,Ue(e.cursor,Gg)),i.cursorAccent=Ke.blend(i.background,Ue(e.cursorAccent,Xg)),i.selectionBackgroundTransparent=Ue(e.selectionBackground,tl),i.selectionBackgroundOpaque=Ke.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=Ue(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=Ke.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?Ue(e.selectionForeground,Wg):void 0,i.selectionForeground===Wg&&(i.selectionForeground=void 0),Ke.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=Ke.opacity(i.selectionBackgroundTransparent,.3)),Ke.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=Ke.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=Ue(e.scrollbarSliderBackground,Ke.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=Ue(e.scrollbarSliderHoverBackground,Ke.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=Ue(e.scrollbarSliderActiveBackground,Ke.opacity(i.foreground,.5)),i.overviewRulerBorder=Ue(e.overviewRulerBorder,Tx),i.ansi=ct.slice(),i.ansi[0]=Ue(e.black,ct[0]),i.ansi[1]=Ue(e.red,ct[1]),i.ansi[2]=Ue(e.green,ct[2]),i.ansi[3]=Ue(e.yellow,ct[3]),i.ansi[4]=Ue(e.blue,ct[4]),i.ansi[5]=Ue(e.magenta,ct[5]),i.ansi[6]=Ue(e.cyan,ct[6]),i.ansi[7]=Ue(e.white,ct[7]),i.ansi[8]=Ue(e.brightBlack,ct[8]),i.ansi[9]=Ue(e.brightRed,ct[9]),i.ansi[10]=Ue(e.brightGreen,ct[10]),i.ansi[11]=Ue(e.brightYellow,ct[11]),i.ansi[12]=Ue(e.brightBlue,ct[12]),i.ansi[13]=Ue(e.brightMagenta,ct[13]),i.ansi[14]=Ue(e.brightCyan,ct[14]),i.ansi[15]=Ue(e.brightWhite,ct[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]=Ue(e.extendedAnsi[l],ct[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()}}};Mu=Ze([se(0,zt)],Mu);function Ue(e,i){if(e!==void 0)try{return Ge.toColor(e)}catch{}return i}var Rx=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)}},Dx=class{constructor(){this._services=new Rx,this._services.set(Ku,this)}setService(e,i){this._services.set(e,i)}getService(e){return this._services.get(e)}createInstance(e,...i){let n=xb(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)}},Mx={trace:0,debug:1,info:2,warn:3,error:4,off:5},Bx="xterm.js: ",Bu=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=Mx[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?"":Bx)+i,...n)}trace(e,...i){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,i)}debug(e,...i){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,i)}info(e,...i){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,i)}warn(e,...i){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,i)}error(e,...i){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,i)}};Bu=Ze([se(0,zt)],Bu);var Vg=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}},ve=3,nt=Object.freeze(new ml),Ya=0,Vh=2,cl=class Sv{constructor(i,n,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(i*ve);let o=n||gi.fromCharData([0,Hm,1,0]);for(let h=0;h<i;++h)this.setCell(h,o);this.length=i}get(i){let n=this._data[i*ve+0],l=n&2097151;return[this._data[i*ve+1],n&2097152?this._combined[i]:l?Os(l):"",n>>22,n&2097152?this._combined[i].charCodeAt(this._combined[i].length-1):l]}set(i,n){this._data[i*ve+1]=n[0],n[1].length>1?(this._combined[i]=n[1],this._data[i*ve+0]=i|2097152|n[2]<<22):this._data[i*ve+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(i){return this._data[i*ve+0]>>22}hasWidth(i){return this._data[i*ve+0]&12582912}getFg(i){return this._data[i*ve+1]}getBg(i){return this._data[i*ve+2]}hasContent(i){return this._data[i*ve+0]&4194303}getCodePoint(i){let n=this._data[i*ve+0];return n&2097152?this._combined[i].charCodeAt(this._combined[i].length-1):n&2097151}isCombined(i){return this._data[i*ve+0]&2097152}getString(i){let n=this._data[i*ve+0];return n&2097152?this._combined[i]:n&2097151?Os(n&2097151):""}isProtected(i){return this._data[i*ve+2]&536870912}loadCell(i,n){return Ya=i*ve,n.content=this._data[Ya+0],n.fg=this._data[Ya+1],n.bg=this._data[Ya+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*ve+0]=n.content,this._data[i*ve+1]=n.fg,this._data[i*ve+2]=n.bg}setCellFromCodepoint(i,n,l,o){o.bg&268435456&&(this._extendedAttrs[i]=o.extended),this._data[i*ve+0]=n|l<<22,this._data[i*ve+1]=o.fg,this._data[i*ve+2]=o.bg}addCodepointToCell(i,n,l){let o=this._data[i*ve+0];o&2097152?this._combined[i]+=Os(n):o&2097151?(this._combined[i]=Os(o&2097151)+Os(n),o&=-2097152,o|=2097152):o=n|1<<22,l&&(o&=-12582913,o|=l<<22),this._data[i*ve+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 gi;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 gi;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*Vh<this._data.buffer.byteLength;let l=i*ve;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*Vh<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Vh<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 Sv(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*ve+0]&4194303)return i+(this._data[i*ve+0]>>22);return 0}getNoBgTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(this._data[i*ve+0]&4194303||this._data[i*ve+2]&50331648)return i+(this._data[i*ve+0]>>22);return 0}copyCellsFrom(i,n,l,o,h){let d=i._data;if(h)for(let p=o-1;p>=0;p--){for(let f=0;f<ve;f++)this._data[(l+p)*ve+f]=d[(n+p)*ve+f];d[(n+p)*ve+2]&268435456&&(this._extendedAttrs[l+p]=i._extendedAttrs[n+p])}else for(let p=0;p<o;p++){for(let f=0;f<ve;f++)this._data[(l+p)*ve+f]=d[(n+p)*ve+f];d[(n+p)*ve+2]&268435456&&(this._extendedAttrs[l+p]=i._extendedAttrs[n+p])}let _=Object.keys(i._combined);for(let p=0;p<_.length;p++){let f=parseInt(_[p],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*ve+0],_=d&2097151,p=d&2097152?this._combined[n]:_?Os(_):Ls;if(h+=p,o)for(let f=0;f<p.length;++f)o.push(n);n+=d>>22||1}return o&&o.push(n),h}};function Ax(e,i,n,l,o,h){let d=[];for(let _=0;_<e.length-1;_++){let p=_,f=e.get(++p);if(!f.isWrapped)continue;let y=[e.get(_)];for(;p<e.length&&f.isWrapped;)y.push(f),f=e.get(++p);if(!h&&l>=_&&l<p){_+=y.length-1;continue}let S=0,x=gl(y,S,i),C=1,b=0;for(;C<y.length;){let j=gl(y,C,i),X=j-b,K=n-x,A=Math.min(X,K);y[S].copyCellsFrom(y[C],b,x,A,!1),x+=A,x===n&&(S++,x=0),b+=A,b===j&&(C++,b=0),x===0&&S!==0&&y[S-1].getWidth(n-1)===2&&(y[S].copyCellsFrom(y[S-1],n-1,x++,1,!1),y[S-1].setCell(n-1,o))}y[S].replaceCells(x,n,o);let R=0;for(let j=y.length-1;j>0&&(j>S||y[j].getTrimmedLength()===0);j--)R++;R>0&&(d.push(_+y.length-R),d.push(R)),_+=y.length-1}return d}function zx(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 Ox(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 Lx(e,i,n){let l=[],o=e.map((p,f)=>gl(e,f,i)).reduce((p,f)=>p+f),h=0,d=0,_=0;for(;_<o;){if(o-_<n){l.push(o-_);break}h+=n;let p=gl(e,d,i);h>p&&(h-=p,d++);let f=e[d].getWidth(h-1)===2;f&&h--;let y=f?n-1:n;l.push(y),_+=y}return l}function gl(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 yv=class bv{constructor(i){this.line=i,this.isDisposed=!1,this._disposables=[],this._id=bv._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}};yv._nextId=1;var Nx=yv,ut={},sr=ut.B;ut[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:"≥","{":"π","|":"≠","}":"£","~":"·"};ut.A={"#":"£"};ut.B=void 0;ut[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ut.C=ut[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ut.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ut.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ut.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ut.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ut.E=ut[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ut.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ut.H=ut[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ut["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Fg=4294967295,Zg=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=nt.clone(),this.savedCharset=sr,this.markers=[],this._nullCell=gi.fromCharData([0,Hm,1,0]),this._whitespaceCell=gi.fromCharData([0,Ls,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 Vg(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 Ja),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 Ja),this._whitespaceCell}getBlankLine(e,i){return new cl(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>Fg?Fg:i}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=nt);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 Vg(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,i){let n=this.getNullCell(nt),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 cl(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 cl(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=Ax(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(nt),n);if(l.length>0){let o=zx(this.lines,l);Ox(this.lines,o.layout),this._reflowLargerAdjustViewport(e,i,o.countRemoved)}}_reflowLargerAdjustViewport(e,i,n){let l=this.getNullCell(nt),o=n;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new cl(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(nt),o=[],h=0;for(let d=this.lines.length-1;d>=0;d--){let _=this.lines.get(d);if(!_||!_.isWrapped&&_.getTrimmedLength()<=e)continue;let p=[_];for(;_.isWrapped&&d>0;)_=this.lines.get(--d),p.unshift(_);if(!n){let A=this.ybase+this.y;if(A>=d&&A<d+p.length)continue}let f=p[p.length-1].getTrimmedLength(),y=Lx(p,this._cols,e),S=y.length-p.length,x;this.ybase===0&&this.y!==this.lines.length-1?x=Math.max(0,this.y-this.lines.maxLength+S):x=Math.max(0,this.lines.length-this.lines.maxLength+S);let C=[];for(let A=0;A<S;A++){let L=this.getBlankLine(nt,!0);C.push(L)}C.length>0&&(o.push({start:d+p.length+h,newLines:C}),h+=C.length),p.push(...C);let b=y.length-1,R=y[b];R===0&&(b--,R=y[b]);let j=p.length-S-1,X=f;for(;j>=0;){let A=Math.min(X,R);if(p[b]===void 0)break;if(p[b].copyCellsFrom(p[j],X-A,R-A,A,!0),R-=A,R===0&&(b--,R=y[b]),X-=A,X===0){j--;let L=Math.max(j,0);X=gl(p,L,this._cols)}}for(let A=0;A<p.length;A++)y[A]<e&&p[A].setCell(y[A],l);let K=S-x;for(;K-- >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 R=0;R<this.lines.length;R++)_.push(this.lines.get(R));let p=this.lines.length,f=p-1,y=0,S=o[y];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+h);let x=0;for(let R=Math.min(this.lines.maxLength-1,p+h-1);R>=0;R--)if(S&&S.start>f+x){for(let j=S.newLines.length-1;j>=0;j--)this.lines.set(R--,S.newLines[j]);R++,d.push({index:f+1,amount:S.newLines.length}),x+=S.newLines.length,S=o[++y]}else this.lines.set(R,_[f--]);let C=0;for(let R=d.length-1;R>=0;R--)d[R].index+=C,this.lines.onInsertEmitter.fire(d[R]),C+=d[R].amount;let b=Math.max(0,p+h-this.lines.maxLength);b>0&&this.lines.onTrimEmitter.fire(b)}}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 Nx(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)}},jx=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 Zg(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Zg(!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)}},xv=2,wv=1,Au=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,xv),this.rows=Math.max(e.rawOptions.rows||0,wv),this.buffers=this._register(new jx(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))}};Au=Ze([se(0,zt)],Au);var Zr={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:io,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},Hx=["normal","bold","100","200","300","400","500","600","700","800","900"],Ux=class extends Se{constructor(e){super(),this._onOptionChange=this._register(new Q),this.onOptionChange=this._onOptionChange.event;let i={...Zr};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($e(()=>{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 Zr))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},i=(n,l)=>{if(!(n in Zr))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=Zr[e]),!qx(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=Zr[e]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=Hx.includes(i)?i:Zr[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 qx(e){return e==="block"||e==="underline"||e==="bar"}function hl(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]&&hl(e[l],i-1);return n}var Qg=Object.freeze({insertMode:!1}),Jg=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),zu=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=hl(Qg),this.decPrivateModes=hl(Jg)}reset(){this.modes=hl(Qg),this.decPrivateModes=hl(Jg)}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))}};zu=Ze([se(0,At),se(1,Km),se(2,zt)],zu);var em={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 Fh(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 Zh=String.fromCharCode,tm={DEFAULT:e=>{let i=[Fh(e,!1)+32,e.col+32,e.row+32];return i[0]>255||i[1]>255||i[2]>255?"":`\x1B[M${Zh(i[0])}${Zh(i[1])}${Zh(i[2])}`},SGR:e=>{let i=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Fh(e,!0)};${e.col};${e.row}${i}`},SGR_PIXELS:e=>{let i=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Fh(e,!0)};${e.x};${e.y}${i}`}},Ou=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(em))this.addProtocol(l,em[l]);for(let l of Object.keys(tm))this.addEncoding(l,tm[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)}};Ou=Ze([se(0,At),se(1,hr),se(2,zt)],Ou);var Qh=[[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]],Wx=[[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]],ht;function Px(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 Kx=class{constructor(){if(this.version="6",!ht){ht=new Uint8Array(65536),ht.fill(1),ht[0]=0,ht.fill(0,1,32),ht.fill(0,127,160),ht.fill(2,4352,4448),ht[9001]=2,ht[9002]=2,ht.fill(2,11904,42192),ht[12351]=1,ht.fill(2,44032,55204),ht.fill(2,63744,64256),ht.fill(2,65040,65050),ht.fill(2,65072,65136),ht.fill(2,65280,65377),ht.fill(2,65504,65511);for(let e=0;e<Qh.length;++e)ht.fill(0,Qh[e][0],Qh[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ht[e]:Px(e,Wx)?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=nr.extractWidth(i);o===0?l=!1:o>n&&(n=o)}return nr.createPropertyValue(0,n,l)}},nr=class Za{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Q,this.onChange=this._onChange.event;let i=new Kx;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),p=Za.extractWidth(_);Za.extractShouldJoin(_)&&(p-=Za.extractWidth(l)),n+=p,l=_}return n}charProperties(i,n){return this._activeProvider.charProperties(i,n)}},Yx=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 im(e){let i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.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 il=2147483647,$x=256,Cv=class Lu{constructor(i=32,n=32){if(this.maxLength=i,this.maxSubParamsLength=n,n>$x)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 Lu;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 Lu(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>il?il: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>il?il: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,il):i}},sl=[],Ix=class{constructor(){this._state=0,this._active=sl,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=sl}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=sl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||sl,!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",co(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=sl,this._id=-1,this._state=0}}},Jt=class{constructor(i){this._handler=i,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(i,n,l){this._hitLimit||(this._data+=co(i,n,l),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(i){let n=!1;if(this._hitLimit)n=!1;else if(i&&(n=this._handler(this._data),n instanceof Promise))return n.then(l=>(this._data="",this._hitLimit=!1,l));return this._data="",this._hitLimit=!1,n}},rl=[],Gx=class{constructor(){this._handlers=Object.create(null),this._active=rl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=rl}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=rl,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||rl,!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",co(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=rl,this._ident=0}},ul=new Cv;ul.addParam(0);var sm=class{constructor(e){this._handler=e,this._data="",this._params=ul,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ul,this._data="",this._hitLimit=!1}put(e,i,n){this._hitLimit||(this._data+=co(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=ul,this._data="",this._hitLimit=!1,n));return this._params=ul,this._data="",this._hitLimit=!1,i}},Xx=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}},pi=160,Vx=(function(){let e=new Xx(4095),i=Array.apply(null,Array(256)).map((_,p)=>p),n=(_,p)=>i.slice(_,p),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(pi,0,2,0),e.add(pi,8,5,8),e.add(pi,6,0,6),e.add(pi,11,0,11),e.add(pi,13,13,13),e})(),Fx=class extends Se{constructor(e=Vx){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 Cv,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($e(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new Ix),this._dcsParser=this._register(new Gx),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,p=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&p>-1){for(;p>=0&&(d=_[p](this._params),d!==!0);p--)if(d instanceof Promise)return this._parseStack.handlerPos=p,d}this._parseStack.handlers=[];break;case 4:if(n===!1&&p>-1){for(;p>=0&&(d=_[p](),d!==!0);p--)if(d instanceof Promise)return this._parseStack.handlerPos=p,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:pi)],o>>4){case 2:for(let x=_+1;;++x){if(x>=i||(l=e[x])<32||l>126&&l<pi){this._printHandler(e,_,x),_=x-1;break}if(++x>=i||(l=e[x])<32||l>126&&l<pi){this._printHandler(e,_,x),_=x-1;break}if(++x>=i||(l=e[x])<32||l>126&&l<pi){this._printHandler(e,_,x),_=x-1;break}if(++x>=i||(l=e[x])<32||l>126&&l<pi){this._printHandler(e,_,x),_=x-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 p=this._csiHandlers[this._collect<<8|l],f=p?p.length-1:-1;for(;f>=0&&(d=p[f](this._params),d!==!0);f--)if(d instanceof Promise)return this._preserveStack(3,p,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 y=this._escHandlers[this._collect<<8|l],S=y?y.length-1:-1;for(;S>=0&&(d=y[S](),d!==!0);S--)if(d instanceof Promise)return this._preserveStack(4,y,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 x=_+1;;++x)if(x>=i||(l=e[x])===24||l===26||l===27||l>127&&l<pi){this._dcsParser.put(e,_,x),_=x-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 x=_+1;;x++)if(x>=i||(l=e[x])<32||l>127&&l<pi){this._oscParser.put(e,_,x),_=x-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}}},Zx=/^([\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})$/,Qx=/^[\da-f]+$/;function rm(e){if(!e)return;let i=e.toLowerCase();if(i.indexOf("rgb:")===0){i=i.slice(4);let n=Zx.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),Qx.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 Jh(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 Jx(e,i=16){let[n,l,o]=e;return`rgb:${Jh(n,i)}/${Jh(l,i)}/${Jh(o,i)}`}var ew={"(":0,")":1,"*":2,"+":3,"-":1,".":2},zs=131072,nm=10;function lm(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 am=5e3,om=0,tw=class extends Se{constructor(e,i,n,l,o,h,d,_,p=new Fx){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=p,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new yb,this._utf8Decoder=new bb,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=nt.clone(),this._eraseAttrDataInternal=nt.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 Nu(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(f=>this._activeBuffer=f.activeBuffer)),this._parser.setCsiHandlerFallback((f,y)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(f),params:y.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,y,S)=>{this._logService.debug("Unknown OSC code: ",{identifier:f,action:y,data:S})}),this._parser.setDcsHandlerFallback((f,y,S)=>{y==="HOOK"&&(S=S.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(f),action:y,payload:S})}),this._parser.setPrintHandler((f,y,S)=>this.print(f,y,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(I.BEL,()=>this.bell()),this._parser.setExecuteHandler(I.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(I.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(I.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(I.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(I.BS,()=>this.backspace()),this._parser.setExecuteHandler(I.HT,()=>this.tab()),this._parser.setExecuteHandler(I.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(I.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Va.IND,()=>this.index()),this._parser.setExecuteHandler(Va.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Va.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 ut)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 sm((f,y)=>this.requestStatusString(f,y)))}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"),am))]).catch(i=>{if(i!=="#SLOW_TIMEOUT")throw i;console.warn(`async parser handler taking longer than ${am} 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>zs&&(h=this._parseStack.position+zs)}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<zs&&(this._parseBuffer=new Uint32Array(Math.min(e.length,zs))),d||this._dirtyRowTracker.clearRange(),e.length>zs)for(let f=h;f<e.length;f+=zs){let y=f+zs<e.length?f+zs:e.length,S=typeof e=="string"?this._stringDecoder.decode(e.substring(f,y),this._parseBuffer):this._utf8Decoder.decode(e.subarray(f,y),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),p=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);p<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(p,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,p=this._coreService.decPrivateModes.wraparound,f=this._coreService.modes.insertMode,y=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,y);let x=this._parser.precedingJoinState;for(let C=i;C<n;++C){if(l=e[C],l<127&&h){let X=h[String.fromCharCode(l)];X&&(l=X.charCodeAt(0))}let b=this._unicodeService.charProperties(l,x);o=nr.extractWidth(b);let R=nr.extractShouldJoin(b),j=R?nr.extractWidth(x):0;if(x=b,d&&this._onA11yChar.fire(Os(l)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o-j>_){if(p){let X=S,K=this._activeBuffer.x-j;for(this._activeBuffer.x=j,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),j>0&&S instanceof cl&&S.copyCellsFrom(X,K,0,j,!1);K<_;)X.setCellFromCodepoint(K++,0,1,y)}else if(this._activeBuffer.x=_-1,o===2)continue}if(R&&this._activeBuffer.x){let X=S.getWidth(this._activeBuffer.x-1)?1:2;S.addCodepointToCell(this._activeBuffer.x-X,l,o);for(let K=o-j;--K>=0;)S.setCellFromCodepoint(this._activeBuffer.x++,0,0,y);continue}if(f&&(S.insertCells(this._activeBuffer.x,o-j,this._activeBuffer.getNullCell(y)),S.getWidth(_-1)===2&&S.setCellFromCodepoint(_-1,0,1,y)),S.setCellFromCodepoint(this._activeBuffer.x++,l,o,y),o>0)for(;--o;)S.setCellFromCodepoint(this._activeBuffer.x++,0,0,y)}this._parser.precedingJoinState=x,this._activeBuffer.x<_&&n-i>0&&S.getWidth(this._activeBuffer.x)===0&&!S.hasContent(this._activeBuffer.x)&&S.setCellFromCodepoint(this._activeBuffer.x,0,1,y),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,i){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>lm(n.params[0],this._optionsService.rawOptions.windowOptions)?i(n):!0):this._parser.registerCsiHandler(e,i)}registerDcsHandler(e,i){return this._parser.registerDcsHandler(e,new sm(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(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.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){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--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+n)?.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 l=this._activeBuffer.lines.length-this._bufferService.rows;l>0&&(this._activeBuffer.lines.trimStart(l),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-l,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-l,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(nt));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=nr.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 y=h.codePointAt(f)||0;d[_++]=y,f+=y>65535?2:1}let p=_;for(let f=1;f<n;++f)d.copyWithin(p,0,_),p+=_;return this.print(d,0,p),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(I.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(I.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(I.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(I.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(I.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,sr),this._charsetService.setgCharset(1,sr),this._charsetService.setgCharset(2,sr),this._charsetService.setgCharset(3,sr);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){let n;(R=>(R[R.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",R[R.SET=1]="SET",R[R.RESET=2]="RESET",R[R.PERMANENTLY_SET=3]="PERMANENTLY_SET",R[R.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(n||={});let l=this._coreService.decPrivateModes,{activeProtocol:o,activeEncoding:h}=this._coreMouseService,d=this._coreService,{buffers:_,cols:p}=this._bufferService,{active:f,alt:y}=_,S=this._optionsService.rawOptions,x=(R,j)=>(d.triggerDataEvent(`${I.ESC}[${i?"":"?"}${R};${j}$y`),!0),C=R=>R?1:2,b=e.params[0];return i?b===2?x(b,4):b===4?x(b,C(d.modes.insertMode)):b===12?x(b,3):b===20?x(b,C(S.convertEol)):x(b,0):b===1?x(b,C(l.applicationCursorKeys)):b===3?x(b,S.windowOptions.setWinLines?p===80?2:p===132?1:0:0):b===6?x(b,C(l.origin)):b===7?x(b,C(l.wraparound)):b===8?x(b,3):b===9?x(b,C(o==="X10")):b===12?x(b,C(S.cursorBlink)):b===25?x(b,C(!d.isCursorHidden)):b===45?x(b,C(l.reverseWraparound)):b===66?x(b,C(l.applicationKeypad)):b===67?x(b,4):b===1e3?x(b,C(o==="VT200")):b===1002?x(b,C(o==="DRAG")):b===1003?x(b,C(o==="ANY")):b===1004?x(b,C(l.sendFocus)):b===1005?x(b,4):b===1006?x(b,C(h==="SGR")):b===1015?x(b,4):b===1016?x(b,C(h==="SGR_PIXELS")):b===1048?x(b,1):b===47||b===1047||b===1049?x(b,C(f===y)):b===2004?x(b,C(l.bracketedPasteMode)):b===2026?x(b,C(l.synchronizedOutput)):x(b,0)}_updateAttrColor(e,i,n,l,o){return i===2?(e|=50331648,e&=-16777216,e|=ml.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=nt.fg,e.bg=nt.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|=nt.fg&16777215):n===49?(l.bg&=-67108864,l.bg|=nt.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|=nt.fg&16777215,l.bg&=-67108864,l.bg|=nt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${I.ESC}[0n`);break;case 6:let i=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${I.ESC}[${i};${n}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let i=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${I.ESC}[?${i};${n}R`)}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=nt.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(!lm(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(`${I.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(i===0||i===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>nm&&this._windowTitleStack.shift()),(i===0||i===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>nm&&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(cm(h))if(o==="?")i.push({type:0,index:h});else{let d=rm(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=rm(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]);cm(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,sr),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(ew[e[0]],ut[e[1]]||sr),!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=nt.clone(),this._eraseAttrDataInternal=nt.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 gi;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(`${I.ESC}${d}${I.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)}},Nu=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&&(om=e,e=i,i=om),e<this.start&&(this.start=e),i>this.end&&(this.end=i)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Nu=Ze([se(0,At)],Nu);function cm(e){return 0<=e&&e<256}var iw=5e7,hm=12,sw=50,rw=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>iw)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>=hm?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>=hm)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>sw&&(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()}},ju=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),p={data:e,id:this._nextId++,lines:[_]};return _.onDispose(()=>this._removeMarkerFromLink(p,_)),this._dataByLinkId.set(p.id,p),p.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){return this._dataByLinkId.get(e)?.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)))}};ju=Ze([se(0,At)],ju);var um=!1,nw=class extends Se{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Jr),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 Dx,this.optionsService=this._register(new Ux(e)),this._instantiationService.setService(zt,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Au)),this._instantiationService.setService(At,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Bu)),this._instantiationService.setService(Km,this._logService),this.coreService=this._register(this._instantiationService.createInstance(zu)),this._instantiationService.setService(hr,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Ou)),this._instantiationService.setService(Pm,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(nr)),this._instantiationService.setService(kb,this.unicodeService),this._charsetService=this._instantiationService.createInstance(Yx),this._instantiationService.setService(Cb,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(ju),this._instantiationService.setService(Ym,this._oscLinkService),this._inputHandler=this._register(new tw(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(kt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(kt.forward(this._bufferService.onResize,this._onResize)),this._register(kt.forward(this.coreService.onData,this._onData)),this._register(kt.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 rw((i,n)=>this._inputHandler.parse(i,n))),this._register(kt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new Q),this._onScroll.event(e=>{this._onScrollApi?.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&&!um&&(this._logService.warn("writeSync is unreliable and will be removed soon."),um=!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,xv),i=Math.max(i,wv),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(im.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(im(this._bufferService),!1))),this._windowsWrappingHeuristics.value=$e(()=>{for(let i of e)i.dispose()})}}},lw={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 aw(e,i,n,l){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=I.ESC+"OA":o.key=I.ESC+"[A":e.key==="UIKeyInputLeftArrow"?i?o.key=I.ESC+"OD":o.key=I.ESC+"[D":e.key==="UIKeyInputRightArrow"?i?o.key=I.ESC+"OC":o.key=I.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(i?o.key=I.ESC+"OB":o.key=I.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":I.DEL,e.altKey&&(o.key=I.ESC+o.key);break;case 9:if(e.shiftKey){o.key=I.ESC+"[Z";break}o.key=I.HT,o.cancel=!0;break;case 13:o.key=e.altKey?I.ESC+I.CR:I.CR,o.cancel=!0;break;case 27:o.key=I.ESC,e.altKey&&(o.key=I.ESC+I.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;h?o.key=I.ESC+"[1;"+(h+1)+"D":i?o.key=I.ESC+"OD":o.key=I.ESC+"[D";break;case 39:if(e.metaKey)break;h?o.key=I.ESC+"[1;"+(h+1)+"C":i?o.key=I.ESC+"OC":o.key=I.ESC+"[C";break;case 38:if(e.metaKey)break;h?o.key=I.ESC+"[1;"+(h+1)+"A":i?o.key=I.ESC+"OA":o.key=I.ESC+"[A";break;case 40:if(e.metaKey)break;h?o.key=I.ESC+"[1;"+(h+1)+"B":i?o.key=I.ESC+"OB":o.key=I.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=I.ESC+"[2~");break;case 46:h?o.key=I.ESC+"[3;"+(h+1)+"~":o.key=I.ESC+"[3~";break;case 36:h?o.key=I.ESC+"[1;"+(h+1)+"H":i?o.key=I.ESC+"OH":o.key=I.ESC+"[H";break;case 35:h?o.key=I.ESC+"[1;"+(h+1)+"F":i?o.key=I.ESC+"OF":o.key=I.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=I.ESC+"[5;"+(h+1)+"~":o.key=I.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=I.ESC+"[6;"+(h+1)+"~":o.key=I.ESC+"[6~";break;case 112:h?o.key=I.ESC+"[1;"+(h+1)+"P":o.key=I.ESC+"OP";break;case 113:h?o.key=I.ESC+"[1;"+(h+1)+"Q":o.key=I.ESC+"OQ";break;case 114:h?o.key=I.ESC+"[1;"+(h+1)+"R":o.key=I.ESC+"OR";break;case 115:h?o.key=I.ESC+"[1;"+(h+1)+"S":o.key=I.ESC+"OS";break;case 116:h?o.key=I.ESC+"[15;"+(h+1)+"~":o.key=I.ESC+"[15~";break;case 117:h?o.key=I.ESC+"[17;"+(h+1)+"~":o.key=I.ESC+"[17~";break;case 118:h?o.key=I.ESC+"[18;"+(h+1)+"~":o.key=I.ESC+"[18~";break;case 119:h?o.key=I.ESC+"[19;"+(h+1)+"~":o.key=I.ESC+"[19~";break;case 120:h?o.key=I.ESC+"[20;"+(h+1)+"~":o.key=I.ESC+"[20~";break;case 121:h?o.key=I.ESC+"[21;"+(h+1)+"~":o.key=I.ESC+"[21~";break;case 122:h?o.key=I.ESC+"[23;"+(h+1)+"~":o.key=I.ESC+"[23~";break;case 123:h?o.key=I.ESC+"[24;"+(h+1)+"~":o.key=I.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=I.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=I.DEL:e.keyCode===219?o.key=I.ESC:e.keyCode===220?o.key=I.FS:e.keyCode===221&&(o.key=I.GS);else if((!n||l)&&e.altKey&&!e.metaKey){let d=lw[e.keyCode]?.[e.shiftKey?1:0];if(d)o.key=I.ESC+d;else if(e.keyCode>=65&&e.keyCode<=90){let _=e.ctrlKey?e.keyCode-64:e.keyCode+32,p=String.fromCharCode(_);e.shiftKey&&(p=p.toUpperCase()),o.key=I.ESC+p}else if(e.keyCode===32)o.key=I.ESC+(e.ctrlKey?I.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let _=e.code.slice(3,4);e.shiftKey||(_=_.toLowerCase()),o.key=I.ESC+_,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=I.US),e.key==="@"&&(o.key=I.NUL));break}return o}var et=0,ow=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||(et=this._search(i),et===-1)||this._getKey(this._array[et])!==i)return!1;do if(this._array[et]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(et),!0;while(++et<this._array.length&&this._getKey(this._array[et])===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&&(et=this._search(e),!(et<0||et>=this._array.length)&&this._getKey(this._array[et])===e))do yield this._array[et];while(++et<this._array.length&&this._getKey(this._array[et])===e)}forEachByKey(e,i){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(et=this._search(e),!(et<0||et>=this._array.length)&&this._getKey(this._array[et])===e))do i(this._array[et]);while(++et<this._array.length&&this._getKey(this._array[et])===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}},eu=0,dm=0,cw=class extends Se{constructor(){super(),this._decorations=new ow(e=>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($e(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let i=new hw(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=>{eu=o.options.x??0,dm=eu+(o.options.width??1),e>=eu&&e<dm&&(!n||(o.options.layer??"bottom")===n)&&l(o)})}},hw=class extends Ns{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=Ge.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Ge.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},uw=1e3,dw=class{constructor(e,i=uw){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)}},fm=20,ro=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 dw(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(`
|
|
67
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Qu&&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){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=Yg(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=Zu(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,-Xh),Xh),i/=Xh,i/Math.abs(i)+Math.round(i*(xx-1)))}shouldForceSelection(e){return io?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(),wx)}_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&&!(io&&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<Cx&&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=px(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]),p=_,f=e[0]-_,y=0,S=0,x=0,C=0;if(d.charAt(_)===" "){for(;_>0&&d.charAt(_-1)===" ";)_--;for(;p<d.length&&d.charAt(p+1)===" ";)p++}else{let M=e[0],W=e[0];h.getWidth(M)===0&&(y++,M--),h.getWidth(W)===2&&(S++,W++);let te=h.getString(W).length;for(te>1&&(C+=te-1,p+=te-1);M>0&&_>0&&!this._isCharWordSeparator(h.loadCell(M-1,this._workCell));){h.loadCell(M-1,this._workCell);let N=this._workCell.getChars().length;this._workCell.getWidth()===0?(y++,M--):N>1&&(x+=N-1,_-=N-1),_--,M--}for(;W<h.length&&p+1<d.length&&!this._isCharWordSeparator(h.loadCell(W+1,this._workCell));){h.loadCell(W+1,this._workCell);let N=this._workCell.getChars().length;this._workCell.getWidth()===2?(S++,W++):N>1&&(C+=N-1,p+=N-1),p++,W++}}p++;let b=_+f-y+x,R=Math.min(this._bufferService.cols,p-_+y+S-x-C);if(!(!i&&d.slice(_,p).trim()==="")){if(n&&b===0&&h.getCodePoint(0)!==32){let M=o.lines.get(e[1]-1);if(M&&h.isWrapped&&M.getCodePoint(this._bufferService.cols-1)!==32){let W=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(W){let te=this._bufferService.cols-W.start;b-=te,R+=te}}}if(l&&b+R===this._bufferService.cols&&h.getCodePoint(this._bufferService.cols-1)!==32){let M=o.lines.get(e[1]+1);if(M?.isWrapped&&M.getCodePoint(0)!==32){let W=this._getWordAt([0,e[1]+1],!1,!1,!0);W&&(R+=W.length)}}return{start:b,length:R}}}_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=Yg(n,this._bufferService.cols)}};Du=Ze([se(3,At),se(4,hr),se(5,Yu),se(6,zt),se(7,ns),se(8,rs)],Du);var $g=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={}}},Ig=class{constructor(){this._color=new $g,this._css=new $g}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()}},ht=Object.freeze((()=>{let e=[Ge.toColor("#2e3436"),Ge.toColor("#cc0000"),Ge.toColor("#4e9a06"),Ge.toColor("#c4a000"),Ge.toColor("#3465a4"),Ge.toColor("#75507b"),Ge.toColor("#06989a"),Ge.toColor("#d3d7cf"),Ge.toColor("#555753"),Ge.toColor("#ef2929"),Ge.toColor("#8ae234"),Ge.toColor("#fce94f"),Ge.toColor("#729fcf"),Ge.toColor("#ad7fa8"),Ge.toColor("#34e2e2"),Ge.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:at.toCss(l,o,h),rgba:at.toRgba(l,o,h)})}for(let n=0;n<24;n++){let l=8+n*10;e.push({css:at.toCss(l,l,l),rgba:at.toRgba(l,l,l)})}return e})()),ir=Ge.toColor("#ffffff"),ol=Ge.toColor("#000000"),Gg=Ge.toColor("#ffffff"),Xg=ol,tl={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},Tx=ir,Mu=class extends Se{constructor(e){super(),this._optionsService=e,this._contrastCache=new Ig,this._halfContrastCache=new Ig,this._onChangeColors=this._register(new F),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:ir,background:ol,cursor:Gg,cursorAccent:Xg,selectionForeground:void 0,selectionBackgroundTransparent:tl,selectionBackgroundOpaque:Ke.blend(ol,tl),selectionInactiveBackgroundTransparent:tl,selectionInactiveBackgroundOpaque:Ke.blend(ol,tl),scrollbarSliderBackground:Ke.opacity(ir,.2),scrollbarSliderHoverBackground:Ke.opacity(ir,.4),scrollbarSliderActiveBackground:Ke.opacity(ir,.5),overviewRulerBorder:ir,ansi:ht.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=Ue(e.foreground,ir),i.background=Ue(e.background,ol),i.cursor=Ke.blend(i.background,Ue(e.cursor,Gg)),i.cursorAccent=Ke.blend(i.background,Ue(e.cursorAccent,Xg)),i.selectionBackgroundTransparent=Ue(e.selectionBackground,tl),i.selectionBackgroundOpaque=Ke.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=Ue(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=Ke.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?Ue(e.selectionForeground,Wg):void 0,i.selectionForeground===Wg&&(i.selectionForeground=void 0),Ke.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=Ke.opacity(i.selectionBackgroundTransparent,.3)),Ke.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=Ke.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=Ue(e.scrollbarSliderBackground,Ke.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=Ue(e.scrollbarSliderHoverBackground,Ke.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=Ue(e.scrollbarSliderActiveBackground,Ke.opacity(i.foreground,.5)),i.overviewRulerBorder=Ue(e.overviewRulerBorder,Tx),i.ansi=ht.slice(),i.ansi[0]=Ue(e.black,ht[0]),i.ansi[1]=Ue(e.red,ht[1]),i.ansi[2]=Ue(e.green,ht[2]),i.ansi[3]=Ue(e.yellow,ht[3]),i.ansi[4]=Ue(e.blue,ht[4]),i.ansi[5]=Ue(e.magenta,ht[5]),i.ansi[6]=Ue(e.cyan,ht[6]),i.ansi[7]=Ue(e.white,ht[7]),i.ansi[8]=Ue(e.brightBlack,ht[8]),i.ansi[9]=Ue(e.brightRed,ht[9]),i.ansi[10]=Ue(e.brightGreen,ht[10]),i.ansi[11]=Ue(e.brightYellow,ht[11]),i.ansi[12]=Ue(e.brightBlue,ht[12]),i.ansi[13]=Ue(e.brightMagenta,ht[13]),i.ansi[14]=Ue(e.brightCyan,ht[14]),i.ansi[15]=Ue(e.brightWhite,ht[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]=Ue(e.extendedAnsi[l],ht[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()}}};Mu=Ze([se(0,zt)],Mu);function Ue(e,i){if(e!==void 0)try{return Ge.toColor(e)}catch{}return i}var Rx=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)}},Dx=class{constructor(){this._services=new Rx,this._services.set(Ku,this)}setService(e,i){this._services.set(e,i)}getService(e){return this._services.get(e)}createInstance(e,...i){let n=xb(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)}},Mx={trace:0,debug:1,info:2,warn:3,error:4,off:5},Bx="xterm.js: ",Bu=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=Mx[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?"":Bx)+i,...n)}trace(e,...i){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,i)}debug(e,...i){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,i)}info(e,...i){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,i)}warn(e,...i){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,i)}error(e,...i){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,i)}};Bu=Ze([se(0,zt)],Bu);var Vg=class extends Se{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new F),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new F),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new F),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}},ve=3,lt=Object.freeze(new ml),Ya=0,Vh=2,cl=class Sv{constructor(i,n,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(i*ve);let o=n||gi.fromCharData([0,Hm,1,0]);for(let h=0;h<i;++h)this.setCell(h,o);this.length=i}get(i){let n=this._data[i*ve+0],l=n&2097151;return[this._data[i*ve+1],n&2097152?this._combined[i]:l?Os(l):"",n>>22,n&2097152?this._combined[i].charCodeAt(this._combined[i].length-1):l]}set(i,n){this._data[i*ve+1]=n[0],n[1].length>1?(this._combined[i]=n[1],this._data[i*ve+0]=i|2097152|n[2]<<22):this._data[i*ve+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(i){return this._data[i*ve+0]>>22}hasWidth(i){return this._data[i*ve+0]&12582912}getFg(i){return this._data[i*ve+1]}getBg(i){return this._data[i*ve+2]}hasContent(i){return this._data[i*ve+0]&4194303}getCodePoint(i){let n=this._data[i*ve+0];return n&2097152?this._combined[i].charCodeAt(this._combined[i].length-1):n&2097151}isCombined(i){return this._data[i*ve+0]&2097152}getString(i){let n=this._data[i*ve+0];return n&2097152?this._combined[i]:n&2097151?Os(n&2097151):""}isProtected(i){return this._data[i*ve+2]&536870912}loadCell(i,n){return Ya=i*ve,n.content=this._data[Ya+0],n.fg=this._data[Ya+1],n.bg=this._data[Ya+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*ve+0]=n.content,this._data[i*ve+1]=n.fg,this._data[i*ve+2]=n.bg}setCellFromCodepoint(i,n,l,o){o.bg&268435456&&(this._extendedAttrs[i]=o.extended),this._data[i*ve+0]=n|l<<22,this._data[i*ve+1]=o.fg,this._data[i*ve+2]=o.bg}addCodepointToCell(i,n,l){let o=this._data[i*ve+0];o&2097152?this._combined[i]+=Os(n):o&2097151?(this._combined[i]=Os(o&2097151)+Os(n),o&=-2097152,o|=2097152):o=n|1<<22,l&&(o&=-12582913,o|=l<<22),this._data[i*ve+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 gi;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 gi;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*Vh<this._data.buffer.byteLength;let l=i*ve;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*Vh<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Vh<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 Sv(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*ve+0]&4194303)return i+(this._data[i*ve+0]>>22);return 0}getNoBgTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(this._data[i*ve+0]&4194303||this._data[i*ve+2]&50331648)return i+(this._data[i*ve+0]>>22);return 0}copyCellsFrom(i,n,l,o,h){let d=i._data;if(h)for(let p=o-1;p>=0;p--){for(let f=0;f<ve;f++)this._data[(l+p)*ve+f]=d[(n+p)*ve+f];d[(n+p)*ve+2]&268435456&&(this._extendedAttrs[l+p]=i._extendedAttrs[n+p])}else for(let p=0;p<o;p++){for(let f=0;f<ve;f++)this._data[(l+p)*ve+f]=d[(n+p)*ve+f];d[(n+p)*ve+2]&268435456&&(this._extendedAttrs[l+p]=i._extendedAttrs[n+p])}let _=Object.keys(i._combined);for(let p=0;p<_.length;p++){let f=parseInt(_[p],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*ve+0],_=d&2097151,p=d&2097152?this._combined[n]:_?Os(_):Ls;if(h+=p,o)for(let f=0;f<p.length;++f)o.push(n);n+=d>>22||1}return o&&o.push(n),h}};function Ax(e,i,n,l,o,h){let d=[];for(let _=0;_<e.length-1;_++){let p=_,f=e.get(++p);if(!f.isWrapped)continue;let y=[e.get(_)];for(;p<e.length&&f.isWrapped;)y.push(f),f=e.get(++p);if(!h&&l>=_&&l<p){_+=y.length-1;continue}let S=0,x=gl(y,S,i),C=1,b=0;for(;C<y.length;){let M=gl(y,C,i),W=M-b,te=n-x,N=Math.min(W,te);y[S].copyCellsFrom(y[C],b,x,N,!1),x+=N,x===n&&(S++,x=0),b+=N,b===M&&(C++,b=0),x===0&&S!==0&&y[S-1].getWidth(n-1)===2&&(y[S].copyCellsFrom(y[S-1],n-1,x++,1,!1),y[S-1].setCell(n-1,o))}y[S].replaceCells(x,n,o);let R=0;for(let M=y.length-1;M>0&&(M>S||y[M].getTrimmedLength()===0);M--)R++;R>0&&(d.push(_+y.length-R),d.push(R)),_+=y.length-1}return d}function zx(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 Ox(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 Lx(e,i,n){let l=[],o=e.map((p,f)=>gl(e,f,i)).reduce((p,f)=>p+f),h=0,d=0,_=0;for(;_<o;){if(o-_<n){l.push(o-_);break}h+=n;let p=gl(e,d,i);h>p&&(h-=p,d++);let f=e[d].getWidth(h-1)===2;f&&h--;let y=f?n-1:n;l.push(y),_+=y}return l}function gl(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 yv=class bv{constructor(i){this.line=i,this.isDisposed=!1,this._disposables=[],this._id=bv._nextId++,this._onDispose=this.register(new F),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}};yv._nextId=1;var Nx=yv,dt={},sr=dt.B;dt[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:"≥","{":"π","|":"≠","}":"£","~":"·"};dt.A={"#":"£"};dt.B=void 0;dt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};dt.C=dt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};dt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};dt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};dt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};dt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};dt.E=dt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};dt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};dt.H=dt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};dt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Fg=4294967295,Zg=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=lt.clone(),this.savedCharset=sr,this.markers=[],this._nullCell=gi.fromCharData([0,Hm,1,0]),this._whitespaceCell=gi.fromCharData([0,Ls,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 Vg(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 Ja),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 Ja),this._whitespaceCell}getBlankLine(e,i){return new cl(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>Fg?Fg:i}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=lt);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 Vg(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,i){let n=this.getNullCell(lt),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 cl(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 cl(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=Ax(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(lt),n);if(l.length>0){let o=zx(this.lines,l);Ox(this.lines,o.layout),this._reflowLargerAdjustViewport(e,i,o.countRemoved)}}_reflowLargerAdjustViewport(e,i,n){let l=this.getNullCell(lt),o=n;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new cl(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(lt),o=[],h=0;for(let d=this.lines.length-1;d>=0;d--){let _=this.lines.get(d);if(!_||!_.isWrapped&&_.getTrimmedLength()<=e)continue;let p=[_];for(;_.isWrapped&&d>0;)_=this.lines.get(--d),p.unshift(_);if(!n){let N=this.ybase+this.y;if(N>=d&&N<d+p.length)continue}let f=p[p.length-1].getTrimmedLength(),y=Lx(p,this._cols,e),S=y.length-p.length,x;this.ybase===0&&this.y!==this.lines.length-1?x=Math.max(0,this.y-this.lines.maxLength+S):x=Math.max(0,this.lines.length-this.lines.maxLength+S);let C=[];for(let N=0;N<S;N++){let L=this.getBlankLine(lt,!0);C.push(L)}C.length>0&&(o.push({start:d+p.length+h,newLines:C}),h+=C.length),p.push(...C);let b=y.length-1,R=y[b];R===0&&(b--,R=y[b]);let M=p.length-S-1,W=f;for(;M>=0;){let N=Math.min(W,R);if(p[b]===void 0)break;if(p[b].copyCellsFrom(p[M],W-N,R-N,N,!0),R-=N,R===0&&(b--,R=y[b]),W-=N,W===0){M--;let L=Math.max(M,0);W=gl(p,L,this._cols)}}for(let N=0;N<p.length;N++)y[N]<e&&p[N].setCell(y[N],l);let te=S-x;for(;te-- >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 R=0;R<this.lines.length;R++)_.push(this.lines.get(R));let p=this.lines.length,f=p-1,y=0,S=o[y];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+h);let x=0;for(let R=Math.min(this.lines.maxLength-1,p+h-1);R>=0;R--)if(S&&S.start>f+x){for(let M=S.newLines.length-1;M>=0;M--)this.lines.set(R--,S.newLines[M]);R++,d.push({index:f+1,amount:S.newLines.length}),x+=S.newLines.length,S=o[++y]}else this.lines.set(R,_[f--]);let C=0;for(let R=d.length-1;R>=0;R--)d[R].index+=C,this.lines.onInsertEmitter.fire(d[R]),C+=d[R].amount;let b=Math.max(0,p+h-this.lines.maxLength);b>0&&this.lines.onTrimEmitter.fire(b)}}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 Nx(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)}},jx=class extends Se{constructor(e,i){super(),this._optionsService=e,this._bufferService=i,this._onBufferActivate=this._register(new F),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 Zg(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Zg(!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)}},xv=2,wv=1,Au=class extends Se{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new F),this.onResize=this._onResize.event,this._onScroll=this._register(new F),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,xv),this.rows=Math.max(e.rawOptions.rows||0,wv),this.buffers=this._register(new jx(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))}};Au=Ze([se(0,zt)],Au);var Zr={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:io,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},Hx=["normal","bold","100","200","300","400","500","600","700","800","900"],Ux=class extends Se{constructor(e){super(),this._onOptionChange=this._register(new F),this.onOptionChange=this._onOptionChange.event;let i={...Zr};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($e(()=>{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 Zr))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},i=(n,l)=>{if(!(n in Zr))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=Zr[e]),!qx(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=Zr[e]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=Hx.includes(i)?i:Zr[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 qx(e){return e==="block"||e==="underline"||e==="bar"}function hl(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]&&hl(e[l],i-1);return n}var Qg=Object.freeze({insertMode:!1}),Jg=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),zu=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 F),this.onData=this._onData.event,this._onUserInput=this._register(new F),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new F),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new F),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=hl(Qg),this.decPrivateModes=hl(Jg)}reset(){this.modes=hl(Qg),this.decPrivateModes=hl(Jg)}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))}};zu=Ze([se(0,At),se(1,Km),se(2,zt)],zu);var em={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 Fh(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 Zh=String.fromCharCode,tm={DEFAULT:e=>{let i=[Fh(e,!1)+32,e.col+32,e.row+32];return i[0]>255||i[1]>255||i[2]>255?"":`\x1B[M${Zh(i[0])}${Zh(i[1])}${Zh(i[2])}`},SGR:e=>{let i=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Fh(e,!0)};${e.col};${e.row}${i}`},SGR_PIXELS:e=>{let i=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Fh(e,!0)};${e.x};${e.y}${i}`}},Ou=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 F),this.onProtocolChange=this._onProtocolChange.event;for(let l of Object.keys(em))this.addProtocol(l,em[l]);for(let l of Object.keys(tm))this.addEncoding(l,tm[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)}};Ou=Ze([se(0,At),se(1,hr),se(2,zt)],Ou);var Qh=[[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]],Wx=[[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]],ut;function Px(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 Kx=class{constructor(){if(this.version="6",!ut){ut=new Uint8Array(65536),ut.fill(1),ut[0]=0,ut.fill(0,1,32),ut.fill(0,127,160),ut.fill(2,4352,4448),ut[9001]=2,ut[9002]=2,ut.fill(2,11904,42192),ut[12351]=1,ut.fill(2,44032,55204),ut.fill(2,63744,64256),ut.fill(2,65040,65050),ut.fill(2,65072,65136),ut.fill(2,65280,65377),ut.fill(2,65504,65511);for(let e=0;e<Qh.length;++e)ut.fill(0,Qh[e][0],Qh[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ut[e]:Px(e,Wx)?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=nr.extractWidth(i);o===0?l=!1:o>n&&(n=o)}return nr.createPropertyValue(0,n,l)}},nr=class Za{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new F,this.onChange=this._onChange.event;let i=new Kx;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),p=Za.extractWidth(_);Za.extractShouldJoin(_)&&(p-=Za.extractWidth(l)),n+=p,l=_}return n}charProperties(i,n){return this._activeProvider.charProperties(i,n)}},Yx=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 im(e){let i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.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 il=2147483647,$x=256,Cv=class Lu{constructor(i=32,n=32){if(this.maxLength=i,this.maxSubParamsLength=n,n>$x)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 Lu;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 Lu(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>il?il: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>il?il: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,il):i}},sl=[],Ix=class{constructor(){this._state=0,this._active=sl,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=sl}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=sl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||sl,!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",co(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=sl,this._id=-1,this._state=0}}},Jt=class{constructor(i){this._handler=i,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(i,n,l){this._hitLimit||(this._data+=co(i,n,l),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(i){let n=!1;if(this._hitLimit)n=!1;else if(i&&(n=this._handler(this._data),n instanceof Promise))return n.then(l=>(this._data="",this._hitLimit=!1,l));return this._data="",this._hitLimit=!1,n}},rl=[],Gx=class{constructor(){this._handlers=Object.create(null),this._active=rl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=rl}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=rl,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||rl,!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",co(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=rl,this._ident=0}},ul=new Cv;ul.addParam(0);var sm=class{constructor(e){this._handler=e,this._data="",this._params=ul,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ul,this._data="",this._hitLimit=!1}put(e,i,n){this._hitLimit||(this._data+=co(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=ul,this._data="",this._hitLimit=!1,n));return this._params=ul,this._data="",this._hitLimit=!1,i}},Xx=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}},pi=160,Vx=(function(){let e=new Xx(4095),i=Array.apply(null,Array(256)).map((_,p)=>p),n=(_,p)=>i.slice(_,p),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(pi,0,2,0),e.add(pi,8,5,8),e.add(pi,6,0,6),e.add(pi,11,0,11),e.add(pi,13,13,13),e})(),Fx=class extends Se{constructor(e=Vx){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 Cv,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($e(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new Ix),this._dcsParser=this._register(new Gx),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,p=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&p>-1){for(;p>=0&&(d=_[p](this._params),d!==!0);p--)if(d instanceof Promise)return this._parseStack.handlerPos=p,d}this._parseStack.handlers=[];break;case 4:if(n===!1&&p>-1){for(;p>=0&&(d=_[p](),d!==!0);p--)if(d instanceof Promise)return this._parseStack.handlerPos=p,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:pi)],o>>4){case 2:for(let x=_+1;;++x){if(x>=i||(l=e[x])<32||l>126&&l<pi){this._printHandler(e,_,x),_=x-1;break}if(++x>=i||(l=e[x])<32||l>126&&l<pi){this._printHandler(e,_,x),_=x-1;break}if(++x>=i||(l=e[x])<32||l>126&&l<pi){this._printHandler(e,_,x),_=x-1;break}if(++x>=i||(l=e[x])<32||l>126&&l<pi){this._printHandler(e,_,x),_=x-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 p=this._csiHandlers[this._collect<<8|l],f=p?p.length-1:-1;for(;f>=0&&(d=p[f](this._params),d!==!0);f--)if(d instanceof Promise)return this._preserveStack(3,p,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 y=this._escHandlers[this._collect<<8|l],S=y?y.length-1:-1;for(;S>=0&&(d=y[S](),d!==!0);S--)if(d instanceof Promise)return this._preserveStack(4,y,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 x=_+1;;++x)if(x>=i||(l=e[x])===24||l===26||l===27||l>127&&l<pi){this._dcsParser.put(e,_,x),_=x-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 x=_+1;;x++)if(x>=i||(l=e[x])<32||l>127&&l<pi){this._oscParser.put(e,_,x),_=x-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}}},Zx=/^([\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})$/,Qx=/^[\da-f]+$/;function rm(e){if(!e)return;let i=e.toLowerCase();if(i.indexOf("rgb:")===0){i=i.slice(4);let n=Zx.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),Qx.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 Jh(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 Jx(e,i=16){let[n,l,o]=e;return`rgb:${Jh(n,i)}/${Jh(l,i)}/${Jh(o,i)}`}var ew={"(":0,")":1,"*":2,"+":3,"-":1,".":2},zs=131072,nm=10;function lm(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 am=5e3,om=0,tw=class extends Se{constructor(e,i,n,l,o,h,d,_,p=new Fx){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=p,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new yb,this._utf8Decoder=new bb,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=lt.clone(),this._eraseAttrDataInternal=lt.clone(),this._onRequestBell=this._register(new F),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new F),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new F),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new F),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new F),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new F),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new F),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new F),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new F),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new F),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new F),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new F),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new F),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 Nu(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(f=>this._activeBuffer=f.activeBuffer)),this._parser.setCsiHandlerFallback((f,y)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(f),params:y.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,y,S)=>{this._logService.debug("Unknown OSC code: ",{identifier:f,action:y,data:S})}),this._parser.setDcsHandlerFallback((f,y,S)=>{y==="HOOK"&&(S=S.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(f),action:y,payload:S})}),this._parser.setPrintHandler((f,y,S)=>this.print(f,y,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(I.BEL,()=>this.bell()),this._parser.setExecuteHandler(I.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(I.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(I.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(I.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(I.BS,()=>this.backspace()),this._parser.setExecuteHandler(I.HT,()=>this.tab()),this._parser.setExecuteHandler(I.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(I.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Va.IND,()=>this.index()),this._parser.setExecuteHandler(Va.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Va.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 dt)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 sm((f,y)=>this.requestStatusString(f,y)))}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"),am))]).catch(i=>{if(i!=="#SLOW_TIMEOUT")throw i;console.warn(`async parser handler taking longer than ${am} 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>zs&&(h=this._parseStack.position+zs)}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<zs&&(this._parseBuffer=new Uint32Array(Math.min(e.length,zs))),d||this._dirtyRowTracker.clearRange(),e.length>zs)for(let f=h;f<e.length;f+=zs){let y=f+zs<e.length?f+zs:e.length,S=typeof e=="string"?this._stringDecoder.decode(e.substring(f,y),this._parseBuffer):this._utf8Decoder.decode(e.subarray(f,y),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),p=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);p<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(p,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,p=this._coreService.decPrivateModes.wraparound,f=this._coreService.modes.insertMode,y=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,y);let x=this._parser.precedingJoinState;for(let C=i;C<n;++C){if(l=e[C],l<127&&h){let W=h[String.fromCharCode(l)];W&&(l=W.charCodeAt(0))}let b=this._unicodeService.charProperties(l,x);o=nr.extractWidth(b);let R=nr.extractShouldJoin(b),M=R?nr.extractWidth(x):0;if(x=b,d&&this._onA11yChar.fire(Os(l)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o-M>_){if(p){let W=S,te=this._activeBuffer.x-M;for(this._activeBuffer.x=M,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),M>0&&S instanceof cl&&S.copyCellsFrom(W,te,0,M,!1);te<_;)W.setCellFromCodepoint(te++,0,1,y)}else if(this._activeBuffer.x=_-1,o===2)continue}if(R&&this._activeBuffer.x){let W=S.getWidth(this._activeBuffer.x-1)?1:2;S.addCodepointToCell(this._activeBuffer.x-W,l,o);for(let te=o-M;--te>=0;)S.setCellFromCodepoint(this._activeBuffer.x++,0,0,y);continue}if(f&&(S.insertCells(this._activeBuffer.x,o-M,this._activeBuffer.getNullCell(y)),S.getWidth(_-1)===2&&S.setCellFromCodepoint(_-1,0,1,y)),S.setCellFromCodepoint(this._activeBuffer.x++,l,o,y),o>0)for(;--o;)S.setCellFromCodepoint(this._activeBuffer.x++,0,0,y)}this._parser.precedingJoinState=x,this._activeBuffer.x<_&&n-i>0&&S.getWidth(this._activeBuffer.x)===0&&!S.hasContent(this._activeBuffer.x)&&S.setCellFromCodepoint(this._activeBuffer.x,0,1,y),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,i){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>lm(n.params[0],this._optionsService.rawOptions.windowOptions)?i(n):!0):this._parser.registerCsiHandler(e,i)}registerDcsHandler(e,i){return this._parser.registerDcsHandler(e,new sm(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(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.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){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--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+n)?.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 l=this._activeBuffer.lines.length-this._bufferService.rows;l>0&&(this._activeBuffer.lines.trimStart(l),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-l,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-l,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(lt));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=nr.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 y=h.codePointAt(f)||0;d[_++]=y,f+=y>65535?2:1}let p=_;for(let f=1;f<n;++f)d.copyWithin(p,0,_),p+=_;return this.print(d,0,p),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(I.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(I.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(I.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(I.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(I.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,sr),this._charsetService.setgCharset(1,sr),this._charsetService.setgCharset(2,sr),this._charsetService.setgCharset(3,sr);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){let n;(R=>(R[R.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",R[R.SET=1]="SET",R[R.RESET=2]="RESET",R[R.PERMANENTLY_SET=3]="PERMANENTLY_SET",R[R.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(n||={});let l=this._coreService.decPrivateModes,{activeProtocol:o,activeEncoding:h}=this._coreMouseService,d=this._coreService,{buffers:_,cols:p}=this._bufferService,{active:f,alt:y}=_,S=this._optionsService.rawOptions,x=(R,M)=>(d.triggerDataEvent(`${I.ESC}[${i?"":"?"}${R};${M}$y`),!0),C=R=>R?1:2,b=e.params[0];return i?b===2?x(b,4):b===4?x(b,C(d.modes.insertMode)):b===12?x(b,3):b===20?x(b,C(S.convertEol)):x(b,0):b===1?x(b,C(l.applicationCursorKeys)):b===3?x(b,S.windowOptions.setWinLines?p===80?2:p===132?1:0:0):b===6?x(b,C(l.origin)):b===7?x(b,C(l.wraparound)):b===8?x(b,3):b===9?x(b,C(o==="X10")):b===12?x(b,C(S.cursorBlink)):b===25?x(b,C(!d.isCursorHidden)):b===45?x(b,C(l.reverseWraparound)):b===66?x(b,C(l.applicationKeypad)):b===67?x(b,4):b===1e3?x(b,C(o==="VT200")):b===1002?x(b,C(o==="DRAG")):b===1003?x(b,C(o==="ANY")):b===1004?x(b,C(l.sendFocus)):b===1005?x(b,4):b===1006?x(b,C(h==="SGR")):b===1015?x(b,4):b===1016?x(b,C(h==="SGR_PIXELS")):b===1048?x(b,1):b===47||b===1047||b===1049?x(b,C(f===y)):b===2004?x(b,C(l.bracketedPasteMode)):b===2026?x(b,C(l.synchronizedOutput)):x(b,0)}_updateAttrColor(e,i,n,l,o){return i===2?(e|=50331648,e&=-16777216,e|=ml.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=lt.fg,e.bg=lt.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|=lt.fg&16777215):n===49?(l.bg&=-67108864,l.bg|=lt.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|=lt.fg&16777215,l.bg&=-67108864,l.bg|=lt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${I.ESC}[0n`);break;case 6:let i=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${I.ESC}[${i};${n}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let i=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${I.ESC}[?${i};${n}R`)}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=lt.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(!lm(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(`${I.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(i===0||i===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>nm&&this._windowTitleStack.shift()),(i===0||i===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>nm&&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(cm(h))if(o==="?")i.push({type:0,index:h});else{let d=rm(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=rm(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]);cm(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,sr),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(ew[e[0]],dt[e[1]]||sr),!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=lt.clone(),this._eraseAttrDataInternal=lt.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 gi;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(`${I.ESC}${d}${I.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)}},Nu=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&&(om=e,e=i,i=om),e<this.start&&(this.start=e),i>this.end&&(this.end=i)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Nu=Ze([se(0,At)],Nu);function cm(e){return 0<=e&&e<256}var iw=5e7,hm=12,sw=50,rw=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 F),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>iw)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>=hm?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>=hm)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>sw&&(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()}},ju=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),p={data:e,id:this._nextId++,lines:[_]};return _.onDispose(()=>this._removeMarkerFromLink(p,_)),this._dataByLinkId.set(p.id,p),p.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){return this._dataByLinkId.get(e)?.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)))}};ju=Ze([se(0,At)],ju);var um=!1,nw=class extends Se{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Jr),this._onBinary=this._register(new F),this.onBinary=this._onBinary.event,this._onData=this._register(new F),this.onData=this._onData.event,this._onLineFeed=this._register(new F),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new F),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new F),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new F),this._instantiationService=new Dx,this.optionsService=this._register(new Ux(e)),this._instantiationService.setService(zt,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Au)),this._instantiationService.setService(At,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Bu)),this._instantiationService.setService(Km,this._logService),this.coreService=this._register(this._instantiationService.createInstance(zu)),this._instantiationService.setService(hr,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Ou)),this._instantiationService.setService(Pm,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(nr)),this._instantiationService.setService(kb,this.unicodeService),this._charsetService=this._instantiationService.createInstance(Yx),this._instantiationService.setService(Cb,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(ju),this._instantiationService.setService(Ym,this._oscLinkService),this._inputHandler=this._register(new tw(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(kt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(kt.forward(this._bufferService.onResize,this._onResize)),this._register(kt.forward(this.coreService.onData,this._onData)),this._register(kt.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 rw((i,n)=>this._inputHandler.parse(i,n))),this._register(kt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new F),this._onScroll.event(e=>{this._onScrollApi?.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&&!um&&(this._logService.warn("writeSync is unreliable and will be removed soon."),um=!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,xv),i=Math.max(i,wv),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(im.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(im(this._bufferService),!1))),this._windowsWrappingHeuristics.value=$e(()=>{for(let i of e)i.dispose()})}}},lw={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 aw(e,i,n,l){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=I.ESC+"OA":o.key=I.ESC+"[A":e.key==="UIKeyInputLeftArrow"?i?o.key=I.ESC+"OD":o.key=I.ESC+"[D":e.key==="UIKeyInputRightArrow"?i?o.key=I.ESC+"OC":o.key=I.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(i?o.key=I.ESC+"OB":o.key=I.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":I.DEL,e.altKey&&(o.key=I.ESC+o.key);break;case 9:if(e.shiftKey){o.key=I.ESC+"[Z";break}o.key=I.HT,o.cancel=!0;break;case 13:o.key=e.altKey?I.ESC+I.CR:I.CR,o.cancel=!0;break;case 27:o.key=I.ESC,e.altKey&&(o.key=I.ESC+I.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;h?o.key=I.ESC+"[1;"+(h+1)+"D":i?o.key=I.ESC+"OD":o.key=I.ESC+"[D";break;case 39:if(e.metaKey)break;h?o.key=I.ESC+"[1;"+(h+1)+"C":i?o.key=I.ESC+"OC":o.key=I.ESC+"[C";break;case 38:if(e.metaKey)break;h?o.key=I.ESC+"[1;"+(h+1)+"A":i?o.key=I.ESC+"OA":o.key=I.ESC+"[A";break;case 40:if(e.metaKey)break;h?o.key=I.ESC+"[1;"+(h+1)+"B":i?o.key=I.ESC+"OB":o.key=I.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=I.ESC+"[2~");break;case 46:h?o.key=I.ESC+"[3;"+(h+1)+"~":o.key=I.ESC+"[3~";break;case 36:h?o.key=I.ESC+"[1;"+(h+1)+"H":i?o.key=I.ESC+"OH":o.key=I.ESC+"[H";break;case 35:h?o.key=I.ESC+"[1;"+(h+1)+"F":i?o.key=I.ESC+"OF":o.key=I.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=I.ESC+"[5;"+(h+1)+"~":o.key=I.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=I.ESC+"[6;"+(h+1)+"~":o.key=I.ESC+"[6~";break;case 112:h?o.key=I.ESC+"[1;"+(h+1)+"P":o.key=I.ESC+"OP";break;case 113:h?o.key=I.ESC+"[1;"+(h+1)+"Q":o.key=I.ESC+"OQ";break;case 114:h?o.key=I.ESC+"[1;"+(h+1)+"R":o.key=I.ESC+"OR";break;case 115:h?o.key=I.ESC+"[1;"+(h+1)+"S":o.key=I.ESC+"OS";break;case 116:h?o.key=I.ESC+"[15;"+(h+1)+"~":o.key=I.ESC+"[15~";break;case 117:h?o.key=I.ESC+"[17;"+(h+1)+"~":o.key=I.ESC+"[17~";break;case 118:h?o.key=I.ESC+"[18;"+(h+1)+"~":o.key=I.ESC+"[18~";break;case 119:h?o.key=I.ESC+"[19;"+(h+1)+"~":o.key=I.ESC+"[19~";break;case 120:h?o.key=I.ESC+"[20;"+(h+1)+"~":o.key=I.ESC+"[20~";break;case 121:h?o.key=I.ESC+"[21;"+(h+1)+"~":o.key=I.ESC+"[21~";break;case 122:h?o.key=I.ESC+"[23;"+(h+1)+"~":o.key=I.ESC+"[23~";break;case 123:h?o.key=I.ESC+"[24;"+(h+1)+"~":o.key=I.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=I.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=I.DEL:e.keyCode===219?o.key=I.ESC:e.keyCode===220?o.key=I.FS:e.keyCode===221&&(o.key=I.GS);else if((!n||l)&&e.altKey&&!e.metaKey){let d=lw[e.keyCode]?.[e.shiftKey?1:0];if(d)o.key=I.ESC+d;else if(e.keyCode>=65&&e.keyCode<=90){let _=e.ctrlKey?e.keyCode-64:e.keyCode+32,p=String.fromCharCode(_);e.shiftKey&&(p=p.toUpperCase()),o.key=I.ESC+p}else if(e.keyCode===32)o.key=I.ESC+(e.ctrlKey?I.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let _=e.code.slice(3,4);e.shiftKey||(_=_.toLowerCase()),o.key=I.ESC+_,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=I.US),e.key==="@"&&(o.key=I.NUL));break}return o}var tt=0,ow=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||(tt=this._search(i),tt===-1)||this._getKey(this._array[tt])!==i)return!1;do if(this._array[tt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(tt),!0;while(++tt<this._array.length&&this._getKey(this._array[tt])===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&&(tt=this._search(e),!(tt<0||tt>=this._array.length)&&this._getKey(this._array[tt])===e))do yield this._array[tt];while(++tt<this._array.length&&this._getKey(this._array[tt])===e)}forEachByKey(e,i){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(tt=this._search(e),!(tt<0||tt>=this._array.length)&&this._getKey(this._array[tt])===e))do i(this._array[tt]);while(++tt<this._array.length&&this._getKey(this._array[tt])===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}},eu=0,dm=0,cw=class extends Se{constructor(){super(),this._decorations=new ow(e=>e?.marker.line),this._onDecorationRegistered=this._register(new F),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new F),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register($e(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let i=new hw(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=>{eu=o.options.x??0,dm=eu+(o.options.width??1),e>=eu&&e<dm&&(!n||(o.options.layer??"bottom")===n)&&l(o)})}},hw=class extends Ns{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new F),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new F),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=Ge.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Ge.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},uw=1e3,dw=class{constructor(e,i=uw){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)}},fm=20,ro=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 dw(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(`
|
|
68
68
|
`))),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(de(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register($e(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let i=0;i<e;i++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<fm+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
69
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===fm+1&&(this._liveRegion.textContent+=su.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?.translateToString(!0,void 0,void 0,d)||"",p=(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",p),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 p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else{let p=this._createAccessibilityTreeNode();this._rowElements.push(p),this._rowContainer.appendChild(p)}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(){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?.length??0}),!this._rowContainer.contains(n.node))return;let o=({node:_,offset:p})=>{let f=_ instanceof Text?_.parentNode:_,y=parseInt(f?.getAttribute("aria-posinset"),10)-1;if(isNaN(y))return console.warn("row is invalid. Race condition?"),null;let S=this._rowColumns.get(f);if(!S)return console.warn("columns is null. Race condition?"),null;let x=p<S.length?S[p]:S.slice(-1)[0]+1;return x>=this._terminal.cols&&(++y,x=0),{row:y,column:x}},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){e.style.transform="";let i=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let l=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${l/i})`}};ro=Ze([se(1,Ku),se(2,rs),se(3,ns)],ro);var Hu=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($e(()=>{ar(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(de(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(de(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(de(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(de(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){(!this._activeProviderReplies||!i)&&(this._activeProviderReplies?.forEach(l=>{l?.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[l,o]of this._linkProviderService.linkProviders.entries())i?this._activeProviderReplies?.get(l)&&(n=this._checkLinkProviderResult(l,e,n)):o.provideLinks(e.y,h=>{if(this._isMouseOut)return;let d=h?.map(_=>({link:_}));this._activeProviderReplies?.set(l,d),n=this._checkLinkProviderResult(l,e,n),this._activeProviderReplies?.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,p=d.link.range.end.y>e?this._bufferService.cols:d.link.range.end.x;for(let f=_;f<=p;f++){if(n.has(f)){o.splice(h--,1);break}n.add(f)}}}}_checkLinkProviderResult(e,i,n){if(!this._activeProviderReplies)return n;let l=this._activeProviderReplies.get(e),o=!1;for(let h=0;h<e;h++)(!this._activeProviderReplies.has(h)||this._activeProviderReplies.get(h))&&(o=!0);if(!o&&l){let h=l.find(d=>this._linkAtPosition(d.link,i));h&&(n=!0,this._handleNewLink(h))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let h=0;h<this._activeProviderReplies.size;h++){let d=this._activeProviderReplies.get(h)?.find(_=>this._linkAtPosition(_.link,i));if(d){n=!0,this._handleNewLink(d);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&&fw(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:()=>this._currentLink?.state?.decorations.pointerCursor,set:n=>{this._currentLink?.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:()=>this._currentLink?.state?.decorations.underline,set:n=>{this._currentLink?.state&&this._currentLink?.state?.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){this._currentLink?.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){this._currentLink?.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}}};Hu=Ze([se(1,Yu),se(2,ns),se(3,At),se(4,Im)],Hu);function fw(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 pw=class extends nw{constructor(e={}){super(e),this._linkifier=this._register(new Jr),this.browser=uv,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Jr),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(cw),this._instantiationService.setService(vl,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(sx),this._instantiationService.setService(Im,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(nu)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(i=>this.refresh(i?.start??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(kt.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(kt.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(kt.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(kt.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(i=>this._afterResize(i.cols,i.rows))),this._register($e(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.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=Ke.toColorRGB(n==="ansi"?this._themeService.colors.ansi[i.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${I.ESC}]${l};${Jx(o)}${cv.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(h=>h.ansi[i.index]=lt.toColor(...i.color));else{let h=n;this._themeService.modifyColors(d=>d[h]=lt.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(ro,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(I.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(I.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(de(this.element,"copy",i=>{this.hasSelection()&&vb(i,this._selectionService)}));let e=i=>Sb(i,this.textarea,this.coreService,this.optionsService);this._register(de(this.textarea,"paste",e)),this._register(de(this.element,"paste",e)),dv?this._register(de(this.element,"mousedown",i=>{i.button===2&&wg(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(de(this.element,"contextmenu",i=>{wg(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Qu&&this._register(de(this.element,"auxclick",i=>{i.button===1&&jm(i,this.textarea,this.screenElement)}))}_bindKeys(){this._register(de(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(de(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(de(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(de(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(de(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(de(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(de(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){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"),this.element?.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(de(this.screenElement,"mousemove",o=>this.updateCursorStyle(o))),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",iu.get()),_v||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(tx,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(rs,this._coreBrowserService),this._register(de(this.textarea,"focus",o=>this._handleTextAreaFocus(o))),this._register(de(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Eu,this._document,this._helperContainer),this._instantiationService.setService(ho,this._charSizeService),this._themeService=this._instantiationService.createInstance(Mu),this._instantiationService.setService(tn,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(to),this._instantiationService.setService($m,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Ru,this.rows,this.screenElement)),this._instantiationService.setService(ns,this._renderService),this._register(this._renderService.onRenderedViewportChange(o=>this._onRender.fire(o))),this.onResize(o=>this._renderService.resize(o.cols,o.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(wu,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Tu),this._instantiationService.setService(Yu,this._mouseService);let l=this._linkifier.value=this._register(this._instantiationService.createInstance(Hu,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(bu,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(o=>{super.scrollLines(o,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Du,this.element,this.screenElement,l)),this._instantiationService.setService(Tb,this._selectionService),this._register(this._selectionService.onRequestScrollLines(o=>this.scrollLines(o.amount,o.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(o=>this._renderService.handleSelectionChanged(o.start,o.end,o.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(o=>{this.textarea.value=o,this.textarea.focus(),this.textarea.select()})),this._register(kt.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(xu,this.screenElement)),this._register(de(this.element,"mousedown",o=>this._selectionService.handleMouseDown(o))),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(ro,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o=>this._handleScreenReaderModeOptionChange(o))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(eo,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o=>{!this._overviewRulerRenderer&&o&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(eo,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(ku,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function n(h){let d=e._mouseService.getMouseReportCoords(h,e.screenElement);if(!d)return!1;let _,p;switch(h.overrideType||h.type){case"mousemove":p=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":p=0,_=h.button<3?h.button:3;break;case"mousedown":p=1,_=h.button<3?h.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(h)===!1)return!1;let f=h.deltaY;if(f===0||e.coreMouseService.consumeWheelEvent(h,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;p=f<0?0:1,_=4;break;default:return!1}return p===void 0||_===void 0||_>4?!1:e.coreMouseService.triggerMouseEvent({col:d.col,row:d.row,x:d.x,y:d.y,button:_,action:p,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(de(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(de(i,"wheel",h=>{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,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(h,!0);let d=I.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(h.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(d,!0),this.cancel(h,!0)}}},{passive:!1}))}refresh(e,i){this._renderService?.refreshRows(e,i)}updateCursorStyle(e){this._selectionService?.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){Nm(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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,i){this._selectionService?.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=aw(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===I.ETX||n.key===I.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)&&(_w(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){this._charSizeService?.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(nt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(I.ESC+"[I"):this.coreService.triggerDataEvent(I.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(`${I.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(`${I.ESC}[6;${o};${l}t`);break}}cancel(e,i){if(!(!this.options.cancelEvents&&!i))return e.preventDefault(),e.stopPropagation(),!1}};function _w(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var gw=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)}},mw=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 gi)}translateToString(e,i,n){return this._line.translateToString(e,i,n)}},pm=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 mw(i)}getNullCell(){return new gi}},vw=class extends Se{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new Q),this.onBufferChange=this._onBufferChange.event,this._normal=new pm(this._core.buffers.normal,"normal"),this._alternate=new pm(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)}},Sw=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)}},yw=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}},bw=["cols","rows"],Mi=0,xw=class extends Se{constructor(e){super(),this._core=this._register(new pw(e)),this._addonManager=this._register(new gw),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(bw.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 Sw(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new yw(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 vw(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
|
|
70
|
-
`,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 iu.get()},set promptLabel(e){iu.set(e)},get tooMuchOutput(){return su.get()},set tooMuchOutput(e){su.set(e)}}}_verifyIntegers(...e){for(Mi of e)if(Mi===1/0||isNaN(Mi)||Mi%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Mi of e)if(Mi&&(Mi===1/0||isNaN(Mi)||Mi%1!==0||Mi<0))throw new Error("This API only accepts positive integers")}};var ww=2,Cw=1,kw=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(){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:this._terminal.options.overviewRuler?.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,p=d.right+d.left,f=l-_,y=o-p-i;return{cols:Math.max(ww,Math.floor(y/e.css.cell.width)),rows:Math.max(Cw,Math.floor(f/e.css.cell.height))}}};var Ew=class{constructor(i,n,l,o={}){this._terminal=i,this._regex=n,this._handler=l,this._options=o}provideLinks(i,n){let l=Rw.computeLink(i,this._regex,this._terminal,this._handler);n(this._addCallbacks(l))}_addCallbacks(i){return i.map(n=>(n.leave=this._options.leave,n.hover=(l,o)=>{if(this._options.hover){let{range:h}=n;this._options.hover(l,o,h)}},n))}};function Tw(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 Rw=class Qa{static computeLink(i,n,l,o){let h=new RegExp(n.source,(n.flags||"")+"g"),[d,_]=Qa._getWindowedLineStrings(i-1,l),p=d.join(""),f,y=[];for(;f=h.exec(p);){let S=f[0];if(!Tw(S))continue;let[x,C]=Qa._mapStrIdx(l,_,0,f.index),[b,R]=Qa._mapStrIdx(l,x,C,S.length);if(x===-1||C===-1||b===-1||R===-1)continue;let
|
|
71
|
-
`).map(
|
|
69
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===fm+1&&(this._liveRegion.textContent+=su.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?.translateToString(!0,void 0,void 0,d)||"",p=(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",p),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 p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else{let p=this._createAccessibilityTreeNode();this._rowElements.push(p),this._rowContainer.appendChild(p)}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(){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?.length??0}),!this._rowContainer.contains(n.node))return;let o=({node:_,offset:p})=>{let f=_ instanceof Text?_.parentNode:_,y=parseInt(f?.getAttribute("aria-posinset"),10)-1;if(isNaN(y))return console.warn("row is invalid. Race condition?"),null;let S=this._rowColumns.get(f);if(!S)return console.warn("columns is null. Race condition?"),null;let x=p<S.length?S[p]:S.slice(-1)[0]+1;return x>=this._terminal.cols&&(++y,x=0),{row:y,column:x}},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){e.style.transform="";let i=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let l=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${l/i})`}};ro=Ze([se(1,Ku),se(2,rs),se(3,ns)],ro);var Hu=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 F),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new F),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register($e(()=>{ar(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(de(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(de(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(de(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(de(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){(!this._activeProviderReplies||!i)&&(this._activeProviderReplies?.forEach(l=>{l?.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[l,o]of this._linkProviderService.linkProviders.entries())i?this._activeProviderReplies?.get(l)&&(n=this._checkLinkProviderResult(l,e,n)):o.provideLinks(e.y,h=>{if(this._isMouseOut)return;let d=h?.map(_=>({link:_}));this._activeProviderReplies?.set(l,d),n=this._checkLinkProviderResult(l,e,n),this._activeProviderReplies?.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,p=d.link.range.end.y>e?this._bufferService.cols:d.link.range.end.x;for(let f=_;f<=p;f++){if(n.has(f)){o.splice(h--,1);break}n.add(f)}}}}_checkLinkProviderResult(e,i,n){if(!this._activeProviderReplies)return n;let l=this._activeProviderReplies.get(e),o=!1;for(let h=0;h<e;h++)(!this._activeProviderReplies.has(h)||this._activeProviderReplies.get(h))&&(o=!0);if(!o&&l){let h=l.find(d=>this._linkAtPosition(d.link,i));h&&(n=!0,this._handleNewLink(h))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let h=0;h<this._activeProviderReplies.size;h++){let d=this._activeProviderReplies.get(h)?.find(_=>this._linkAtPosition(_.link,i));if(d){n=!0,this._handleNewLink(d);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&&fw(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:()=>this._currentLink?.state?.decorations.pointerCursor,set:n=>{this._currentLink?.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:()=>this._currentLink?.state?.decorations.underline,set:n=>{this._currentLink?.state&&this._currentLink?.state?.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){this._currentLink?.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){this._currentLink?.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}}};Hu=Ze([se(1,Yu),se(2,ns),se(3,At),se(4,Im)],Hu);function fw(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 pw=class extends nw{constructor(e={}){super(e),this._linkifier=this._register(new Jr),this.browser=uv,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Jr),this._onCursorMove=this._register(new F),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new F),this.onKey=this._onKey.event,this._onRender=this._register(new F),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new F),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new F),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new F),this.onBell=this._onBell.event,this._onFocus=this._register(new F),this._onBlur=this._register(new F),this._onA11yCharEmitter=this._register(new F),this._onA11yTabEmitter=this._register(new F),this._onWillOpen=this._register(new F),this._setup(),this._decorationService=this._instantiationService.createInstance(cw),this._instantiationService.setService(vl,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(sx),this._instantiationService.setService(Im,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(nu)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(i=>this.refresh(i?.start??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(kt.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(kt.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(kt.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(kt.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(i=>this._afterResize(i.cols,i.rows))),this._register($e(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.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=Ke.toColorRGB(n==="ansi"?this._themeService.colors.ansi[i.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${I.ESC}]${l};${Jx(o)}${cv.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(h=>h.ansi[i.index]=at.toColor(...i.color));else{let h=n;this._themeService.modifyColors(d=>d[h]=at.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(ro,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(I.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(I.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(de(this.element,"copy",i=>{this.hasSelection()&&vb(i,this._selectionService)}));let e=i=>Sb(i,this.textarea,this.coreService,this.optionsService);this._register(de(this.textarea,"paste",e)),this._register(de(this.element,"paste",e)),dv?this._register(de(this.element,"mousedown",i=>{i.button===2&&wg(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(de(this.element,"contextmenu",i=>{wg(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Qu&&this._register(de(this.element,"auxclick",i=>{i.button===1&&jm(i,this.textarea,this.screenElement)}))}_bindKeys(){this._register(de(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(de(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(de(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(de(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(de(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(de(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(de(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){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"),this.element?.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(de(this.screenElement,"mousemove",o=>this.updateCursorStyle(o))),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",iu.get()),_v||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(tx,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(rs,this._coreBrowserService),this._register(de(this.textarea,"focus",o=>this._handleTextAreaFocus(o))),this._register(de(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Eu,this._document,this._helperContainer),this._instantiationService.setService(ho,this._charSizeService),this._themeService=this._instantiationService.createInstance(Mu),this._instantiationService.setService(tn,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(to),this._instantiationService.setService($m,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Ru,this.rows,this.screenElement)),this._instantiationService.setService(ns,this._renderService),this._register(this._renderService.onRenderedViewportChange(o=>this._onRender.fire(o))),this.onResize(o=>this._renderService.resize(o.cols,o.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(wu,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Tu),this._instantiationService.setService(Yu,this._mouseService);let l=this._linkifier.value=this._register(this._instantiationService.createInstance(Hu,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(bu,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(o=>{super.scrollLines(o,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Du,this.element,this.screenElement,l)),this._instantiationService.setService(Tb,this._selectionService),this._register(this._selectionService.onRequestScrollLines(o=>this.scrollLines(o.amount,o.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(o=>this._renderService.handleSelectionChanged(o.start,o.end,o.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(o=>{this.textarea.value=o,this.textarea.focus(),this.textarea.select()})),this._register(kt.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(xu,this.screenElement)),this._register(de(this.element,"mousedown",o=>this._selectionService.handleMouseDown(o))),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(ro,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o=>this._handleScreenReaderModeOptionChange(o))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(eo,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o=>{!this._overviewRulerRenderer&&o&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(eo,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(ku,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function n(h){let d=e._mouseService.getMouseReportCoords(h,e.screenElement);if(!d)return!1;let _,p;switch(h.overrideType||h.type){case"mousemove":p=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":p=0,_=h.button<3?h.button:3;break;case"mousedown":p=1,_=h.button<3?h.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(h)===!1)return!1;let f=h.deltaY;if(f===0||e.coreMouseService.consumeWheelEvent(h,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;p=f<0?0:1,_=4;break;default:return!1}return p===void 0||_===void 0||_>4?!1:e.coreMouseService.triggerMouseEvent({col:d.col,row:d.row,x:d.x,y:d.y,button:_,action:p,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(de(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(de(i,"wheel",h=>{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,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(h,!0);let d=I.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(h.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(d,!0),this.cancel(h,!0)}}},{passive:!1}))}refresh(e,i){this._renderService?.refreshRows(e,i)}updateCursorStyle(e){this._selectionService?.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){Nm(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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,i){this._selectionService?.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=aw(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===I.ETX||n.key===I.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)&&(_w(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){this._charSizeService?.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(lt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(I.ESC+"[I"):this.coreService.triggerDataEvent(I.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(`${I.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(`${I.ESC}[6;${o};${l}t`);break}}cancel(e,i){if(!(!this.options.cancelEvents&&!i))return e.preventDefault(),e.stopPropagation(),!1}};function _w(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var gw=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)}},mw=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 gi)}translateToString(e,i,n){return this._line.translateToString(e,i,n)}},pm=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 mw(i)}getNullCell(){return new gi}},vw=class extends Se{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new F),this.onBufferChange=this._onBufferChange.event,this._normal=new pm(this._core.buffers.normal,"normal"),this._alternate=new pm(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)}},Sw=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)}},yw=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}},bw=["cols","rows"],Mi=0,xw=class extends Se{constructor(e){super(),this._core=this._register(new pw(e)),this._addonManager=this._register(new gw),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(bw.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 Sw(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new yw(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 vw(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
|
|
70
|
+
`,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 iu.get()},set promptLabel(e){iu.set(e)},get tooMuchOutput(){return su.get()},set tooMuchOutput(e){su.set(e)}}}_verifyIntegers(...e){for(Mi of e)if(Mi===1/0||isNaN(Mi)||Mi%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Mi of e)if(Mi&&(Mi===1/0||isNaN(Mi)||Mi%1!==0||Mi<0))throw new Error("This API only accepts positive integers")}};var ww=2,Cw=1,kw=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(){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:this._terminal.options.overviewRuler?.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,p=d.right+d.left,f=l-_,y=o-p-i;return{cols:Math.max(ww,Math.floor(y/e.css.cell.width)),rows:Math.max(Cw,Math.floor(f/e.css.cell.height))}}};var Ew=class{constructor(i,n,l,o={}){this._terminal=i,this._regex=n,this._handler=l,this._options=o}provideLinks(i,n){let l=Rw.computeLink(i,this._regex,this._terminal,this._handler);n(this._addCallbacks(l))}_addCallbacks(i){return i.map(n=>(n.leave=this._options.leave,n.hover=(l,o)=>{if(this._options.hover){let{range:h}=n;this._options.hover(l,o,h)}},n))}};function Tw(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 Rw=class Qa{static computeLink(i,n,l,o){let h=new RegExp(n.source,(n.flags||"")+"g"),[d,_]=Qa._getWindowedLineStrings(i-1,l),p=d.join(""),f,y=[];for(;f=h.exec(p);){let S=f[0];if(!Tw(S))continue;let[x,C]=Qa._mapStrIdx(l,_,0,f.index),[b,R]=Qa._mapStrIdx(l,x,C,S.length);if(x===-1||C===-1||b===-1||R===-1)continue;let M={start:{x:C+1,y:x+1},end:{x:R,y:b+1}};y.push({range:M,text:S,activate:o})}return y}static _getWindowedLineStrings(i,n){let l,o=i,h=i,d=0,_="",p=[];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,p.push(_),!(!l.isWrapped||_.indexOf(" ")!==-1)););p.reverse()}for(p.push(f),d=0;(l=n.buffer.active.getLine(++h))&&l.isWrapped&&d<2048&&(_=l.translateToString(!0),d+=_.length,p.push(_),_.indexOf(" ")===-1););}return[p,o]}static _mapStrIdx(i,n,l,o){let h=i.buffer.active,d=h.getNullCell(),_=l;for(;o;){let p=h.getLine(n);if(!p)return[-1,-1];for(let f=_;f<p.length;++f){p.getCell(f,d);let y=d.getChars();if(d.getWidth()&&(o-=y.length||1,f===p.length-1&&y==="")){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,_]}},Dw=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function Mw(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 Bw=class{constructor(i=Mw,n={}){this._handler=i,this._options=n}activate(i){this._terminal=i;let n=this._options,l=n.urlRegex||Dw;this._linkProvider=this._terminal.registerLinkProvider(new Ew(this._terminal,l,this._handler,n))}dispose(){this._linkProvider?.dispose()}};function Aw(){const e=O.useRef(null),{connect:i,wsRef:n,onOutput:l,onExit:o,setConnectionCallbacks:h,addOutputLine:d}=en(),{path:_,setTerminalConnected:p}=Rt();return O.useEffect(()=>{if(!e.current||!_)return;const f=new xw({theme:{background:"#1a1a2e",foreground:"#e0e0e0",cursor:"#4ade80",selectionBackground:"rgba(74, 222, 128, 0.3)"},fontFamily:"'Inconsolata', 'Menlo', 'Courier New', monospace",fontSize:14,cursorBlink:!0}),y=new kw;f.loadAddon(y),f.loadAddon(new Bw),f.open(e.current),y.fit(),l.current=C=>{f.write(C),C.replace(/\x1b\[[?>=!]?[0-9;]*[a-zA-Z]/g,"").replace(/\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/g,"").replace(/\x1b[()][0-9A-Z]/g,"").replace(/\x1b./g,"").replace(/\r/g,"").split(`
|
|
71
|
+
`).map(M=>M.trim()).filter(M=>M.length>0).filter(M=>!M.match(/^\(thinking\)$/)).forEach(M=>d(M))},o.current=()=>f.writeln(`\r
|
|
72
72
|
[Process exited. Refresh to restart]`),h(()=>p(!0),()=>{p(!1),f.writeln(`\r
|
|
73
73
|
[Connection lost]`)});const S=i(_);f.onData(C=>{S?.readyState===WebSocket.OPEN&&S.send(JSON.stringify({type:"input",data:C}))});const x=new ResizeObserver(()=>{y.fit(),S?.readyState===WebSocket.OPEN&&S.send(JSON.stringify({type:"resize",cols:f.cols,rows:f.rows}))});return x.observe(e.current),()=>{x.disconnect(),f.dispose(),S?.close()}},[_]),m.jsx("div",{ref:e,className:"h-full w-full"})}function zw(){const[e,i]=O.useState(!1),[n,l]=O.useState(!1),{sendPrompt:o}=en(),h=()=>{o("Run the dev server for this project so I can preview it in the browser. Use npm run dev or the appropriate command. IMPORTANT: Make sure it runs on port 5173 — the preview panel is connected to that port. If the framework defaults to a different port, configure it to use 5173 (e.g. --port 5173)."),l(!0),setTimeout(()=>{i(!0),l(!1)},4e3)},d=()=>{i(!1),setTimeout(()=>i(!0),100)};return e?m.jsxs("div",{className:"h-full flex flex-col",style:{background:"#f8fafc"},children:[m.jsxs("div",{style:{padding:"8px 16px",borderBottom:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0,background:"#fff"},children:[m.jsx("span",{style:{fontSize:"12px",color:"#9ca3af",fontFamily:"'SF Mono', monospace"},children:"localhost:5173 (errors → terminal)"}),m.jsx("button",{onClick:d,style:{padding:"4px 10px",borderRadius:"6px",border:"1px solid #e5e7eb",background:"#fff",color:"#6b7280",fontSize:"12px",cursor:"pointer"},children:"↻ Refresh"})]}),m.jsx("iframe",{src:"/api/dev-preview/?port=5173",style:{flex:1,border:"none",width:"100%"},sandbox:"allow-scripts allow-same-origin allow-forms allow-popups",title:"Live Preview"})]}):m.jsx("div",{className:"h-full flex items-center justify-center",style:{background:"#f8fafc"},children:m.jsxs("div",{className:"text-center",children:[m.jsx("div",{className:"text-3xl mb-3",children:"🌐"}),m.jsx("div",{style:{color:"#374151",fontSize:"15px",fontWeight:600,marginBottom:"4px"},children:"Live Preview"}),m.jsx("div",{style:{color:"#9ca3af",fontSize:"12px",marginBottom:"20px"},children:"localhost:5173"}),m.jsx("button",{onClick:h,disabled:n,style:{padding:"10px 24px",borderRadius:"10px",border:"none",background:n?"#e5e7eb":"#22c55e",color:n?"#9ca3af":"#fff",fontSize:"14px",fontWeight:600,cursor:n?"not-allowed":"pointer",transition:"all 0.15s"},children:n?"⏳ Starting...":"▶ View Tool"}),m.jsx("div",{style:{color:"#9ca3af",fontSize:"11px",marginTop:"10px"},children:"Starts the dev server and shows your app here"})]})})}function Ju(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ur=Ju();function kv(e){ur=e}var rr={exec:()=>null};function Te(e,i=""){let n=typeof e=="string"?e:e.source,l={replace:(o,h)=>{let d=typeof h=="string"?h:h.source;return d=d.replace(Bt.caret,"$1"),n=n.replace(o,d),l},getRegex:()=>new RegExp(n,i)};return l}var Ow=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Bt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Lw=/^(?:[ \t]*(?:\n|$))+/,Nw=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,jw=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,bl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Hw=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ed=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ev=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Tv=Te(Ev).replace(/bull/g,ed).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Uw=Te(Ev).replace(/bull/g,ed).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),td=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,qw=/^[^\n]+/,id=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ww=Te(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",id).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Pw=Te(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ed).getRegex(),po="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",sd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Kw=Te("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",sd).replace("tag",po).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Rv=Te(td).replace("hr",bl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",po).getRegex(),Yw=Te(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Rv).getRegex(),rd={blockquote:Yw,code:Nw,def:Ww,fences:jw,heading:Hw,hr:bl,html:Kw,lheading:Tv,list:Pw,newline:Lw,paragraph:Rv,table:rr,text:qw},_m=Te("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",bl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",po).getRegex(),$w={...rd,lheading:Uw,table:_m,paragraph:Te(td).replace("hr",bl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_m).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",po).getRegex()},Iw={...rd,html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",sd).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:rr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Te(td).replace("hr",bl).replace("heading",` *#{1,6} *[^
|
|
74
74
|
]`).replace("lheading",Tv).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Gw=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Xw=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Dv=/^( {2,}|\\)\n(?!\s*$)/,Vw=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_o=/[\p{P}\p{S}]/u,nd=/[\s\p{P}\p{S}]/u,Mv=/[^\s\p{P}\p{S}]/u,Fw=Te(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,nd).getRegex(),Bv=/(?!~)[\p{P}\p{S}]/u,Zw=/(?!~)[\s\p{P}\p{S}]/u,Qw=/(?:[^\s\p{P}\p{S}]|~)/u,Av=/(?![*_])[\p{P}\p{S}]/u,Jw=/(?![*_])[\s\p{P}\p{S}]/u,eC=/(?:[^\s\p{P}\p{S}]|[*_])/u,tC=Te(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ow?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),zv=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,iC=Te(zv,"u").replace(/punct/g,_o).getRegex(),sC=Te(zv,"u").replace(/punct/g,Bv).getRegex(),Ov="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",rC=Te(Ov,"gu").replace(/notPunctSpace/g,Mv).replace(/punctSpace/g,nd).replace(/punct/g,_o).getRegex(),nC=Te(Ov,"gu").replace(/notPunctSpace/g,Qw).replace(/punctSpace/g,Zw).replace(/punct/g,Bv).getRegex(),lC=Te("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Mv).replace(/punctSpace/g,nd).replace(/punct/g,_o).getRegex(),aC=Te(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Av).getRegex(),oC="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",cC=Te(oC,"gu").replace(/notPunctSpace/g,eC).replace(/punctSpace/g,Jw).replace(/punct/g,Av).getRegex(),hC=Te(/\\(punct)/,"gu").replace(/punct/g,_o).getRegex(),uC=Te(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),dC=Te(sd).replace("(?:-->|$)","-->").getRegex(),fC=Te("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",dC).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),no=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,pC=Te(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",no).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Lv=Te(/^!?\[(label)\]\[(ref)\]/).replace("label",no).replace("ref",id).getRegex(),Nv=Te(/^!?\[(ref)\](?:\[\])?/).replace("ref",id).getRegex(),_C=Te("reflink|nolink(?!\\()","g").replace("reflink",Lv).replace("nolink",Nv).getRegex(),gm=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ld={_backpedal:rr,anyPunctuation:hC,autolink:uC,blockSkip:tC,br:Dv,code:Xw,del:rr,delLDelim:rr,delRDelim:rr,emStrongLDelim:iC,emStrongRDelimAst:rC,emStrongRDelimUnd:lC,escape:Gw,link:pC,nolink:Nv,punctuation:Fw,reflink:Lv,reflinkSearch:_C,tag:fC,text:Vw,url:rr},gC={...ld,link:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",no).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",no).getRegex()},Uu={...ld,emStrongRDelimAst:nC,emStrongLDelim:sC,delLDelim:aC,delRDelim:cC,url:Te(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",gm).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Te(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",gm).getRegex()},mC={...Uu,br:Te(Dv).replace("{2,}","*").getRegex(),text:Te(Uu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},$a={normal:rd,gfm:$w,pedantic:Iw},nl={normal:ld,gfm:Uu,breaks:mC,pedantic:gC},vC={"&":"&","<":"<",">":">",'"':""","'":"'"},mm=e=>vC[e];function Ai(e,i){if(i){if(Bt.escapeTest.test(e))return e.replace(Bt.escapeReplace,mm)}else if(Bt.escapeTestNoEncode.test(e))return e.replace(Bt.escapeReplaceNoEncode,mm);return e}function vm(e){try{e=encodeURI(e).replace(Bt.percentDecode,"%")}catch{return null}return e}function Sm(e,i){let n=e.replace(Bt.findPipe,(h,d,_)=>{let p=!1,f=d;for(;--f>=0&&_[f]==="\\";)p=!p;return p?"|":" |"}),l=n.split(Bt.splitPipe),o=0;if(l[0].trim()||l.shift(),l.length>0&&!l.at(-1)?.trim()&&l.pop(),i)if(l.length>i)l.splice(i);else for(;l.length<i;)l.push("");for(;o<l.length;o++)l[o]=l[o].trim().replace(Bt.slashPipe,"|");return l}function ll(e,i,n){let l=e.length;if(l===0)return"";let o=0;for(;o<l&&e.charAt(l-o-1)===i;)o++;return e.slice(0,l-o)}function SC(e,i){if(e.indexOf(i[1])===-1)return-1;let n=0;for(let l=0;l<e.length;l++)if(e[l]==="\\")l++;else if(e[l]===i[0])n++;else if(e[l]===i[1]&&(n--,n<0))return l;return n>0?-2:-1}function yC(e,i=0){let n=i,l="";for(let o of e)if(o===" "){let h=4-n%4;l+=" ".repeat(h),n+=h}else l+=o,n++;return l}function ym(e,i,n,l,o){let h=i.href,d=i.title||null,_=e[1].replace(o.other.outputLinkReplace,"$1");l.state.inLink=!0;let p={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:h,title:d,text:_,tokens:l.inlineTokens(_)};return l.state.inLink=!1,p}function bC(e,i,n){let l=e.match(n.other.indentCodeCompensation);if(l===null)return i;let o=l[1];return i.split(`
|
|
@@ -89,11 +89,11 @@ ${y}`:y;let S=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
89
89
|
`);continue}}return{type:"blockquote",raw:l,tokens:h,text:o}}}list(e){let i=this.rules.block.list.exec(e);if(i){let n=i[1].trim(),l=n.length>1,o={type:"list",raw:"",ordered:l,start:l?+n.slice(0,-1):"",loose:!1,items:[]};n=l?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=l?n:"[*+-]");let h=this.rules.other.listItemRegex(n),d=!1;for(;e;){let p=!1,f="",y="";if(!(i=h.exec(e))||this.rules.block.hr.test(e))break;f=i[0],e=e.substring(f.length);let S=yC(i[2].split(`
|
|
90
90
|
`,1)[0],i[1].length),x=e.split(`
|
|
91
91
|
`,1)[0],C=!S.trim(),b=0;if(this.options.pedantic?(b=2,y=S.trimStart()):C?b=i[1].length+1:(b=S.search(this.rules.other.nonSpaceChar),b=b>4?1:b,y=S.slice(b),b+=i[1].length),C&&this.rules.other.blankLine.test(x)&&(f+=x+`
|
|
92
|
-
`,e=e.substring(x.length+1),p=!0),!p){let R=this.rules.other.nextBulletRegex(b),
|
|
93
|
-
`,1)[0],
|
|
94
|
-
`+
|
|
95
|
-
`+x}C=!x.trim(),f+=
|
|
96
|
-
`,e=e.substring(
|
|
92
|
+
`,e=e.substring(x.length+1),p=!0),!p){let R=this.rules.other.nextBulletRegex(b),M=this.rules.other.hrRegex(b),W=this.rules.other.fencesBeginRegex(b),te=this.rules.other.headingBeginRegex(b),N=this.rules.other.htmlBeginRegex(b),L=this.rules.other.blockquoteBeginRegex(b);for(;e;){let U=e.split(`
|
|
93
|
+
`,1)[0],X;if(x=U,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),X=x):X=x.replace(this.rules.other.tabCharGlobal," "),W.test(x)||te.test(x)||N.test(x)||L.test(x)||R.test(x)||M.test(x))break;if(X.search(this.rules.other.nonSpaceChar)>=b||!x.trim())y+=`
|
|
94
|
+
`+X.slice(b);else{if(C||S.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||W.test(S)||te.test(S)||M.test(S))break;y+=`
|
|
95
|
+
`+x}C=!x.trim(),f+=U+`
|
|
96
|
+
`,e=e.substring(U.length+1),S=X.slice(b)}}o.loose||(d?o.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(d=!0)),o.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),o.raw+=f}let _=o.items.at(-1);if(_)_.raw=_.raw.trimEnd(),_.text=_.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let p of o.items){if(this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]),p.task){if(p.text=p.text.replace(this.rules.other.listReplaceTask,""),p.tokens[0]?.type==="text"||p.tokens[0]?.type==="paragraph"){p.tokens[0].raw=p.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),p.tokens[0].text=p.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let y=this.lexer.inlineQueue.length-1;y>=0;y--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[y].src)){this.lexer.inlineQueue[y].src=this.lexer.inlineQueue[y].src.replace(this.rules.other.listReplaceTask,"");break}}let f=this.rules.other.listTaskCheckbox.exec(p.raw);if(f){let y={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};p.checked=y.checked,o.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=y.raw+p.tokens[0].raw,p.tokens[0].text=y.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(y)):p.tokens.unshift({type:"paragraph",raw:y.raw,text:y.raw,tokens:[y]}):p.tokens.unshift(y)}}if(!o.loose){let f=p.tokens.filter(S=>S.type==="space"),y=f.length>0&&f.some(S=>this.rules.other.anyLine.test(S.raw));o.loose=y}}if(o.loose)for(let p of o.items){p.loose=!0;for(let f of p.tokens)f.type==="text"&&(f.type="paragraph")}return o}}html(e){let i=this.rules.block.html.exec(e);if(i)return{type:"html",block:!0,raw:i[0],pre:i[1]==="pre"||i[1]==="script"||i[1]==="style",text:i[0]}}def(e){let i=this.rules.block.def.exec(e);if(i){let n=i[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),l=i[2]?i[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):i[3];return{type:"def",tag:n,raw:i[0],href:l,title:o}}}table(e){let i=this.rules.block.table.exec(e);if(!i||!this.rules.other.tableDelimiter.test(i[2]))return;let n=Sm(i[1]),l=i[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=i[3]?.trim()?i[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
97
97
|
`):[],h={type:"table",raw:i[0],header:[],align:[],rows:[]};if(n.length===l.length){for(let d of l)this.rules.other.tableAlignRight.test(d)?h.align.push("right"):this.rules.other.tableAlignCenter.test(d)?h.align.push("center"):this.rules.other.tableAlignLeft.test(d)?h.align.push("left"):h.align.push(null);for(let d=0;d<n.length;d++)h.header.push({text:n[d],tokens:this.lexer.inline(n[d]),header:!0,align:h.align[d]});for(let d of o)h.rows.push(Sm(d,h.header.length).map((_,p)=>({text:_,tokens:this.lexer.inline(_),header:!1,align:h.align[p]})));return h}}lheading(e){let i=this.rules.block.lheading.exec(e);if(i)return{type:"heading",raw:i[0],depth:i[2].charAt(0)==="="?1:2,text:i[1],tokens:this.lexer.inline(i[1])}}paragraph(e){let i=this.rules.block.paragraph.exec(e);if(i){let n=i[1].charAt(i[1].length-1)===`
|
|
98
98
|
`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let i=this.rules.block.text.exec(e);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(e){let i=this.rules.inline.escape.exec(e);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(e){let i=this.rules.inline.tag.exec(e);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(e){let i=this.rules.inline.link.exec(e);if(i){let n=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let h=ll(n.slice(0,-1),"\\");if((n.length-h.length)%2===0)return}else{let h=SC(i[2],"()");if(h===-2)return;if(h>-1){let d=(i[0].indexOf("!")===0?5:4)+i[1].length+h;i[2]=i[2].substring(0,h),i[0]=i[0].substring(0,d).trim(),i[3]=""}}let l=i[2],o="";if(this.options.pedantic){let h=this.rules.other.pedanticHrefTitle.exec(l);h&&(l=h[1],o=h[3])}else o=i[3]?i[3].slice(1,-1):"";return l=l.trim(),this.rules.other.startAngleBracket.test(l)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?l=l.slice(1):l=l.slice(1,-1)),ym(i,{href:l&&l.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer,this.rules)}}reflink(e,i){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let l=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=i[l.toLowerCase()];if(!o){let h=n[0].charAt(0);return{type:"text",raw:h,text:h}}return ym(n,o,n[0],this.lexer,this.rules)}}emStrong(e,i,n=""){let l=this.rules.inline.emStrongLDelim.exec(e);if(!(!l||l[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(l[1]||l[2])||!n||this.rules.inline.punctuation.exec(n))){let o=[...l[0]].length-1,h,d,_=o,p=0,f=l[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,i=i.slice(-1*e.length+o);(l=f.exec(i))!=null;){if(h=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!h)continue;if(d=[...h].length,l[3]||l[4]){_+=d;continue}else if((l[5]||l[6])&&o%3&&!((o+d)%3)){p+=d;continue}if(_-=d,_>0)continue;d=Math.min(d,d+_+p);let y=[...l[0]][0].length,S=e.slice(0,o+l.index+y+d);if(Math.min(o,d)%2){let C=S.slice(1,-1);return{type:"em",raw:S,text:C,tokens:this.lexer.inlineTokens(C)}}let x=S.slice(2,-2);return{type:"strong",raw:S,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){let i=this.rules.inline.code.exec(e);if(i){let n=i[2].replace(this.rules.other.newLineCharGlobal," "),l=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return l&&o&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:i[0],text:n}}}br(e){let i=this.rules.inline.br.exec(e);if(i)return{type:"br",raw:i[0]}}del(e,i,n=""){let l=this.rules.inline.delLDelim.exec(e);if(l&&(!l[1]||!n||this.rules.inline.punctuation.exec(n))){let o=[...l[0]].length-1,h,d,_=o,p=this.rules.inline.delRDelim;for(p.lastIndex=0,i=i.slice(-1*e.length+o);(l=p.exec(i))!=null;){if(h=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!h||(d=[...h].length,d!==o))continue;if(l[3]||l[4]){_+=d;continue}if(_-=d,_>0)continue;d=Math.min(d,d+_);let f=[...l[0]][0].length,y=e.slice(0,o+l.index+f+d),S=y.slice(o,-o);return{type:"del",raw:y,text:S,tokens:this.lexer.inlineTokens(S)}}}}autolink(e){let i=this.rules.inline.autolink.exec(e);if(i){let n,l;return i[2]==="@"?(n=i[1],l="mailto:"+n):(n=i[1],l=n),{type:"link",raw:i[0],text:n,href:l,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let i;if(i=this.rules.inline.url.exec(e)){let n,l;if(i[2]==="@")n=i[0],l="mailto:"+n;else{let o;do o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])?.[0]??"";while(o!==i[0]);n=i[0],i[1]==="www."?l="http://"+i[0]:l=i[0]}return{type:"link",raw:i[0],text:n,href:l,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let i=this.rules.inline.text.exec(e);if(i){let n=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:i[0],escaped:n}}}},bi=class qu{tokens;options;state;inlineQueue;tokenizer;constructor(i){this.tokens=[],this.tokens.links=Object.create(null),this.options=i||ur,this.options.tokenizer=this.options.tokenizer||new lo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Bt,block:$a.normal,inline:nl.normal};this.options.pedantic?(n.block=$a.pedantic,n.inline=nl.pedantic):this.options.gfm&&(n.block=$a.gfm,this.options.breaks?n.inline=nl.breaks:n.inline=nl.gfm),this.tokenizer.rules=n}static get rules(){return{block:$a,inline:nl}}static lex(i,n){return new qu(n).lex(i)}static lexInline(i,n){return new qu(n).inlineTokens(i)}lex(i){i=i.replace(Bt.carriageReturn,`
|
|
99
99
|
`),this.blockTokens(i,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let l=this.inlineQueue[n];this.inlineTokens(l.src,l.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(i,n=[],l=!1){for(this.options.pedantic&&(i=i.replace(Bt.tabCharGlobal," ").replace(Bt.spaceLine,""));i;){let o;if(this.options.extensions?.block?.some(d=>(o=d.call({lexer:this},i,n))?(i=i.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.space(i)){i=i.substring(o.raw.length);let d=n.at(-1);o.raw.length===1&&d!==void 0?d.raw+=`
|