aegis-bridge 2.17.0 → 2.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,7 +14,7 @@ var R0=Object.defineProperty;var D0=(i,r,a)=>r in i?R0(i,r,{enumerable:!0,config
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var qm;function M0(){if(qm)return we;qm=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),k=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),S=Symbol.iterator;function E(L){return L===null||typeof L!="object"?null:(L=S&&L[S]||L["@@iterator"],typeof L=="function"?L:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,m={};function g(L,H,q){this.props=L,this.context=H,this.refs=m,this.updater=q||O}g.prototype.isReactComponent={},g.prototype.setState=function(L,H){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,H,"setState")},g.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function h(){}h.prototype=g.prototype;function _(L,H,q){this.props=L,this.context=H,this.refs=m,this.updater=q||O}var x=_.prototype=new h;x.constructor=_,C(x,g.prototype),x.isPureReactComponent=!0;var A=Array.isArray;function R(){}var D={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function M(L,H,q){var W=q.ref;return{$$typeof:i,type:L,key:H,ref:W!==void 0?W:null,props:q}}function $(L,H){return M(L.type,H,L.props)}function Z(L){return typeof L=="object"&&L!==null&&L.$$typeof===i}function K(L){var H={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(q){return H[q]})}var F=/\/+/g;function X(L,H){return typeof L=="object"&&L!==null&&L.key!=null?K(""+L.key):H.toString(36)}function ee(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(R,R):(L.status="pending",L.then(function(H){L.status==="pending"&&(L.status="fulfilled",L.value=H)},function(H){L.status==="pending"&&(L.status="rejected",L.reason=H)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function V(L,H,q,W,le){var fe=typeof L;(fe==="undefined"||fe==="boolean")&&(L=null);var
|
|
17
|
+
*/var qm;function M0(){if(qm)return we;qm=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),k=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),S=Symbol.iterator;function E(L){return L===null||typeof L!="object"?null:(L=S&&L[S]||L["@@iterator"],typeof L=="function"?L:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,m={};function g(L,H,q){this.props=L,this.context=H,this.refs=m,this.updater=q||O}g.prototype.isReactComponent={},g.prototype.setState=function(L,H){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,H,"setState")},g.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function h(){}h.prototype=g.prototype;function _(L,H,q){this.props=L,this.context=H,this.refs=m,this.updater=q||O}var x=_.prototype=new h;x.constructor=_,C(x,g.prototype),x.isPureReactComponent=!0;var A=Array.isArray;function R(){}var D={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function M(L,H,q){var W=q.ref;return{$$typeof:i,type:L,key:H,ref:W!==void 0?W:null,props:q}}function $(L,H){return M(L.type,H,L.props)}function Z(L){return typeof L=="object"&&L!==null&&L.$$typeof===i}function K(L){var H={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(q){return H[q]})}var F=/\/+/g;function X(L,H){return typeof L=="object"&&L!==null&&L.key!=null?K(""+L.key):H.toString(36)}function ee(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(R,R):(L.status="pending",L.then(function(H){L.status==="pending"&&(L.status="fulfilled",L.value=H)},function(H){L.status==="pending"&&(L.status="rejected",L.reason=H)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function V(L,H,q,W,le){var fe=typeof L;(fe==="undefined"||fe==="boolean")&&(L=null);var U=!1;if(L===null)U=!0;else switch(fe){case"bigint":case"string":case"number":U=!0;break;case"object":switch(L.$$typeof){case i:case r:U=!0;break;case y:return U=L._init,V(U(L._payload),H,q,W,le)}}if(U)return le=le(L),U=W===""?"."+X(L,0):W,A(le)?(q="",U!=null&&(q=U.replace(F,"$&/")+"/"),V(le,H,q,"",function(ne){return ne})):le!=null&&(Z(le)&&(le=$(le,q+(le.key==null||L&&L.key===le.key?"":(""+le.key).replace(F,"$&/")+"/")+U)),H.push(le)),1;U=0;var B=W===""?".":W+":";if(A(L))for(var ie=0;ie<L.length;ie++)W=L[ie],fe=B+X(W,ie),U+=V(W,H,q,fe,le);else if(ie=E(L),typeof ie=="function")for(L=ie.call(L),ie=0;!(W=L.next()).done;)W=W.value,fe=B+X(W,ie++),U+=V(W,H,q,fe,le);else if(fe==="object"){if(typeof L.then=="function")return V(ee(L),H,q,W,le);throw H=String(L),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return U}function Q(L,H,q){if(L==null)return L;var W=[],le=0;return V(L,W,"","",function(fe){return H.call(q,fe,le++)}),W}function ae(L){if(L._status===-1){var H=L._result;H=H(),H.then(function(q){(L._status===0||L._status===-1)&&(L._status=1,L._result=q)},function(q){(L._status===0||L._status===-1)&&(L._status=2,L._result=q)}),L._status===-1&&(L._status=0,L._result=H)}if(L._status===1)return L._result.default;throw L._result}var j=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},I={map:Q,forEach:function(L,H,q){Q(L,function(){H.apply(this,arguments)},q)},count:function(L){var H=0;return Q(L,function(){H++}),H},toArray:function(L){return Q(L,function(H){return H})||[]},only:function(L){if(!Z(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return we.Activity=d,we.Children=I,we.Component=g,we.Fragment=a,we.Profiler=v,we.PureComponent=_,we.StrictMode=o,we.Suspense=u,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,we.__COMPILER_RUNTIME={__proto__:null,c:function(L){return D.H.useMemoCache(L)}},we.cache=function(L){return function(){return L.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(L,H,q){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var W=C({},L.props),le=L.key;if(H!=null)for(fe in H.key!==void 0&&(le=""+H.key),H)!T.call(H,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&H.ref===void 0||(W[fe]=H[fe]);var fe=arguments.length-2;if(fe===1)W.children=q;else if(1<fe){for(var U=Array(fe),B=0;B<fe;B++)U[B]=arguments[B+2];W.children=U}return M(L.type,le,W)},we.createContext=function(L){return L={$$typeof:k,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:w,_context:L},L},we.createElement=function(L,H,q){var W,le={},fe=null;if(H!=null)for(W in H.key!==void 0&&(fe=""+H.key),H)T.call(H,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(le[W]=H[W]);var U=arguments.length-2;if(U===1)le.children=q;else if(1<U){for(var B=Array(U),ie=0;ie<U;ie++)B[ie]=arguments[ie+2];le.children=B}if(L&&L.defaultProps)for(W in U=L.defaultProps,U)le[W]===void 0&&(le[W]=U[W]);return M(L,fe,le)},we.createRef=function(){return{current:null}},we.forwardRef=function(L){return{$$typeof:l,render:L}},we.isValidElement=Z,we.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:ae}},we.memo=function(L,H){return{$$typeof:f,type:L,compare:H===void 0?null:H}},we.startTransition=function(L){var H=D.T,q={};D.T=q;try{var W=L(),le=D.S;le!==null&&le(q,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(R,j)}catch(fe){j(fe)}finally{H!==null&&q.types!==null&&(H.types=q.types),D.T=H}},we.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},we.use=function(L){return D.H.use(L)},we.useActionState=function(L,H,q){return D.H.useActionState(L,H,q)},we.useCallback=function(L,H){return D.H.useCallback(L,H)},we.useContext=function(L){return D.H.useContext(L)},we.useDebugValue=function(){},we.useDeferredValue=function(L,H){return D.H.useDeferredValue(L,H)},we.useEffect=function(L,H){return D.H.useEffect(L,H)},we.useEffectEvent=function(L){return D.H.useEffectEvent(L)},we.useId=function(){return D.H.useId()},we.useImperativeHandle=function(L,H,q){return D.H.useImperativeHandle(L,H,q)},we.useInsertionEffect=function(L,H){return D.H.useInsertionEffect(L,H)},we.useLayoutEffect=function(L,H){return D.H.useLayoutEffect(L,H)},we.useMemo=function(L,H){return D.H.useMemo(L,H)},we.useOptimistic=function(L,H){return D.H.useOptimistic(L,H)},we.useReducer=function(L,H,q){return D.H.useReducer(L,H,q)},we.useRef=function(L){return D.H.useRef(L)},we.useState=function(L){return D.H.useState(L)},we.useSyncExternalStore=function(L,H,q){return D.H.useSyncExternalStore(L,H,q)},we.useTransition=function(){return D.H.useTransition()},we.version="19.2.4",we}var Km;function ku(){return Km||(Km=1,tu.exports=M0()),tu.exports}var P=ku();const Hn=Jp(P);var iu={exports:{}},Ln={},su={exports:{}},ru={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var R0=Object.defineProperty;var D0=(i,r,a)=>r in i?R0(i,r,{enumerable:!0,config
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var Vm;function L0(){return Vm||(Vm=1,(function(i){function r(V,Q){var ae=V.length;V.push(Q);e:for(;0<ae;){var j=ae-1>>>1,
|
|
25
|
+
*/var Vm;function L0(){return Vm||(Vm=1,(function(i){function r(V,Q){var ae=V.length;V.push(Q);e:for(;0<ae;){var j=ae-1>>>1,I=V[j];if(0<v(I,Q))V[j]=Q,V[ae]=I,ae=j;else break e}}function a(V){return V.length===0?null:V[0]}function o(V){if(V.length===0)return null;var Q=V[0],ae=V.pop();if(ae!==Q){V[0]=ae;e:for(var j=0,I=V.length,L=I>>>1;j<L;){var H=2*(j+1)-1,q=V[H],W=H+1,le=V[W];if(0>v(q,ae))W<I&&0>v(le,q)?(V[j]=le,V[W]=ae,j=W):(V[j]=q,V[H]=ae,j=H);else if(W<I&&0>v(le,ae))V[j]=le,V[W]=ae,j=W;else break e}}return Q}function v(V,Q){var ae=V.sortIndex-Q.sortIndex;return ae!==0?ae:V.id-Q.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var w=performance;i.unstable_now=function(){return w.now()}}else{var k=Date,l=k.now();i.unstable_now=function(){return k.now()-l}}var u=[],f=[],y=1,d=null,S=3,E=!1,O=!1,C=!1,m=!1,g=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function x(V){for(var Q=a(f);Q!==null;){if(Q.callback===null)o(f);else if(Q.startTime<=V)o(f),Q.sortIndex=Q.expirationTime,r(u,Q);else break;Q=a(f)}}function A(V){if(C=!1,x(V),!O)if(a(u)!==null)O=!0,R||(R=!0,K());else{var Q=a(f);Q!==null&&ee(A,Q.startTime-V)}}var R=!1,D=-1,T=5,M=-1;function $(){return m?!0:!(i.unstable_now()-M<T)}function Z(){if(m=!1,R){var V=i.unstable_now();M=V;var Q=!0;try{e:{O=!1,C&&(C=!1,h(D),D=-1),E=!0;var ae=S;try{t:{for(x(V),d=a(u);d!==null&&!(d.expirationTime>V&&$());){var j=d.callback;if(typeof j=="function"){d.callback=null,S=d.priorityLevel;var I=j(d.expirationTime<=V);if(V=i.unstable_now(),typeof I=="function"){d.callback=I,x(V),Q=!0;break t}d===a(u)&&o(u),x(V)}else o(u);d=a(u)}if(d!==null)Q=!0;else{var L=a(f);L!==null&&ee(A,L.startTime-V),Q=!1}}break e}finally{d=null,S=ae,E=!1}Q=void 0}}finally{Q?K():R=!1}}}var K;if(typeof _=="function")K=function(){_(Z)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,X=F.port2;F.port1.onmessage=Z,K=function(){X.postMessage(null)}}else K=function(){g(Z,0)};function ee(V,Q){D=g(function(){V(i.unstable_now())},Q)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(V){V.callback=null},i.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<V?Math.floor(1e3/V):5},i.unstable_getCurrentPriorityLevel=function(){return S},i.unstable_next=function(V){switch(S){case 1:case 2:case 3:var Q=3;break;default:Q=S}var ae=S;S=Q;try{return V()}finally{S=ae}},i.unstable_requestPaint=function(){m=!0},i.unstable_runWithPriority=function(V,Q){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var ae=S;S=V;try{return Q()}finally{S=ae}},i.unstable_scheduleCallback=function(V,Q,ae){var j=i.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?j+ae:j):ae=j,V){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=ae+I,V={id:y++,callback:Q,priorityLevel:V,startTime:ae,expirationTime:I,sortIndex:-1},ae>j?(V.sortIndex=ae,r(f,V),a(u)===null&&V===a(f)&&(C?(h(D),D=-1):C=!0,ee(A,ae-j))):(V.sortIndex=I,r(u,V),O||E||(O=!0,R||(R=!0,K()))),V},i.unstable_shouldYield=$,i.unstable_wrapCallback=function(V){var Q=S;return function(){var ae=S;S=Q;try{return V.apply(this,arguments)}finally{S=ae}}}})(ru)),ru}var Gm;function j0(){return Gm||(Gm=1,su.exports=L0()),su.exports}var nu={exports:{}},kt={};/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.js
|
|
28
28
|
*
|
|
@@ -38,14 +38,14 @@ var R0=Object.defineProperty;var D0=(i,r,a)=>r in i?R0(i,r,{enumerable:!0,config
|
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the MIT license found in the
|
|
40
40
|
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var Xm;function H0(){if(Xm)return Ln;Xm=1;var i=j0(),r=ku(),a=z0();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function v(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function w(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function k(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(w(e)!==e)throw Error(o(188))}function f(e){var t=e.alternate;if(!t){if(t=w(e),t===null)throw Error(o(188));return t!==e?null:e}for(var s=e,n=t;;){var c=s.return;if(c===null)break;var p=c.alternate;if(p===null){if(n=c.return,n!==null){s=n;continue}break}if(c.child===p.child){for(p=c.child;p;){if(p===s)return u(c),e;if(p===n)return u(c),t;p=p.sibling}throw Error(o(188))}if(s.return!==n.return)s=c,n=p;else{for(var N=!1,z=c.child;z;){if(z===s){N=!0,s=c,n=p;break}if(z===n){N=!0,n=c,s=p;break}z=z.sibling}if(!N){for(z=p.child;z;){if(z===s){N=!0,s=p,n=c;break}if(z===n){N=!0,n=p,s=c;break}z=z.sibling}if(!N)throw Error(o(189))}}if(s.alternate!==n)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var d=Object.assign,S=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),_=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),Z=Symbol.iterator;function K(e){return e===null||typeof e!="object"?null:(e=Z&&e[Z]||e["@@iterator"],typeof e=="function"?e:null)}var F=Symbol.for("react.client.reference");function X(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===F?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case g:return"Profiler";case m:return"StrictMode";case A:return"Suspense";case R:return"SuspenseList";case M:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case O:return"Portal";case _:return e.displayName||"Context";case h:return(e._context.displayName||"Context")+".Consumer";case x:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:X(e.type)||"Memo";case T:t=e._payload,e=e._init;try{return X(e(t))}catch{}}return null}var ee=Array.isArray,V=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},j=[],
|
|
41
|
+
*/var Xm;function H0(){if(Xm)return Ln;Xm=1;var i=j0(),r=ku(),a=z0();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function v(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function w(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function k(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(w(e)!==e)throw Error(o(188))}function f(e){var t=e.alternate;if(!t){if(t=w(e),t===null)throw Error(o(188));return t!==e?null:e}for(var s=e,n=t;;){var c=s.return;if(c===null)break;var p=c.alternate;if(p===null){if(n=c.return,n!==null){s=n;continue}break}if(c.child===p.child){for(p=c.child;p;){if(p===s)return u(c),e;if(p===n)return u(c),t;p=p.sibling}throw Error(o(188))}if(s.return!==n.return)s=c,n=p;else{for(var N=!1,z=c.child;z;){if(z===s){N=!0,s=c,n=p;break}if(z===n){N=!0,n=c,s=p;break}z=z.sibling}if(!N){for(z=p.child;z;){if(z===s){N=!0,s=p,n=c;break}if(z===n){N=!0,n=p,s=c;break}z=z.sibling}if(!N)throw Error(o(189))}}if(s.alternate!==n)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var d=Object.assign,S=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),_=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),Z=Symbol.iterator;function K(e){return e===null||typeof e!="object"?null:(e=Z&&e[Z]||e["@@iterator"],typeof e=="function"?e:null)}var F=Symbol.for("react.client.reference");function X(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===F?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case g:return"Profiler";case m:return"StrictMode";case A:return"Suspense";case R:return"SuspenseList";case M:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case O:return"Portal";case _:return e.displayName||"Context";case h:return(e._context.displayName||"Context")+".Consumer";case x:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:X(e.type)||"Memo";case T:t=e._payload,e=e._init;try{return X(e(t))}catch{}}return null}var ee=Array.isArray,V=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},j=[],I=-1;function L(e){return{current:e}}function H(e){0>I||(e.current=j[I],j[I]=null,I--)}function q(e,t){I++,j[I]=e.current,e.current=t}var W=L(null),le=L(null),fe=L(null),U=L(null);function B(e,t){switch(q(fe,t),q(le,e),q(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dm(t),e=fm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(W),q(W,e)}function ie(){H(W),H(le),H(fe)}function ne(e){e.memoizedState!==null&&q(U,e);var t=W.current,s=fm(t,e.type);t!==s&&(q(le,e),q(W,s))}function me(e){le.current===e&&(H(W),H(le)),U.current===e&&(H(U),Rn._currentValue=ae)}var pe,Ee;function je(e){if(pe===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||"",Ee=-1<s.stack.indexOf(`
|
|
42
42
|
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
43
|
`+pe+e+Ee}var Be=!1;function st(e,t){if(!e||Be)return"";Be=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(oe){var re=oe}Reflect.construct(e,[],de)}else{try{de.call()}catch(oe){re=oe}e.call(de.prototype)}}else{try{throw Error()}catch(oe){re=oe}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(oe){if(oe&&re&&typeof oe.stack=="string")return[oe.stack,re.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=n.DetermineComponentFrameRoot(),N=p[0],z=p[1];if(N&&z){var G=N.split(`
|
|
44
44
|
`),se=z.split(`
|
|
45
45
|
`);for(c=n=0;n<G.length&&!G[n].includes("DetermineComponentFrameRoot");)n++;for(;c<se.length&&!se[c].includes("DetermineComponentFrameRoot");)c++;if(n===G.length||c===se.length)for(n=G.length-1,c=se.length-1;1<=n&&0<=c&&G[n]!==se[c];)c--;for(;1<=n&&0<=c;n--,c--)if(G[n]!==se[c]){if(n!==1||c!==1)do if(n--,c--,0>c||G[n]!==se[c]){var ce=`
|
|
46
46
|
`+G[n].replace(" at new "," at ");return e.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",e.displayName)),ce}while(1<=n&&0<=c);break}}}finally{Be=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?je(s):""}function Ce(e,t){switch(e.tag){case 26:case 27:case 5:return je(e.type);case 16:return je("Lazy");case 13:return e.child!==t&&t!==null?je("Suspense Fallback"):je("Suspense");case 19:return je("SuspenseList");case 0:case 15:return st(e.type,!1);case 11:return st(e.type.render,!1);case 1:return st(e.type,!0);case 31:return je("Activity");default:return""}}function _e(e){try{var t="",s=null;do t+=Ce(e,s),s=e,e=e.return;while(e);return t}catch(n){return`
|
|
47
47
|
Error generating stack: `+n.message+`
|
|
48
|
-
`+n.stack}}var Rt=Object.prototype.hasOwnProperty,mi=i.unstable_scheduleCallback,xs=i.unstable_cancelCallback,Ks=i.unstable_shouldYield,Dt=i.unstable_requestPaint,vt=i.unstable_now,Yt=i.unstable_getCurrentPriorityLevel,Fi=i.unstable_ImmediatePriority,Vs=i.unstable_UserBlockingPriority,Ut=i.unstable_NormalPriority,Gs=i.unstable_LowPriority,li=i.unstable_IdlePriority,Cs=i.log,We=i.unstable_setDisableYieldValue,ws=null,It=null;function Zi(e){if(typeof Cs=="function"&&We(e),It&&typeof It.setStrictMode=="function")try{It.setStrictMode(ws,e)}catch{}}var Pt=Math.clz32?Math.clz32:pv,fv=Math.log,mv=Math.LN2;function pv(e){return e>>>=0,e===0?32:31-(fv(e)/mv|0)|0}var Wn=256,Xn=262144,Jn=4194304;function Es(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Qn(e,t,s){var n=e.pendingLanes;if(n===0)return 0;var c=0,p=e.suspendedLanes,N=e.pingedLanes;e=e.warmLanes;var z=n&134217727;return z!==0?(n=z&~p,n!==0?c=Es(n):(N&=z,N!==0?c=Es(N):s||(s=z&~e,s!==0&&(c=Es(s))))):(z=n&~p,z!==0?c=Es(z):N!==0?c=Es(N):s||(s=n&~e,s!==0&&(c=Es(s)))),c===0?0:t!==0&&t!==c&&(t&p)===0&&(p=c&-c,s=t&-t,p>=s||p===32&&(s&4194048)!==0)?t:c}function Pr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _v(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ku(){var e=Jn;return Jn<<=1,(Jn&62914560)===0&&(Jn=4194304),e}function $o(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function $r(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function vv(e,t,s,n,c,p){var N=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var z=e.entanglements,G=e.expirationTimes,se=e.hiddenUpdates;for(s=N&~s;0<s;){var ce=31-Pt(s),de=1<<ce;z[ce]=0,G[ce]=-1;var re=se[ce];if(re!==null)for(se[ce]=null,ce=0;ce<re.length;ce++){var oe=re[ce];oe!==null&&(oe.lane&=-536870913)}s&=~de}n!==0&&Vu(e,n,0),p!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=p&~(N&~t))}function Vu(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Pt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|s&261930}function Gu(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var n=31-Pt(s),c=1<<n;c&t|e[n]&t&&(e[n]|=t),s&=~c}}function Yu(e,t){var s=t&-t;return s=(s&42)!==0?1:Fo(s),(s&(e.suspendedLanes|t))!==0?0:s}function Fo(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Zo(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Wu(){var e=Q.p;return e!==0?e:(e=window.event,e===void 0?32:Bm(e.type))}function Xu(e,t){var s=Q.p;try{return Q.p=e,t()}finally{Q.p=s}}var qi=Math.random().toString(36).slice(2),St="__reactFiber$"+qi,Ot="__reactProps$"+qi,Ys="__reactContainer$"+qi,qo="__reactEvents$"+qi,gv="__reactListeners$"+qi,yv="__reactHandles$"+qi,Ju="__reactResources$"+qi,Fr="__reactMarker$"+qi;function Ko(e){delete e[St],delete e[Ot],delete e[qo],delete e[gv],delete e[yv]}function Ws(e){var t=e[St];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Ys]||s[St]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=bm(e);e!==null;){if(s=e[St])return s;e=bm(e)}return t}e=s,s=e.parentNode}return null}function Xs(e){if(e=e[St]||e[Ys]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Zr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Js(e){var t=e[Ju];return t||(t=e[Ju]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[Fr]=!0}var Qu=new Set,eh={};function ks(e,t){Qs(e,t),Qs(e+"Capture",t)}function Qs(e,t){for(eh[e]=t,e=0;e<t.length;e++)Qu.add(t[e])}var bv=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]*$"),th={},ih={};function Sv(e){return Rt.call(ih,e)?!0:Rt.call(th,e)?!1:bv.test(e)?ih[e]=!0:(th[e]=!0,!1)}function ea(e,t,s){if(Sv(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function ta(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function Si(e,t,s,n){if(n===null)e.removeAttribute(s);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+n)}}function Wt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xv(e,t,s){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var c=n.get,p=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(N){s=""+N,p.call(this,N)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(N){s=""+N},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vo(e){if(!e._valueTracker){var t=sh(e)?"checked":"value";e._valueTracker=xv(e,t,""+e[t])}}function rh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),n="";return e&&(n=sh(e)?e.checked?"true":"false":e.value),e=n,e!==s?(t.setValue(e),!0):!1}function ia(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Cv=/[\n"\\]/g;function Xt(e){return e.replace(Cv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Go(e,t,s,n,c,p,N,z){e.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.type=N:e.removeAttribute("type"),t!=null?N==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Wt(t)):e.value!==""+Wt(t)&&(e.value=""+Wt(t)):N!=="submit"&&N!=="reset"||e.removeAttribute("value"),t!=null?Yo(e,N,Wt(t)):s!=null?Yo(e,N,Wt(s)):n!=null&&e.removeAttribute("value"),c==null&&p!=null&&(e.defaultChecked=!!p),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?e.name=""+Wt(z):e.removeAttribute("name")}function nh(e,t,s,n,c,p,N,z){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.type=p),t!=null||s!=null){if(!(p!=="submit"&&p!=="reset"||t!=null)){Vo(e);return}s=s!=null?""+Wt(s):"",t=t!=null?""+Wt(t):s,z||t===e.value||(e.value=t),e.defaultValue=t}n=n??c,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=z?e.checked:!!n,e.defaultChecked=!!n,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(e.name=N),Vo(e)}function Yo(e,t,s){t==="number"&&ia(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function er(e,t,s,n){if(e=e.options,t){t={};for(var c=0;c<s.length;c++)t["$"+s[c]]=!0;for(s=0;s<e.length;s++)c=t.hasOwnProperty("$"+e[s].value),e[s].selected!==c&&(e[s].selected=c),c&&n&&(e[s].defaultSelected=!0)}else{for(s=""+Wt(s),t=null,c=0;c<e.length;c++){if(e[c].value===s){e[c].selected=!0,n&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function ah(e,t,s){if(t!=null&&(t=""+Wt(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Wt(s):""}function oh(e,t,s,n){if(t==null){if(n!=null){if(s!=null)throw Error(o(92));if(ee(n)){if(1<n.length)throw Error(o(93));n=n[0]}s=n}s==null&&(s=""),t=s}s=Wt(t),e.defaultValue=s,n=e.textContent,n===s&&n!==""&&n!==null&&(e.value=n),Vo(e)}function tr(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var wv=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 lh(e,t,s){var n=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,s):typeof s!="number"||s===0||wv.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function ch(e,t,s){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,s!=null){for(var n in s)!s.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var c in t)n=t[c],t.hasOwnProperty(c)&&s[c]!==n&&lh(e,c,n)}else for(var p in t)t.hasOwnProperty(p)&&lh(e,p,t[p])}function Wo(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ev=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"]]),kv=/^[\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 sa(e){return kv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function xi(){}var Xo=null;function Jo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ir=null,sr=null;function uh(e){var t=Xs(e);if(t&&(e=t.stateNode)){var s=e[Ot]||null;e:switch(e=t.stateNode,t.type){case"input":if(Go(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Xt(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var n=s[t];if(n!==e&&n.form===e.form){var c=n[Ot]||null;if(!c)throw Error(o(90));Go(n,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<s.length;t++)n=s[t],n.form===e.form&&rh(n)}break e;case"textarea":ah(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&er(e,!!s.multiple,t,!1)}}}var Qo=!1;function hh(e,t,s){if(Qo)return e(t,s);Qo=!0;try{var n=e(t);return n}finally{if(Qo=!1,(ir!==null||sr!==null)&&(Za(),ir&&(t=ir,e=sr,sr=ir=null,uh(t),e)))for(t=0;t<e.length;t++)uh(e[t])}}function qr(e,t){var s=e.stateNode;if(s===null)return null;var n=s[Ot]||null;if(n===null)return null;s=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,t,typeof s));return s}var Ci=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),el=!1;if(Ci)try{var Kr={};Object.defineProperty(Kr,"passive",{get:function(){el=!0}}),window.addEventListener("test",Kr,Kr),window.removeEventListener("test",Kr,Kr)}catch{el=!1}var Ki=null,tl=null,ra=null;function dh(){if(ra)return ra;var e,t=tl,s=t.length,n,c="value"in Ki?Ki.value:Ki.textContent,p=c.length;for(e=0;e<s&&t[e]===c[e];e++);var N=s-e;for(n=1;n<=N&&t[s-n]===c[p-n];n++);return ra=c.slice(e,1<n?1-n:void 0)}function na(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function aa(){return!0}function fh(){return!1}function Nt(e){function t(s,n,c,p,N){this._reactName=s,this._targetInst=c,this.type=n,this.nativeEvent=p,this.target=N,this.currentTarget=null;for(var z in e)e.hasOwnProperty(z)&&(s=e[z],this[z]=s?s(p):p[z]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?aa:fh,this.isPropagationStopped=fh,this}return d(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=aa)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=aa)},persist:function(){},isPersistent:aa}),t}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},oa=Nt(Ts),Vr=d({},Ts,{view:0,detail:0}),Tv=Nt(Vr),il,sl,Gr,la=d({},Vr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nl,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Gr&&(Gr&&e.type==="mousemove"?(il=e.screenX-Gr.screenX,sl=e.screenY-Gr.screenY):sl=il=0,Gr=e),il)},movementY:function(e){return"movementY"in e?e.movementY:sl}}),mh=Nt(la),Av=d({},la,{dataTransfer:0}),Rv=Nt(Av),Dv=d({},Vr,{relatedTarget:0}),rl=Nt(Dv),Ov=d({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),Nv=Nt(Ov),Mv=d({},Ts,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lv=Nt(Mv),jv=d({},Ts,{data:0}),ph=Nt(jv),Bv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zv={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"},Hv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Hv[e])?!!t[e]:!1}function nl(){return Uv}var Iv=d({},Vr,{key:function(e){if(e.key){var t=Bv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=na(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?zv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nl,charCode:function(e){return e.type==="keypress"?na(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?na(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Pv=Nt(Iv),$v=d({},la,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_h=Nt($v),Fv=d({},Vr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nl}),Zv=Nt(Fv),qv=d({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kv=Nt(qv),Vv=d({},la,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Gv=Nt(Vv),Yv=d({},Ts,{newState:0,oldState:0}),Wv=Nt(Yv),Xv=[9,13,27,32],al=Ci&&"CompositionEvent"in window,Yr=null;Ci&&"documentMode"in document&&(Yr=document.documentMode);var Jv=Ci&&"TextEvent"in window&&!Yr,vh=Ci&&(!al||Yr&&8<Yr&&11>=Yr),gh=" ",yh=!1;function bh(e,t){switch(e){case"keyup":return Xv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rr=!1;function Qv(e,t){switch(e){case"compositionend":return Sh(t);case"keypress":return t.which!==32?null:(yh=!0,gh);case"textInput":return e=t.data,e===gh&&yh?null:e;default:return null}}function eg(e,t){if(rr)return e==="compositionend"||!al&&bh(e,t)?(e=dh(),ra=tl=Ki=null,rr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return vh&&t.locale!=="ko"?null:t.data;default:return null}}var tg={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 xh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tg[e.type]:t==="textarea"}function Ch(e,t,s,n){ir?sr?sr.push(n):sr=[n]:ir=n,t=Xa(t,"onChange"),0<t.length&&(s=new oa("onChange","change",null,s,n),e.push({event:s,listeners:t}))}var Wr=null,Xr=null;function ig(e){am(e,0)}function ca(e){var t=Zr(e);if(rh(t))return e}function wh(e,t){if(e==="change")return t}var Eh=!1;if(Ci){var ol;if(Ci){var ll="oninput"in document;if(!ll){var kh=document.createElement("div");kh.setAttribute("oninput","return;"),ll=typeof kh.oninput=="function"}ol=ll}else ol=!1;Eh=ol&&(!document.documentMode||9<document.documentMode)}function Th(){Wr&&(Wr.detachEvent("onpropertychange",Ah),Xr=Wr=null)}function Ah(e){if(e.propertyName==="value"&&ca(Xr)){var t=[];Ch(t,Xr,e,Jo(e)),hh(ig,t)}}function sg(e,t,s){e==="focusin"?(Th(),Wr=t,Xr=s,Wr.attachEvent("onpropertychange",Ah)):e==="focusout"&&Th()}function rg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ca(Xr)}function ng(e,t){if(e==="click")return ca(t)}function ag(e,t){if(e==="input"||e==="change")return ca(t)}function og(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $t=typeof Object.is=="function"?Object.is:og;function Jr(e,t){if($t(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),n=Object.keys(t);if(s.length!==n.length)return!1;for(n=0;n<s.length;n++){var c=s[n];if(!Rt.call(t,c)||!$t(e[c],t[c]))return!1}return!0}function Rh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dh(e,t){var s=Rh(e);e=0;for(var n;s;){if(s.nodeType===3){if(n=e+s.textContent.length,e<=t&&n>=t)return{node:s,offset:t-e};e=n}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Rh(s)}}function Oh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Oh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ia(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=ia(e.document)}return t}function cl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var lg=Ci&&"documentMode"in document&&11>=document.documentMode,nr=null,ul=null,Qr=null,hl=!1;function Mh(e,t,s){var n=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;hl||nr==null||nr!==ia(n)||(n=nr,"selectionStart"in n&&cl(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Qr&&Jr(Qr,n)||(Qr=n,n=Xa(ul,"onSelect"),0<n.length&&(t=new oa("onSelect","select",null,t,s),e.push({event:t,listeners:n}),t.target=nr)))}function As(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var ar={animationend:As("Animation","AnimationEnd"),animationiteration:As("Animation","AnimationIteration"),animationstart:As("Animation","AnimationStart"),transitionrun:As("Transition","TransitionRun"),transitionstart:As("Transition","TransitionStart"),transitioncancel:As("Transition","TransitionCancel"),transitionend:As("Transition","TransitionEnd")},dl={},Lh={};Ci&&(Lh=document.createElement("div").style,"AnimationEvent"in window||(delete ar.animationend.animation,delete ar.animationiteration.animation,delete ar.animationstart.animation),"TransitionEvent"in window||delete ar.transitionend.transition);function Rs(e){if(dl[e])return dl[e];if(!ar[e])return e;var t=ar[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Lh)return dl[e]=t[s];return e}var jh=Rs("animationend"),Bh=Rs("animationiteration"),zh=Rs("animationstart"),cg=Rs("transitionrun"),ug=Rs("transitionstart"),hg=Rs("transitioncancel"),Hh=Rs("transitionend"),Uh=new Map,fl="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(" ");fl.push("scrollEnd");function ci(e,t){Uh.set(e,t),ks(t,[e])}var ua=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Jt=[],or=0,ml=0;function ha(){for(var e=or,t=ml=or=0;t<e;){var s=Jt[t];Jt[t++]=null;var n=Jt[t];Jt[t++]=null;var c=Jt[t];Jt[t++]=null;var p=Jt[t];if(Jt[t++]=null,n!==null&&c!==null){var N=n.pending;N===null?c.next=c:(c.next=N.next,N.next=c),n.pending=c}p!==0&&Ih(s,c,p)}}function da(e,t,s,n){Jt[or++]=e,Jt[or++]=t,Jt[or++]=s,Jt[or++]=n,ml|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function pl(e,t,s,n){return da(e,t,s,n),fa(e)}function Ds(e,t){return da(e,null,null,t),fa(e)}function Ih(e,t,s){e.lanes|=s;var n=e.alternate;n!==null&&(n.lanes|=s);for(var c=!1,p=e.return;p!==null;)p.childLanes|=s,n=p.alternate,n!==null&&(n.childLanes|=s),p.tag===22&&(e=p.stateNode,e===null||e._visibility&1||(c=!0)),e=p,p=p.return;return e.tag===3?(p=e.stateNode,c&&t!==null&&(c=31-Pt(s),e=p.hiddenUpdates,n=e[c],n===null?e[c]=[t]:n.push(t),t.lane=s|536870912),p):null}function fa(e){if(50<xn)throw xn=0,wc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var lr={};function dg(e,t,s,n){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ft(e,t,s,n){return new dg(e,t,s,n)}function _l(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wi(e,t){var s=e.alternate;return s===null?(s=Ft(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Ph(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ma(e,t,s,n,c,p){var N=0;if(n=e,typeof e=="function")_l(e)&&(N=1);else if(typeof e=="string")N=v0(e,s,W.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case M:return e=Ft(31,s,t,c),e.elementType=M,e.lanes=p,e;case C:return Os(s.children,c,p,t);case m:N=8,c|=24;break;case g:return e=Ft(12,s,t,c|2),e.elementType=g,e.lanes=p,e;case A:return e=Ft(13,s,t,c),e.elementType=A,e.lanes=p,e;case R:return e=Ft(19,s,t,c),e.elementType=R,e.lanes=p,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _:N=10;break e;case h:N=9;break e;case x:N=11;break e;case D:N=14;break e;case T:N=16,n=null;break e}N=29,s=Error(o(130,e===null?"null":typeof e,"")),n=null}return t=Ft(N,s,t,c),t.elementType=e,t.type=n,t.lanes=p,t}function Os(e,t,s,n){return e=Ft(7,e,n,t),e.lanes=s,e}function vl(e,t,s){return e=Ft(6,e,null,t),e.lanes=s,e}function $h(e){var t=Ft(18,null,null,0);return t.stateNode=e,t}function gl(e,t,s){return t=Ft(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fh=new WeakMap;function Qt(e,t){if(typeof e=="object"&&e!==null){var s=Fh.get(e);return s!==void 0?s:(t={value:e,source:t,stack:_e(t)},Fh.set(e,t),t)}return{value:e,source:t,stack:_e(t)}}var cr=[],ur=0,pa=null,en=0,ei=[],ti=0,Vi=null,pi=1,_i="";function Ei(e,t){cr[ur++]=en,cr[ur++]=pa,pa=e,en=t}function Zh(e,t,s){ei[ti++]=pi,ei[ti++]=_i,ei[ti++]=Vi,Vi=e;var n=pi;e=_i;var c=32-Pt(n)-1;n&=~(1<<c),s+=1;var p=32-Pt(t)+c;if(30<p){var N=c-c%5;p=(n&(1<<N)-1).toString(32),n>>=N,c-=N,pi=1<<32-Pt(t)+c|s<<c|n,_i=p+e}else pi=1<<p|s<<c|n,_i=e}function yl(e){e.return!==null&&(Ei(e,1),Zh(e,1,0))}function bl(e){for(;e===pa;)pa=cr[--ur],cr[ur]=null,en=cr[--ur],cr[ur]=null;for(;e===Vi;)Vi=ei[--ti],ei[ti]=null,_i=ei[--ti],ei[ti]=null,pi=ei[--ti],ei[ti]=null}function qh(e,t){ei[ti++]=pi,ei[ti++]=_i,ei[ti++]=Vi,pi=t.id,_i=t.overflow,Vi=e}var xt=null,Xe=null,Le=!1,Gi=null,ii=!1,Sl=Error(o(519));function Yi(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw tn(Qt(t,e)),Sl}function Kh(e){var t=e.stateNode,s=e.type,n=e.memoizedProps;switch(t[St]=e,t[Ot]=n,s){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(s=0;s<wn.length;s++)De(wn[s],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),nh(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),oh(t,n.value,n.defaultValue,n.children)}s=n.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||n.suppressHydrationWarning===!0||um(t.textContent,s)?(n.popover!=null&&(De("beforetoggle",t),De("toggle",t)),n.onScroll!=null&&De("scroll",t),n.onScrollEnd!=null&&De("scrollend",t),n.onClick!=null&&(t.onclick=xi),t=!0):t=!1,t||Yi(e,!0)}function Vh(e){for(xt=e.return;xt;)switch(xt.tag){case 5:case 31:case 13:ii=!1;return;case 27:case 3:ii=!0;return;default:xt=xt.return}}function hr(e){if(e!==xt)return!1;if(!Le)return Vh(e),Le=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Uc(e.type,e.memoizedProps)),s=!s),s&&Xe&&Yi(e),Vh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Xe=ym(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Xe=ym(e)}else t===27?(t=Xe,cs(e.type)?(e=Zc,Zc=null,Xe=e):Xe=t):Xe=xt?ri(e.stateNode.nextSibling):null;return!0}function Ns(){Xe=xt=null,Le=!1}function xl(){var e=Gi;return e!==null&&(Bt===null?Bt=e:Bt.push.apply(Bt,e),Gi=null),e}function tn(e){Gi===null?Gi=[e]:Gi.push(e)}var Cl=L(null),Ms=null,ki=null;function Wi(e,t,s){q(Cl,t._currentValue),t._currentValue=s}function Ti(e){e._currentValue=Cl.current,H(Cl)}function wl(e,t,s){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===s)break;e=e.return}}function El(e,t,s,n){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var p=c.dependencies;if(p!==null){var N=c.child;p=p.firstContext;e:for(;p!==null;){var z=p;p=c;for(var G=0;G<t.length;G++)if(z.context===t[G]){p.lanes|=s,z=p.alternate,z!==null&&(z.lanes|=s),wl(p.return,s,e),n||(N=null);break e}p=z.next}}else if(c.tag===18){if(N=c.return,N===null)throw Error(o(341));N.lanes|=s,p=N.alternate,p!==null&&(p.lanes|=s),wl(N,s,e),N=null}else N=c.child;if(N!==null)N.return=c;else for(N=c;N!==null;){if(N===e){N=null;break}if(c=N.sibling,c!==null){c.return=N.return,N=c;break}N=N.return}c=N}}function dr(e,t,s,n){e=null;for(var c=t,p=!1;c!==null;){if(!p){if((c.flags&524288)!==0)p=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var N=c.alternate;if(N===null)throw Error(o(387));if(N=N.memoizedProps,N!==null){var z=c.type;$t(c.pendingProps.value,N.value)||(e!==null?e.push(z):e=[z])}}else if(c===I.current){if(N=c.alternate,N===null)throw Error(o(387));N.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Rn):e=[Rn])}c=c.return}e!==null&&El(t,e,s,n),t.flags|=262144}function _a(e){for(e=e.firstContext;e!==null;){if(!$t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ls(e){Ms=e,ki=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ct(e){return Gh(Ms,e)}function va(e,t){return Ms===null&&Ls(e),Gh(e,t)}function Gh(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},ki===null){if(e===null)throw Error(o(308));ki=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ki=ki.next=t;return s}var fg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},mg=i.unstable_scheduleCallback,pg=i.unstable_NormalPriority,ht={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function kl(){return{controller:new fg,data:new Map,refCount:0}}function sn(e){e.refCount--,e.refCount===0&&mg(pg,function(){e.controller.abort()})}var rn=null,Tl=0,fr=0,mr=null;function _g(e,t){if(rn===null){var s=rn=[];Tl=0,fr=Dc(),mr={status:"pending",value:void 0,then:function(n){s.push(n)}}}return Tl++,t.then(Yh,Yh),t}function Yh(){if(--Tl===0&&rn!==null){mr!==null&&(mr.status="fulfilled");var e=rn;rn=null,fr=0,mr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function vg(e,t){var s=[],n={status:"pending",value:null,reason:null,then:function(c){s.push(c)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var c=0;c<s.length;c++)(0,s[c])(t)},function(c){for(n.status="rejected",n.reason=c,c=0;c<s.length;c++)(0,s[c])(void 0)}),n}var Wh=V.S;V.S=function(e,t){Lf=vt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&_g(e,t),Wh!==null&&Wh(e,t)};var js=L(null);function Al(){var e=js.current;return e!==null?e:Ge.pooledCache}function ga(e,t){t===null?q(js,js.current):q(js,t.pool)}function Xh(){var e=Al();return e===null?null:{parent:ht._currentValue,pool:e}}var pr=Error(o(460)),Rl=Error(o(474)),ya=Error(o(542)),ba={then:function(){}};function Jh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Qh(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(xi,xi),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,td(e),e;default:if(typeof t.status=="string")t.then(xi,xi);else{if(e=Ge,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=n}},function(n){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,td(e),e}throw zs=t,pr}}function Bs(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(zs=s,pr):s}}var zs=null;function ed(){if(zs===null)throw Error(o(459));var e=zs;return zs=null,e}function td(e){if(e===pr||e===ya)throw Error(o(483))}var _r=null,nn=0;function Sa(e){var t=nn;return nn+=1,_r===null&&(_r=[]),Qh(_r,e,t)}function an(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function xa(e,t){throw t.$$typeof===S?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function id(e){function t(J,Y){if(e){var te=J.deletions;te===null?(J.deletions=[Y],J.flags|=16):te.push(Y)}}function s(J,Y){if(!e)return null;for(;Y!==null;)t(J,Y),Y=Y.sibling;return null}function n(J){for(var Y=new Map;J!==null;)J.key!==null?Y.set(J.key,J):Y.set(J.index,J),J=J.sibling;return Y}function c(J,Y){return J=wi(J,Y),J.index=0,J.sibling=null,J}function p(J,Y,te){return J.index=te,e?(te=J.alternate,te!==null?(te=te.index,te<Y?(J.flags|=67108866,Y):te):(J.flags|=67108866,Y)):(J.flags|=1048576,Y)}function N(J){return e&&J.alternate===null&&(J.flags|=67108866),J}function z(J,Y,te,ue){return Y===null||Y.tag!==6?(Y=vl(te,J.mode,ue),Y.return=J,Y):(Y=c(Y,te),Y.return=J,Y)}function G(J,Y,te,ue){var Se=te.type;return Se===C?ce(J,Y,te.props.children,ue,te.key):Y!==null&&(Y.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===T&&Bs(Se)===Y.type)?(Y=c(Y,te.props),an(Y,te),Y.return=J,Y):(Y=ma(te.type,te.key,te.props,null,J.mode,ue),an(Y,te),Y.return=J,Y)}function se(J,Y,te,ue){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==te.containerInfo||Y.stateNode.implementation!==te.implementation?(Y=gl(te,J.mode,ue),Y.return=J,Y):(Y=c(Y,te.children||[]),Y.return=J,Y)}function ce(J,Y,te,ue,Se){return Y===null||Y.tag!==7?(Y=Os(te,J.mode,ue,Se),Y.return=J,Y):(Y=c(Y,te),Y.return=J,Y)}function de(J,Y,te){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=vl(""+Y,J.mode,te),Y.return=J,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case E:return te=ma(Y.type,Y.key,Y.props,null,J.mode,te),an(te,Y),te.return=J,te;case O:return Y=gl(Y,J.mode,te),Y.return=J,Y;case T:return Y=Bs(Y),de(J,Y,te)}if(ee(Y)||K(Y))return Y=Os(Y,J.mode,te,null),Y.return=J,Y;if(typeof Y.then=="function")return de(J,Sa(Y),te);if(Y.$$typeof===_)return de(J,va(J,Y),te);xa(J,Y)}return null}function re(J,Y,te,ue){var Se=Y!==null?Y.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Se!==null?null:z(J,Y,""+te,ue);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case E:return te.key===Se?G(J,Y,te,ue):null;case O:return te.key===Se?se(J,Y,te,ue):null;case T:return te=Bs(te),re(J,Y,te,ue)}if(ee(te)||K(te))return Se!==null?null:ce(J,Y,te,ue,null);if(typeof te.then=="function")return re(J,Y,Sa(te),ue);if(te.$$typeof===_)return re(J,Y,va(J,te),ue);xa(J,te)}return null}function oe(J,Y,te,ue,Se){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return J=J.get(te)||null,z(Y,J,""+ue,Se);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case E:return J=J.get(ue.key===null?te:ue.key)||null,G(Y,J,ue,Se);case O:return J=J.get(ue.key===null?te:ue.key)||null,se(Y,J,ue,Se);case T:return ue=Bs(ue),oe(J,Y,te,ue,Se)}if(ee(ue)||K(ue))return J=J.get(te)||null,ce(Y,J,ue,Se,null);if(typeof ue.then=="function")return oe(J,Y,te,Sa(ue),Se);if(ue.$$typeof===_)return oe(J,Y,te,va(Y,ue),Se);xa(Y,ue)}return null}function ve(J,Y,te,ue){for(var Se=null,ze=null,ge=Y,Te=Y=0,Me=null;ge!==null&&Te<te.length;Te++){ge.index>Te?(Me=ge,ge=null):Me=ge.sibling;var He=re(J,ge,te[Te],ue);if(He===null){ge===null&&(ge=Me);break}e&&ge&&He.alternate===null&&t(J,ge),Y=p(He,Y,Te),ze===null?Se=He:ze.sibling=He,ze=He,ge=Me}if(Te===te.length)return s(J,ge),Le&&Ei(J,Te),Se;if(ge===null){for(;Te<te.length;Te++)ge=de(J,te[Te],ue),ge!==null&&(Y=p(ge,Y,Te),ze===null?Se=ge:ze.sibling=ge,ze=ge);return Le&&Ei(J,Te),Se}for(ge=n(ge);Te<te.length;Te++)Me=oe(ge,J,Te,te[Te],ue),Me!==null&&(e&&Me.alternate!==null&&ge.delete(Me.key===null?Te:Me.key),Y=p(Me,Y,Te),ze===null?Se=Me:ze.sibling=Me,ze=Me);return e&&ge.forEach(function(ms){return t(J,ms)}),Le&&Ei(J,Te),Se}function xe(J,Y,te,ue){if(te==null)throw Error(o(151));for(var Se=null,ze=null,ge=Y,Te=Y=0,Me=null,He=te.next();ge!==null&&!He.done;Te++,He=te.next()){ge.index>Te?(Me=ge,ge=null):Me=ge.sibling;var ms=re(J,ge,He.value,ue);if(ms===null){ge===null&&(ge=Me);break}e&&ge&&ms.alternate===null&&t(J,ge),Y=p(ms,Y,Te),ze===null?Se=ms:ze.sibling=ms,ze=ms,ge=Me}if(He.done)return s(J,ge),Le&&Ei(J,Te),Se;if(ge===null){for(;!He.done;Te++,He=te.next())He=de(J,He.value,ue),He!==null&&(Y=p(He,Y,Te),ze===null?Se=He:ze.sibling=He,ze=He);return Le&&Ei(J,Te),Se}for(ge=n(ge);!He.done;Te++,He=te.next())He=oe(ge,J,Te,He.value,ue),He!==null&&(e&&He.alternate!==null&&ge.delete(He.key===null?Te:He.key),Y=p(He,Y,Te),ze===null?Se=He:ze.sibling=He,ze=He);return e&&ge.forEach(function(A0){return t(J,A0)}),Le&&Ei(J,Te),Se}function Ve(J,Y,te,ue){if(typeof te=="object"&&te!==null&&te.type===C&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case E:e:{for(var Se=te.key;Y!==null;){if(Y.key===Se){if(Se=te.type,Se===C){if(Y.tag===7){s(J,Y.sibling),ue=c(Y,te.props.children),ue.return=J,J=ue;break e}}else if(Y.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===T&&Bs(Se)===Y.type){s(J,Y.sibling),ue=c(Y,te.props),an(ue,te),ue.return=J,J=ue;break e}s(J,Y);break}else t(J,Y);Y=Y.sibling}te.type===C?(ue=Os(te.props.children,J.mode,ue,te.key),ue.return=J,J=ue):(ue=ma(te.type,te.key,te.props,null,J.mode,ue),an(ue,te),ue.return=J,J=ue)}return N(J);case O:e:{for(Se=te.key;Y!==null;){if(Y.key===Se)if(Y.tag===4&&Y.stateNode.containerInfo===te.containerInfo&&Y.stateNode.implementation===te.implementation){s(J,Y.sibling),ue=c(Y,te.children||[]),ue.return=J,J=ue;break e}else{s(J,Y);break}else t(J,Y);Y=Y.sibling}ue=gl(te,J.mode,ue),ue.return=J,J=ue}return N(J);case T:return te=Bs(te),Ve(J,Y,te,ue)}if(ee(te))return ve(J,Y,te,ue);if(K(te)){if(Se=K(te),typeof Se!="function")throw Error(o(150));return te=Se.call(te),xe(J,Y,te,ue)}if(typeof te.then=="function")return Ve(J,Y,Sa(te),ue);if(te.$$typeof===_)return Ve(J,Y,va(J,te),ue);xa(J,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,Y!==null&&Y.tag===6?(s(J,Y.sibling),ue=c(Y,te),ue.return=J,J=ue):(s(J,Y),ue=vl(te,J.mode,ue),ue.return=J,J=ue),N(J)):s(J,Y)}return function(J,Y,te,ue){try{nn=0;var Se=Ve(J,Y,te,ue);return _r=null,Se}catch(ge){if(ge===pr||ge===ya)throw ge;var ze=Ft(29,ge,null,J.mode);return ze.lanes=ue,ze.return=J,ze}finally{}}}var Hs=id(!0),sd=id(!1),Xi=!1;function Dl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ol(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ji(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Qi(e,t,s){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Ie&2)!==0){var c=n.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),n.pending=t,t=fa(e),Ih(e,null,s),t}return da(e,n,t,s),fa(e)}function on(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,s|=n,t.lanes=s,Gu(e,s)}}function Nl(e,t){var s=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,s===n)){var c=null,p=null;if(s=s.firstBaseUpdate,s!==null){do{var N={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};p===null?c=p=N:p=p.next=N,s=s.next}while(s!==null);p===null?c=p=t:p=p.next=t}else c=p=t;s={baseState:n.baseState,firstBaseUpdate:c,lastBaseUpdate:p,shared:n.shared,callbacks:n.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var Ml=!1;function ln(){if(Ml){var e=mr;if(e!==null)throw e}}function cn(e,t,s,n){Ml=!1;var c=e.updateQueue;Xi=!1;var p=c.firstBaseUpdate,N=c.lastBaseUpdate,z=c.shared.pending;if(z!==null){c.shared.pending=null;var G=z,se=G.next;G.next=null,N===null?p=se:N.next=se,N=G;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,z=ce.lastBaseUpdate,z!==N&&(z===null?ce.firstBaseUpdate=se:z.next=se,ce.lastBaseUpdate=G))}if(p!==null){var de=c.baseState;N=0,ce=se=G=null,z=p;do{var re=z.lane&-536870913,oe=re!==z.lane;if(oe?(Ne&re)===re:(n&re)===re){re!==0&&re===fr&&(Ml=!0),ce!==null&&(ce=ce.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var ve=e,xe=z;re=t;var Ve=s;switch(xe.tag){case 1:if(ve=xe.payload,typeof ve=="function"){de=ve.call(Ve,de,re);break e}de=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=xe.payload,re=typeof ve=="function"?ve.call(Ve,de,re):ve,re==null)break e;de=d({},de,re);break e;case 2:Xi=!0}}re=z.callback,re!==null&&(e.flags|=64,oe&&(e.flags|=8192),oe=c.callbacks,oe===null?c.callbacks=[re]:oe.push(re))}else oe={lane:re,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ce===null?(se=ce=oe,G=de):ce=ce.next=oe,N|=re;if(z=z.next,z===null){if(z=c.shared.pending,z===null)break;oe=z,z=oe.next,oe.next=null,c.lastBaseUpdate=oe,c.shared.pending=null}}while(!0);ce===null&&(G=de),c.baseState=G,c.firstBaseUpdate=se,c.lastBaseUpdate=ce,p===null&&(c.shared.lanes=0),rs|=N,e.lanes=N,e.memoizedState=de}}function rd(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function nd(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)rd(s[e],t)}var vr=L(null),Ca=L(0);function ad(e,t){e=Bi,q(Ca,e),q(vr,t),Bi=e|t.baseLanes}function Ll(){q(Ca,Bi),q(vr,vr.current)}function jl(){Bi=Ca.current,H(vr),H(Ca)}var Zt=L(null),si=null;function es(e){var t=e.alternate;q(lt,lt.current&1),q(Zt,e),si===null&&(t===null||vr.current!==null||t.memoizedState!==null)&&(si=e)}function Bl(e){q(lt,lt.current),q(Zt,e),si===null&&(si=e)}function od(e){e.tag===22?(q(lt,lt.current),q(Zt,e),si===null&&(si=e)):ts()}function ts(){q(lt,lt.current),q(Zt,Zt.current)}function qt(e){H(Zt),si===e&&(si=null),H(lt)}var lt=L(0);function wa(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||$c(s)||Fc(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ai=0,ke=null,qe=null,dt=null,Ea=!1,gr=!1,Us=!1,ka=0,un=0,yr=null,gg=0;function rt(){throw Error(o(321))}function zl(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!$t(e[s],t[s]))return!1;return!0}function Hl(e,t,s,n,c,p){return Ai=p,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?Zd:Ql,Us=!1,p=s(n,c),Us=!1,gr&&(p=cd(t,s,n,c)),ld(e),p}function ld(e){V.H=fn;var t=qe!==null&&qe.next!==null;if(Ai=0,dt=qe=ke=null,Ea=!1,un=0,yr=null,t)throw Error(o(300));e===null||ft||(e=e.dependencies,e!==null&&_a(e)&&(ft=!0))}function cd(e,t,s,n){ke=e;var c=0;do{if(gr&&(yr=null),un=0,gr=!1,25<=c)throw Error(o(301));if(c+=1,dt=qe=null,e.updateQueue!=null){var p=e.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}V.H=qd,p=t(s,n)}while(gr);return p}function yg(){var e=V.H,t=e.useState()[0];return t=typeof t.then=="function"?hn(t):t,e=e.useState()[0],(qe!==null?qe.memoizedState:null)!==e&&(ke.flags|=1024),t}function Ul(){var e=ka!==0;return ka=0,e}function Il(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Pl(e){if(Ea){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ea=!1}Ai=0,dt=qe=ke=null,gr=!1,un=ka=0,yr=null}function Tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?ke.memoizedState=dt=e:dt=dt.next=e,dt}function ct(){if(qe===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=dt===null?ke.memoizedState:dt.next;if(t!==null)dt=t,qe=e;else{if(e===null)throw ke.alternate===null?Error(o(467)):Error(o(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},dt===null?ke.memoizedState=dt=e:dt=dt.next=e}return dt}function Ta(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hn(e){var t=un;return un+=1,yr===null&&(yr=[]),e=Qh(yr,e,t),t=ke,(dt===null?t.memoizedState:dt.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?Zd:Ql),e}function Aa(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return hn(e);if(e.$$typeof===_)return Ct(e)}throw Error(o(438,String(e)))}function $l(e){var t=null,s=ke.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var n=ke.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Ta(),ke.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),n=0;n<e;n++)s[n]=$;return t.index++,s}function Ri(e,t){return typeof t=="function"?t(e):t}function Ra(e){var t=ct();return Fl(t,qe,e)}function Fl(e,t,s){var n=e.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=s;var c=e.baseQueue,p=n.pending;if(p!==null){if(c!==null){var N=c.next;c.next=p.next,p.next=N}t.baseQueue=c=p,n.pending=null}if(p=e.baseState,c===null)e.memoizedState=p;else{t=c.next;var z=N=null,G=null,se=t,ce=!1;do{var de=se.lane&-536870913;if(de!==se.lane?(Ne&de)===de:(Ai&de)===de){var re=se.revertLane;if(re===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),de===fr&&(ce=!0);else if((Ai&re)===re){se=se.next,re===fr&&(ce=!0);continue}else de={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},G===null?(z=G=de,N=p):G=G.next=de,ke.lanes|=re,rs|=re;de=se.action,Us&&s(p,de),p=se.hasEagerState?se.eagerState:s(p,de)}else re={lane:de,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},G===null?(z=G=re,N=p):G=G.next=re,ke.lanes|=de,rs|=de;se=se.next}while(se!==null&&se!==t);if(G===null?N=p:G.next=z,!$t(p,e.memoizedState)&&(ft=!0,ce&&(s=mr,s!==null)))throw s;e.memoizedState=p,e.baseState=N,e.baseQueue=G,n.lastRenderedState=p}return c===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Zl(e){var t=ct(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var n=s.dispatch,c=s.pending,p=t.memoizedState;if(c!==null){s.pending=null;var N=c=c.next;do p=e(p,N.action),N=N.next;while(N!==c);$t(p,t.memoizedState)||(ft=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),s.lastRenderedState=p}return[p,n]}function ud(e,t,s){var n=ke,c=ct(),p=Le;if(p){if(s===void 0)throw Error(o(407));s=s()}else s=t();var N=!$t((qe||c).memoizedState,s);if(N&&(c.memoizedState=s,ft=!0),c=c.queue,Vl(fd.bind(null,n,c,e),[e]),c.getSnapshot!==t||N||dt!==null&&dt.memoizedState.tag&1){if(n.flags|=2048,br(9,{destroy:void 0},dd.bind(null,n,c,s,t),null),Ge===null)throw Error(o(349));p||(Ai&127)!==0||hd(n,t,s)}return s}function hd(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=ke.updateQueue,t===null?(t=Ta(),ke.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function dd(e,t,s,n){t.value=s,t.getSnapshot=n,md(t)&&pd(e)}function fd(e,t,s){return s(function(){md(t)&&pd(e)})}function md(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!$t(e,s)}catch{return!0}}function pd(e){var t=Ds(e,2);t!==null&&zt(t,e,2)}function ql(e){var t=Tt();if(typeof e=="function"){var s=e;if(e=s(),Us){Zi(!0);try{s()}finally{Zi(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:e},t}function _d(e,t,s,n){return e.baseState=s,Fl(e,qe,typeof n=="function"?n:Ri)}function bg(e,t,s,n,c){if(Na(e))throw Error(o(485));if(e=t.action,e!==null){var p={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){p.listeners.push(N)}};V.T!==null?s(!0):p.isTransition=!1,n(p),s=t.pending,s===null?(p.next=t.pending=p,vd(t,p)):(p.next=s.next,t.pending=s.next=p)}}function vd(e,t){var s=t.action,n=t.payload,c=e.state;if(t.isTransition){var p=V.T,N={};V.T=N;try{var z=s(c,n),G=V.S;G!==null&&G(N,z),gd(e,t,z)}catch(se){Kl(e,t,se)}finally{p!==null&&N.types!==null&&(p.types=N.types),V.T=p}}else try{p=s(c,n),gd(e,t,p)}catch(se){Kl(e,t,se)}}function gd(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(n){yd(e,t,n)},function(n){return Kl(e,t,n)}):yd(e,t,s)}function yd(e,t,s){t.status="fulfilled",t.value=s,bd(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,vd(e,s)))}function Kl(e,t,s){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=s,bd(t),t=t.next;while(t!==n)}e.action=null}function bd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Sd(e,t){return t}function xd(e,t){if(Le){var s=Ge.formState;if(s!==null){e:{var n=ke;if(Le){if(Xe){t:{for(var c=Xe,p=ii;c.nodeType!==8;){if(!p){c=null;break t}if(c=ri(c.nextSibling),c===null){c=null;break t}}p=c.data,c=p==="F!"||p==="F"?c:null}if(c){Xe=ri(c.nextSibling),n=c.data==="F!";break e}}Yi(n)}n=!1}n&&(t=s[0])}}return s=Tt(),s.memoizedState=s.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sd,lastRenderedState:t},s.queue=n,s=Pd.bind(null,ke,n),n.dispatch=s,n=ql(!1),p=Jl.bind(null,ke,!1,n.queue),n=Tt(),c={state:t,dispatch:null,action:e,pending:null},n.queue=c,s=bg.bind(null,ke,c,p,s),c.dispatch=s,n.memoizedState=e,[t,s,!1]}function Cd(e){var t=ct();return wd(t,qe,e)}function wd(e,t,s){if(t=Fl(e,t,Sd)[0],e=Ra(Ri)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=hn(t)}catch(N){throw N===pr?ya:N}else n=t;t=ct();var c=t.queue,p=c.dispatch;return s!==t.memoizedState&&(ke.flags|=2048,br(9,{destroy:void 0},Sg.bind(null,c,s),null)),[n,p,e]}function Sg(e,t){e.action=t}function Ed(e){var t=ct(),s=qe;if(s!==null)return wd(t,s,e);ct(),t=t.memoizedState,s=ct();var n=s.queue.dispatch;return s.memoizedState=e,[t,n,!1]}function br(e,t,s,n){return e={tag:e,create:s,deps:n,inst:t,next:null},t=ke.updateQueue,t===null&&(t=Ta(),ke.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(n=s.next,s.next=e,e.next=n,t.lastEffect=e),e}function kd(){return ct().memoizedState}function Da(e,t,s,n){var c=Tt();ke.flags|=e,c.memoizedState=br(1|t,{destroy:void 0},s,n===void 0?null:n)}function Oa(e,t,s,n){var c=ct();n=n===void 0?null:n;var p=c.memoizedState.inst;qe!==null&&n!==null&&zl(n,qe.memoizedState.deps)?c.memoizedState=br(t,p,s,n):(ke.flags|=e,c.memoizedState=br(1|t,p,s,n))}function Td(e,t){Da(8390656,8,e,t)}function Vl(e,t){Oa(2048,8,e,t)}function xg(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=Ta(),ke.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Ad(e){var t=ct().memoizedState;return xg({ref:t,nextImpl:e}),function(){if((Ie&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Rd(e,t){return Oa(4,2,e,t)}function Dd(e,t){return Oa(4,4,e,t)}function Od(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Nd(e,t,s){s=s!=null?s.concat([e]):null,Oa(4,4,Od.bind(null,t,e),s)}function Gl(){}function Md(e,t){var s=ct();t=t===void 0?null:t;var n=s.memoizedState;return t!==null&&zl(t,n[1])?n[0]:(s.memoizedState=[e,t],e)}function Ld(e,t){var s=ct();t=t===void 0?null:t;var n=s.memoizedState;if(t!==null&&zl(t,n[1]))return n[0];if(n=e(),Us){Zi(!0);try{e()}finally{Zi(!1)}}return s.memoizedState=[n,t],n}function Yl(e,t,s){return s===void 0||(Ai&1073741824)!==0&&(Ne&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Bf(),ke.lanes|=e,rs|=e,s)}function jd(e,t,s,n){return $t(s,t)?s:vr.current!==null?(e=Yl(e,s,n),$t(e,t)||(ft=!0),e):(Ai&42)===0||(Ai&1073741824)!==0&&(Ne&261930)===0?(ft=!0,e.memoizedState=s):(e=Bf(),ke.lanes|=e,rs|=e,t)}function Bd(e,t,s,n,c){var p=Q.p;Q.p=p!==0&&8>p?p:8;var N=V.T,z={};V.T=z,Jl(e,!1,t,s);try{var G=c(),se=V.S;if(se!==null&&se(z,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var ce=vg(G,n);dn(e,t,ce,Gt(e))}else dn(e,t,n,Gt(e))}catch(de){dn(e,t,{then:function(){},status:"rejected",reason:de},Gt())}finally{Q.p=p,N!==null&&z.types!==null&&(N.types=z.types),V.T=N}}function Cg(){}function Wl(e,t,s,n){if(e.tag!==5)throw Error(o(476));var c=zd(e).queue;Bd(e,c,t,ae,s===null?Cg:function(){return Hd(e),s(n)})}function zd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:ae},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Hd(e){var t=zd(e);t.next===null&&(t=e.alternate.memoizedState),dn(e,t.next.queue,{},Gt())}function Xl(){return Ct(Rn)}function Ud(){return ct().memoizedState}function Id(){return ct().memoizedState}function wg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Gt();e=Ji(s);var n=Qi(t,e,s);n!==null&&(zt(n,t,s),on(n,t,s)),t={cache:kl()},e.payload=t;return}t=t.return}}function Eg(e,t,s){var n=Gt();s={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Na(e)?$d(t,s):(s=pl(e,t,s,n),s!==null&&(zt(s,e,n),Fd(s,t,n)))}function Pd(e,t,s){var n=Gt();dn(e,t,s,n)}function dn(e,t,s,n){var c={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Na(e))$d(t,c);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var N=t.lastRenderedState,z=p(N,s);if(c.hasEagerState=!0,c.eagerState=z,$t(z,N))return da(e,t,c,0),Ge===null&&ha(),!1}catch{}finally{}if(s=pl(e,t,c,n),s!==null)return zt(s,e,n),Fd(s,t,n),!0}return!1}function Jl(e,t,s,n){if(n={lane:2,revertLane:Dc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Na(e)){if(t)throw Error(o(479))}else t=pl(e,s,n,2),t!==null&&zt(t,e,2)}function Na(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function $d(e,t){gr=Ea=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Fd(e,t,s){if((s&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,s|=n,t.lanes=s,Gu(e,s)}}var fn={readContext:Ct,use:Aa,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useLayoutEffect:rt,useInsertionEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useSyncExternalStore:rt,useId:rt,useHostTransitionStatus:rt,useFormState:rt,useActionState:rt,useOptimistic:rt,useMemoCache:rt,useCacheRefresh:rt};fn.useEffectEvent=rt;var Zd={readContext:Ct,use:Aa,useCallback:function(e,t){return Tt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:Td,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Da(4194308,4,Od.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Da(4194308,4,e,t)},useInsertionEffect:function(e,t){Da(4,2,e,t)},useMemo:function(e,t){var s=Tt();t=t===void 0?null:t;var n=e();if(Us){Zi(!0);try{e()}finally{Zi(!1)}}return s.memoizedState=[n,t],n},useReducer:function(e,t,s){var n=Tt();if(s!==void 0){var c=s(t);if(Us){Zi(!0);try{s(t)}finally{Zi(!1)}}}else c=t;return n.memoizedState=n.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},n.queue=e,e=e.dispatch=Eg.bind(null,ke,e),[n.memoizedState,e]},useRef:function(e){var t=Tt();return e={current:e},t.memoizedState=e},useState:function(e){e=ql(e);var t=e.queue,s=Pd.bind(null,ke,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Gl,useDeferredValue:function(e,t){var s=Tt();return Yl(s,e,t)},useTransition:function(){var e=ql(!1);return e=Bd.bind(null,ke,e.queue,!0,!1),Tt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var n=ke,c=Tt();if(Le){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),Ge===null)throw Error(o(349));(Ne&127)!==0||hd(n,t,s)}c.memoizedState=s;var p={value:s,getSnapshot:t};return c.queue=p,Td(fd.bind(null,n,p,e),[e]),n.flags|=2048,br(9,{destroy:void 0},dd.bind(null,n,p,s,t),null),s},useId:function(){var e=Tt(),t=Ge.identifierPrefix;if(Le){var s=_i,n=pi;s=(n&~(1<<32-Pt(n)-1)).toString(32)+s,t="_"+t+"R_"+s,s=ka++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=gg++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Xl,useFormState:xd,useActionState:xd,useOptimistic:function(e){var t=Tt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Jl.bind(null,ke,!0,s),s.dispatch=t,[e,t]},useMemoCache:$l,useCacheRefresh:function(){return Tt().memoizedState=wg.bind(null,ke)},useEffectEvent:function(e){var t=Tt(),s={impl:e};return t.memoizedState=s,function(){if((Ie&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Ql={readContext:Ct,use:Aa,useCallback:Md,useContext:Ct,useEffect:Vl,useImperativeHandle:Nd,useInsertionEffect:Rd,useLayoutEffect:Dd,useMemo:Ld,useReducer:Ra,useRef:kd,useState:function(){return Ra(Ri)},useDebugValue:Gl,useDeferredValue:function(e,t){var s=ct();return jd(s,qe.memoizedState,e,t)},useTransition:function(){var e=Ra(Ri)[0],t=ct().memoizedState;return[typeof e=="boolean"?e:hn(e),t]},useSyncExternalStore:ud,useId:Ud,useHostTransitionStatus:Xl,useFormState:Cd,useActionState:Cd,useOptimistic:function(e,t){var s=ct();return _d(s,qe,e,t)},useMemoCache:$l,useCacheRefresh:Id};Ql.useEffectEvent=Ad;var qd={readContext:Ct,use:Aa,useCallback:Md,useContext:Ct,useEffect:Vl,useImperativeHandle:Nd,useInsertionEffect:Rd,useLayoutEffect:Dd,useMemo:Ld,useReducer:Zl,useRef:kd,useState:function(){return Zl(Ri)},useDebugValue:Gl,useDeferredValue:function(e,t){var s=ct();return qe===null?Yl(s,e,t):jd(s,qe.memoizedState,e,t)},useTransition:function(){var e=Zl(Ri)[0],t=ct().memoizedState;return[typeof e=="boolean"?e:hn(e),t]},useSyncExternalStore:ud,useId:Ud,useHostTransitionStatus:Xl,useFormState:Ed,useActionState:Ed,useOptimistic:function(e,t){var s=ct();return qe!==null?_d(s,qe,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:$l,useCacheRefresh:Id};qd.useEffectEvent=Ad;function ec(e,t,s,n){t=e.memoizedState,s=s(n,t),s=s==null?t:d({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var tc={enqueueSetState:function(e,t,s){e=e._reactInternals;var n=Gt(),c=Ji(n);c.payload=t,s!=null&&(c.callback=s),t=Qi(e,c,n),t!==null&&(zt(t,e,n),on(t,e,n))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var n=Gt(),c=Ji(n);c.tag=1,c.payload=t,s!=null&&(c.callback=s),t=Qi(e,c,n),t!==null&&(zt(t,e,n),on(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Gt(),n=Ji(s);n.tag=2,t!=null&&(n.callback=t),t=Qi(e,n,s),t!==null&&(zt(t,e,s),on(t,e,s))}};function Kd(e,t,s,n,c,p,N){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,p,N):t.prototype&&t.prototype.isPureReactComponent?!Jr(s,n)||!Jr(c,p):!0}function Vd(e,t,s,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,n),t.state!==e&&tc.enqueueReplaceState(t,t.state,null)}function Is(e,t){var s=t;if("ref"in t){s={};for(var n in t)n!=="ref"&&(s[n]=t[n])}if(e=e.defaultProps){s===t&&(s=d({},s));for(var c in e)s[c]===void 0&&(s[c]=e[c])}return s}function Gd(e){ua(e)}function Yd(e){console.error(e)}function Wd(e){ua(e)}function Ma(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Xd(e,t,s){try{var n=e.onCaughtError;n(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function ic(e,t,s){return s=Ji(s),s.tag=3,s.payload={element:null},s.callback=function(){Ma(e,t)},s}function Jd(e){return e=Ji(e),e.tag=3,e}function Qd(e,t,s,n){var c=s.type.getDerivedStateFromError;if(typeof c=="function"){var p=n.value;e.payload=function(){return c(p)},e.callback=function(){Xd(t,s,n)}}var N=s.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(e.callback=function(){Xd(t,s,n),typeof c!="function"&&(ns===null?ns=new Set([this]):ns.add(this));var z=n.stack;this.componentDidCatch(n.value,{componentStack:z!==null?z:""})})}function kg(e,t,s,n,c){if(s.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=s.alternate,t!==null&&dr(t,s,c,!0),s=Zt.current,s!==null){switch(s.tag){case 31:case 13:return si===null?qa():s.alternate===null&&nt===0&&(nt=3),s.flags&=-257,s.flags|=65536,s.lanes=c,n===ba?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([n]):t.add(n),Tc(e,n,c)),!1;case 22:return s.flags|=65536,n===ba?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([n]):s.add(n)),Tc(e,n,c)),!1}throw Error(o(435,s.tag))}return Tc(e,n,c),qa(),!1}if(Le)return t=Zt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,n!==Sl&&(e=Error(o(422),{cause:n}),tn(Qt(e,s)))):(n!==Sl&&(t=Error(o(423),{cause:n}),tn(Qt(t,s))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,n=Qt(n,s),c=ic(e.stateNode,n,c),Nl(e,c),nt!==4&&(nt=2)),!1;var p=Error(o(520),{cause:n});if(p=Qt(p,s),Sn===null?Sn=[p]:Sn.push(p),nt!==4&&(nt=2),t===null)return!0;n=Qt(n,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=c&-c,s.lanes|=e,e=ic(s.stateNode,n,e),Nl(s,e),!1;case 1:if(t=s.type,p=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(ns===null||!ns.has(p))))return s.flags|=65536,c&=-c,s.lanes|=c,c=Jd(c),Qd(c,e,s,n),Nl(s,c),!1}s=s.return}while(s!==null);return!1}var sc=Error(o(461)),ft=!1;function wt(e,t,s,n){t.child=e===null?sd(t,null,s,n):Hs(t,e.child,s,n)}function ef(e,t,s,n,c){s=s.render;var p=t.ref;if("ref"in n){var N={};for(var z in n)z!=="ref"&&(N[z]=n[z])}else N=n;return Ls(t),n=Hl(e,t,s,N,p,c),z=Ul(),e!==null&&!ft?(Il(e,t,c),Di(e,t,c)):(Le&&z&&yl(t),t.flags|=1,wt(e,t,n,c),t.child)}function tf(e,t,s,n,c){if(e===null){var p=s.type;return typeof p=="function"&&!_l(p)&&p.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=p,sf(e,t,p,n,c)):(e=ma(s.type,null,n,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,!hc(e,c)){var N=p.memoizedProps;if(s=s.compare,s=s!==null?s:Jr,s(N,n)&&e.ref===t.ref)return Di(e,t,c)}return t.flags|=1,e=wi(p,n),e.ref=t.ref,e.return=t,t.child=e}function sf(e,t,s,n,c){if(e!==null){var p=e.memoizedProps;if(Jr(p,n)&&e.ref===t.ref)if(ft=!1,t.pendingProps=n=p,hc(e,c))(e.flags&131072)!==0&&(ft=!0);else return t.lanes=e.lanes,Di(e,t,c)}return rc(e,t,s,n,c)}function rf(e,t,s,n){var c=n.children,p=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(p=p!==null?p.baseLanes|s:s,e!==null){for(n=t.child=e.child,c=0;n!==null;)c=c|n.lanes|n.childLanes,n=n.sibling;n=c&~p}else n=0,t.child=null;return nf(e,t,p,s,n)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ga(t,p!==null?p.cachePool:null),p!==null?ad(t,p):Ll(),od(t);else return n=t.lanes=536870912,nf(e,t,p!==null?p.baseLanes|s:s,s,n)}else p!==null?(ga(t,p.cachePool),ad(t,p),ts(),t.memoizedState=null):(e!==null&&ga(t,null),Ll(),ts());return wt(e,t,c,s),t.child}function mn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function nf(e,t,s,n,c){var p=Al();return p=p===null?null:{parent:ht._currentValue,pool:p},t.memoizedState={baseLanes:s,cachePool:p},e!==null&&ga(t,null),Ll(),od(t),e!==null&&dr(e,t,n,!0),t.childLanes=c,null}function La(e,t){return t=Ba({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function af(e,t,s){return Hs(t,e.child,null,s),e=La(t,t.pendingProps),e.flags|=2,qt(t),t.memoizedState=null,e}function Tg(e,t,s){var n=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(n.mode==="hidden")return e=La(t,n),t.lanes=536870912,mn(null,e);if(Bl(t),(e=Xe)?(e=gm(e,ii),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Vi!==null?{id:pi,overflow:_i}:null,retryLane:536870912,hydrationErrors:null},s=$h(e),s.return=t,t.child=s,xt=t,Xe=null)):e=null,e===null)throw Yi(t);return t.lanes=536870912,null}return La(t,n)}var p=e.memoizedState;if(p!==null){var N=p.dehydrated;if(Bl(t),c)if(t.flags&256)t.flags&=-257,t=af(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(ft||dr(e,t,s,!1),c=(s&e.childLanes)!==0,ft||c){if(n=Ge,n!==null&&(N=Yu(n,s),N!==0&&N!==p.retryLane))throw p.retryLane=N,Ds(e,N),zt(n,e,N),sc;qa(),t=af(e,t,s)}else e=p.treeContext,Xe=ri(N.nextSibling),xt=t,Le=!0,Gi=null,ii=!1,e!==null&&qh(t,e),t=La(t,n),t.flags|=4096;return t}return e=wi(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ja(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function rc(e,t,s,n,c){return Ls(t),s=Hl(e,t,s,n,void 0,c),n=Ul(),e!==null&&!ft?(Il(e,t,c),Di(e,t,c)):(Le&&n&&yl(t),t.flags|=1,wt(e,t,s,c),t.child)}function of(e,t,s,n,c,p){return Ls(t),t.updateQueue=null,s=cd(t,n,s,c),ld(e),n=Ul(),e!==null&&!ft?(Il(e,t,p),Di(e,t,p)):(Le&&n&&yl(t),t.flags|=1,wt(e,t,s,p),t.child)}function lf(e,t,s,n,c){if(Ls(t),t.stateNode===null){var p=lr,N=s.contextType;typeof N=="object"&&N!==null&&(p=Ct(N)),p=new s(n,p),t.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=tc,t.stateNode=p,p._reactInternals=t,p=t.stateNode,p.props=n,p.state=t.memoizedState,p.refs={},Dl(t),N=s.contextType,p.context=typeof N=="object"&&N!==null?Ct(N):lr,p.state=t.memoizedState,N=s.getDerivedStateFromProps,typeof N=="function"&&(ec(t,s,N,n),p.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(N=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),N!==p.state&&tc.enqueueReplaceState(p,p.state,null),cn(t,n,p,c),ln(),p.state=t.memoizedState),typeof p.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){p=t.stateNode;var z=t.memoizedProps,G=Is(s,z);p.props=G;var se=p.context,ce=s.contextType;N=lr,typeof ce=="object"&&ce!==null&&(N=Ct(ce));var de=s.getDerivedStateFromProps;ce=typeof de=="function"||typeof p.getSnapshotBeforeUpdate=="function",z=t.pendingProps!==z,ce||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(z||se!==N)&&Vd(t,p,n,N),Xi=!1;var re=t.memoizedState;p.state=re,cn(t,n,p,c),ln(),se=t.memoizedState,z||re!==se||Xi?(typeof de=="function"&&(ec(t,s,de,n),se=t.memoizedState),(G=Xi||Kd(t,s,G,n,re,se,N))?(ce||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(t.flags|=4194308)):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=se),p.props=n,p.state=se,p.context=N,n=G):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{p=t.stateNode,Ol(e,t),N=t.memoizedProps,ce=Is(s,N),p.props=ce,de=t.pendingProps,re=p.context,se=s.contextType,G=lr,typeof se=="object"&&se!==null&&(G=Ct(se)),z=s.getDerivedStateFromProps,(se=typeof z=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(N!==de||re!==G)&&Vd(t,p,n,G),Xi=!1,re=t.memoizedState,p.state=re,cn(t,n,p,c),ln();var oe=t.memoizedState;N!==de||re!==oe||Xi||e!==null&&e.dependencies!==null&&_a(e.dependencies)?(typeof z=="function"&&(ec(t,s,z,n),oe=t.memoizedState),(ce=Xi||Kd(t,s,ce,n,re,oe,G)||e!==null&&e.dependencies!==null&&_a(e.dependencies))?(se||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(n,oe,G),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(n,oe,G)),typeof p.componentDidUpdate=="function"&&(t.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof p.componentDidUpdate!="function"||N===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=oe),p.props=n,p.state=oe,p.context=G,n=ce):(typeof p.componentDidUpdate!="function"||N===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),n=!1)}return p=n,ja(e,t),n=(t.flags&128)!==0,p||n?(p=t.stateNode,s=n&&typeof s.getDerivedStateFromError!="function"?null:p.render(),t.flags|=1,e!==null&&n?(t.child=Hs(t,e.child,null,c),t.child=Hs(t,null,s,c)):wt(e,t,s,c),t.memoizedState=p.state,e=t.child):e=Di(e,t,c),e}function cf(e,t,s,n){return Ns(),t.flags|=256,wt(e,t,s,n),t.child}var nc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ac(e){return{baseLanes:e,cachePool:Xh()}}function oc(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=Vt),e}function uf(e,t,s){var n=t.pendingProps,c=!1,p=(t.flags&128)!==0,N;if((N=p)||(N=e!==null&&e.memoizedState===null?!1:(lt.current&2)!==0),N&&(c=!0,t.flags&=-129),N=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(c?es(t):ts(),(e=Xe)?(e=gm(e,ii),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Vi!==null?{id:pi,overflow:_i}:null,retryLane:536870912,hydrationErrors:null},s=$h(e),s.return=t,t.child=s,xt=t,Xe=null)):e=null,e===null)throw Yi(t);return Fc(e)?t.lanes=32:t.lanes=536870912,null}var z=n.children;return n=n.fallback,c?(ts(),c=t.mode,z=Ba({mode:"hidden",children:z},c),n=Os(n,c,s,null),z.return=t,n.return=t,z.sibling=n,t.child=z,n=t.child,n.memoizedState=ac(s),n.childLanes=oc(e,N,s),t.memoizedState=nc,mn(null,n)):(es(t),lc(t,z))}var G=e.memoizedState;if(G!==null&&(z=G.dehydrated,z!==null)){if(p)t.flags&256?(es(t),t.flags&=-257,t=cc(e,t,s)):t.memoizedState!==null?(ts(),t.child=e.child,t.flags|=128,t=null):(ts(),z=n.fallback,c=t.mode,n=Ba({mode:"visible",children:n.children},c),z=Os(z,c,s,null),z.flags|=2,n.return=t,z.return=t,n.sibling=z,t.child=n,Hs(t,e.child,null,s),n=t.child,n.memoizedState=ac(s),n.childLanes=oc(e,N,s),t.memoizedState=nc,t=mn(null,n));else if(es(t),Fc(z)){if(N=z.nextSibling&&z.nextSibling.dataset,N)var se=N.dgst;N=se,n=Error(o(419)),n.stack="",n.digest=N,tn({value:n,source:null,stack:null}),t=cc(e,t,s)}else if(ft||dr(e,t,s,!1),N=(s&e.childLanes)!==0,ft||N){if(N=Ge,N!==null&&(n=Yu(N,s),n!==0&&n!==G.retryLane))throw G.retryLane=n,Ds(e,n),zt(N,e,n),sc;$c(z)||qa(),t=cc(e,t,s)}else $c(z)?(t.flags|=192,t.child=e.child,t=null):(e=G.treeContext,Xe=ri(z.nextSibling),xt=t,Le=!0,Gi=null,ii=!1,e!==null&&qh(t,e),t=lc(t,n.children),t.flags|=4096);return t}return c?(ts(),z=n.fallback,c=t.mode,G=e.child,se=G.sibling,n=wi(G,{mode:"hidden",children:n.children}),n.subtreeFlags=G.subtreeFlags&65011712,se!==null?z=wi(se,z):(z=Os(z,c,s,null),z.flags|=2),z.return=t,n.return=t,n.sibling=z,t.child=n,mn(null,n),n=t.child,z=e.child.memoizedState,z===null?z=ac(s):(c=z.cachePool,c!==null?(G=ht._currentValue,c=c.parent!==G?{parent:G,pool:G}:c):c=Xh(),z={baseLanes:z.baseLanes|s,cachePool:c}),n.memoizedState=z,n.childLanes=oc(e,N,s),t.memoizedState=nc,mn(e.child,n)):(es(t),s=e.child,e=s.sibling,s=wi(s,{mode:"visible",children:n.children}),s.return=t,s.sibling=null,e!==null&&(N=t.deletions,N===null?(t.deletions=[e],t.flags|=16):N.push(e)),t.child=s,t.memoizedState=null,s)}function lc(e,t){return t=Ba({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ba(e,t){return e=Ft(22,e,null,t),e.lanes=0,e}function cc(e,t,s){return Hs(t,e.child,null,s),e=lc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hf(e,t,s){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),wl(e.return,t,s)}function uc(e,t,s,n,c,p){var N=e.memoizedState;N===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:s,tailMode:c,treeForkCount:p}:(N.isBackwards=t,N.rendering=null,N.renderingStartTime=0,N.last=n,N.tail=s,N.tailMode=c,N.treeForkCount=p)}function df(e,t,s){var n=t.pendingProps,c=n.revealOrder,p=n.tail;n=n.children;var N=lt.current,z=(N&2)!==0;if(z?(N=N&1|2,t.flags|=128):N&=1,q(lt,N),wt(e,t,n,s),n=Le?en:0,!z&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&hf(e,s,t);else if(e.tag===19)hf(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(s=t.child,c=null;s!==null;)e=s.alternate,e!==null&&wa(e)===null&&(c=s),s=s.sibling;s=c,s===null?(c=t.child,t.child=null):(c=s.sibling,s.sibling=null),uc(t,!1,c,s,p,n);break;case"backwards":case"unstable_legacy-backwards":for(s=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&wa(e)===null){t.child=c;break}e=c.sibling,c.sibling=s,s=c,c=e}uc(t,!0,s,null,p,n);break;case"together":uc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Di(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),rs|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(dr(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,s=wi(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=wi(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function hc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&_a(e)))}function Ag(e,t,s){switch(t.tag){case 3:B(t,t.stateNode.containerInfo),Wi(t,ht,e.memoizedState.cache),Ns();break;case 27:case 5:ne(t);break;case 4:B(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Bl(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(es(t),t.flags|=128,null):(s&t.child.childLanes)!==0?uf(e,t,s):(es(t),e=Di(e,t,s),e!==null?e.sibling:null);es(t);break;case 19:var c=(e.flags&128)!==0;if(n=(s&t.childLanes)!==0,n||(dr(e,t,s,!1),n=(s&t.childLanes)!==0),c){if(n)return df(e,t,s);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),q(lt,lt.current),n)break;return null;case 22:return t.lanes=0,rf(e,t,s,t.pendingProps);case 24:Wi(t,ht,e.memoizedState.cache)}return Di(e,t,s)}function ff(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)ft=!0;else{if(!hc(e,s)&&(t.flags&128)===0)return ft=!1,Ag(e,t,s);ft=(e.flags&131072)!==0}else ft=!1,Le&&(t.flags&1048576)!==0&&Zh(t,en,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Bs(t.elementType),t.type=e,typeof e=="function")_l(e)?(n=Is(e,n),t.tag=1,t=lf(null,t,e,n,s)):(t.tag=0,t=rc(null,t,e,n,s));else{if(e!=null){var c=e.$$typeof;if(c===x){t.tag=11,t=ef(null,t,e,n,s);break e}else if(c===D){t.tag=14,t=tf(null,t,e,n,s);break e}}throw t=X(e)||e,Error(o(306,t,""))}}return t;case 0:return rc(e,t,t.type,t.pendingProps,s);case 1:return n=t.type,c=Is(n,t.pendingProps),lf(e,t,n,c,s);case 3:e:{if(B(t,t.stateNode.containerInfo),e===null)throw Error(o(387));n=t.pendingProps;var p=t.memoizedState;c=p.element,Ol(e,t),cn(t,n,null,s);var N=t.memoizedState;if(n=N.cache,Wi(t,ht,n),n!==p.cache&&El(t,[ht],s,!0),ln(),n=N.element,p.isDehydrated)if(p={element:n,isDehydrated:!1,cache:N.cache},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){t=cf(e,t,n,s);break e}else if(n!==c){c=Qt(Error(o(424)),t),tn(c),t=cf(e,t,n,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Xe=ri(e.firstChild),xt=t,Le=!0,Gi=null,ii=!0,s=sd(t,null,n,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Ns(),n===c){t=Di(e,t,s);break e}wt(e,t,n,s)}t=t.child}return t;case 26:return ja(e,t),e===null?(s=wm(t.type,null,t.pendingProps,null))?t.memoizedState=s:Le||(s=t.type,e=t.pendingProps,n=Ja(fe.current).createElement(s),n[St]=t,n[Ot]=e,Et(n,s,e),yt(n),t.stateNode=n):t.memoizedState=wm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ne(t),e===null&&Le&&(n=t.stateNode=Sm(t.type,t.pendingProps,fe.current),xt=t,ii=!0,c=Xe,cs(t.type)?(Zc=c,Xe=ri(n.firstChild)):Xe=c),wt(e,t,t.pendingProps.children,s),ja(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((c=n=Xe)&&(n=r0(n,t.type,t.pendingProps,ii),n!==null?(t.stateNode=n,xt=t,Xe=ri(n.firstChild),ii=!1,c=!0):c=!1),c||Yi(t)),ne(t),c=t.type,p=t.pendingProps,N=e!==null?e.memoizedProps:null,n=p.children,Uc(c,p)?n=null:N!==null&&Uc(c,N)&&(t.flags|=32),t.memoizedState!==null&&(c=Hl(e,t,yg,null,null,s),Rn._currentValue=c),ja(e,t),wt(e,t,n,s),t.child;case 6:return e===null&&Le&&((e=s=Xe)&&(s=n0(s,t.pendingProps,ii),s!==null?(t.stateNode=s,xt=t,Xe=null,e=!0):e=!1),e||Yi(t)),null;case 13:return uf(e,t,s);case 4:return B(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Hs(t,null,n,s):wt(e,t,n,s),t.child;case 11:return ef(e,t,t.type,t.pendingProps,s);case 7:return wt(e,t,t.pendingProps,s),t.child;case 8:return wt(e,t,t.pendingProps.children,s),t.child;case 12:return wt(e,t,t.pendingProps.children,s),t.child;case 10:return n=t.pendingProps,Wi(t,t.type,n.value),wt(e,t,n.children,s),t.child;case 9:return c=t.type._context,n=t.pendingProps.children,Ls(t),c=Ct(c),n=n(c),t.flags|=1,wt(e,t,n,s),t.child;case 14:return tf(e,t,t.type,t.pendingProps,s);case 15:return sf(e,t,t.type,t.pendingProps,s);case 19:return df(e,t,s);case 31:return Tg(e,t,s);case 22:return rf(e,t,s,t.pendingProps);case 24:return Ls(t),n=Ct(ht),e===null?(c=Al(),c===null&&(c=Ge,p=kl(),c.pooledCache=p,p.refCount++,p!==null&&(c.pooledCacheLanes|=s),c=p),t.memoizedState={parent:n,cache:c},Dl(t),Wi(t,ht,c)):((e.lanes&s)!==0&&(Ol(e,t),cn(t,null,null,s),ln()),c=e.memoizedState,p=t.memoizedState,c.parent!==n?(c={parent:n,cache:n},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Wi(t,ht,n)):(n=p.cache,Wi(t,ht,n),n!==c.cache&&El(t,[ht],s,!0))),wt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Oi(e){e.flags|=4}function dc(e,t,s,n,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(If())e.flags|=8192;else throw zs=ba,Rl}else e.flags&=-16777217}function mf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Rm(t))if(If())e.flags|=8192;else throw zs=ba,Rl}function za(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ku():536870912,e.lanes|=t,wr|=t)}function pn(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var n=null;s!==null;)s.alternate!==null&&(n=s),s=s.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Je(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,n=0;if(t)for(var c=e.child;c!==null;)s|=c.lanes|c.childLanes,n|=c.subtreeFlags&65011712,n|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)s|=c.lanes|c.childLanes,n|=c.subtreeFlags,n|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=n,e.childLanes=s,t}function Rg(e,t,s){var n=t.pendingProps;switch(bl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(t),null;case 1:return Je(t),null;case 3:return s=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ti(ht),ie(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(hr(t)?Oi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,xl())),Je(t),null;case 26:var c=t.type,p=t.memoizedState;return e===null?(Oi(t),p!==null?(Je(t),mf(t,p)):(Je(t),dc(t,c,null,n,s))):p?p!==e.memoizedState?(Oi(t),Je(t),mf(t,p)):(Je(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Oi(t),Je(t),dc(t,c,e,n,s)),null;case 27:if(me(t),s=fe.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Oi(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return Je(t),null}e=W.current,hr(t)?Kh(t):(e=Sm(c,n,s),t.stateNode=e,Oi(t))}return Je(t),null;case 5:if(me(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Oi(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return Je(t),null}if(p=W.current,hr(t))Kh(t);else{var N=Ja(fe.current);switch(p){case 1:p=N.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:p=N.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":p=N.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":p=N.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":p=N.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof n.is=="string"?N.createElement("select",{is:n.is}):N.createElement("select"),n.multiple?p.multiple=!0:n.size&&(p.size=n.size);break;default:p=typeof n.is=="string"?N.createElement(c,{is:n.is}):N.createElement(c)}}p[St]=t,p[Ot]=n;e:for(N=t.child;N!==null;){if(N.tag===5||N.tag===6)p.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===t)break e;for(;N.sibling===null;){if(N.return===null||N.return===t)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}t.stateNode=p;e:switch(Et(p,c,n),c){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Oi(t)}}return Je(t),dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Oi(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(o(166));if(e=fe.current,hr(t)){if(e=t.stateNode,s=t.memoizedProps,n=null,c=xt,c!==null)switch(c.tag){case 27:case 5:n=c.memoizedProps}e[St]=t,e=!!(e.nodeValue===s||n!==null&&n.suppressHydrationWarning===!0||um(e.nodeValue,s)),e||Yi(t,!0)}else e=Ja(e).createTextNode(n),e[St]=t,t.stateNode=e}return Je(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(n=hr(t),s!==null){if(e===null){if(!n)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[St]=t}else Ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),e=!1}else s=xl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(qt(t),t):(qt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Je(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=hr(t),n!==null&&n.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[St]=t}else Ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),c=!1}else c=xl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(qt(t),t):(qt(t),null)}return qt(t),(t.flags&128)!==0?(t.lanes=s,t):(s=n!==null,e=e!==null&&e.memoizedState!==null,s&&(n=t.child,c=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(c=n.alternate.memoizedState.cachePool.pool),p=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(p=n.memoizedState.cachePool.pool),p!==c&&(n.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),za(t,t.updateQueue),Je(t),null);case 4:return ie(),e===null&&Lc(t.stateNode.containerInfo),Je(t),null;case 10:return Ti(t.type),Je(t),null;case 19:if(H(lt),n=t.memoizedState,n===null)return Je(t),null;if(c=(t.flags&128)!==0,p=n.rendering,p===null)if(c)pn(n,!1);else{if(nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(p=wa(e),p!==null){for(t.flags|=128,pn(n,!1),e=p.updateQueue,t.updateQueue=e,za(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Ph(s,e),s=s.sibling;return q(lt,lt.current&1|2),Le&&Ei(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&vt()>$a&&(t.flags|=128,c=!0,pn(n,!1),t.lanes=4194304)}else{if(!c)if(e=wa(p),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,za(t,e),pn(n,!0),n.tail===null&&n.tailMode==="hidden"&&!p.alternate&&!Le)return Je(t),null}else 2*vt()-n.renderingStartTime>$a&&s!==536870912&&(t.flags|=128,c=!0,pn(n,!1),t.lanes=4194304);n.isBackwards?(p.sibling=t.child,t.child=p):(e=n.last,e!==null?e.sibling=p:t.child=p,n.last=p)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=vt(),e.sibling=null,s=lt.current,q(lt,c?s&1|2:s&1),Le&&Ei(t,n.treeForkCount),e):(Je(t),null);case 22:case 23:return qt(t),jl(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(s&536870912)!==0&&(t.flags&128)===0&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),s=t.updateQueue,s!==null&&za(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==s&&(t.flags|=2048),e!==null&&H(js),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ti(ht),Je(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Dg(e,t){switch(bl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ti(ht),ie(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(qt(t),t.alternate===null)throw Error(o(340));Ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(qt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(lt),null;case 4:return ie(),null;case 10:return Ti(t.type),null;case 22:case 23:return qt(t),jl(),e!==null&&H(js),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ti(ht),null;case 25:return null;default:return null}}function pf(e,t){switch(bl(t),t.tag){case 3:Ti(ht),ie();break;case 26:case 27:case 5:me(t);break;case 4:ie();break;case 31:t.memoizedState!==null&&qt(t);break;case 13:qt(t);break;case 19:H(lt);break;case 10:Ti(t.type);break;case 22:case 23:qt(t),jl(),e!==null&&H(js);break;case 24:Ti(ht)}}function _n(e,t){try{var s=t.updateQueue,n=s!==null?s.lastEffect:null;if(n!==null){var c=n.next;s=c;do{if((s.tag&e)===e){n=void 0;var p=s.create,N=s.inst;n=p(),N.destroy=n}s=s.next}while(s!==c)}}catch(z){$e(t,t.return,z)}}function is(e,t,s){try{var n=t.updateQueue,c=n!==null?n.lastEffect:null;if(c!==null){var p=c.next;n=p;do{if((n.tag&e)===e){var N=n.inst,z=N.destroy;if(z!==void 0){N.destroy=void 0,c=t;var G=s,se=z;try{se()}catch(ce){$e(c,G,ce)}}}n=n.next}while(n!==p)}}catch(ce){$e(t,t.return,ce)}}function _f(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{nd(t,s)}catch(n){$e(e,e.return,n)}}}function vf(e,t,s){s.props=Is(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(n){$e(e,t,n)}}function vn(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof s=="function"?e.refCleanup=s(n):s.current=n}}catch(c){$e(e,t,c)}}function vi(e,t){var s=e.ref,n=e.refCleanup;if(s!==null)if(typeof n=="function")try{n()}catch(c){$e(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(c){$e(e,t,c)}else s.current=null}function gf(e){var t=e.type,s=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&n.focus();break e;case"img":s.src?n.src=s.src:s.srcSet&&(n.srcset=s.srcSet)}}catch(c){$e(e,e.return,c)}}function fc(e,t,s){try{var n=e.stateNode;Jg(n,e.type,s,t),n[Ot]=t}catch(c){$e(e,e.return,c)}}function yf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&cs(e.type)||e.tag===4}function mc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&cs(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function pc(e,t,s){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=xi));else if(n!==4&&(n===27&&cs(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(pc(e,t,s),e=e.sibling;e!==null;)pc(e,t,s),e=e.sibling}function Ha(e,t,s){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(n!==4&&(n===27&&cs(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(Ha(e,t,s),e=e.sibling;e!==null;)Ha(e,t,s),e=e.sibling}function bf(e){var t=e.stateNode,s=e.memoizedProps;try{for(var n=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Et(t,n,s),t[St]=e,t[Ot]=s}catch(p){$e(e,e.return,p)}}var Ni=!1,mt=!1,_c=!1,Sf=typeof WeakSet=="function"?WeakSet:Set,bt=null;function Og(e,t){if(e=e.containerInfo,zc=no,e=Nh(e),cl(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var n=s.getSelection&&s.getSelection();if(n&&n.rangeCount!==0){s=n.anchorNode;var c=n.anchorOffset,p=n.focusNode;n=n.focusOffset;try{s.nodeType,p.nodeType}catch{s=null;break e}var N=0,z=-1,G=-1,se=0,ce=0,de=e,re=null;t:for(;;){for(var oe;de!==s||c!==0&&de.nodeType!==3||(z=N+c),de!==p||n!==0&&de.nodeType!==3||(G=N+n),de.nodeType===3&&(N+=de.nodeValue.length),(oe=de.firstChild)!==null;)re=de,de=oe;for(;;){if(de===e)break t;if(re===s&&++se===c&&(z=N),re===p&&++ce===n&&(G=N),(oe=de.nextSibling)!==null)break;de=re,re=de.parentNode}de=oe}s=z===-1||G===-1?null:{start:z,end:G}}else s=null}s=s||{start:0,end:0}}else s=null;for(Hc={focusedElem:e,selectionRange:s},no=!1,bt=t;bt!==null;)if(t=bt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,bt=e;else for(;bt!==null;){switch(t=bt,p=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)c=e[s],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&p!==null){e=void 0,s=t,c=p.memoizedProps,p=p.memoizedState,n=s.stateNode;try{var ve=Is(s.type,c);e=n.getSnapshotBeforeUpdate(ve,p),n.__reactInternalSnapshotBeforeUpdate=e}catch(xe){$e(s,s.return,xe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Pc(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Pc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,bt=e;break}bt=t.return}}function xf(e,t,s){var n=s.flags;switch(s.tag){case 0:case 11:case 15:Li(e,s),n&4&&_n(5,s);break;case 1:if(Li(e,s),n&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(N){$e(s,s.return,N)}else{var c=Is(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(N){$e(s,s.return,N)}}n&64&&_f(s),n&512&&vn(s,s.return);break;case 3:if(Li(e,s),n&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{nd(e,t)}catch(N){$e(s,s.return,N)}}break;case 27:t===null&&n&4&&bf(s);case 26:case 5:Li(e,s),t===null&&n&4&&gf(s),n&512&&vn(s,s.return);break;case 12:Li(e,s);break;case 31:Li(e,s),n&4&&Ef(e,s);break;case 13:Li(e,s),n&4&&kf(e,s),n&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=Ig.bind(null,s),a0(e,s))));break;case 22:if(n=s.memoizedState!==null||Ni,!n){t=t!==null&&t.memoizedState!==null||mt,c=Ni;var p=mt;Ni=n,(mt=t)&&!p?ji(e,s,(s.subtreeFlags&8772)!==0):Li(e,s),Ni=c,mt=p}break;case 30:break;default:Li(e,s)}}function Cf(e){var t=e.alternate;t!==null&&(e.alternate=null,Cf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ko(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Qe=null,Mt=!1;function Mi(e,t,s){for(s=s.child;s!==null;)wf(e,t,s),s=s.sibling}function wf(e,t,s){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(ws,s)}catch{}switch(s.tag){case 26:mt||vi(s,t),Mi(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:mt||vi(s,t);var n=Qe,c=Mt;cs(s.type)&&(Qe=s.stateNode,Mt=!1),Mi(e,t,s),kn(s.stateNode),Qe=n,Mt=c;break;case 5:mt||vi(s,t);case 6:if(n=Qe,c=Mt,Qe=null,Mi(e,t,s),Qe=n,Mt=c,Qe!==null)if(Mt)try{(Qe.nodeType===9?Qe.body:Qe.nodeName==="HTML"?Qe.ownerDocument.body:Qe).removeChild(s.stateNode)}catch(p){$e(s,t,p)}else try{Qe.removeChild(s.stateNode)}catch(p){$e(s,t,p)}break;case 18:Qe!==null&&(Mt?(e=Qe,_m(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Nr(e)):_m(Qe,s.stateNode));break;case 4:n=Qe,c=Mt,Qe=s.stateNode.containerInfo,Mt=!0,Mi(e,t,s),Qe=n,Mt=c;break;case 0:case 11:case 14:case 15:is(2,s,t),mt||is(4,s,t),Mi(e,t,s);break;case 1:mt||(vi(s,t),n=s.stateNode,typeof n.componentWillUnmount=="function"&&vf(s,t,n)),Mi(e,t,s);break;case 21:Mi(e,t,s);break;case 22:mt=(n=mt)||s.memoizedState!==null,Mi(e,t,s),mt=n;break;default:Mi(e,t,s)}}function Ef(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Nr(e)}catch(s){$e(t,t.return,s)}}}function kf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Nr(e)}catch(s){$e(t,t.return,s)}}function Ng(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Sf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Sf),t;default:throw Error(o(435,e.tag))}}function Ua(e,t){var s=Ng(e);t.forEach(function(n){if(!s.has(n)){s.add(n);var c=Pg.bind(null,e,n);n.then(c,c)}})}function Lt(e,t){var s=t.deletions;if(s!==null)for(var n=0;n<s.length;n++){var c=s[n],p=e,N=t,z=N;e:for(;z!==null;){switch(z.tag){case 27:if(cs(z.type)){Qe=z.stateNode,Mt=!1;break e}break;case 5:Qe=z.stateNode,Mt=!1;break e;case 3:case 4:Qe=z.stateNode.containerInfo,Mt=!0;break e}z=z.return}if(Qe===null)throw Error(o(160));wf(p,N,c),Qe=null,Mt=!1,p=c.alternate,p!==null&&(p.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tf(t,e),t=t.sibling}var ui=null;function Tf(e,t){var s=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Lt(t,e),jt(e),n&4&&(is(3,e,e.return),_n(3,e),is(5,e,e.return));break;case 1:Lt(t,e),jt(e),n&512&&(mt||s===null||vi(s,s.return)),n&64&&Ni&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?n:s.concat(n))));break;case 26:var c=ui;if(Lt(t,e),jt(e),n&512&&(mt||s===null||vi(s,s.return)),n&4){var p=s!==null?s.memoizedState:null;if(n=e.memoizedState,s===null)if(n===null)if(e.stateNode===null){e:{n=e.type,s=e.memoizedProps,c=c.ownerDocument||c;t:switch(n){case"title":p=c.getElementsByTagName("title")[0],(!p||p[Fr]||p[St]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=c.createElement(n),c.head.insertBefore(p,c.querySelector("head > title"))),Et(p,n,s),p[St]=e,yt(p),n=p;break e;case"link":var N=Tm("link","href",c).get(n+(s.href||""));if(N){for(var z=0;z<N.length;z++)if(p=N[z],p.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&p.getAttribute("rel")===(s.rel==null?null:s.rel)&&p.getAttribute("title")===(s.title==null?null:s.title)&&p.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){N.splice(z,1);break t}}p=c.createElement(n),Et(p,n,s),c.head.appendChild(p);break;case"meta":if(N=Tm("meta","content",c).get(n+(s.content||""))){for(z=0;z<N.length;z++)if(p=N[z],p.getAttribute("content")===(s.content==null?null:""+s.content)&&p.getAttribute("name")===(s.name==null?null:s.name)&&p.getAttribute("property")===(s.property==null?null:s.property)&&p.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&p.getAttribute("charset")===(s.charSet==null?null:s.charSet)){N.splice(z,1);break t}}p=c.createElement(n),Et(p,n,s),c.head.appendChild(p);break;default:throw Error(o(468,n))}p[St]=e,yt(p),n=p}e.stateNode=n}else Am(c,e.type,e.stateNode);else e.stateNode=km(c,n,e.memoizedProps);else p!==n?(p===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):p.count--,n===null?Am(c,e.type,e.stateNode):km(c,n,e.memoizedProps)):n===null&&e.stateNode!==null&&fc(e,e.memoizedProps,s.memoizedProps)}break;case 27:Lt(t,e),jt(e),n&512&&(mt||s===null||vi(s,s.return)),s!==null&&n&4&&fc(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Lt(t,e),jt(e),n&512&&(mt||s===null||vi(s,s.return)),e.flags&32){c=e.stateNode;try{tr(c,"")}catch(ve){$e(e,e.return,ve)}}n&4&&e.stateNode!=null&&(c=e.memoizedProps,fc(e,c,s!==null?s.memoizedProps:c)),n&1024&&(_c=!0);break;case 6:if(Lt(t,e),jt(e),n&4){if(e.stateNode===null)throw Error(o(162));n=e.memoizedProps,s=e.stateNode;try{s.nodeValue=n}catch(ve){$e(e,e.return,ve)}}break;case 3:if(to=null,c=ui,ui=Qa(t.containerInfo),Lt(t,e),ui=c,jt(e),n&4&&s!==null&&s.memoizedState.isDehydrated)try{Nr(t.containerInfo)}catch(ve){$e(e,e.return,ve)}_c&&(_c=!1,Af(e));break;case 4:n=ui,ui=Qa(e.stateNode.containerInfo),Lt(t,e),jt(e),ui=n;break;case 12:Lt(t,e),jt(e);break;case 31:Lt(t,e),jt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ua(e,n)));break;case 13:Lt(t,e),jt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Pa=vt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ua(e,n)));break;case 22:c=e.memoizedState!==null;var G=s!==null&&s.memoizedState!==null,se=Ni,ce=mt;if(Ni=se||c,mt=ce||G,Lt(t,e),mt=ce,Ni=se,jt(e),n&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(s===null||G||Ni||mt||Ps(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){G=s=t;try{if(p=G.stateNode,c)N=p.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{z=G.stateNode;var de=G.memoizedProps.style,re=de!=null&&de.hasOwnProperty("display")?de.display:null;z.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(ve){$e(G,G.return,ve)}}}else if(t.tag===6){if(s===null){G=t;try{G.stateNode.nodeValue=c?"":G.memoizedProps}catch(ve){$e(G,G.return,ve)}}}else if(t.tag===18){if(s===null){G=t;try{var oe=G.stateNode;c?vm(oe,!0):vm(G.stateNode,!1)}catch(ve){$e(G,G.return,ve)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(s=n.retryQueue,s!==null&&(n.retryQueue=null,Ua(e,s))));break;case 19:Lt(t,e),jt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ua(e,n)));break;case 30:break;case 21:break;default:Lt(t,e),jt(e)}}function jt(e){var t=e.flags;if(t&2){try{for(var s,n=e.return;n!==null;){if(yf(n)){s=n;break}n=n.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var c=s.stateNode,p=mc(e);Ha(e,p,c);break;case 5:var N=s.stateNode;s.flags&32&&(tr(N,""),s.flags&=-33);var z=mc(e);Ha(e,z,N);break;case 3:case 4:var G=s.stateNode.containerInfo,se=mc(e);pc(e,se,G);break;default:throw Error(o(161))}}catch(ce){$e(e,e.return,ce)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Af(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Af(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Li(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)xf(e,t.alternate,t),t=t.sibling}function Ps(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:is(4,t,t.return),Ps(t);break;case 1:vi(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&vf(t,t.return,s),Ps(t);break;case 27:kn(t.stateNode);case 26:case 5:vi(t,t.return),Ps(t);break;case 22:t.memoizedState===null&&Ps(t);break;case 30:Ps(t);break;default:Ps(t)}e=e.sibling}}function ji(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,c=e,p=t,N=p.flags;switch(p.tag){case 0:case 11:case 15:ji(c,p,s),_n(4,p);break;case 1:if(ji(c,p,s),n=p,c=n.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(se){$e(n,n.return,se)}if(n=p,c=n.updateQueue,c!==null){var z=n.stateNode;try{var G=c.shared.hiddenCallbacks;if(G!==null)for(c.shared.hiddenCallbacks=null,c=0;c<G.length;c++)rd(G[c],z)}catch(se){$e(n,n.return,se)}}s&&N&64&&_f(p),vn(p,p.return);break;case 27:bf(p);case 26:case 5:ji(c,p,s),s&&n===null&&N&4&&gf(p),vn(p,p.return);break;case 12:ji(c,p,s);break;case 31:ji(c,p,s),s&&N&4&&Ef(c,p);break;case 13:ji(c,p,s),s&&N&4&&kf(c,p);break;case 22:p.memoizedState===null&&ji(c,p,s),vn(p,p.return);break;case 30:break;default:ji(c,p,s)}t=t.sibling}}function vc(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&sn(s))}function gc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sn(e))}function hi(e,t,s,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Rf(e,t,s,n),t=t.sibling}function Rf(e,t,s,n){var c=t.flags;switch(t.tag){case 0:case 11:case 15:hi(e,t,s,n),c&2048&&_n(9,t);break;case 1:hi(e,t,s,n);break;case 3:hi(e,t,s,n),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sn(e)));break;case 12:if(c&2048){hi(e,t,s,n),e=t.stateNode;try{var p=t.memoizedProps,N=p.id,z=p.onPostCommit;typeof z=="function"&&z(N,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(G){$e(t,t.return,G)}}else hi(e,t,s,n);break;case 31:hi(e,t,s,n);break;case 13:hi(e,t,s,n);break;case 23:break;case 22:p=t.stateNode,N=t.alternate,t.memoizedState!==null?p._visibility&2?hi(e,t,s,n):gn(e,t):p._visibility&2?hi(e,t,s,n):(p._visibility|=2,Sr(e,t,s,n,(t.subtreeFlags&10256)!==0||!1)),c&2048&&vc(N,t);break;case 24:hi(e,t,s,n),c&2048&&gc(t.alternate,t);break;default:hi(e,t,s,n)}}function Sr(e,t,s,n,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var p=e,N=t,z=s,G=n,se=N.flags;switch(N.tag){case 0:case 11:case 15:Sr(p,N,z,G,c),_n(8,N);break;case 23:break;case 22:var ce=N.stateNode;N.memoizedState!==null?ce._visibility&2?Sr(p,N,z,G,c):gn(p,N):(ce._visibility|=2,Sr(p,N,z,G,c)),c&&se&2048&&vc(N.alternate,N);break;case 24:Sr(p,N,z,G,c),c&&se&2048&&gc(N.alternate,N);break;default:Sr(p,N,z,G,c)}t=t.sibling}}function gn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,n=t,c=n.flags;switch(n.tag){case 22:gn(s,n),c&2048&&vc(n.alternate,n);break;case 24:gn(s,n),c&2048&&gc(n.alternate,n);break;default:gn(s,n)}t=t.sibling}}var yn=8192;function xr(e,t,s){if(e.subtreeFlags&yn)for(e=e.child;e!==null;)Df(e,t,s),e=e.sibling}function Df(e,t,s){switch(e.tag){case 26:xr(e,t,s),e.flags&yn&&e.memoizedState!==null&&g0(s,ui,e.memoizedState,e.memoizedProps);break;case 5:xr(e,t,s);break;case 3:case 4:var n=ui;ui=Qa(e.stateNode.containerInfo),xr(e,t,s),ui=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=yn,yn=16777216,xr(e,t,s),yn=n):xr(e,t,s));break;default:xr(e,t,s)}}function Of(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function bn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var n=t[s];bt=n,Mf(n,e)}Of(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nf(e),e=e.sibling}function Nf(e){switch(e.tag){case 0:case 11:case 15:bn(e),e.flags&2048&&is(9,e,e.return);break;case 3:bn(e);break;case 12:bn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ia(e)):bn(e);break;default:bn(e)}}function Ia(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var n=t[s];bt=n,Mf(n,e)}Of(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:is(8,t,t.return),Ia(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,Ia(t));break;default:Ia(t)}e=e.sibling}}function Mf(e,t){for(;bt!==null;){var s=bt;switch(s.tag){case 0:case 11:case 15:is(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var n=s.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:sn(s.memoizedState.cache)}if(n=s.child,n!==null)n.return=s,bt=n;else e:for(s=e;bt!==null;){n=bt;var c=n.sibling,p=n.return;if(Cf(n),n===s){bt=null;break e}if(c!==null){c.return=p,bt=c;break e}bt=p}}}var Mg={getCacheForType:function(e){var t=Ct(ht),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Ct(ht).controller.signal}},Lg=typeof WeakMap=="function"?WeakMap:Map,Ie=0,Ge=null,Re=null,Ne=0,Pe=0,Kt=null,ss=!1,Cr=!1,yc=!1,Bi=0,nt=0,rs=0,$s=0,bc=0,Vt=0,wr=0,Sn=null,Bt=null,Sc=!1,Pa=0,Lf=0,$a=1/0,Fa=null,ns=null,gt=0,as=null,Er=null,zi=0,xc=0,Cc=null,jf=null,xn=0,wc=null;function Gt(){return(Ie&2)!==0&&Ne!==0?Ne&-Ne:V.T!==null?Dc():Wu()}function Bf(){if(Vt===0)if((Ne&536870912)===0||Le){var e=Xn;Xn<<=1,(Xn&3932160)===0&&(Xn=262144),Vt=e}else Vt=536870912;return e=Zt.current,e!==null&&(e.flags|=32),Vt}function zt(e,t,s){(e===Ge&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)&&(kr(e,0),os(e,Ne,Vt,!1)),$r(e,s),((Ie&2)===0||e!==Ge)&&(e===Ge&&((Ie&2)===0&&($s|=s),nt===4&&os(e,Ne,Vt,!1)),gi(e))}function zf(e,t,s){if((Ie&6)!==0)throw Error(o(327));var n=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Pr(e,t),c=n?zg(e,t):kc(e,t,!0),p=n;do{if(c===0){Cr&&!n&&os(e,t,0,!1);break}else{if(s=e.current.alternate,p&&!jg(s)){c=kc(e,t,!1),p=!1;continue}if(c===2){if(p=t,e.errorRecoveryDisabledLanes&p)var N=0;else N=e.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){t=N;e:{var z=e;c=Sn;var G=z.current.memoizedState.isDehydrated;if(G&&(kr(z,N).flags|=256),N=kc(z,N,!1),N!==2){if(yc&&!G){z.errorRecoveryDisabledLanes|=p,$s|=p,c=4;break e}p=Bt,Bt=c,p!==null&&(Bt===null?Bt=p:Bt.push.apply(Bt,p))}c=N}if(p=!1,c!==2)continue}}if(c===1){kr(e,0),os(e,t,0,!0);break}e:{switch(n=e,p=c,p){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:os(n,t,Vt,!ss);break e;case 2:Bt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=Pa+300-vt(),10<c)){if(os(n,t,Vt,!ss),Qn(n,0,!0)!==0)break e;zi=t,n.timeoutHandle=mm(Hf.bind(null,n,s,Bt,Fa,Sc,t,Vt,$s,wr,ss,p,"Throttled",-0,0),c);break e}Hf(n,s,Bt,Fa,Sc,t,Vt,$s,wr,ss,p,null,-0,0)}}break}while(!0);gi(e)}function Hf(e,t,s,n,c,p,N,z,G,se,ce,de,re,oe){if(e.timeoutHandle=-1,de=t.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xi},Df(t,p,de);var ve=(p&62914560)===p?Pa-vt():(p&4194048)===p?Lf-vt():0;if(ve=y0(de,ve),ve!==null){zi=p,e.cancelPendingCommit=ve(Kf.bind(null,e,t,p,s,n,c,N,z,G,ce,de,null,re,oe)),os(e,p,N,!se);return}}Kf(e,t,p,s,n,c,N,z,G)}function jg(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var n=0;n<s.length;n++){var c=s[n],p=c.getSnapshot;c=c.value;try{if(!$t(p(),c))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function os(e,t,s,n){t&=~bc,t&=~$s,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var c=t;0<c;){var p=31-Pt(c),N=1<<p;n[p]=-1,c&=~N}s!==0&&Vu(e,s,t)}function Za(){return(Ie&6)===0?(Cn(0),!1):!0}function Ec(){if(Re!==null){if(Pe===0)var e=Re.return;else e=Re,ki=Ms=null,Pl(e),_r=null,nn=0,e=Re;for(;e!==null;)pf(e.alternate,e),e=e.return;Re=null}}function kr(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,t0(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),zi=0,Ec(),Ge=e,Re=s=wi(e.current,null),Ne=t,Pe=0,Kt=null,ss=!1,Cr=Pr(e,t),yc=!1,wr=Vt=bc=$s=rs=nt=0,Bt=Sn=null,Sc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var c=31-Pt(n),p=1<<c;t|=e[c],n&=~p}return Bi=t,ha(),s}function Uf(e,t){ke=null,V.H=fn,t===pr||t===ya?(t=ed(),Pe=3):t===Rl?(t=ed(),Pe=4):Pe=t===sc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Kt=t,Re===null&&(nt=1,Ma(e,Qt(t,e.current)))}function If(){var e=Zt.current;return e===null?!0:(Ne&4194048)===Ne?si===null:(Ne&62914560)===Ne||(Ne&536870912)!==0?e===si:!1}function Pf(){var e=V.H;return V.H=fn,e===null?fn:e}function $f(){var e=V.A;return V.A=Mg,e}function qa(){nt=4,ss||(Ne&4194048)!==Ne&&Zt.current!==null||(Cr=!0),(rs&134217727)===0&&($s&134217727)===0||Ge===null||os(Ge,Ne,Vt,!1)}function kc(e,t,s){var n=Ie;Ie|=2;var c=Pf(),p=$f();(Ge!==e||Ne!==t)&&(Fa=null,kr(e,t)),t=!1;var N=nt;e:do try{if(Pe!==0&&Re!==null){var z=Re,G=Kt;switch(Pe){case 8:Ec(),N=6;break e;case 3:case 2:case 9:case 6:Zt.current===null&&(t=!0);var se=Pe;if(Pe=0,Kt=null,Tr(e,z,G,se),s&&Cr){N=0;break e}break;default:se=Pe,Pe=0,Kt=null,Tr(e,z,G,se)}}Bg(),N=nt;break}catch(ce){Uf(e,ce)}while(!0);return t&&e.shellSuspendCounter++,ki=Ms=null,Ie=n,V.H=c,V.A=p,Re===null&&(Ge=null,Ne=0,ha()),N}function Bg(){for(;Re!==null;)Ff(Re)}function zg(e,t){var s=Ie;Ie|=2;var n=Pf(),c=$f();Ge!==e||Ne!==t?(Fa=null,$a=vt()+500,kr(e,t)):Cr=Pr(e,t);e:do try{if(Pe!==0&&Re!==null){t=Re;var p=Kt;t:switch(Pe){case 1:Pe=0,Kt=null,Tr(e,t,p,1);break;case 2:case 9:if(Jh(p)){Pe=0,Kt=null,Zf(t);break}t=function(){Pe!==2&&Pe!==9||Ge!==e||(Pe=7),gi(e)},p.then(t,t);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:Jh(p)?(Pe=0,Kt=null,Zf(t)):(Pe=0,Kt=null,Tr(e,t,p,7));break;case 5:var N=null;switch(Re.tag){case 26:N=Re.memoizedState;case 5:case 27:var z=Re;if(N?Rm(N):z.stateNode.complete){Pe=0,Kt=null;var G=z.sibling;if(G!==null)Re=G;else{var se=z.return;se!==null?(Re=se,Ka(se)):Re=null}break t}}Pe=0,Kt=null,Tr(e,t,p,5);break;case 6:Pe=0,Kt=null,Tr(e,t,p,6);break;case 8:Ec(),nt=6;break e;default:throw Error(o(462))}}Hg();break}catch(ce){Uf(e,ce)}while(!0);return ki=Ms=null,V.H=n,V.A=c,Ie=s,Re!==null?0:(Ge=null,Ne=0,ha(),nt)}function Hg(){for(;Re!==null&&!Ks();)Ff(Re)}function Ff(e){var t=ff(e.alternate,e,Bi);e.memoizedProps=e.pendingProps,t===null?Ka(e):Re=t}function Zf(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=of(s,t,t.pendingProps,t.type,void 0,Ne);break;case 11:t=of(s,t,t.pendingProps,t.type.render,t.ref,Ne);break;case 5:Pl(t);default:pf(s,t),t=Re=Ph(t,Bi),t=ff(s,t,Bi)}e.memoizedProps=e.pendingProps,t===null?Ka(e):Re=t}function Tr(e,t,s,n){ki=Ms=null,Pl(t),_r=null,nn=0;var c=t.return;try{if(kg(e,c,t,s,Ne)){nt=1,Ma(e,Qt(s,e.current)),Re=null;return}}catch(p){if(c!==null)throw Re=c,p;nt=1,Ma(e,Qt(s,e.current)),Re=null;return}t.flags&32768?(Le||n===1?e=!0:Cr||(Ne&536870912)!==0?e=!1:(ss=e=!0,(n===2||n===9||n===3||n===6)&&(n=Zt.current,n!==null&&n.tag===13&&(n.flags|=16384))),qf(t,e)):Ka(t)}function Ka(e){var t=e;do{if((t.flags&32768)!==0){qf(t,ss);return}e=t.return;var s=Rg(t.alternate,t,Bi);if(s!==null){Re=s;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);nt===0&&(nt=5)}function qf(e,t){do{var s=Dg(e.alternate,e);if(s!==null){s.flags&=32767,Re=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Re=e;return}Re=e=s}while(e!==null);nt=6,Re=null}function Kf(e,t,s,n,c,p,N,z,G){e.cancelPendingCommit=null;do Va();while(gt!==0);if((Ie&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(p=t.lanes|t.childLanes,p|=ml,vv(e,s,p,N,z,G),e===Ge&&(Re=Ge=null,Ne=0),Er=t,as=e,zi=s,xc=p,Cc=c,jf=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,$g(Ut,function(){return Xf(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=V.T,V.T=null,c=Q.p,Q.p=2,N=Ie,Ie|=4;try{Og(e,t,s)}finally{Ie=N,Q.p=c,V.T=n}}gt=1,Vf(),Gf(),Yf()}}function Vf(){if(gt===1){gt=0;var e=as,t=Er,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=V.T,V.T=null;var n=Q.p;Q.p=2;var c=Ie;Ie|=4;try{Tf(t,e);var p=Hc,N=Nh(e.containerInfo),z=p.focusedElem,G=p.selectionRange;if(N!==z&&z&&z.ownerDocument&&Oh(z.ownerDocument.documentElement,z)){if(G!==null&&cl(z)){var se=G.start,ce=G.end;if(ce===void 0&&(ce=se),"selectionStart"in z)z.selectionStart=se,z.selectionEnd=Math.min(ce,z.value.length);else{var de=z.ownerDocument||document,re=de&&de.defaultView||window;if(re.getSelection){var oe=re.getSelection(),ve=z.textContent.length,xe=Math.min(G.start,ve),Ve=G.end===void 0?xe:Math.min(G.end,ve);!oe.extend&&xe>Ve&&(N=Ve,Ve=xe,xe=N);var J=Dh(z,xe),Y=Dh(z,Ve);if(J&&Y&&(oe.rangeCount!==1||oe.anchorNode!==J.node||oe.anchorOffset!==J.offset||oe.focusNode!==Y.node||oe.focusOffset!==Y.offset)){var te=de.createRange();te.setStart(J.node,J.offset),oe.removeAllRanges(),xe>Ve?(oe.addRange(te),oe.extend(Y.node,Y.offset)):(te.setEnd(Y.node,Y.offset),oe.addRange(te))}}}}for(de=[],oe=z;oe=oe.parentNode;)oe.nodeType===1&&de.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<de.length;z++){var ue=de[z];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}no=!!zc,Hc=zc=null}finally{Ie=c,Q.p=n,V.T=s}}e.current=t,gt=2}}function Gf(){if(gt===2){gt=0;var e=as,t=Er,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=V.T,V.T=null;var n=Q.p;Q.p=2;var c=Ie;Ie|=4;try{xf(e,t.alternate,t)}finally{Ie=c,Q.p=n,V.T=s}}gt=3}}function Yf(){if(gt===4||gt===3){gt=0,Dt();var e=as,t=Er,s=zi,n=jf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?gt=5:(gt=0,Er=as=null,Wf(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(ns=null),Zo(s),t=t.stateNode,It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(ws,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=V.T,c=Q.p,Q.p=2,V.T=null;try{for(var p=e.onRecoverableError,N=0;N<n.length;N++){var z=n[N];p(z.value,{componentStack:z.stack})}}finally{V.T=t,Q.p=c}}(zi&3)!==0&&Va(),gi(e),c=e.pendingLanes,(s&261930)!==0&&(c&42)!==0?e===wc?xn++:(xn=0,wc=e):xn=0,Cn(0)}}function Wf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sn(t)))}function Va(){return Vf(),Gf(),Yf(),Xf()}function Xf(){if(gt!==5)return!1;var e=as,t=xc;xc=0;var s=Zo(zi),n=V.T,c=Q.p;try{Q.p=32>s?32:s,V.T=null,s=Cc,Cc=null;var p=as,N=zi;if(gt=0,Er=as=null,zi=0,(Ie&6)!==0)throw Error(o(331));var z=Ie;if(Ie|=4,Nf(p.current),Rf(p,p.current,N,s),Ie=z,Cn(0,!1),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(ws,p)}catch{}return!0}finally{Q.p=c,V.T=n,Wf(e,t)}}function Jf(e,t,s){t=Qt(s,t),t=ic(e.stateNode,t,2),e=Qi(e,t,2),e!==null&&($r(e,2),gi(e))}function $e(e,t,s){if(e.tag===3)Jf(e,e,s);else for(;t!==null;){if(t.tag===3){Jf(t,e,s);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(ns===null||!ns.has(n))){e=Qt(s,e),s=Jd(2),n=Qi(t,s,2),n!==null&&(Qd(s,n,t,e),$r(n,2),gi(n));break}}t=t.return}}function Tc(e,t,s){var n=e.pingCache;if(n===null){n=e.pingCache=new Lg;var c=new Set;n.set(t,c)}else c=n.get(t),c===void 0&&(c=new Set,n.set(t,c));c.has(s)||(yc=!0,c.add(s),e=Ug.bind(null,e,t,s),t.then(e,e))}function Ug(e,t,s){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Ge===e&&(Ne&s)===s&&(nt===4||nt===3&&(Ne&62914560)===Ne&&300>vt()-Pa?(Ie&2)===0&&kr(e,0):bc|=s,wr===Ne&&(wr=0)),gi(e)}function Qf(e,t){t===0&&(t=Ku()),e=Ds(e,t),e!==null&&($r(e,t),gi(e))}function Ig(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Qf(e,s)}function Pg(e,t){var s=0;switch(e.tag){case 31:case 13:var n=e.stateNode,c=e.memoizedState;c!==null&&(s=c.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(o(314))}n!==null&&n.delete(t),Qf(e,s)}function $g(e,t){return mi(e,t)}var Ga=null,Ar=null,Ac=!1,Ya=!1,Rc=!1,ls=0;function gi(e){e!==Ar&&e.next===null&&(Ar===null?Ga=Ar=e:Ar=Ar.next=e),Ya=!0,Ac||(Ac=!0,Zg())}function Cn(e,t){if(!Rc&&Ya){Rc=!0;do for(var s=!1,n=Ga;n!==null;){if(e!==0){var c=n.pendingLanes;if(c===0)var p=0;else{var N=n.suspendedLanes,z=n.pingedLanes;p=(1<<31-Pt(42|e)+1)-1,p&=c&~(N&~z),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(s=!0,sm(n,p))}else p=Ne,p=Qn(n,n===Ge?p:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(p&3)===0||Pr(n,p)||(s=!0,sm(n,p));n=n.next}while(s);Rc=!1}}function Fg(){em()}function em(){Ya=Ac=!1;var e=0;ls!==0&&e0()&&(e=ls);for(var t=vt(),s=null,n=Ga;n!==null;){var c=n.next,p=tm(n,t);p===0?(n.next=null,s===null?Ga=c:s.next=c,c===null&&(Ar=s)):(s=n,(e!==0||(p&3)!==0)&&(Ya=!0)),n=c}gt!==0&>!==5||Cn(e),ls!==0&&(ls=0)}function tm(e,t){for(var s=e.suspendedLanes,n=e.pingedLanes,c=e.expirationTimes,p=e.pendingLanes&-62914561;0<p;){var N=31-Pt(p),z=1<<N,G=c[N];G===-1?((z&s)===0||(z&n)!==0)&&(c[N]=_v(z,t)):G<=t&&(e.expiredLanes|=z),p&=~z}if(t=Ge,s=Ne,s=Qn(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,s===0||e===t&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&xs(n),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Pr(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(n!==null&&xs(n),Zo(s)){case 2:case 8:s=Vs;break;case 32:s=Ut;break;case 268435456:s=li;break;default:s=Ut}return n=im.bind(null,e),s=mi(s,n),e.callbackPriority=t,e.callbackNode=s,t}return n!==null&&n!==null&&xs(n),e.callbackPriority=2,e.callbackNode=null,2}function im(e,t){if(gt!==0&>!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Va()&&e.callbackNode!==s)return null;var n=Ne;return n=Qn(e,e===Ge?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(zf(e,n,t),tm(e,vt()),e.callbackNode!=null&&e.callbackNode===s?im.bind(null,e):null)}function sm(e,t){if(Va())return null;zf(e,t,!0)}function Zg(){i0(function(){(Ie&6)!==0?mi(Fi,Fg):em()})}function Dc(){if(ls===0){var e=fr;e===0&&(e=Wn,Wn<<=1,(Wn&261888)===0&&(Wn=256)),ls=e}return ls}function rm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:sa(""+e)}function nm(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function qg(e,t,s,n,c){if(t==="submit"&&s&&s.stateNode===c){var p=rm((c[Ot]||null).action),N=n.submitter;N&&(t=(t=N[Ot]||null)?rm(t.formAction):N.getAttribute("formAction"),t!==null&&(p=t,N=null));var z=new oa("action","action",null,n,c);e.push({event:z,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(ls!==0){var G=N?nm(c,N):new FormData(c);Wl(s,{pending:!0,data:G,method:c.method,action:p},null,G)}}else typeof p=="function"&&(z.preventDefault(),G=N?nm(c,N):new FormData(c),Wl(s,{pending:!0,data:G,method:c.method,action:p},p,G))},currentTarget:c}]})}}for(var Oc=0;Oc<fl.length;Oc++){var Nc=fl[Oc],Kg=Nc.toLowerCase(),Vg=Nc[0].toUpperCase()+Nc.slice(1);ci(Kg,"on"+Vg)}ci(jh,"onAnimationEnd"),ci(Bh,"onAnimationIteration"),ci(zh,"onAnimationStart"),ci("dblclick","onDoubleClick"),ci("focusin","onFocus"),ci("focusout","onBlur"),ci(cg,"onTransitionRun"),ci(ug,"onTransitionStart"),ci(hg,"onTransitionCancel"),ci(Hh,"onTransitionEnd"),Qs("onMouseEnter",["mouseout","mouseover"]),Qs("onMouseLeave",["mouseout","mouseover"]),Qs("onPointerEnter",["pointerout","pointerover"]),Qs("onPointerLeave",["pointerout","pointerover"]),ks("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ks("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ks("onBeforeInput",["compositionend","keypress","textInput","paste"]),ks("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ks("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(" "),Gg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wn));function am(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var n=e[s],c=n.event;n=n.listeners;e:{var p=void 0;if(t)for(var N=n.length-1;0<=N;N--){var z=n[N],G=z.instance,se=z.currentTarget;if(z=z.listener,G!==p&&c.isPropagationStopped())break e;p=z,c.currentTarget=se;try{p(c)}catch(ce){ua(ce)}c.currentTarget=null,p=G}else for(N=0;N<n.length;N++){if(z=n[N],G=z.instance,se=z.currentTarget,z=z.listener,G!==p&&c.isPropagationStopped())break e;p=z,c.currentTarget=se;try{p(c)}catch(ce){ua(ce)}c.currentTarget=null,p=G}}}}function De(e,t){var s=t[qo];s===void 0&&(s=t[qo]=new Set);var n=e+"__bubble";s.has(n)||(om(t,e,2,!1),s.add(n))}function Mc(e,t,s){var n=0;t&&(n|=4),om(s,e,n,t)}var Wa="_reactListening"+Math.random().toString(36).slice(2);function Lc(e){if(!e[Wa]){e[Wa]=!0,Qu.forEach(function(s){s!=="selectionchange"&&(Gg.has(s)||Mc(s,!1,e),Mc(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wa]||(t[Wa]=!0,Mc("selectionchange",!1,t))}}function om(e,t,s,n){switch(Bm(t)){case 2:var c=x0;break;case 8:c=C0;break;default:c=Yc}s=c.bind(null,t,s,e),c=void 0,!el||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),n?c!==void 0?e.addEventListener(t,s,{capture:!0,passive:c}):e.addEventListener(t,s,!0):c!==void 0?e.addEventListener(t,s,{passive:c}):e.addEventListener(t,s,!1)}function jc(e,t,s,n,c){var p=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var N=n.tag;if(N===3||N===4){var z=n.stateNode.containerInfo;if(z===c)break;if(N===4)for(N=n.return;N!==null;){var G=N.tag;if((G===3||G===4)&&N.stateNode.containerInfo===c)return;N=N.return}for(;z!==null;){if(N=Ws(z),N===null)return;if(G=N.tag,G===5||G===6||G===26||G===27){n=p=N;continue e}z=z.parentNode}}n=n.return}hh(function(){var se=p,ce=Jo(s),de=[];e:{var re=Uh.get(e);if(re!==void 0){var oe=oa,ve=e;switch(e){case"keypress":if(na(s)===0)break e;case"keydown":case"keyup":oe=Pv;break;case"focusin":ve="focus",oe=rl;break;case"focusout":ve="blur",oe=rl;break;case"beforeblur":case"afterblur":oe=rl;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=mh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=Rv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=Zv;break;case jh:case Bh:case zh:oe=Nv;break;case Hh:oe=Kv;break;case"scroll":case"scrollend":oe=Tv;break;case"wheel":oe=Gv;break;case"copy":case"cut":case"paste":oe=Lv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=_h;break;case"toggle":case"beforetoggle":oe=Wv}var xe=(t&4)!==0,Ve=!xe&&(e==="scroll"||e==="scrollend"),J=xe?re!==null?re+"Capture":null:re;xe=[];for(var Y=se,te;Y!==null;){var ue=Y;if(te=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||te===null||J===null||(ue=qr(Y,J),ue!=null&&xe.push(En(Y,ue,te))),Ve)break;Y=Y.return}0<xe.length&&(re=new oe(re,ve,null,s,ce),de.push({event:re,listeners:xe}))}}if((t&7)===0){e:{if(re=e==="mouseover"||e==="pointerover",oe=e==="mouseout"||e==="pointerout",re&&s!==Xo&&(ve=s.relatedTarget||s.fromElement)&&(Ws(ve)||ve[Ys]))break e;if((oe||re)&&(re=ce.window===ce?ce:(re=ce.ownerDocument)?re.defaultView||re.parentWindow:window,oe?(ve=s.relatedTarget||s.toElement,oe=se,ve=ve?Ws(ve):null,ve!==null&&(Ve=w(ve),xe=ve.tag,ve!==Ve||xe!==5&&xe!==27&&xe!==6)&&(ve=null)):(oe=null,ve=se),oe!==ve)){if(xe=mh,ue="onMouseLeave",J="onMouseEnter",Y="mouse",(e==="pointerout"||e==="pointerover")&&(xe=_h,ue="onPointerLeave",J="onPointerEnter",Y="pointer"),Ve=oe==null?re:Zr(oe),te=ve==null?re:Zr(ve),re=new xe(ue,Y+"leave",oe,s,ce),re.target=Ve,re.relatedTarget=te,ue=null,Ws(ce)===se&&(xe=new xe(J,Y+"enter",ve,s,ce),xe.target=te,xe.relatedTarget=Ve,ue=xe),Ve=ue,oe&&ve)t:{for(xe=Yg,J=oe,Y=ve,te=0,ue=J;ue;ue=xe(ue))te++;ue=0;for(var Se=Y;Se;Se=xe(Se))ue++;for(;0<te-ue;)J=xe(J),te--;for(;0<ue-te;)Y=xe(Y),ue--;for(;te--;){if(J===Y||Y!==null&&J===Y.alternate){xe=J;break t}J=xe(J),Y=xe(Y)}xe=null}else xe=null;oe!==null&&lm(de,re,oe,xe,!1),ve!==null&&Ve!==null&&lm(de,Ve,ve,xe,!0)}}e:{if(re=se?Zr(se):window,oe=re.nodeName&&re.nodeName.toLowerCase(),oe==="select"||oe==="input"&&re.type==="file")var ze=wh;else if(xh(re))if(Eh)ze=ag;else{ze=rg;var ge=sg}else oe=re.nodeName,!oe||oe.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?se&&Wo(se.elementType)&&(ze=wh):ze=ng;if(ze&&(ze=ze(e,se))){Ch(de,ze,s,ce);break e}ge&&ge(e,re,se),e==="focusout"&&se&&re.type==="number"&&se.memoizedProps.value!=null&&Yo(re,"number",re.value)}switch(ge=se?Zr(se):window,e){case"focusin":(xh(ge)||ge.contentEditable==="true")&&(nr=ge,ul=se,Qr=null);break;case"focusout":Qr=ul=nr=null;break;case"mousedown":hl=!0;break;case"contextmenu":case"mouseup":case"dragend":hl=!1,Mh(de,s,ce);break;case"selectionchange":if(lg)break;case"keydown":case"keyup":Mh(de,s,ce)}var Te;if(al)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else rr?bh(e,s)&&(Me="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Me="onCompositionStart");Me&&(vh&&s.locale!=="ko"&&(rr||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&rr&&(Te=dh()):(Ki=ce,tl="value"in Ki?Ki.value:Ki.textContent,rr=!0)),ge=Xa(se,Me),0<ge.length&&(Me=new ph(Me,e,null,s,ce),de.push({event:Me,listeners:ge}),Te?Me.data=Te:(Te=Sh(s),Te!==null&&(Me.data=Te)))),(Te=Jv?Qv(e,s):eg(e,s))&&(Me=Xa(se,"onBeforeInput"),0<Me.length&&(ge=new ph("onBeforeInput","beforeinput",null,s,ce),de.push({event:ge,listeners:Me}),ge.data=Te)),qg(de,e,se,s,ce)}am(de,t)})}function En(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Xa(e,t){for(var s=t+"Capture",n=[];e!==null;){var c=e,p=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||p===null||(c=qr(e,s),c!=null&&n.unshift(En(e,c,p)),c=qr(e,t),c!=null&&n.push(En(e,c,p))),e.tag===3)return n;e=e.return}return[]}function Yg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function lm(e,t,s,n,c){for(var p=t._reactName,N=[];s!==null&&s!==n;){var z=s,G=z.alternate,se=z.stateNode;if(z=z.tag,G!==null&&G===n)break;z!==5&&z!==26&&z!==27||se===null||(G=se,c?(se=qr(s,p),se!=null&&N.unshift(En(s,se,G))):c||(se=qr(s,p),se!=null&&N.push(En(s,se,G)))),s=s.return}N.length!==0&&e.push({event:t,listeners:N})}var Wg=/\r\n?/g,Xg=/\u0000|\uFFFD/g;function cm(e){return(typeof e=="string"?e:""+e).replace(Wg,`
|
|
48
|
+
`+n.stack}}var Rt=Object.prototype.hasOwnProperty,mi=i.unstable_scheduleCallback,xs=i.unstable_cancelCallback,Ks=i.unstable_shouldYield,Dt=i.unstable_requestPaint,vt=i.unstable_now,Yt=i.unstable_getCurrentPriorityLevel,Fi=i.unstable_ImmediatePriority,Vs=i.unstable_UserBlockingPriority,Ut=i.unstable_NormalPriority,Gs=i.unstable_LowPriority,li=i.unstable_IdlePriority,Cs=i.log,We=i.unstable_setDisableYieldValue,ws=null,It=null;function Zi(e){if(typeof Cs=="function"&&We(e),It&&typeof It.setStrictMode=="function")try{It.setStrictMode(ws,e)}catch{}}var Pt=Math.clz32?Math.clz32:pv,fv=Math.log,mv=Math.LN2;function pv(e){return e>>>=0,e===0?32:31-(fv(e)/mv|0)|0}var Wn=256,Xn=262144,Jn=4194304;function Es(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Qn(e,t,s){var n=e.pendingLanes;if(n===0)return 0;var c=0,p=e.suspendedLanes,N=e.pingedLanes;e=e.warmLanes;var z=n&134217727;return z!==0?(n=z&~p,n!==0?c=Es(n):(N&=z,N!==0?c=Es(N):s||(s=z&~e,s!==0&&(c=Es(s))))):(z=n&~p,z!==0?c=Es(z):N!==0?c=Es(N):s||(s=n&~e,s!==0&&(c=Es(s)))),c===0?0:t!==0&&t!==c&&(t&p)===0&&(p=c&-c,s=t&-t,p>=s||p===32&&(s&4194048)!==0)?t:c}function Pr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _v(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ku(){var e=Jn;return Jn<<=1,(Jn&62914560)===0&&(Jn=4194304),e}function $o(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function $r(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function vv(e,t,s,n,c,p){var N=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var z=e.entanglements,G=e.expirationTimes,se=e.hiddenUpdates;for(s=N&~s;0<s;){var ce=31-Pt(s),de=1<<ce;z[ce]=0,G[ce]=-1;var re=se[ce];if(re!==null)for(se[ce]=null,ce=0;ce<re.length;ce++){var oe=re[ce];oe!==null&&(oe.lane&=-536870913)}s&=~de}n!==0&&Vu(e,n,0),p!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=p&~(N&~t))}function Vu(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Pt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|s&261930}function Gu(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var n=31-Pt(s),c=1<<n;c&t|e[n]&t&&(e[n]|=t),s&=~c}}function Yu(e,t){var s=t&-t;return s=(s&42)!==0?1:Fo(s),(s&(e.suspendedLanes|t))!==0?0:s}function Fo(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Zo(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Wu(){var e=Q.p;return e!==0?e:(e=window.event,e===void 0?32:Bm(e.type))}function Xu(e,t){var s=Q.p;try{return Q.p=e,t()}finally{Q.p=s}}var qi=Math.random().toString(36).slice(2),St="__reactFiber$"+qi,Ot="__reactProps$"+qi,Ys="__reactContainer$"+qi,qo="__reactEvents$"+qi,gv="__reactListeners$"+qi,yv="__reactHandles$"+qi,Ju="__reactResources$"+qi,Fr="__reactMarker$"+qi;function Ko(e){delete e[St],delete e[Ot],delete e[qo],delete e[gv],delete e[yv]}function Ws(e){var t=e[St];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Ys]||s[St]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=bm(e);e!==null;){if(s=e[St])return s;e=bm(e)}return t}e=s,s=e.parentNode}return null}function Xs(e){if(e=e[St]||e[Ys]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Zr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Js(e){var t=e[Ju];return t||(t=e[Ju]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[Fr]=!0}var Qu=new Set,eh={};function ks(e,t){Qs(e,t),Qs(e+"Capture",t)}function Qs(e,t){for(eh[e]=t,e=0;e<t.length;e++)Qu.add(t[e])}var bv=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]*$"),th={},ih={};function Sv(e){return Rt.call(ih,e)?!0:Rt.call(th,e)?!1:bv.test(e)?ih[e]=!0:(th[e]=!0,!1)}function ea(e,t,s){if(Sv(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function ta(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function Si(e,t,s,n){if(n===null)e.removeAttribute(s);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+n)}}function Wt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xv(e,t,s){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var c=n.get,p=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(N){s=""+N,p.call(this,N)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(N){s=""+N},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vo(e){if(!e._valueTracker){var t=sh(e)?"checked":"value";e._valueTracker=xv(e,t,""+e[t])}}function rh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),n="";return e&&(n=sh(e)?e.checked?"true":"false":e.value),e=n,e!==s?(t.setValue(e),!0):!1}function ia(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Cv=/[\n"\\]/g;function Xt(e){return e.replace(Cv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Go(e,t,s,n,c,p,N,z){e.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.type=N:e.removeAttribute("type"),t!=null?N==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Wt(t)):e.value!==""+Wt(t)&&(e.value=""+Wt(t)):N!=="submit"&&N!=="reset"||e.removeAttribute("value"),t!=null?Yo(e,N,Wt(t)):s!=null?Yo(e,N,Wt(s)):n!=null&&e.removeAttribute("value"),c==null&&p!=null&&(e.defaultChecked=!!p),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?e.name=""+Wt(z):e.removeAttribute("name")}function nh(e,t,s,n,c,p,N,z){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.type=p),t!=null||s!=null){if(!(p!=="submit"&&p!=="reset"||t!=null)){Vo(e);return}s=s!=null?""+Wt(s):"",t=t!=null?""+Wt(t):s,z||t===e.value||(e.value=t),e.defaultValue=t}n=n??c,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=z?e.checked:!!n,e.defaultChecked=!!n,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(e.name=N),Vo(e)}function Yo(e,t,s){t==="number"&&ia(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function er(e,t,s,n){if(e=e.options,t){t={};for(var c=0;c<s.length;c++)t["$"+s[c]]=!0;for(s=0;s<e.length;s++)c=t.hasOwnProperty("$"+e[s].value),e[s].selected!==c&&(e[s].selected=c),c&&n&&(e[s].defaultSelected=!0)}else{for(s=""+Wt(s),t=null,c=0;c<e.length;c++){if(e[c].value===s){e[c].selected=!0,n&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function ah(e,t,s){if(t!=null&&(t=""+Wt(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Wt(s):""}function oh(e,t,s,n){if(t==null){if(n!=null){if(s!=null)throw Error(o(92));if(ee(n)){if(1<n.length)throw Error(o(93));n=n[0]}s=n}s==null&&(s=""),t=s}s=Wt(t),e.defaultValue=s,n=e.textContent,n===s&&n!==""&&n!==null&&(e.value=n),Vo(e)}function tr(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var wv=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 lh(e,t,s){var n=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,s):typeof s!="number"||s===0||wv.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function ch(e,t,s){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,s!=null){for(var n in s)!s.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var c in t)n=t[c],t.hasOwnProperty(c)&&s[c]!==n&&lh(e,c,n)}else for(var p in t)t.hasOwnProperty(p)&&lh(e,p,t[p])}function Wo(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ev=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"]]),kv=/^[\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 sa(e){return kv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function xi(){}var Xo=null;function Jo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ir=null,sr=null;function uh(e){var t=Xs(e);if(t&&(e=t.stateNode)){var s=e[Ot]||null;e:switch(e=t.stateNode,t.type){case"input":if(Go(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Xt(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var n=s[t];if(n!==e&&n.form===e.form){var c=n[Ot]||null;if(!c)throw Error(o(90));Go(n,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<s.length;t++)n=s[t],n.form===e.form&&rh(n)}break e;case"textarea":ah(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&er(e,!!s.multiple,t,!1)}}}var Qo=!1;function hh(e,t,s){if(Qo)return e(t,s);Qo=!0;try{var n=e(t);return n}finally{if(Qo=!1,(ir!==null||sr!==null)&&(Za(),ir&&(t=ir,e=sr,sr=ir=null,uh(t),e)))for(t=0;t<e.length;t++)uh(e[t])}}function qr(e,t){var s=e.stateNode;if(s===null)return null;var n=s[Ot]||null;if(n===null)return null;s=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,t,typeof s));return s}var Ci=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),el=!1;if(Ci)try{var Kr={};Object.defineProperty(Kr,"passive",{get:function(){el=!0}}),window.addEventListener("test",Kr,Kr),window.removeEventListener("test",Kr,Kr)}catch{el=!1}var Ki=null,tl=null,ra=null;function dh(){if(ra)return ra;var e,t=tl,s=t.length,n,c="value"in Ki?Ki.value:Ki.textContent,p=c.length;for(e=0;e<s&&t[e]===c[e];e++);var N=s-e;for(n=1;n<=N&&t[s-n]===c[p-n];n++);return ra=c.slice(e,1<n?1-n:void 0)}function na(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function aa(){return!0}function fh(){return!1}function Nt(e){function t(s,n,c,p,N){this._reactName=s,this._targetInst=c,this.type=n,this.nativeEvent=p,this.target=N,this.currentTarget=null;for(var z in e)e.hasOwnProperty(z)&&(s=e[z],this[z]=s?s(p):p[z]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?aa:fh,this.isPropagationStopped=fh,this}return d(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=aa)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=aa)},persist:function(){},isPersistent:aa}),t}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},oa=Nt(Ts),Vr=d({},Ts,{view:0,detail:0}),Tv=Nt(Vr),il,sl,Gr,la=d({},Vr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nl,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Gr&&(Gr&&e.type==="mousemove"?(il=e.screenX-Gr.screenX,sl=e.screenY-Gr.screenY):sl=il=0,Gr=e),il)},movementY:function(e){return"movementY"in e?e.movementY:sl}}),mh=Nt(la),Av=d({},la,{dataTransfer:0}),Rv=Nt(Av),Dv=d({},Vr,{relatedTarget:0}),rl=Nt(Dv),Ov=d({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),Nv=Nt(Ov),Mv=d({},Ts,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lv=Nt(Mv),jv=d({},Ts,{data:0}),ph=Nt(jv),Bv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zv={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"},Hv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Hv[e])?!!t[e]:!1}function nl(){return Uv}var Iv=d({},Vr,{key:function(e){if(e.key){var t=Bv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=na(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?zv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nl,charCode:function(e){return e.type==="keypress"?na(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?na(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Pv=Nt(Iv),$v=d({},la,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_h=Nt($v),Fv=d({},Vr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nl}),Zv=Nt(Fv),qv=d({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kv=Nt(qv),Vv=d({},la,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Gv=Nt(Vv),Yv=d({},Ts,{newState:0,oldState:0}),Wv=Nt(Yv),Xv=[9,13,27,32],al=Ci&&"CompositionEvent"in window,Yr=null;Ci&&"documentMode"in document&&(Yr=document.documentMode);var Jv=Ci&&"TextEvent"in window&&!Yr,vh=Ci&&(!al||Yr&&8<Yr&&11>=Yr),gh=" ",yh=!1;function bh(e,t){switch(e){case"keyup":return Xv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rr=!1;function Qv(e,t){switch(e){case"compositionend":return Sh(t);case"keypress":return t.which!==32?null:(yh=!0,gh);case"textInput":return e=t.data,e===gh&&yh?null:e;default:return null}}function eg(e,t){if(rr)return e==="compositionend"||!al&&bh(e,t)?(e=dh(),ra=tl=Ki=null,rr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return vh&&t.locale!=="ko"?null:t.data;default:return null}}var tg={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 xh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tg[e.type]:t==="textarea"}function Ch(e,t,s,n){ir?sr?sr.push(n):sr=[n]:ir=n,t=Xa(t,"onChange"),0<t.length&&(s=new oa("onChange","change",null,s,n),e.push({event:s,listeners:t}))}var Wr=null,Xr=null;function ig(e){am(e,0)}function ca(e){var t=Zr(e);if(rh(t))return e}function wh(e,t){if(e==="change")return t}var Eh=!1;if(Ci){var ol;if(Ci){var ll="oninput"in document;if(!ll){var kh=document.createElement("div");kh.setAttribute("oninput","return;"),ll=typeof kh.oninput=="function"}ol=ll}else ol=!1;Eh=ol&&(!document.documentMode||9<document.documentMode)}function Th(){Wr&&(Wr.detachEvent("onpropertychange",Ah),Xr=Wr=null)}function Ah(e){if(e.propertyName==="value"&&ca(Xr)){var t=[];Ch(t,Xr,e,Jo(e)),hh(ig,t)}}function sg(e,t,s){e==="focusin"?(Th(),Wr=t,Xr=s,Wr.attachEvent("onpropertychange",Ah)):e==="focusout"&&Th()}function rg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ca(Xr)}function ng(e,t){if(e==="click")return ca(t)}function ag(e,t){if(e==="input"||e==="change")return ca(t)}function og(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $t=typeof Object.is=="function"?Object.is:og;function Jr(e,t){if($t(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),n=Object.keys(t);if(s.length!==n.length)return!1;for(n=0;n<s.length;n++){var c=s[n];if(!Rt.call(t,c)||!$t(e[c],t[c]))return!1}return!0}function Rh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dh(e,t){var s=Rh(e);e=0;for(var n;s;){if(s.nodeType===3){if(n=e+s.textContent.length,e<=t&&n>=t)return{node:s,offset:t-e};e=n}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Rh(s)}}function Oh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Oh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ia(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=ia(e.document)}return t}function cl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var lg=Ci&&"documentMode"in document&&11>=document.documentMode,nr=null,ul=null,Qr=null,hl=!1;function Mh(e,t,s){var n=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;hl||nr==null||nr!==ia(n)||(n=nr,"selectionStart"in n&&cl(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Qr&&Jr(Qr,n)||(Qr=n,n=Xa(ul,"onSelect"),0<n.length&&(t=new oa("onSelect","select",null,t,s),e.push({event:t,listeners:n}),t.target=nr)))}function As(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var ar={animationend:As("Animation","AnimationEnd"),animationiteration:As("Animation","AnimationIteration"),animationstart:As("Animation","AnimationStart"),transitionrun:As("Transition","TransitionRun"),transitionstart:As("Transition","TransitionStart"),transitioncancel:As("Transition","TransitionCancel"),transitionend:As("Transition","TransitionEnd")},dl={},Lh={};Ci&&(Lh=document.createElement("div").style,"AnimationEvent"in window||(delete ar.animationend.animation,delete ar.animationiteration.animation,delete ar.animationstart.animation),"TransitionEvent"in window||delete ar.transitionend.transition);function Rs(e){if(dl[e])return dl[e];if(!ar[e])return e;var t=ar[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Lh)return dl[e]=t[s];return e}var jh=Rs("animationend"),Bh=Rs("animationiteration"),zh=Rs("animationstart"),cg=Rs("transitionrun"),ug=Rs("transitionstart"),hg=Rs("transitioncancel"),Hh=Rs("transitionend"),Uh=new Map,fl="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(" ");fl.push("scrollEnd");function ci(e,t){Uh.set(e,t),ks(t,[e])}var ua=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Jt=[],or=0,ml=0;function ha(){for(var e=or,t=ml=or=0;t<e;){var s=Jt[t];Jt[t++]=null;var n=Jt[t];Jt[t++]=null;var c=Jt[t];Jt[t++]=null;var p=Jt[t];if(Jt[t++]=null,n!==null&&c!==null){var N=n.pending;N===null?c.next=c:(c.next=N.next,N.next=c),n.pending=c}p!==0&&Ih(s,c,p)}}function da(e,t,s,n){Jt[or++]=e,Jt[or++]=t,Jt[or++]=s,Jt[or++]=n,ml|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function pl(e,t,s,n){return da(e,t,s,n),fa(e)}function Ds(e,t){return da(e,null,null,t),fa(e)}function Ih(e,t,s){e.lanes|=s;var n=e.alternate;n!==null&&(n.lanes|=s);for(var c=!1,p=e.return;p!==null;)p.childLanes|=s,n=p.alternate,n!==null&&(n.childLanes|=s),p.tag===22&&(e=p.stateNode,e===null||e._visibility&1||(c=!0)),e=p,p=p.return;return e.tag===3?(p=e.stateNode,c&&t!==null&&(c=31-Pt(s),e=p.hiddenUpdates,n=e[c],n===null?e[c]=[t]:n.push(t),t.lane=s|536870912),p):null}function fa(e){if(50<xn)throw xn=0,wc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var lr={};function dg(e,t,s,n){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ft(e,t,s,n){return new dg(e,t,s,n)}function _l(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wi(e,t){var s=e.alternate;return s===null?(s=Ft(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Ph(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ma(e,t,s,n,c,p){var N=0;if(n=e,typeof e=="function")_l(e)&&(N=1);else if(typeof e=="string")N=v0(e,s,W.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case M:return e=Ft(31,s,t,c),e.elementType=M,e.lanes=p,e;case C:return Os(s.children,c,p,t);case m:N=8,c|=24;break;case g:return e=Ft(12,s,t,c|2),e.elementType=g,e.lanes=p,e;case A:return e=Ft(13,s,t,c),e.elementType=A,e.lanes=p,e;case R:return e=Ft(19,s,t,c),e.elementType=R,e.lanes=p,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _:N=10;break e;case h:N=9;break e;case x:N=11;break e;case D:N=14;break e;case T:N=16,n=null;break e}N=29,s=Error(o(130,e===null?"null":typeof e,"")),n=null}return t=Ft(N,s,t,c),t.elementType=e,t.type=n,t.lanes=p,t}function Os(e,t,s,n){return e=Ft(7,e,n,t),e.lanes=s,e}function vl(e,t,s){return e=Ft(6,e,null,t),e.lanes=s,e}function $h(e){var t=Ft(18,null,null,0);return t.stateNode=e,t}function gl(e,t,s){return t=Ft(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fh=new WeakMap;function Qt(e,t){if(typeof e=="object"&&e!==null){var s=Fh.get(e);return s!==void 0?s:(t={value:e,source:t,stack:_e(t)},Fh.set(e,t),t)}return{value:e,source:t,stack:_e(t)}}var cr=[],ur=0,pa=null,en=0,ei=[],ti=0,Vi=null,pi=1,_i="";function Ei(e,t){cr[ur++]=en,cr[ur++]=pa,pa=e,en=t}function Zh(e,t,s){ei[ti++]=pi,ei[ti++]=_i,ei[ti++]=Vi,Vi=e;var n=pi;e=_i;var c=32-Pt(n)-1;n&=~(1<<c),s+=1;var p=32-Pt(t)+c;if(30<p){var N=c-c%5;p=(n&(1<<N)-1).toString(32),n>>=N,c-=N,pi=1<<32-Pt(t)+c|s<<c|n,_i=p+e}else pi=1<<p|s<<c|n,_i=e}function yl(e){e.return!==null&&(Ei(e,1),Zh(e,1,0))}function bl(e){for(;e===pa;)pa=cr[--ur],cr[ur]=null,en=cr[--ur],cr[ur]=null;for(;e===Vi;)Vi=ei[--ti],ei[ti]=null,_i=ei[--ti],ei[ti]=null,pi=ei[--ti],ei[ti]=null}function qh(e,t){ei[ti++]=pi,ei[ti++]=_i,ei[ti++]=Vi,pi=t.id,_i=t.overflow,Vi=e}var xt=null,Xe=null,Le=!1,Gi=null,ii=!1,Sl=Error(o(519));function Yi(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw tn(Qt(t,e)),Sl}function Kh(e){var t=e.stateNode,s=e.type,n=e.memoizedProps;switch(t[St]=e,t[Ot]=n,s){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(s=0;s<wn.length;s++)De(wn[s],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),nh(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),oh(t,n.value,n.defaultValue,n.children)}s=n.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||n.suppressHydrationWarning===!0||um(t.textContent,s)?(n.popover!=null&&(De("beforetoggle",t),De("toggle",t)),n.onScroll!=null&&De("scroll",t),n.onScrollEnd!=null&&De("scrollend",t),n.onClick!=null&&(t.onclick=xi),t=!0):t=!1,t||Yi(e,!0)}function Vh(e){for(xt=e.return;xt;)switch(xt.tag){case 5:case 31:case 13:ii=!1;return;case 27:case 3:ii=!0;return;default:xt=xt.return}}function hr(e){if(e!==xt)return!1;if(!Le)return Vh(e),Le=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Uc(e.type,e.memoizedProps)),s=!s),s&&Xe&&Yi(e),Vh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Xe=ym(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Xe=ym(e)}else t===27?(t=Xe,cs(e.type)?(e=Zc,Zc=null,Xe=e):Xe=t):Xe=xt?ri(e.stateNode.nextSibling):null;return!0}function Ns(){Xe=xt=null,Le=!1}function xl(){var e=Gi;return e!==null&&(Bt===null?Bt=e:Bt.push.apply(Bt,e),Gi=null),e}function tn(e){Gi===null?Gi=[e]:Gi.push(e)}var Cl=L(null),Ms=null,ki=null;function Wi(e,t,s){q(Cl,t._currentValue),t._currentValue=s}function Ti(e){e._currentValue=Cl.current,H(Cl)}function wl(e,t,s){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===s)break;e=e.return}}function El(e,t,s,n){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var p=c.dependencies;if(p!==null){var N=c.child;p=p.firstContext;e:for(;p!==null;){var z=p;p=c;for(var G=0;G<t.length;G++)if(z.context===t[G]){p.lanes|=s,z=p.alternate,z!==null&&(z.lanes|=s),wl(p.return,s,e),n||(N=null);break e}p=z.next}}else if(c.tag===18){if(N=c.return,N===null)throw Error(o(341));N.lanes|=s,p=N.alternate,p!==null&&(p.lanes|=s),wl(N,s,e),N=null}else N=c.child;if(N!==null)N.return=c;else for(N=c;N!==null;){if(N===e){N=null;break}if(c=N.sibling,c!==null){c.return=N.return,N=c;break}N=N.return}c=N}}function dr(e,t,s,n){e=null;for(var c=t,p=!1;c!==null;){if(!p){if((c.flags&524288)!==0)p=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var N=c.alternate;if(N===null)throw Error(o(387));if(N=N.memoizedProps,N!==null){var z=c.type;$t(c.pendingProps.value,N.value)||(e!==null?e.push(z):e=[z])}}else if(c===U.current){if(N=c.alternate,N===null)throw Error(o(387));N.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Rn):e=[Rn])}c=c.return}e!==null&&El(t,e,s,n),t.flags|=262144}function _a(e){for(e=e.firstContext;e!==null;){if(!$t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ls(e){Ms=e,ki=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ct(e){return Gh(Ms,e)}function va(e,t){return Ms===null&&Ls(e),Gh(e,t)}function Gh(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},ki===null){if(e===null)throw Error(o(308));ki=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ki=ki.next=t;return s}var fg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},mg=i.unstable_scheduleCallback,pg=i.unstable_NormalPriority,ht={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function kl(){return{controller:new fg,data:new Map,refCount:0}}function sn(e){e.refCount--,e.refCount===0&&mg(pg,function(){e.controller.abort()})}var rn=null,Tl=0,fr=0,mr=null;function _g(e,t){if(rn===null){var s=rn=[];Tl=0,fr=Dc(),mr={status:"pending",value:void 0,then:function(n){s.push(n)}}}return Tl++,t.then(Yh,Yh),t}function Yh(){if(--Tl===0&&rn!==null){mr!==null&&(mr.status="fulfilled");var e=rn;rn=null,fr=0,mr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function vg(e,t){var s=[],n={status:"pending",value:null,reason:null,then:function(c){s.push(c)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var c=0;c<s.length;c++)(0,s[c])(t)},function(c){for(n.status="rejected",n.reason=c,c=0;c<s.length;c++)(0,s[c])(void 0)}),n}var Wh=V.S;V.S=function(e,t){Lf=vt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&_g(e,t),Wh!==null&&Wh(e,t)};var js=L(null);function Al(){var e=js.current;return e!==null?e:Ge.pooledCache}function ga(e,t){t===null?q(js,js.current):q(js,t.pool)}function Xh(){var e=Al();return e===null?null:{parent:ht._currentValue,pool:e}}var pr=Error(o(460)),Rl=Error(o(474)),ya=Error(o(542)),ba={then:function(){}};function Jh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Qh(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(xi,xi),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,td(e),e;default:if(typeof t.status=="string")t.then(xi,xi);else{if(e=Ge,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=n}},function(n){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,td(e),e}throw zs=t,pr}}function Bs(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(zs=s,pr):s}}var zs=null;function ed(){if(zs===null)throw Error(o(459));var e=zs;return zs=null,e}function td(e){if(e===pr||e===ya)throw Error(o(483))}var _r=null,nn=0;function Sa(e){var t=nn;return nn+=1,_r===null&&(_r=[]),Qh(_r,e,t)}function an(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function xa(e,t){throw t.$$typeof===S?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function id(e){function t(J,Y){if(e){var te=J.deletions;te===null?(J.deletions=[Y],J.flags|=16):te.push(Y)}}function s(J,Y){if(!e)return null;for(;Y!==null;)t(J,Y),Y=Y.sibling;return null}function n(J){for(var Y=new Map;J!==null;)J.key!==null?Y.set(J.key,J):Y.set(J.index,J),J=J.sibling;return Y}function c(J,Y){return J=wi(J,Y),J.index=0,J.sibling=null,J}function p(J,Y,te){return J.index=te,e?(te=J.alternate,te!==null?(te=te.index,te<Y?(J.flags|=67108866,Y):te):(J.flags|=67108866,Y)):(J.flags|=1048576,Y)}function N(J){return e&&J.alternate===null&&(J.flags|=67108866),J}function z(J,Y,te,ue){return Y===null||Y.tag!==6?(Y=vl(te,J.mode,ue),Y.return=J,Y):(Y=c(Y,te),Y.return=J,Y)}function G(J,Y,te,ue){var Se=te.type;return Se===C?ce(J,Y,te.props.children,ue,te.key):Y!==null&&(Y.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===T&&Bs(Se)===Y.type)?(Y=c(Y,te.props),an(Y,te),Y.return=J,Y):(Y=ma(te.type,te.key,te.props,null,J.mode,ue),an(Y,te),Y.return=J,Y)}function se(J,Y,te,ue){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==te.containerInfo||Y.stateNode.implementation!==te.implementation?(Y=gl(te,J.mode,ue),Y.return=J,Y):(Y=c(Y,te.children||[]),Y.return=J,Y)}function ce(J,Y,te,ue,Se){return Y===null||Y.tag!==7?(Y=Os(te,J.mode,ue,Se),Y.return=J,Y):(Y=c(Y,te),Y.return=J,Y)}function de(J,Y,te){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=vl(""+Y,J.mode,te),Y.return=J,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case E:return te=ma(Y.type,Y.key,Y.props,null,J.mode,te),an(te,Y),te.return=J,te;case O:return Y=gl(Y,J.mode,te),Y.return=J,Y;case T:return Y=Bs(Y),de(J,Y,te)}if(ee(Y)||K(Y))return Y=Os(Y,J.mode,te,null),Y.return=J,Y;if(typeof Y.then=="function")return de(J,Sa(Y),te);if(Y.$$typeof===_)return de(J,va(J,Y),te);xa(J,Y)}return null}function re(J,Y,te,ue){var Se=Y!==null?Y.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Se!==null?null:z(J,Y,""+te,ue);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case E:return te.key===Se?G(J,Y,te,ue):null;case O:return te.key===Se?se(J,Y,te,ue):null;case T:return te=Bs(te),re(J,Y,te,ue)}if(ee(te)||K(te))return Se!==null?null:ce(J,Y,te,ue,null);if(typeof te.then=="function")return re(J,Y,Sa(te),ue);if(te.$$typeof===_)return re(J,Y,va(J,te),ue);xa(J,te)}return null}function oe(J,Y,te,ue,Se){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return J=J.get(te)||null,z(Y,J,""+ue,Se);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case E:return J=J.get(ue.key===null?te:ue.key)||null,G(Y,J,ue,Se);case O:return J=J.get(ue.key===null?te:ue.key)||null,se(Y,J,ue,Se);case T:return ue=Bs(ue),oe(J,Y,te,ue,Se)}if(ee(ue)||K(ue))return J=J.get(te)||null,ce(Y,J,ue,Se,null);if(typeof ue.then=="function")return oe(J,Y,te,Sa(ue),Se);if(ue.$$typeof===_)return oe(J,Y,te,va(Y,ue),Se);xa(Y,ue)}return null}function ve(J,Y,te,ue){for(var Se=null,ze=null,ge=Y,Te=Y=0,Me=null;ge!==null&&Te<te.length;Te++){ge.index>Te?(Me=ge,ge=null):Me=ge.sibling;var He=re(J,ge,te[Te],ue);if(He===null){ge===null&&(ge=Me);break}e&&ge&&He.alternate===null&&t(J,ge),Y=p(He,Y,Te),ze===null?Se=He:ze.sibling=He,ze=He,ge=Me}if(Te===te.length)return s(J,ge),Le&&Ei(J,Te),Se;if(ge===null){for(;Te<te.length;Te++)ge=de(J,te[Te],ue),ge!==null&&(Y=p(ge,Y,Te),ze===null?Se=ge:ze.sibling=ge,ze=ge);return Le&&Ei(J,Te),Se}for(ge=n(ge);Te<te.length;Te++)Me=oe(ge,J,Te,te[Te],ue),Me!==null&&(e&&Me.alternate!==null&&ge.delete(Me.key===null?Te:Me.key),Y=p(Me,Y,Te),ze===null?Se=Me:ze.sibling=Me,ze=Me);return e&&ge.forEach(function(ms){return t(J,ms)}),Le&&Ei(J,Te),Se}function xe(J,Y,te,ue){if(te==null)throw Error(o(151));for(var Se=null,ze=null,ge=Y,Te=Y=0,Me=null,He=te.next();ge!==null&&!He.done;Te++,He=te.next()){ge.index>Te?(Me=ge,ge=null):Me=ge.sibling;var ms=re(J,ge,He.value,ue);if(ms===null){ge===null&&(ge=Me);break}e&&ge&&ms.alternate===null&&t(J,ge),Y=p(ms,Y,Te),ze===null?Se=ms:ze.sibling=ms,ze=ms,ge=Me}if(He.done)return s(J,ge),Le&&Ei(J,Te),Se;if(ge===null){for(;!He.done;Te++,He=te.next())He=de(J,He.value,ue),He!==null&&(Y=p(He,Y,Te),ze===null?Se=He:ze.sibling=He,ze=He);return Le&&Ei(J,Te),Se}for(ge=n(ge);!He.done;Te++,He=te.next())He=oe(ge,J,Te,He.value,ue),He!==null&&(e&&He.alternate!==null&&ge.delete(He.key===null?Te:He.key),Y=p(He,Y,Te),ze===null?Se=He:ze.sibling=He,ze=He);return e&&ge.forEach(function(A0){return t(J,A0)}),Le&&Ei(J,Te),Se}function Ve(J,Y,te,ue){if(typeof te=="object"&&te!==null&&te.type===C&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case E:e:{for(var Se=te.key;Y!==null;){if(Y.key===Se){if(Se=te.type,Se===C){if(Y.tag===7){s(J,Y.sibling),ue=c(Y,te.props.children),ue.return=J,J=ue;break e}}else if(Y.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===T&&Bs(Se)===Y.type){s(J,Y.sibling),ue=c(Y,te.props),an(ue,te),ue.return=J,J=ue;break e}s(J,Y);break}else t(J,Y);Y=Y.sibling}te.type===C?(ue=Os(te.props.children,J.mode,ue,te.key),ue.return=J,J=ue):(ue=ma(te.type,te.key,te.props,null,J.mode,ue),an(ue,te),ue.return=J,J=ue)}return N(J);case O:e:{for(Se=te.key;Y!==null;){if(Y.key===Se)if(Y.tag===4&&Y.stateNode.containerInfo===te.containerInfo&&Y.stateNode.implementation===te.implementation){s(J,Y.sibling),ue=c(Y,te.children||[]),ue.return=J,J=ue;break e}else{s(J,Y);break}else t(J,Y);Y=Y.sibling}ue=gl(te,J.mode,ue),ue.return=J,J=ue}return N(J);case T:return te=Bs(te),Ve(J,Y,te,ue)}if(ee(te))return ve(J,Y,te,ue);if(K(te)){if(Se=K(te),typeof Se!="function")throw Error(o(150));return te=Se.call(te),xe(J,Y,te,ue)}if(typeof te.then=="function")return Ve(J,Y,Sa(te),ue);if(te.$$typeof===_)return Ve(J,Y,va(J,te),ue);xa(J,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,Y!==null&&Y.tag===6?(s(J,Y.sibling),ue=c(Y,te),ue.return=J,J=ue):(s(J,Y),ue=vl(te,J.mode,ue),ue.return=J,J=ue),N(J)):s(J,Y)}return function(J,Y,te,ue){try{nn=0;var Se=Ve(J,Y,te,ue);return _r=null,Se}catch(ge){if(ge===pr||ge===ya)throw ge;var ze=Ft(29,ge,null,J.mode);return ze.lanes=ue,ze.return=J,ze}finally{}}}var Hs=id(!0),sd=id(!1),Xi=!1;function Dl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ol(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ji(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Qi(e,t,s){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Ie&2)!==0){var c=n.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),n.pending=t,t=fa(e),Ih(e,null,s),t}return da(e,n,t,s),fa(e)}function on(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,s|=n,t.lanes=s,Gu(e,s)}}function Nl(e,t){var s=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,s===n)){var c=null,p=null;if(s=s.firstBaseUpdate,s!==null){do{var N={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};p===null?c=p=N:p=p.next=N,s=s.next}while(s!==null);p===null?c=p=t:p=p.next=t}else c=p=t;s={baseState:n.baseState,firstBaseUpdate:c,lastBaseUpdate:p,shared:n.shared,callbacks:n.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var Ml=!1;function ln(){if(Ml){var e=mr;if(e!==null)throw e}}function cn(e,t,s,n){Ml=!1;var c=e.updateQueue;Xi=!1;var p=c.firstBaseUpdate,N=c.lastBaseUpdate,z=c.shared.pending;if(z!==null){c.shared.pending=null;var G=z,se=G.next;G.next=null,N===null?p=se:N.next=se,N=G;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,z=ce.lastBaseUpdate,z!==N&&(z===null?ce.firstBaseUpdate=se:z.next=se,ce.lastBaseUpdate=G))}if(p!==null){var de=c.baseState;N=0,ce=se=G=null,z=p;do{var re=z.lane&-536870913,oe=re!==z.lane;if(oe?(Ne&re)===re:(n&re)===re){re!==0&&re===fr&&(Ml=!0),ce!==null&&(ce=ce.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var ve=e,xe=z;re=t;var Ve=s;switch(xe.tag){case 1:if(ve=xe.payload,typeof ve=="function"){de=ve.call(Ve,de,re);break e}de=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=xe.payload,re=typeof ve=="function"?ve.call(Ve,de,re):ve,re==null)break e;de=d({},de,re);break e;case 2:Xi=!0}}re=z.callback,re!==null&&(e.flags|=64,oe&&(e.flags|=8192),oe=c.callbacks,oe===null?c.callbacks=[re]:oe.push(re))}else oe={lane:re,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ce===null?(se=ce=oe,G=de):ce=ce.next=oe,N|=re;if(z=z.next,z===null){if(z=c.shared.pending,z===null)break;oe=z,z=oe.next,oe.next=null,c.lastBaseUpdate=oe,c.shared.pending=null}}while(!0);ce===null&&(G=de),c.baseState=G,c.firstBaseUpdate=se,c.lastBaseUpdate=ce,p===null&&(c.shared.lanes=0),rs|=N,e.lanes=N,e.memoizedState=de}}function rd(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function nd(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)rd(s[e],t)}var vr=L(null),Ca=L(0);function ad(e,t){e=Bi,q(Ca,e),q(vr,t),Bi=e|t.baseLanes}function Ll(){q(Ca,Bi),q(vr,vr.current)}function jl(){Bi=Ca.current,H(vr),H(Ca)}var Zt=L(null),si=null;function es(e){var t=e.alternate;q(lt,lt.current&1),q(Zt,e),si===null&&(t===null||vr.current!==null||t.memoizedState!==null)&&(si=e)}function Bl(e){q(lt,lt.current),q(Zt,e),si===null&&(si=e)}function od(e){e.tag===22?(q(lt,lt.current),q(Zt,e),si===null&&(si=e)):ts()}function ts(){q(lt,lt.current),q(Zt,Zt.current)}function qt(e){H(Zt),si===e&&(si=null),H(lt)}var lt=L(0);function wa(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||$c(s)||Fc(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ai=0,ke=null,qe=null,dt=null,Ea=!1,gr=!1,Us=!1,ka=0,un=0,yr=null,gg=0;function rt(){throw Error(o(321))}function zl(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!$t(e[s],t[s]))return!1;return!0}function Hl(e,t,s,n,c,p){return Ai=p,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?Zd:Ql,Us=!1,p=s(n,c),Us=!1,gr&&(p=cd(t,s,n,c)),ld(e),p}function ld(e){V.H=fn;var t=qe!==null&&qe.next!==null;if(Ai=0,dt=qe=ke=null,Ea=!1,un=0,yr=null,t)throw Error(o(300));e===null||ft||(e=e.dependencies,e!==null&&_a(e)&&(ft=!0))}function cd(e,t,s,n){ke=e;var c=0;do{if(gr&&(yr=null),un=0,gr=!1,25<=c)throw Error(o(301));if(c+=1,dt=qe=null,e.updateQueue!=null){var p=e.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}V.H=qd,p=t(s,n)}while(gr);return p}function yg(){var e=V.H,t=e.useState()[0];return t=typeof t.then=="function"?hn(t):t,e=e.useState()[0],(qe!==null?qe.memoizedState:null)!==e&&(ke.flags|=1024),t}function Ul(){var e=ka!==0;return ka=0,e}function Il(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Pl(e){if(Ea){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ea=!1}Ai=0,dt=qe=ke=null,gr=!1,un=ka=0,yr=null}function Tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?ke.memoizedState=dt=e:dt=dt.next=e,dt}function ct(){if(qe===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=dt===null?ke.memoizedState:dt.next;if(t!==null)dt=t,qe=e;else{if(e===null)throw ke.alternate===null?Error(o(467)):Error(o(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},dt===null?ke.memoizedState=dt=e:dt=dt.next=e}return dt}function Ta(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hn(e){var t=un;return un+=1,yr===null&&(yr=[]),e=Qh(yr,e,t),t=ke,(dt===null?t.memoizedState:dt.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?Zd:Ql),e}function Aa(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return hn(e);if(e.$$typeof===_)return Ct(e)}throw Error(o(438,String(e)))}function $l(e){var t=null,s=ke.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var n=ke.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Ta(),ke.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),n=0;n<e;n++)s[n]=$;return t.index++,s}function Ri(e,t){return typeof t=="function"?t(e):t}function Ra(e){var t=ct();return Fl(t,qe,e)}function Fl(e,t,s){var n=e.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=s;var c=e.baseQueue,p=n.pending;if(p!==null){if(c!==null){var N=c.next;c.next=p.next,p.next=N}t.baseQueue=c=p,n.pending=null}if(p=e.baseState,c===null)e.memoizedState=p;else{t=c.next;var z=N=null,G=null,se=t,ce=!1;do{var de=se.lane&-536870913;if(de!==se.lane?(Ne&de)===de:(Ai&de)===de){var re=se.revertLane;if(re===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),de===fr&&(ce=!0);else if((Ai&re)===re){se=se.next,re===fr&&(ce=!0);continue}else de={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},G===null?(z=G=de,N=p):G=G.next=de,ke.lanes|=re,rs|=re;de=se.action,Us&&s(p,de),p=se.hasEagerState?se.eagerState:s(p,de)}else re={lane:de,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},G===null?(z=G=re,N=p):G=G.next=re,ke.lanes|=de,rs|=de;se=se.next}while(se!==null&&se!==t);if(G===null?N=p:G.next=z,!$t(p,e.memoizedState)&&(ft=!0,ce&&(s=mr,s!==null)))throw s;e.memoizedState=p,e.baseState=N,e.baseQueue=G,n.lastRenderedState=p}return c===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Zl(e){var t=ct(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var n=s.dispatch,c=s.pending,p=t.memoizedState;if(c!==null){s.pending=null;var N=c=c.next;do p=e(p,N.action),N=N.next;while(N!==c);$t(p,t.memoizedState)||(ft=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),s.lastRenderedState=p}return[p,n]}function ud(e,t,s){var n=ke,c=ct(),p=Le;if(p){if(s===void 0)throw Error(o(407));s=s()}else s=t();var N=!$t((qe||c).memoizedState,s);if(N&&(c.memoizedState=s,ft=!0),c=c.queue,Vl(fd.bind(null,n,c,e),[e]),c.getSnapshot!==t||N||dt!==null&&dt.memoizedState.tag&1){if(n.flags|=2048,br(9,{destroy:void 0},dd.bind(null,n,c,s,t),null),Ge===null)throw Error(o(349));p||(Ai&127)!==0||hd(n,t,s)}return s}function hd(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=ke.updateQueue,t===null?(t=Ta(),ke.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function dd(e,t,s,n){t.value=s,t.getSnapshot=n,md(t)&&pd(e)}function fd(e,t,s){return s(function(){md(t)&&pd(e)})}function md(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!$t(e,s)}catch{return!0}}function pd(e){var t=Ds(e,2);t!==null&&zt(t,e,2)}function ql(e){var t=Tt();if(typeof e=="function"){var s=e;if(e=s(),Us){Zi(!0);try{s()}finally{Zi(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:e},t}function _d(e,t,s,n){return e.baseState=s,Fl(e,qe,typeof n=="function"?n:Ri)}function bg(e,t,s,n,c){if(Na(e))throw Error(o(485));if(e=t.action,e!==null){var p={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){p.listeners.push(N)}};V.T!==null?s(!0):p.isTransition=!1,n(p),s=t.pending,s===null?(p.next=t.pending=p,vd(t,p)):(p.next=s.next,t.pending=s.next=p)}}function vd(e,t){var s=t.action,n=t.payload,c=e.state;if(t.isTransition){var p=V.T,N={};V.T=N;try{var z=s(c,n),G=V.S;G!==null&&G(N,z),gd(e,t,z)}catch(se){Kl(e,t,se)}finally{p!==null&&N.types!==null&&(p.types=N.types),V.T=p}}else try{p=s(c,n),gd(e,t,p)}catch(se){Kl(e,t,se)}}function gd(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(n){yd(e,t,n)},function(n){return Kl(e,t,n)}):yd(e,t,s)}function yd(e,t,s){t.status="fulfilled",t.value=s,bd(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,vd(e,s)))}function Kl(e,t,s){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=s,bd(t),t=t.next;while(t!==n)}e.action=null}function bd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Sd(e,t){return t}function xd(e,t){if(Le){var s=Ge.formState;if(s!==null){e:{var n=ke;if(Le){if(Xe){t:{for(var c=Xe,p=ii;c.nodeType!==8;){if(!p){c=null;break t}if(c=ri(c.nextSibling),c===null){c=null;break t}}p=c.data,c=p==="F!"||p==="F"?c:null}if(c){Xe=ri(c.nextSibling),n=c.data==="F!";break e}}Yi(n)}n=!1}n&&(t=s[0])}}return s=Tt(),s.memoizedState=s.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sd,lastRenderedState:t},s.queue=n,s=Pd.bind(null,ke,n),n.dispatch=s,n=ql(!1),p=Jl.bind(null,ke,!1,n.queue),n=Tt(),c={state:t,dispatch:null,action:e,pending:null},n.queue=c,s=bg.bind(null,ke,c,p,s),c.dispatch=s,n.memoizedState=e,[t,s,!1]}function Cd(e){var t=ct();return wd(t,qe,e)}function wd(e,t,s){if(t=Fl(e,t,Sd)[0],e=Ra(Ri)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=hn(t)}catch(N){throw N===pr?ya:N}else n=t;t=ct();var c=t.queue,p=c.dispatch;return s!==t.memoizedState&&(ke.flags|=2048,br(9,{destroy:void 0},Sg.bind(null,c,s),null)),[n,p,e]}function Sg(e,t){e.action=t}function Ed(e){var t=ct(),s=qe;if(s!==null)return wd(t,s,e);ct(),t=t.memoizedState,s=ct();var n=s.queue.dispatch;return s.memoizedState=e,[t,n,!1]}function br(e,t,s,n){return e={tag:e,create:s,deps:n,inst:t,next:null},t=ke.updateQueue,t===null&&(t=Ta(),ke.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(n=s.next,s.next=e,e.next=n,t.lastEffect=e),e}function kd(){return ct().memoizedState}function Da(e,t,s,n){var c=Tt();ke.flags|=e,c.memoizedState=br(1|t,{destroy:void 0},s,n===void 0?null:n)}function Oa(e,t,s,n){var c=ct();n=n===void 0?null:n;var p=c.memoizedState.inst;qe!==null&&n!==null&&zl(n,qe.memoizedState.deps)?c.memoizedState=br(t,p,s,n):(ke.flags|=e,c.memoizedState=br(1|t,p,s,n))}function Td(e,t){Da(8390656,8,e,t)}function Vl(e,t){Oa(2048,8,e,t)}function xg(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=Ta(),ke.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Ad(e){var t=ct().memoizedState;return xg({ref:t,nextImpl:e}),function(){if((Ie&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Rd(e,t){return Oa(4,2,e,t)}function Dd(e,t){return Oa(4,4,e,t)}function Od(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Nd(e,t,s){s=s!=null?s.concat([e]):null,Oa(4,4,Od.bind(null,t,e),s)}function Gl(){}function Md(e,t){var s=ct();t=t===void 0?null:t;var n=s.memoizedState;return t!==null&&zl(t,n[1])?n[0]:(s.memoizedState=[e,t],e)}function Ld(e,t){var s=ct();t=t===void 0?null:t;var n=s.memoizedState;if(t!==null&&zl(t,n[1]))return n[0];if(n=e(),Us){Zi(!0);try{e()}finally{Zi(!1)}}return s.memoizedState=[n,t],n}function Yl(e,t,s){return s===void 0||(Ai&1073741824)!==0&&(Ne&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Bf(),ke.lanes|=e,rs|=e,s)}function jd(e,t,s,n){return $t(s,t)?s:vr.current!==null?(e=Yl(e,s,n),$t(e,t)||(ft=!0),e):(Ai&42)===0||(Ai&1073741824)!==0&&(Ne&261930)===0?(ft=!0,e.memoizedState=s):(e=Bf(),ke.lanes|=e,rs|=e,t)}function Bd(e,t,s,n,c){var p=Q.p;Q.p=p!==0&&8>p?p:8;var N=V.T,z={};V.T=z,Jl(e,!1,t,s);try{var G=c(),se=V.S;if(se!==null&&se(z,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var ce=vg(G,n);dn(e,t,ce,Gt(e))}else dn(e,t,n,Gt(e))}catch(de){dn(e,t,{then:function(){},status:"rejected",reason:de},Gt())}finally{Q.p=p,N!==null&&z.types!==null&&(N.types=z.types),V.T=N}}function Cg(){}function Wl(e,t,s,n){if(e.tag!==5)throw Error(o(476));var c=zd(e).queue;Bd(e,c,t,ae,s===null?Cg:function(){return Hd(e),s(n)})}function zd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:ae},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Hd(e){var t=zd(e);t.next===null&&(t=e.alternate.memoizedState),dn(e,t.next.queue,{},Gt())}function Xl(){return Ct(Rn)}function Ud(){return ct().memoizedState}function Id(){return ct().memoizedState}function wg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Gt();e=Ji(s);var n=Qi(t,e,s);n!==null&&(zt(n,t,s),on(n,t,s)),t={cache:kl()},e.payload=t;return}t=t.return}}function Eg(e,t,s){var n=Gt();s={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Na(e)?$d(t,s):(s=pl(e,t,s,n),s!==null&&(zt(s,e,n),Fd(s,t,n)))}function Pd(e,t,s){var n=Gt();dn(e,t,s,n)}function dn(e,t,s,n){var c={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Na(e))$d(t,c);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var N=t.lastRenderedState,z=p(N,s);if(c.hasEagerState=!0,c.eagerState=z,$t(z,N))return da(e,t,c,0),Ge===null&&ha(),!1}catch{}finally{}if(s=pl(e,t,c,n),s!==null)return zt(s,e,n),Fd(s,t,n),!0}return!1}function Jl(e,t,s,n){if(n={lane:2,revertLane:Dc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Na(e)){if(t)throw Error(o(479))}else t=pl(e,s,n,2),t!==null&&zt(t,e,2)}function Na(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function $d(e,t){gr=Ea=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Fd(e,t,s){if((s&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,s|=n,t.lanes=s,Gu(e,s)}}var fn={readContext:Ct,use:Aa,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useLayoutEffect:rt,useInsertionEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useSyncExternalStore:rt,useId:rt,useHostTransitionStatus:rt,useFormState:rt,useActionState:rt,useOptimistic:rt,useMemoCache:rt,useCacheRefresh:rt};fn.useEffectEvent=rt;var Zd={readContext:Ct,use:Aa,useCallback:function(e,t){return Tt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:Td,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Da(4194308,4,Od.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Da(4194308,4,e,t)},useInsertionEffect:function(e,t){Da(4,2,e,t)},useMemo:function(e,t){var s=Tt();t=t===void 0?null:t;var n=e();if(Us){Zi(!0);try{e()}finally{Zi(!1)}}return s.memoizedState=[n,t],n},useReducer:function(e,t,s){var n=Tt();if(s!==void 0){var c=s(t);if(Us){Zi(!0);try{s(t)}finally{Zi(!1)}}}else c=t;return n.memoizedState=n.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},n.queue=e,e=e.dispatch=Eg.bind(null,ke,e),[n.memoizedState,e]},useRef:function(e){var t=Tt();return e={current:e},t.memoizedState=e},useState:function(e){e=ql(e);var t=e.queue,s=Pd.bind(null,ke,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Gl,useDeferredValue:function(e,t){var s=Tt();return Yl(s,e,t)},useTransition:function(){var e=ql(!1);return e=Bd.bind(null,ke,e.queue,!0,!1),Tt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var n=ke,c=Tt();if(Le){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),Ge===null)throw Error(o(349));(Ne&127)!==0||hd(n,t,s)}c.memoizedState=s;var p={value:s,getSnapshot:t};return c.queue=p,Td(fd.bind(null,n,p,e),[e]),n.flags|=2048,br(9,{destroy:void 0},dd.bind(null,n,p,s,t),null),s},useId:function(){var e=Tt(),t=Ge.identifierPrefix;if(Le){var s=_i,n=pi;s=(n&~(1<<32-Pt(n)-1)).toString(32)+s,t="_"+t+"R_"+s,s=ka++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=gg++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Xl,useFormState:xd,useActionState:xd,useOptimistic:function(e){var t=Tt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Jl.bind(null,ke,!0,s),s.dispatch=t,[e,t]},useMemoCache:$l,useCacheRefresh:function(){return Tt().memoizedState=wg.bind(null,ke)},useEffectEvent:function(e){var t=Tt(),s={impl:e};return t.memoizedState=s,function(){if((Ie&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Ql={readContext:Ct,use:Aa,useCallback:Md,useContext:Ct,useEffect:Vl,useImperativeHandle:Nd,useInsertionEffect:Rd,useLayoutEffect:Dd,useMemo:Ld,useReducer:Ra,useRef:kd,useState:function(){return Ra(Ri)},useDebugValue:Gl,useDeferredValue:function(e,t){var s=ct();return jd(s,qe.memoizedState,e,t)},useTransition:function(){var e=Ra(Ri)[0],t=ct().memoizedState;return[typeof e=="boolean"?e:hn(e),t]},useSyncExternalStore:ud,useId:Ud,useHostTransitionStatus:Xl,useFormState:Cd,useActionState:Cd,useOptimistic:function(e,t){var s=ct();return _d(s,qe,e,t)},useMemoCache:$l,useCacheRefresh:Id};Ql.useEffectEvent=Ad;var qd={readContext:Ct,use:Aa,useCallback:Md,useContext:Ct,useEffect:Vl,useImperativeHandle:Nd,useInsertionEffect:Rd,useLayoutEffect:Dd,useMemo:Ld,useReducer:Zl,useRef:kd,useState:function(){return Zl(Ri)},useDebugValue:Gl,useDeferredValue:function(e,t){var s=ct();return qe===null?Yl(s,e,t):jd(s,qe.memoizedState,e,t)},useTransition:function(){var e=Zl(Ri)[0],t=ct().memoizedState;return[typeof e=="boolean"?e:hn(e),t]},useSyncExternalStore:ud,useId:Ud,useHostTransitionStatus:Xl,useFormState:Ed,useActionState:Ed,useOptimistic:function(e,t){var s=ct();return qe!==null?_d(s,qe,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:$l,useCacheRefresh:Id};qd.useEffectEvent=Ad;function ec(e,t,s,n){t=e.memoizedState,s=s(n,t),s=s==null?t:d({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var tc={enqueueSetState:function(e,t,s){e=e._reactInternals;var n=Gt(),c=Ji(n);c.payload=t,s!=null&&(c.callback=s),t=Qi(e,c,n),t!==null&&(zt(t,e,n),on(t,e,n))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var n=Gt(),c=Ji(n);c.tag=1,c.payload=t,s!=null&&(c.callback=s),t=Qi(e,c,n),t!==null&&(zt(t,e,n),on(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Gt(),n=Ji(s);n.tag=2,t!=null&&(n.callback=t),t=Qi(e,n,s),t!==null&&(zt(t,e,s),on(t,e,s))}};function Kd(e,t,s,n,c,p,N){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,p,N):t.prototype&&t.prototype.isPureReactComponent?!Jr(s,n)||!Jr(c,p):!0}function Vd(e,t,s,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,n),t.state!==e&&tc.enqueueReplaceState(t,t.state,null)}function Is(e,t){var s=t;if("ref"in t){s={};for(var n in t)n!=="ref"&&(s[n]=t[n])}if(e=e.defaultProps){s===t&&(s=d({},s));for(var c in e)s[c]===void 0&&(s[c]=e[c])}return s}function Gd(e){ua(e)}function Yd(e){console.error(e)}function Wd(e){ua(e)}function Ma(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Xd(e,t,s){try{var n=e.onCaughtError;n(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function ic(e,t,s){return s=Ji(s),s.tag=3,s.payload={element:null},s.callback=function(){Ma(e,t)},s}function Jd(e){return e=Ji(e),e.tag=3,e}function Qd(e,t,s,n){var c=s.type.getDerivedStateFromError;if(typeof c=="function"){var p=n.value;e.payload=function(){return c(p)},e.callback=function(){Xd(t,s,n)}}var N=s.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(e.callback=function(){Xd(t,s,n),typeof c!="function"&&(ns===null?ns=new Set([this]):ns.add(this));var z=n.stack;this.componentDidCatch(n.value,{componentStack:z!==null?z:""})})}function kg(e,t,s,n,c){if(s.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=s.alternate,t!==null&&dr(t,s,c,!0),s=Zt.current,s!==null){switch(s.tag){case 31:case 13:return si===null?qa():s.alternate===null&&nt===0&&(nt=3),s.flags&=-257,s.flags|=65536,s.lanes=c,n===ba?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([n]):t.add(n),Tc(e,n,c)),!1;case 22:return s.flags|=65536,n===ba?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([n]):s.add(n)),Tc(e,n,c)),!1}throw Error(o(435,s.tag))}return Tc(e,n,c),qa(),!1}if(Le)return t=Zt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,n!==Sl&&(e=Error(o(422),{cause:n}),tn(Qt(e,s)))):(n!==Sl&&(t=Error(o(423),{cause:n}),tn(Qt(t,s))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,n=Qt(n,s),c=ic(e.stateNode,n,c),Nl(e,c),nt!==4&&(nt=2)),!1;var p=Error(o(520),{cause:n});if(p=Qt(p,s),Sn===null?Sn=[p]:Sn.push(p),nt!==4&&(nt=2),t===null)return!0;n=Qt(n,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=c&-c,s.lanes|=e,e=ic(s.stateNode,n,e),Nl(s,e),!1;case 1:if(t=s.type,p=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(ns===null||!ns.has(p))))return s.flags|=65536,c&=-c,s.lanes|=c,c=Jd(c),Qd(c,e,s,n),Nl(s,c),!1}s=s.return}while(s!==null);return!1}var sc=Error(o(461)),ft=!1;function wt(e,t,s,n){t.child=e===null?sd(t,null,s,n):Hs(t,e.child,s,n)}function ef(e,t,s,n,c){s=s.render;var p=t.ref;if("ref"in n){var N={};for(var z in n)z!=="ref"&&(N[z]=n[z])}else N=n;return Ls(t),n=Hl(e,t,s,N,p,c),z=Ul(),e!==null&&!ft?(Il(e,t,c),Di(e,t,c)):(Le&&z&&yl(t),t.flags|=1,wt(e,t,n,c),t.child)}function tf(e,t,s,n,c){if(e===null){var p=s.type;return typeof p=="function"&&!_l(p)&&p.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=p,sf(e,t,p,n,c)):(e=ma(s.type,null,n,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,!hc(e,c)){var N=p.memoizedProps;if(s=s.compare,s=s!==null?s:Jr,s(N,n)&&e.ref===t.ref)return Di(e,t,c)}return t.flags|=1,e=wi(p,n),e.ref=t.ref,e.return=t,t.child=e}function sf(e,t,s,n,c){if(e!==null){var p=e.memoizedProps;if(Jr(p,n)&&e.ref===t.ref)if(ft=!1,t.pendingProps=n=p,hc(e,c))(e.flags&131072)!==0&&(ft=!0);else return t.lanes=e.lanes,Di(e,t,c)}return rc(e,t,s,n,c)}function rf(e,t,s,n){var c=n.children,p=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(p=p!==null?p.baseLanes|s:s,e!==null){for(n=t.child=e.child,c=0;n!==null;)c=c|n.lanes|n.childLanes,n=n.sibling;n=c&~p}else n=0,t.child=null;return nf(e,t,p,s,n)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ga(t,p!==null?p.cachePool:null),p!==null?ad(t,p):Ll(),od(t);else return n=t.lanes=536870912,nf(e,t,p!==null?p.baseLanes|s:s,s,n)}else p!==null?(ga(t,p.cachePool),ad(t,p),ts(),t.memoizedState=null):(e!==null&&ga(t,null),Ll(),ts());return wt(e,t,c,s),t.child}function mn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function nf(e,t,s,n,c){var p=Al();return p=p===null?null:{parent:ht._currentValue,pool:p},t.memoizedState={baseLanes:s,cachePool:p},e!==null&&ga(t,null),Ll(),od(t),e!==null&&dr(e,t,n,!0),t.childLanes=c,null}function La(e,t){return t=Ba({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function af(e,t,s){return Hs(t,e.child,null,s),e=La(t,t.pendingProps),e.flags|=2,qt(t),t.memoizedState=null,e}function Tg(e,t,s){var n=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(n.mode==="hidden")return e=La(t,n),t.lanes=536870912,mn(null,e);if(Bl(t),(e=Xe)?(e=gm(e,ii),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Vi!==null?{id:pi,overflow:_i}:null,retryLane:536870912,hydrationErrors:null},s=$h(e),s.return=t,t.child=s,xt=t,Xe=null)):e=null,e===null)throw Yi(t);return t.lanes=536870912,null}return La(t,n)}var p=e.memoizedState;if(p!==null){var N=p.dehydrated;if(Bl(t),c)if(t.flags&256)t.flags&=-257,t=af(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(ft||dr(e,t,s,!1),c=(s&e.childLanes)!==0,ft||c){if(n=Ge,n!==null&&(N=Yu(n,s),N!==0&&N!==p.retryLane))throw p.retryLane=N,Ds(e,N),zt(n,e,N),sc;qa(),t=af(e,t,s)}else e=p.treeContext,Xe=ri(N.nextSibling),xt=t,Le=!0,Gi=null,ii=!1,e!==null&&qh(t,e),t=La(t,n),t.flags|=4096;return t}return e=wi(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ja(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function rc(e,t,s,n,c){return Ls(t),s=Hl(e,t,s,n,void 0,c),n=Ul(),e!==null&&!ft?(Il(e,t,c),Di(e,t,c)):(Le&&n&&yl(t),t.flags|=1,wt(e,t,s,c),t.child)}function of(e,t,s,n,c,p){return Ls(t),t.updateQueue=null,s=cd(t,n,s,c),ld(e),n=Ul(),e!==null&&!ft?(Il(e,t,p),Di(e,t,p)):(Le&&n&&yl(t),t.flags|=1,wt(e,t,s,p),t.child)}function lf(e,t,s,n,c){if(Ls(t),t.stateNode===null){var p=lr,N=s.contextType;typeof N=="object"&&N!==null&&(p=Ct(N)),p=new s(n,p),t.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=tc,t.stateNode=p,p._reactInternals=t,p=t.stateNode,p.props=n,p.state=t.memoizedState,p.refs={},Dl(t),N=s.contextType,p.context=typeof N=="object"&&N!==null?Ct(N):lr,p.state=t.memoizedState,N=s.getDerivedStateFromProps,typeof N=="function"&&(ec(t,s,N,n),p.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(N=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),N!==p.state&&tc.enqueueReplaceState(p,p.state,null),cn(t,n,p,c),ln(),p.state=t.memoizedState),typeof p.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){p=t.stateNode;var z=t.memoizedProps,G=Is(s,z);p.props=G;var se=p.context,ce=s.contextType;N=lr,typeof ce=="object"&&ce!==null&&(N=Ct(ce));var de=s.getDerivedStateFromProps;ce=typeof de=="function"||typeof p.getSnapshotBeforeUpdate=="function",z=t.pendingProps!==z,ce||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(z||se!==N)&&Vd(t,p,n,N),Xi=!1;var re=t.memoizedState;p.state=re,cn(t,n,p,c),ln(),se=t.memoizedState,z||re!==se||Xi?(typeof de=="function"&&(ec(t,s,de,n),se=t.memoizedState),(G=Xi||Kd(t,s,G,n,re,se,N))?(ce||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(t.flags|=4194308)):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=se),p.props=n,p.state=se,p.context=N,n=G):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{p=t.stateNode,Ol(e,t),N=t.memoizedProps,ce=Is(s,N),p.props=ce,de=t.pendingProps,re=p.context,se=s.contextType,G=lr,typeof se=="object"&&se!==null&&(G=Ct(se)),z=s.getDerivedStateFromProps,(se=typeof z=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(N!==de||re!==G)&&Vd(t,p,n,G),Xi=!1,re=t.memoizedState,p.state=re,cn(t,n,p,c),ln();var oe=t.memoizedState;N!==de||re!==oe||Xi||e!==null&&e.dependencies!==null&&_a(e.dependencies)?(typeof z=="function"&&(ec(t,s,z,n),oe=t.memoizedState),(ce=Xi||Kd(t,s,ce,n,re,oe,G)||e!==null&&e.dependencies!==null&&_a(e.dependencies))?(se||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(n,oe,G),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(n,oe,G)),typeof p.componentDidUpdate=="function"&&(t.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof p.componentDidUpdate!="function"||N===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=oe),p.props=n,p.state=oe,p.context=G,n=ce):(typeof p.componentDidUpdate!="function"||N===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),n=!1)}return p=n,ja(e,t),n=(t.flags&128)!==0,p||n?(p=t.stateNode,s=n&&typeof s.getDerivedStateFromError!="function"?null:p.render(),t.flags|=1,e!==null&&n?(t.child=Hs(t,e.child,null,c),t.child=Hs(t,null,s,c)):wt(e,t,s,c),t.memoizedState=p.state,e=t.child):e=Di(e,t,c),e}function cf(e,t,s,n){return Ns(),t.flags|=256,wt(e,t,s,n),t.child}var nc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ac(e){return{baseLanes:e,cachePool:Xh()}}function oc(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=Vt),e}function uf(e,t,s){var n=t.pendingProps,c=!1,p=(t.flags&128)!==0,N;if((N=p)||(N=e!==null&&e.memoizedState===null?!1:(lt.current&2)!==0),N&&(c=!0,t.flags&=-129),N=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(c?es(t):ts(),(e=Xe)?(e=gm(e,ii),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Vi!==null?{id:pi,overflow:_i}:null,retryLane:536870912,hydrationErrors:null},s=$h(e),s.return=t,t.child=s,xt=t,Xe=null)):e=null,e===null)throw Yi(t);return Fc(e)?t.lanes=32:t.lanes=536870912,null}var z=n.children;return n=n.fallback,c?(ts(),c=t.mode,z=Ba({mode:"hidden",children:z},c),n=Os(n,c,s,null),z.return=t,n.return=t,z.sibling=n,t.child=z,n=t.child,n.memoizedState=ac(s),n.childLanes=oc(e,N,s),t.memoizedState=nc,mn(null,n)):(es(t),lc(t,z))}var G=e.memoizedState;if(G!==null&&(z=G.dehydrated,z!==null)){if(p)t.flags&256?(es(t),t.flags&=-257,t=cc(e,t,s)):t.memoizedState!==null?(ts(),t.child=e.child,t.flags|=128,t=null):(ts(),z=n.fallback,c=t.mode,n=Ba({mode:"visible",children:n.children},c),z=Os(z,c,s,null),z.flags|=2,n.return=t,z.return=t,n.sibling=z,t.child=n,Hs(t,e.child,null,s),n=t.child,n.memoizedState=ac(s),n.childLanes=oc(e,N,s),t.memoizedState=nc,t=mn(null,n));else if(es(t),Fc(z)){if(N=z.nextSibling&&z.nextSibling.dataset,N)var se=N.dgst;N=se,n=Error(o(419)),n.stack="",n.digest=N,tn({value:n,source:null,stack:null}),t=cc(e,t,s)}else if(ft||dr(e,t,s,!1),N=(s&e.childLanes)!==0,ft||N){if(N=Ge,N!==null&&(n=Yu(N,s),n!==0&&n!==G.retryLane))throw G.retryLane=n,Ds(e,n),zt(N,e,n),sc;$c(z)||qa(),t=cc(e,t,s)}else $c(z)?(t.flags|=192,t.child=e.child,t=null):(e=G.treeContext,Xe=ri(z.nextSibling),xt=t,Le=!0,Gi=null,ii=!1,e!==null&&qh(t,e),t=lc(t,n.children),t.flags|=4096);return t}return c?(ts(),z=n.fallback,c=t.mode,G=e.child,se=G.sibling,n=wi(G,{mode:"hidden",children:n.children}),n.subtreeFlags=G.subtreeFlags&65011712,se!==null?z=wi(se,z):(z=Os(z,c,s,null),z.flags|=2),z.return=t,n.return=t,n.sibling=z,t.child=n,mn(null,n),n=t.child,z=e.child.memoizedState,z===null?z=ac(s):(c=z.cachePool,c!==null?(G=ht._currentValue,c=c.parent!==G?{parent:G,pool:G}:c):c=Xh(),z={baseLanes:z.baseLanes|s,cachePool:c}),n.memoizedState=z,n.childLanes=oc(e,N,s),t.memoizedState=nc,mn(e.child,n)):(es(t),s=e.child,e=s.sibling,s=wi(s,{mode:"visible",children:n.children}),s.return=t,s.sibling=null,e!==null&&(N=t.deletions,N===null?(t.deletions=[e],t.flags|=16):N.push(e)),t.child=s,t.memoizedState=null,s)}function lc(e,t){return t=Ba({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ba(e,t){return e=Ft(22,e,null,t),e.lanes=0,e}function cc(e,t,s){return Hs(t,e.child,null,s),e=lc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hf(e,t,s){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),wl(e.return,t,s)}function uc(e,t,s,n,c,p){var N=e.memoizedState;N===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:s,tailMode:c,treeForkCount:p}:(N.isBackwards=t,N.rendering=null,N.renderingStartTime=0,N.last=n,N.tail=s,N.tailMode=c,N.treeForkCount=p)}function df(e,t,s){var n=t.pendingProps,c=n.revealOrder,p=n.tail;n=n.children;var N=lt.current,z=(N&2)!==0;if(z?(N=N&1|2,t.flags|=128):N&=1,q(lt,N),wt(e,t,n,s),n=Le?en:0,!z&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&hf(e,s,t);else if(e.tag===19)hf(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(s=t.child,c=null;s!==null;)e=s.alternate,e!==null&&wa(e)===null&&(c=s),s=s.sibling;s=c,s===null?(c=t.child,t.child=null):(c=s.sibling,s.sibling=null),uc(t,!1,c,s,p,n);break;case"backwards":case"unstable_legacy-backwards":for(s=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&wa(e)===null){t.child=c;break}e=c.sibling,c.sibling=s,s=c,c=e}uc(t,!0,s,null,p,n);break;case"together":uc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Di(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),rs|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(dr(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,s=wi(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=wi(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function hc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&_a(e)))}function Ag(e,t,s){switch(t.tag){case 3:B(t,t.stateNode.containerInfo),Wi(t,ht,e.memoizedState.cache),Ns();break;case 27:case 5:ne(t);break;case 4:B(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Bl(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(es(t),t.flags|=128,null):(s&t.child.childLanes)!==0?uf(e,t,s):(es(t),e=Di(e,t,s),e!==null?e.sibling:null);es(t);break;case 19:var c=(e.flags&128)!==0;if(n=(s&t.childLanes)!==0,n||(dr(e,t,s,!1),n=(s&t.childLanes)!==0),c){if(n)return df(e,t,s);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),q(lt,lt.current),n)break;return null;case 22:return t.lanes=0,rf(e,t,s,t.pendingProps);case 24:Wi(t,ht,e.memoizedState.cache)}return Di(e,t,s)}function ff(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)ft=!0;else{if(!hc(e,s)&&(t.flags&128)===0)return ft=!1,Ag(e,t,s);ft=(e.flags&131072)!==0}else ft=!1,Le&&(t.flags&1048576)!==0&&Zh(t,en,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Bs(t.elementType),t.type=e,typeof e=="function")_l(e)?(n=Is(e,n),t.tag=1,t=lf(null,t,e,n,s)):(t.tag=0,t=rc(null,t,e,n,s));else{if(e!=null){var c=e.$$typeof;if(c===x){t.tag=11,t=ef(null,t,e,n,s);break e}else if(c===D){t.tag=14,t=tf(null,t,e,n,s);break e}}throw t=X(e)||e,Error(o(306,t,""))}}return t;case 0:return rc(e,t,t.type,t.pendingProps,s);case 1:return n=t.type,c=Is(n,t.pendingProps),lf(e,t,n,c,s);case 3:e:{if(B(t,t.stateNode.containerInfo),e===null)throw Error(o(387));n=t.pendingProps;var p=t.memoizedState;c=p.element,Ol(e,t),cn(t,n,null,s);var N=t.memoizedState;if(n=N.cache,Wi(t,ht,n),n!==p.cache&&El(t,[ht],s,!0),ln(),n=N.element,p.isDehydrated)if(p={element:n,isDehydrated:!1,cache:N.cache},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){t=cf(e,t,n,s);break e}else if(n!==c){c=Qt(Error(o(424)),t),tn(c),t=cf(e,t,n,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Xe=ri(e.firstChild),xt=t,Le=!0,Gi=null,ii=!0,s=sd(t,null,n,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Ns(),n===c){t=Di(e,t,s);break e}wt(e,t,n,s)}t=t.child}return t;case 26:return ja(e,t),e===null?(s=wm(t.type,null,t.pendingProps,null))?t.memoizedState=s:Le||(s=t.type,e=t.pendingProps,n=Ja(fe.current).createElement(s),n[St]=t,n[Ot]=e,Et(n,s,e),yt(n),t.stateNode=n):t.memoizedState=wm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ne(t),e===null&&Le&&(n=t.stateNode=Sm(t.type,t.pendingProps,fe.current),xt=t,ii=!0,c=Xe,cs(t.type)?(Zc=c,Xe=ri(n.firstChild)):Xe=c),wt(e,t,t.pendingProps.children,s),ja(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((c=n=Xe)&&(n=r0(n,t.type,t.pendingProps,ii),n!==null?(t.stateNode=n,xt=t,Xe=ri(n.firstChild),ii=!1,c=!0):c=!1),c||Yi(t)),ne(t),c=t.type,p=t.pendingProps,N=e!==null?e.memoizedProps:null,n=p.children,Uc(c,p)?n=null:N!==null&&Uc(c,N)&&(t.flags|=32),t.memoizedState!==null&&(c=Hl(e,t,yg,null,null,s),Rn._currentValue=c),ja(e,t),wt(e,t,n,s),t.child;case 6:return e===null&&Le&&((e=s=Xe)&&(s=n0(s,t.pendingProps,ii),s!==null?(t.stateNode=s,xt=t,Xe=null,e=!0):e=!1),e||Yi(t)),null;case 13:return uf(e,t,s);case 4:return B(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Hs(t,null,n,s):wt(e,t,n,s),t.child;case 11:return ef(e,t,t.type,t.pendingProps,s);case 7:return wt(e,t,t.pendingProps,s),t.child;case 8:return wt(e,t,t.pendingProps.children,s),t.child;case 12:return wt(e,t,t.pendingProps.children,s),t.child;case 10:return n=t.pendingProps,Wi(t,t.type,n.value),wt(e,t,n.children,s),t.child;case 9:return c=t.type._context,n=t.pendingProps.children,Ls(t),c=Ct(c),n=n(c),t.flags|=1,wt(e,t,n,s),t.child;case 14:return tf(e,t,t.type,t.pendingProps,s);case 15:return sf(e,t,t.type,t.pendingProps,s);case 19:return df(e,t,s);case 31:return Tg(e,t,s);case 22:return rf(e,t,s,t.pendingProps);case 24:return Ls(t),n=Ct(ht),e===null?(c=Al(),c===null&&(c=Ge,p=kl(),c.pooledCache=p,p.refCount++,p!==null&&(c.pooledCacheLanes|=s),c=p),t.memoizedState={parent:n,cache:c},Dl(t),Wi(t,ht,c)):((e.lanes&s)!==0&&(Ol(e,t),cn(t,null,null,s),ln()),c=e.memoizedState,p=t.memoizedState,c.parent!==n?(c={parent:n,cache:n},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Wi(t,ht,n)):(n=p.cache,Wi(t,ht,n),n!==c.cache&&El(t,[ht],s,!0))),wt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Oi(e){e.flags|=4}function dc(e,t,s,n,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(If())e.flags|=8192;else throw zs=ba,Rl}else e.flags&=-16777217}function mf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Rm(t))if(If())e.flags|=8192;else throw zs=ba,Rl}function za(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ku():536870912,e.lanes|=t,wr|=t)}function pn(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var n=null;s!==null;)s.alternate!==null&&(n=s),s=s.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Je(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,n=0;if(t)for(var c=e.child;c!==null;)s|=c.lanes|c.childLanes,n|=c.subtreeFlags&65011712,n|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)s|=c.lanes|c.childLanes,n|=c.subtreeFlags,n|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=n,e.childLanes=s,t}function Rg(e,t,s){var n=t.pendingProps;switch(bl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(t),null;case 1:return Je(t),null;case 3:return s=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ti(ht),ie(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(hr(t)?Oi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,xl())),Je(t),null;case 26:var c=t.type,p=t.memoizedState;return e===null?(Oi(t),p!==null?(Je(t),mf(t,p)):(Je(t),dc(t,c,null,n,s))):p?p!==e.memoizedState?(Oi(t),Je(t),mf(t,p)):(Je(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Oi(t),Je(t),dc(t,c,e,n,s)),null;case 27:if(me(t),s=fe.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Oi(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return Je(t),null}e=W.current,hr(t)?Kh(t):(e=Sm(c,n,s),t.stateNode=e,Oi(t))}return Je(t),null;case 5:if(me(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Oi(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return Je(t),null}if(p=W.current,hr(t))Kh(t);else{var N=Ja(fe.current);switch(p){case 1:p=N.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:p=N.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":p=N.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":p=N.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":p=N.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof n.is=="string"?N.createElement("select",{is:n.is}):N.createElement("select"),n.multiple?p.multiple=!0:n.size&&(p.size=n.size);break;default:p=typeof n.is=="string"?N.createElement(c,{is:n.is}):N.createElement(c)}}p[St]=t,p[Ot]=n;e:for(N=t.child;N!==null;){if(N.tag===5||N.tag===6)p.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===t)break e;for(;N.sibling===null;){if(N.return===null||N.return===t)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}t.stateNode=p;e:switch(Et(p,c,n),c){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Oi(t)}}return Je(t),dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Oi(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(o(166));if(e=fe.current,hr(t)){if(e=t.stateNode,s=t.memoizedProps,n=null,c=xt,c!==null)switch(c.tag){case 27:case 5:n=c.memoizedProps}e[St]=t,e=!!(e.nodeValue===s||n!==null&&n.suppressHydrationWarning===!0||um(e.nodeValue,s)),e||Yi(t,!0)}else e=Ja(e).createTextNode(n),e[St]=t,t.stateNode=e}return Je(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(n=hr(t),s!==null){if(e===null){if(!n)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[St]=t}else Ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),e=!1}else s=xl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(qt(t),t):(qt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Je(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=hr(t),n!==null&&n.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[St]=t}else Ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),c=!1}else c=xl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(qt(t),t):(qt(t),null)}return qt(t),(t.flags&128)!==0?(t.lanes=s,t):(s=n!==null,e=e!==null&&e.memoizedState!==null,s&&(n=t.child,c=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(c=n.alternate.memoizedState.cachePool.pool),p=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(p=n.memoizedState.cachePool.pool),p!==c&&(n.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),za(t,t.updateQueue),Je(t),null);case 4:return ie(),e===null&&Lc(t.stateNode.containerInfo),Je(t),null;case 10:return Ti(t.type),Je(t),null;case 19:if(H(lt),n=t.memoizedState,n===null)return Je(t),null;if(c=(t.flags&128)!==0,p=n.rendering,p===null)if(c)pn(n,!1);else{if(nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(p=wa(e),p!==null){for(t.flags|=128,pn(n,!1),e=p.updateQueue,t.updateQueue=e,za(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Ph(s,e),s=s.sibling;return q(lt,lt.current&1|2),Le&&Ei(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&vt()>$a&&(t.flags|=128,c=!0,pn(n,!1),t.lanes=4194304)}else{if(!c)if(e=wa(p),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,za(t,e),pn(n,!0),n.tail===null&&n.tailMode==="hidden"&&!p.alternate&&!Le)return Je(t),null}else 2*vt()-n.renderingStartTime>$a&&s!==536870912&&(t.flags|=128,c=!0,pn(n,!1),t.lanes=4194304);n.isBackwards?(p.sibling=t.child,t.child=p):(e=n.last,e!==null?e.sibling=p:t.child=p,n.last=p)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=vt(),e.sibling=null,s=lt.current,q(lt,c?s&1|2:s&1),Le&&Ei(t,n.treeForkCount),e):(Je(t),null);case 22:case 23:return qt(t),jl(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(s&536870912)!==0&&(t.flags&128)===0&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),s=t.updateQueue,s!==null&&za(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==s&&(t.flags|=2048),e!==null&&H(js),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ti(ht),Je(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Dg(e,t){switch(bl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ti(ht),ie(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(qt(t),t.alternate===null)throw Error(o(340));Ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(qt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(lt),null;case 4:return ie(),null;case 10:return Ti(t.type),null;case 22:case 23:return qt(t),jl(),e!==null&&H(js),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ti(ht),null;case 25:return null;default:return null}}function pf(e,t){switch(bl(t),t.tag){case 3:Ti(ht),ie();break;case 26:case 27:case 5:me(t);break;case 4:ie();break;case 31:t.memoizedState!==null&&qt(t);break;case 13:qt(t);break;case 19:H(lt);break;case 10:Ti(t.type);break;case 22:case 23:qt(t),jl(),e!==null&&H(js);break;case 24:Ti(ht)}}function _n(e,t){try{var s=t.updateQueue,n=s!==null?s.lastEffect:null;if(n!==null){var c=n.next;s=c;do{if((s.tag&e)===e){n=void 0;var p=s.create,N=s.inst;n=p(),N.destroy=n}s=s.next}while(s!==c)}}catch(z){$e(t,t.return,z)}}function is(e,t,s){try{var n=t.updateQueue,c=n!==null?n.lastEffect:null;if(c!==null){var p=c.next;n=p;do{if((n.tag&e)===e){var N=n.inst,z=N.destroy;if(z!==void 0){N.destroy=void 0,c=t;var G=s,se=z;try{se()}catch(ce){$e(c,G,ce)}}}n=n.next}while(n!==p)}}catch(ce){$e(t,t.return,ce)}}function _f(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{nd(t,s)}catch(n){$e(e,e.return,n)}}}function vf(e,t,s){s.props=Is(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(n){$e(e,t,n)}}function vn(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof s=="function"?e.refCleanup=s(n):s.current=n}}catch(c){$e(e,t,c)}}function vi(e,t){var s=e.ref,n=e.refCleanup;if(s!==null)if(typeof n=="function")try{n()}catch(c){$e(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(c){$e(e,t,c)}else s.current=null}function gf(e){var t=e.type,s=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&n.focus();break e;case"img":s.src?n.src=s.src:s.srcSet&&(n.srcset=s.srcSet)}}catch(c){$e(e,e.return,c)}}function fc(e,t,s){try{var n=e.stateNode;Jg(n,e.type,s,t),n[Ot]=t}catch(c){$e(e,e.return,c)}}function yf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&cs(e.type)||e.tag===4}function mc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&cs(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function pc(e,t,s){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=xi));else if(n!==4&&(n===27&&cs(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(pc(e,t,s),e=e.sibling;e!==null;)pc(e,t,s),e=e.sibling}function Ha(e,t,s){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(n!==4&&(n===27&&cs(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(Ha(e,t,s),e=e.sibling;e!==null;)Ha(e,t,s),e=e.sibling}function bf(e){var t=e.stateNode,s=e.memoizedProps;try{for(var n=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Et(t,n,s),t[St]=e,t[Ot]=s}catch(p){$e(e,e.return,p)}}var Ni=!1,mt=!1,_c=!1,Sf=typeof WeakSet=="function"?WeakSet:Set,bt=null;function Og(e,t){if(e=e.containerInfo,zc=no,e=Nh(e),cl(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var n=s.getSelection&&s.getSelection();if(n&&n.rangeCount!==0){s=n.anchorNode;var c=n.anchorOffset,p=n.focusNode;n=n.focusOffset;try{s.nodeType,p.nodeType}catch{s=null;break e}var N=0,z=-1,G=-1,se=0,ce=0,de=e,re=null;t:for(;;){for(var oe;de!==s||c!==0&&de.nodeType!==3||(z=N+c),de!==p||n!==0&&de.nodeType!==3||(G=N+n),de.nodeType===3&&(N+=de.nodeValue.length),(oe=de.firstChild)!==null;)re=de,de=oe;for(;;){if(de===e)break t;if(re===s&&++se===c&&(z=N),re===p&&++ce===n&&(G=N),(oe=de.nextSibling)!==null)break;de=re,re=de.parentNode}de=oe}s=z===-1||G===-1?null:{start:z,end:G}}else s=null}s=s||{start:0,end:0}}else s=null;for(Hc={focusedElem:e,selectionRange:s},no=!1,bt=t;bt!==null;)if(t=bt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,bt=e;else for(;bt!==null;){switch(t=bt,p=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)c=e[s],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&p!==null){e=void 0,s=t,c=p.memoizedProps,p=p.memoizedState,n=s.stateNode;try{var ve=Is(s.type,c);e=n.getSnapshotBeforeUpdate(ve,p),n.__reactInternalSnapshotBeforeUpdate=e}catch(xe){$e(s,s.return,xe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Pc(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Pc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,bt=e;break}bt=t.return}}function xf(e,t,s){var n=s.flags;switch(s.tag){case 0:case 11:case 15:Li(e,s),n&4&&_n(5,s);break;case 1:if(Li(e,s),n&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(N){$e(s,s.return,N)}else{var c=Is(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(N){$e(s,s.return,N)}}n&64&&_f(s),n&512&&vn(s,s.return);break;case 3:if(Li(e,s),n&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{nd(e,t)}catch(N){$e(s,s.return,N)}}break;case 27:t===null&&n&4&&bf(s);case 26:case 5:Li(e,s),t===null&&n&4&&gf(s),n&512&&vn(s,s.return);break;case 12:Li(e,s);break;case 31:Li(e,s),n&4&&Ef(e,s);break;case 13:Li(e,s),n&4&&kf(e,s),n&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=Ig.bind(null,s),a0(e,s))));break;case 22:if(n=s.memoizedState!==null||Ni,!n){t=t!==null&&t.memoizedState!==null||mt,c=Ni;var p=mt;Ni=n,(mt=t)&&!p?ji(e,s,(s.subtreeFlags&8772)!==0):Li(e,s),Ni=c,mt=p}break;case 30:break;default:Li(e,s)}}function Cf(e){var t=e.alternate;t!==null&&(e.alternate=null,Cf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ko(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Qe=null,Mt=!1;function Mi(e,t,s){for(s=s.child;s!==null;)wf(e,t,s),s=s.sibling}function wf(e,t,s){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(ws,s)}catch{}switch(s.tag){case 26:mt||vi(s,t),Mi(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:mt||vi(s,t);var n=Qe,c=Mt;cs(s.type)&&(Qe=s.stateNode,Mt=!1),Mi(e,t,s),kn(s.stateNode),Qe=n,Mt=c;break;case 5:mt||vi(s,t);case 6:if(n=Qe,c=Mt,Qe=null,Mi(e,t,s),Qe=n,Mt=c,Qe!==null)if(Mt)try{(Qe.nodeType===9?Qe.body:Qe.nodeName==="HTML"?Qe.ownerDocument.body:Qe).removeChild(s.stateNode)}catch(p){$e(s,t,p)}else try{Qe.removeChild(s.stateNode)}catch(p){$e(s,t,p)}break;case 18:Qe!==null&&(Mt?(e=Qe,_m(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Nr(e)):_m(Qe,s.stateNode));break;case 4:n=Qe,c=Mt,Qe=s.stateNode.containerInfo,Mt=!0,Mi(e,t,s),Qe=n,Mt=c;break;case 0:case 11:case 14:case 15:is(2,s,t),mt||is(4,s,t),Mi(e,t,s);break;case 1:mt||(vi(s,t),n=s.stateNode,typeof n.componentWillUnmount=="function"&&vf(s,t,n)),Mi(e,t,s);break;case 21:Mi(e,t,s);break;case 22:mt=(n=mt)||s.memoizedState!==null,Mi(e,t,s),mt=n;break;default:Mi(e,t,s)}}function Ef(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Nr(e)}catch(s){$e(t,t.return,s)}}}function kf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Nr(e)}catch(s){$e(t,t.return,s)}}function Ng(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Sf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Sf),t;default:throw Error(o(435,e.tag))}}function Ua(e,t){var s=Ng(e);t.forEach(function(n){if(!s.has(n)){s.add(n);var c=Pg.bind(null,e,n);n.then(c,c)}})}function Lt(e,t){var s=t.deletions;if(s!==null)for(var n=0;n<s.length;n++){var c=s[n],p=e,N=t,z=N;e:for(;z!==null;){switch(z.tag){case 27:if(cs(z.type)){Qe=z.stateNode,Mt=!1;break e}break;case 5:Qe=z.stateNode,Mt=!1;break e;case 3:case 4:Qe=z.stateNode.containerInfo,Mt=!0;break e}z=z.return}if(Qe===null)throw Error(o(160));wf(p,N,c),Qe=null,Mt=!1,p=c.alternate,p!==null&&(p.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tf(t,e),t=t.sibling}var ui=null;function Tf(e,t){var s=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Lt(t,e),jt(e),n&4&&(is(3,e,e.return),_n(3,e),is(5,e,e.return));break;case 1:Lt(t,e),jt(e),n&512&&(mt||s===null||vi(s,s.return)),n&64&&Ni&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?n:s.concat(n))));break;case 26:var c=ui;if(Lt(t,e),jt(e),n&512&&(mt||s===null||vi(s,s.return)),n&4){var p=s!==null?s.memoizedState:null;if(n=e.memoizedState,s===null)if(n===null)if(e.stateNode===null){e:{n=e.type,s=e.memoizedProps,c=c.ownerDocument||c;t:switch(n){case"title":p=c.getElementsByTagName("title")[0],(!p||p[Fr]||p[St]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=c.createElement(n),c.head.insertBefore(p,c.querySelector("head > title"))),Et(p,n,s),p[St]=e,yt(p),n=p;break e;case"link":var N=Tm("link","href",c).get(n+(s.href||""));if(N){for(var z=0;z<N.length;z++)if(p=N[z],p.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&p.getAttribute("rel")===(s.rel==null?null:s.rel)&&p.getAttribute("title")===(s.title==null?null:s.title)&&p.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){N.splice(z,1);break t}}p=c.createElement(n),Et(p,n,s),c.head.appendChild(p);break;case"meta":if(N=Tm("meta","content",c).get(n+(s.content||""))){for(z=0;z<N.length;z++)if(p=N[z],p.getAttribute("content")===(s.content==null?null:""+s.content)&&p.getAttribute("name")===(s.name==null?null:s.name)&&p.getAttribute("property")===(s.property==null?null:s.property)&&p.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&p.getAttribute("charset")===(s.charSet==null?null:s.charSet)){N.splice(z,1);break t}}p=c.createElement(n),Et(p,n,s),c.head.appendChild(p);break;default:throw Error(o(468,n))}p[St]=e,yt(p),n=p}e.stateNode=n}else Am(c,e.type,e.stateNode);else e.stateNode=km(c,n,e.memoizedProps);else p!==n?(p===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):p.count--,n===null?Am(c,e.type,e.stateNode):km(c,n,e.memoizedProps)):n===null&&e.stateNode!==null&&fc(e,e.memoizedProps,s.memoizedProps)}break;case 27:Lt(t,e),jt(e),n&512&&(mt||s===null||vi(s,s.return)),s!==null&&n&4&&fc(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Lt(t,e),jt(e),n&512&&(mt||s===null||vi(s,s.return)),e.flags&32){c=e.stateNode;try{tr(c,"")}catch(ve){$e(e,e.return,ve)}}n&4&&e.stateNode!=null&&(c=e.memoizedProps,fc(e,c,s!==null?s.memoizedProps:c)),n&1024&&(_c=!0);break;case 6:if(Lt(t,e),jt(e),n&4){if(e.stateNode===null)throw Error(o(162));n=e.memoizedProps,s=e.stateNode;try{s.nodeValue=n}catch(ve){$e(e,e.return,ve)}}break;case 3:if(to=null,c=ui,ui=Qa(t.containerInfo),Lt(t,e),ui=c,jt(e),n&4&&s!==null&&s.memoizedState.isDehydrated)try{Nr(t.containerInfo)}catch(ve){$e(e,e.return,ve)}_c&&(_c=!1,Af(e));break;case 4:n=ui,ui=Qa(e.stateNode.containerInfo),Lt(t,e),jt(e),ui=n;break;case 12:Lt(t,e),jt(e);break;case 31:Lt(t,e),jt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ua(e,n)));break;case 13:Lt(t,e),jt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Pa=vt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ua(e,n)));break;case 22:c=e.memoizedState!==null;var G=s!==null&&s.memoizedState!==null,se=Ni,ce=mt;if(Ni=se||c,mt=ce||G,Lt(t,e),mt=ce,Ni=se,jt(e),n&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(s===null||G||Ni||mt||Ps(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){G=s=t;try{if(p=G.stateNode,c)N=p.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{z=G.stateNode;var de=G.memoizedProps.style,re=de!=null&&de.hasOwnProperty("display")?de.display:null;z.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(ve){$e(G,G.return,ve)}}}else if(t.tag===6){if(s===null){G=t;try{G.stateNode.nodeValue=c?"":G.memoizedProps}catch(ve){$e(G,G.return,ve)}}}else if(t.tag===18){if(s===null){G=t;try{var oe=G.stateNode;c?vm(oe,!0):vm(G.stateNode,!1)}catch(ve){$e(G,G.return,ve)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(s=n.retryQueue,s!==null&&(n.retryQueue=null,Ua(e,s))));break;case 19:Lt(t,e),jt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ua(e,n)));break;case 30:break;case 21:break;default:Lt(t,e),jt(e)}}function jt(e){var t=e.flags;if(t&2){try{for(var s,n=e.return;n!==null;){if(yf(n)){s=n;break}n=n.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var c=s.stateNode,p=mc(e);Ha(e,p,c);break;case 5:var N=s.stateNode;s.flags&32&&(tr(N,""),s.flags&=-33);var z=mc(e);Ha(e,z,N);break;case 3:case 4:var G=s.stateNode.containerInfo,se=mc(e);pc(e,se,G);break;default:throw Error(o(161))}}catch(ce){$e(e,e.return,ce)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Af(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Af(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Li(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)xf(e,t.alternate,t),t=t.sibling}function Ps(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:is(4,t,t.return),Ps(t);break;case 1:vi(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&vf(t,t.return,s),Ps(t);break;case 27:kn(t.stateNode);case 26:case 5:vi(t,t.return),Ps(t);break;case 22:t.memoizedState===null&&Ps(t);break;case 30:Ps(t);break;default:Ps(t)}e=e.sibling}}function ji(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,c=e,p=t,N=p.flags;switch(p.tag){case 0:case 11:case 15:ji(c,p,s),_n(4,p);break;case 1:if(ji(c,p,s),n=p,c=n.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(se){$e(n,n.return,se)}if(n=p,c=n.updateQueue,c!==null){var z=n.stateNode;try{var G=c.shared.hiddenCallbacks;if(G!==null)for(c.shared.hiddenCallbacks=null,c=0;c<G.length;c++)rd(G[c],z)}catch(se){$e(n,n.return,se)}}s&&N&64&&_f(p),vn(p,p.return);break;case 27:bf(p);case 26:case 5:ji(c,p,s),s&&n===null&&N&4&&gf(p),vn(p,p.return);break;case 12:ji(c,p,s);break;case 31:ji(c,p,s),s&&N&4&&Ef(c,p);break;case 13:ji(c,p,s),s&&N&4&&kf(c,p);break;case 22:p.memoizedState===null&&ji(c,p,s),vn(p,p.return);break;case 30:break;default:ji(c,p,s)}t=t.sibling}}function vc(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&sn(s))}function gc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sn(e))}function hi(e,t,s,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Rf(e,t,s,n),t=t.sibling}function Rf(e,t,s,n){var c=t.flags;switch(t.tag){case 0:case 11:case 15:hi(e,t,s,n),c&2048&&_n(9,t);break;case 1:hi(e,t,s,n);break;case 3:hi(e,t,s,n),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sn(e)));break;case 12:if(c&2048){hi(e,t,s,n),e=t.stateNode;try{var p=t.memoizedProps,N=p.id,z=p.onPostCommit;typeof z=="function"&&z(N,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(G){$e(t,t.return,G)}}else hi(e,t,s,n);break;case 31:hi(e,t,s,n);break;case 13:hi(e,t,s,n);break;case 23:break;case 22:p=t.stateNode,N=t.alternate,t.memoizedState!==null?p._visibility&2?hi(e,t,s,n):gn(e,t):p._visibility&2?hi(e,t,s,n):(p._visibility|=2,Sr(e,t,s,n,(t.subtreeFlags&10256)!==0||!1)),c&2048&&vc(N,t);break;case 24:hi(e,t,s,n),c&2048&&gc(t.alternate,t);break;default:hi(e,t,s,n)}}function Sr(e,t,s,n,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var p=e,N=t,z=s,G=n,se=N.flags;switch(N.tag){case 0:case 11:case 15:Sr(p,N,z,G,c),_n(8,N);break;case 23:break;case 22:var ce=N.stateNode;N.memoizedState!==null?ce._visibility&2?Sr(p,N,z,G,c):gn(p,N):(ce._visibility|=2,Sr(p,N,z,G,c)),c&&se&2048&&vc(N.alternate,N);break;case 24:Sr(p,N,z,G,c),c&&se&2048&&gc(N.alternate,N);break;default:Sr(p,N,z,G,c)}t=t.sibling}}function gn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,n=t,c=n.flags;switch(n.tag){case 22:gn(s,n),c&2048&&vc(n.alternate,n);break;case 24:gn(s,n),c&2048&&gc(n.alternate,n);break;default:gn(s,n)}t=t.sibling}}var yn=8192;function xr(e,t,s){if(e.subtreeFlags&yn)for(e=e.child;e!==null;)Df(e,t,s),e=e.sibling}function Df(e,t,s){switch(e.tag){case 26:xr(e,t,s),e.flags&yn&&e.memoizedState!==null&&g0(s,ui,e.memoizedState,e.memoizedProps);break;case 5:xr(e,t,s);break;case 3:case 4:var n=ui;ui=Qa(e.stateNode.containerInfo),xr(e,t,s),ui=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=yn,yn=16777216,xr(e,t,s),yn=n):xr(e,t,s));break;default:xr(e,t,s)}}function Of(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function bn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var n=t[s];bt=n,Mf(n,e)}Of(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nf(e),e=e.sibling}function Nf(e){switch(e.tag){case 0:case 11:case 15:bn(e),e.flags&2048&&is(9,e,e.return);break;case 3:bn(e);break;case 12:bn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ia(e)):bn(e);break;default:bn(e)}}function Ia(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var n=t[s];bt=n,Mf(n,e)}Of(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:is(8,t,t.return),Ia(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,Ia(t));break;default:Ia(t)}e=e.sibling}}function Mf(e,t){for(;bt!==null;){var s=bt;switch(s.tag){case 0:case 11:case 15:is(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var n=s.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:sn(s.memoizedState.cache)}if(n=s.child,n!==null)n.return=s,bt=n;else e:for(s=e;bt!==null;){n=bt;var c=n.sibling,p=n.return;if(Cf(n),n===s){bt=null;break e}if(c!==null){c.return=p,bt=c;break e}bt=p}}}var Mg={getCacheForType:function(e){var t=Ct(ht),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Ct(ht).controller.signal}},Lg=typeof WeakMap=="function"?WeakMap:Map,Ie=0,Ge=null,Re=null,Ne=0,Pe=0,Kt=null,ss=!1,Cr=!1,yc=!1,Bi=0,nt=0,rs=0,$s=0,bc=0,Vt=0,wr=0,Sn=null,Bt=null,Sc=!1,Pa=0,Lf=0,$a=1/0,Fa=null,ns=null,gt=0,as=null,Er=null,zi=0,xc=0,Cc=null,jf=null,xn=0,wc=null;function Gt(){return(Ie&2)!==0&&Ne!==0?Ne&-Ne:V.T!==null?Dc():Wu()}function Bf(){if(Vt===0)if((Ne&536870912)===0||Le){var e=Xn;Xn<<=1,(Xn&3932160)===0&&(Xn=262144),Vt=e}else Vt=536870912;return e=Zt.current,e!==null&&(e.flags|=32),Vt}function zt(e,t,s){(e===Ge&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)&&(kr(e,0),os(e,Ne,Vt,!1)),$r(e,s),((Ie&2)===0||e!==Ge)&&(e===Ge&&((Ie&2)===0&&($s|=s),nt===4&&os(e,Ne,Vt,!1)),gi(e))}function zf(e,t,s){if((Ie&6)!==0)throw Error(o(327));var n=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Pr(e,t),c=n?zg(e,t):kc(e,t,!0),p=n;do{if(c===0){Cr&&!n&&os(e,t,0,!1);break}else{if(s=e.current.alternate,p&&!jg(s)){c=kc(e,t,!1),p=!1;continue}if(c===2){if(p=t,e.errorRecoveryDisabledLanes&p)var N=0;else N=e.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){t=N;e:{var z=e;c=Sn;var G=z.current.memoizedState.isDehydrated;if(G&&(kr(z,N).flags|=256),N=kc(z,N,!1),N!==2){if(yc&&!G){z.errorRecoveryDisabledLanes|=p,$s|=p,c=4;break e}p=Bt,Bt=c,p!==null&&(Bt===null?Bt=p:Bt.push.apply(Bt,p))}c=N}if(p=!1,c!==2)continue}}if(c===1){kr(e,0),os(e,t,0,!0);break}e:{switch(n=e,p=c,p){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:os(n,t,Vt,!ss);break e;case 2:Bt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=Pa+300-vt(),10<c)){if(os(n,t,Vt,!ss),Qn(n,0,!0)!==0)break e;zi=t,n.timeoutHandle=mm(Hf.bind(null,n,s,Bt,Fa,Sc,t,Vt,$s,wr,ss,p,"Throttled",-0,0),c);break e}Hf(n,s,Bt,Fa,Sc,t,Vt,$s,wr,ss,p,null,-0,0)}}break}while(!0);gi(e)}function Hf(e,t,s,n,c,p,N,z,G,se,ce,de,re,oe){if(e.timeoutHandle=-1,de=t.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xi},Df(t,p,de);var ve=(p&62914560)===p?Pa-vt():(p&4194048)===p?Lf-vt():0;if(ve=y0(de,ve),ve!==null){zi=p,e.cancelPendingCommit=ve(Kf.bind(null,e,t,p,s,n,c,N,z,G,ce,de,null,re,oe)),os(e,p,N,!se);return}}Kf(e,t,p,s,n,c,N,z,G)}function jg(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var n=0;n<s.length;n++){var c=s[n],p=c.getSnapshot;c=c.value;try{if(!$t(p(),c))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function os(e,t,s,n){t&=~bc,t&=~$s,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var c=t;0<c;){var p=31-Pt(c),N=1<<p;n[p]=-1,c&=~N}s!==0&&Vu(e,s,t)}function Za(){return(Ie&6)===0?(Cn(0),!1):!0}function Ec(){if(Re!==null){if(Pe===0)var e=Re.return;else e=Re,ki=Ms=null,Pl(e),_r=null,nn=0,e=Re;for(;e!==null;)pf(e.alternate,e),e=e.return;Re=null}}function kr(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,t0(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),zi=0,Ec(),Ge=e,Re=s=wi(e.current,null),Ne=t,Pe=0,Kt=null,ss=!1,Cr=Pr(e,t),yc=!1,wr=Vt=bc=$s=rs=nt=0,Bt=Sn=null,Sc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var c=31-Pt(n),p=1<<c;t|=e[c],n&=~p}return Bi=t,ha(),s}function Uf(e,t){ke=null,V.H=fn,t===pr||t===ya?(t=ed(),Pe=3):t===Rl?(t=ed(),Pe=4):Pe=t===sc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Kt=t,Re===null&&(nt=1,Ma(e,Qt(t,e.current)))}function If(){var e=Zt.current;return e===null?!0:(Ne&4194048)===Ne?si===null:(Ne&62914560)===Ne||(Ne&536870912)!==0?e===si:!1}function Pf(){var e=V.H;return V.H=fn,e===null?fn:e}function $f(){var e=V.A;return V.A=Mg,e}function qa(){nt=4,ss||(Ne&4194048)!==Ne&&Zt.current!==null||(Cr=!0),(rs&134217727)===0&&($s&134217727)===0||Ge===null||os(Ge,Ne,Vt,!1)}function kc(e,t,s){var n=Ie;Ie|=2;var c=Pf(),p=$f();(Ge!==e||Ne!==t)&&(Fa=null,kr(e,t)),t=!1;var N=nt;e:do try{if(Pe!==0&&Re!==null){var z=Re,G=Kt;switch(Pe){case 8:Ec(),N=6;break e;case 3:case 2:case 9:case 6:Zt.current===null&&(t=!0);var se=Pe;if(Pe=0,Kt=null,Tr(e,z,G,se),s&&Cr){N=0;break e}break;default:se=Pe,Pe=0,Kt=null,Tr(e,z,G,se)}}Bg(),N=nt;break}catch(ce){Uf(e,ce)}while(!0);return t&&e.shellSuspendCounter++,ki=Ms=null,Ie=n,V.H=c,V.A=p,Re===null&&(Ge=null,Ne=0,ha()),N}function Bg(){for(;Re!==null;)Ff(Re)}function zg(e,t){var s=Ie;Ie|=2;var n=Pf(),c=$f();Ge!==e||Ne!==t?(Fa=null,$a=vt()+500,kr(e,t)):Cr=Pr(e,t);e:do try{if(Pe!==0&&Re!==null){t=Re;var p=Kt;t:switch(Pe){case 1:Pe=0,Kt=null,Tr(e,t,p,1);break;case 2:case 9:if(Jh(p)){Pe=0,Kt=null,Zf(t);break}t=function(){Pe!==2&&Pe!==9||Ge!==e||(Pe=7),gi(e)},p.then(t,t);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:Jh(p)?(Pe=0,Kt=null,Zf(t)):(Pe=0,Kt=null,Tr(e,t,p,7));break;case 5:var N=null;switch(Re.tag){case 26:N=Re.memoizedState;case 5:case 27:var z=Re;if(N?Rm(N):z.stateNode.complete){Pe=0,Kt=null;var G=z.sibling;if(G!==null)Re=G;else{var se=z.return;se!==null?(Re=se,Ka(se)):Re=null}break t}}Pe=0,Kt=null,Tr(e,t,p,5);break;case 6:Pe=0,Kt=null,Tr(e,t,p,6);break;case 8:Ec(),nt=6;break e;default:throw Error(o(462))}}Hg();break}catch(ce){Uf(e,ce)}while(!0);return ki=Ms=null,V.H=n,V.A=c,Ie=s,Re!==null?0:(Ge=null,Ne=0,ha(),nt)}function Hg(){for(;Re!==null&&!Ks();)Ff(Re)}function Ff(e){var t=ff(e.alternate,e,Bi);e.memoizedProps=e.pendingProps,t===null?Ka(e):Re=t}function Zf(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=of(s,t,t.pendingProps,t.type,void 0,Ne);break;case 11:t=of(s,t,t.pendingProps,t.type.render,t.ref,Ne);break;case 5:Pl(t);default:pf(s,t),t=Re=Ph(t,Bi),t=ff(s,t,Bi)}e.memoizedProps=e.pendingProps,t===null?Ka(e):Re=t}function Tr(e,t,s,n){ki=Ms=null,Pl(t),_r=null,nn=0;var c=t.return;try{if(kg(e,c,t,s,Ne)){nt=1,Ma(e,Qt(s,e.current)),Re=null;return}}catch(p){if(c!==null)throw Re=c,p;nt=1,Ma(e,Qt(s,e.current)),Re=null;return}t.flags&32768?(Le||n===1?e=!0:Cr||(Ne&536870912)!==0?e=!1:(ss=e=!0,(n===2||n===9||n===3||n===6)&&(n=Zt.current,n!==null&&n.tag===13&&(n.flags|=16384))),qf(t,e)):Ka(t)}function Ka(e){var t=e;do{if((t.flags&32768)!==0){qf(t,ss);return}e=t.return;var s=Rg(t.alternate,t,Bi);if(s!==null){Re=s;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);nt===0&&(nt=5)}function qf(e,t){do{var s=Dg(e.alternate,e);if(s!==null){s.flags&=32767,Re=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Re=e;return}Re=e=s}while(e!==null);nt=6,Re=null}function Kf(e,t,s,n,c,p,N,z,G){e.cancelPendingCommit=null;do Va();while(gt!==0);if((Ie&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(p=t.lanes|t.childLanes,p|=ml,vv(e,s,p,N,z,G),e===Ge&&(Re=Ge=null,Ne=0),Er=t,as=e,zi=s,xc=p,Cc=c,jf=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,$g(Ut,function(){return Xf(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=V.T,V.T=null,c=Q.p,Q.p=2,N=Ie,Ie|=4;try{Og(e,t,s)}finally{Ie=N,Q.p=c,V.T=n}}gt=1,Vf(),Gf(),Yf()}}function Vf(){if(gt===1){gt=0;var e=as,t=Er,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=V.T,V.T=null;var n=Q.p;Q.p=2;var c=Ie;Ie|=4;try{Tf(t,e);var p=Hc,N=Nh(e.containerInfo),z=p.focusedElem,G=p.selectionRange;if(N!==z&&z&&z.ownerDocument&&Oh(z.ownerDocument.documentElement,z)){if(G!==null&&cl(z)){var se=G.start,ce=G.end;if(ce===void 0&&(ce=se),"selectionStart"in z)z.selectionStart=se,z.selectionEnd=Math.min(ce,z.value.length);else{var de=z.ownerDocument||document,re=de&&de.defaultView||window;if(re.getSelection){var oe=re.getSelection(),ve=z.textContent.length,xe=Math.min(G.start,ve),Ve=G.end===void 0?xe:Math.min(G.end,ve);!oe.extend&&xe>Ve&&(N=Ve,Ve=xe,xe=N);var J=Dh(z,xe),Y=Dh(z,Ve);if(J&&Y&&(oe.rangeCount!==1||oe.anchorNode!==J.node||oe.anchorOffset!==J.offset||oe.focusNode!==Y.node||oe.focusOffset!==Y.offset)){var te=de.createRange();te.setStart(J.node,J.offset),oe.removeAllRanges(),xe>Ve?(oe.addRange(te),oe.extend(Y.node,Y.offset)):(te.setEnd(Y.node,Y.offset),oe.addRange(te))}}}}for(de=[],oe=z;oe=oe.parentNode;)oe.nodeType===1&&de.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<de.length;z++){var ue=de[z];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}no=!!zc,Hc=zc=null}finally{Ie=c,Q.p=n,V.T=s}}e.current=t,gt=2}}function Gf(){if(gt===2){gt=0;var e=as,t=Er,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=V.T,V.T=null;var n=Q.p;Q.p=2;var c=Ie;Ie|=4;try{xf(e,t.alternate,t)}finally{Ie=c,Q.p=n,V.T=s}}gt=3}}function Yf(){if(gt===4||gt===3){gt=0,Dt();var e=as,t=Er,s=zi,n=jf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?gt=5:(gt=0,Er=as=null,Wf(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(ns=null),Zo(s),t=t.stateNode,It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(ws,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=V.T,c=Q.p,Q.p=2,V.T=null;try{for(var p=e.onRecoverableError,N=0;N<n.length;N++){var z=n[N];p(z.value,{componentStack:z.stack})}}finally{V.T=t,Q.p=c}}(zi&3)!==0&&Va(),gi(e),c=e.pendingLanes,(s&261930)!==0&&(c&42)!==0?e===wc?xn++:(xn=0,wc=e):xn=0,Cn(0)}}function Wf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sn(t)))}function Va(){return Vf(),Gf(),Yf(),Xf()}function Xf(){if(gt!==5)return!1;var e=as,t=xc;xc=0;var s=Zo(zi),n=V.T,c=Q.p;try{Q.p=32>s?32:s,V.T=null,s=Cc,Cc=null;var p=as,N=zi;if(gt=0,Er=as=null,zi=0,(Ie&6)!==0)throw Error(o(331));var z=Ie;if(Ie|=4,Nf(p.current),Rf(p,p.current,N,s),Ie=z,Cn(0,!1),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(ws,p)}catch{}return!0}finally{Q.p=c,V.T=n,Wf(e,t)}}function Jf(e,t,s){t=Qt(s,t),t=ic(e.stateNode,t,2),e=Qi(e,t,2),e!==null&&($r(e,2),gi(e))}function $e(e,t,s){if(e.tag===3)Jf(e,e,s);else for(;t!==null;){if(t.tag===3){Jf(t,e,s);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(ns===null||!ns.has(n))){e=Qt(s,e),s=Jd(2),n=Qi(t,s,2),n!==null&&(Qd(s,n,t,e),$r(n,2),gi(n));break}}t=t.return}}function Tc(e,t,s){var n=e.pingCache;if(n===null){n=e.pingCache=new Lg;var c=new Set;n.set(t,c)}else c=n.get(t),c===void 0&&(c=new Set,n.set(t,c));c.has(s)||(yc=!0,c.add(s),e=Ug.bind(null,e,t,s),t.then(e,e))}function Ug(e,t,s){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Ge===e&&(Ne&s)===s&&(nt===4||nt===3&&(Ne&62914560)===Ne&&300>vt()-Pa?(Ie&2)===0&&kr(e,0):bc|=s,wr===Ne&&(wr=0)),gi(e)}function Qf(e,t){t===0&&(t=Ku()),e=Ds(e,t),e!==null&&($r(e,t),gi(e))}function Ig(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Qf(e,s)}function Pg(e,t){var s=0;switch(e.tag){case 31:case 13:var n=e.stateNode,c=e.memoizedState;c!==null&&(s=c.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(o(314))}n!==null&&n.delete(t),Qf(e,s)}function $g(e,t){return mi(e,t)}var Ga=null,Ar=null,Ac=!1,Ya=!1,Rc=!1,ls=0;function gi(e){e!==Ar&&e.next===null&&(Ar===null?Ga=Ar=e:Ar=Ar.next=e),Ya=!0,Ac||(Ac=!0,Zg())}function Cn(e,t){if(!Rc&&Ya){Rc=!0;do for(var s=!1,n=Ga;n!==null;){if(e!==0){var c=n.pendingLanes;if(c===0)var p=0;else{var N=n.suspendedLanes,z=n.pingedLanes;p=(1<<31-Pt(42|e)+1)-1,p&=c&~(N&~z),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(s=!0,sm(n,p))}else p=Ne,p=Qn(n,n===Ge?p:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(p&3)===0||Pr(n,p)||(s=!0,sm(n,p));n=n.next}while(s);Rc=!1}}function Fg(){em()}function em(){Ya=Ac=!1;var e=0;ls!==0&&e0()&&(e=ls);for(var t=vt(),s=null,n=Ga;n!==null;){var c=n.next,p=tm(n,t);p===0?(n.next=null,s===null?Ga=c:s.next=c,c===null&&(Ar=s)):(s=n,(e!==0||(p&3)!==0)&&(Ya=!0)),n=c}gt!==0&>!==5||Cn(e),ls!==0&&(ls=0)}function tm(e,t){for(var s=e.suspendedLanes,n=e.pingedLanes,c=e.expirationTimes,p=e.pendingLanes&-62914561;0<p;){var N=31-Pt(p),z=1<<N,G=c[N];G===-1?((z&s)===0||(z&n)!==0)&&(c[N]=_v(z,t)):G<=t&&(e.expiredLanes|=z),p&=~z}if(t=Ge,s=Ne,s=Qn(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,s===0||e===t&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&xs(n),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Pr(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(n!==null&&xs(n),Zo(s)){case 2:case 8:s=Vs;break;case 32:s=Ut;break;case 268435456:s=li;break;default:s=Ut}return n=im.bind(null,e),s=mi(s,n),e.callbackPriority=t,e.callbackNode=s,t}return n!==null&&n!==null&&xs(n),e.callbackPriority=2,e.callbackNode=null,2}function im(e,t){if(gt!==0&>!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Va()&&e.callbackNode!==s)return null;var n=Ne;return n=Qn(e,e===Ge?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(zf(e,n,t),tm(e,vt()),e.callbackNode!=null&&e.callbackNode===s?im.bind(null,e):null)}function sm(e,t){if(Va())return null;zf(e,t,!0)}function Zg(){i0(function(){(Ie&6)!==0?mi(Fi,Fg):em()})}function Dc(){if(ls===0){var e=fr;e===0&&(e=Wn,Wn<<=1,(Wn&261888)===0&&(Wn=256)),ls=e}return ls}function rm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:sa(""+e)}function nm(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function qg(e,t,s,n,c){if(t==="submit"&&s&&s.stateNode===c){var p=rm((c[Ot]||null).action),N=n.submitter;N&&(t=(t=N[Ot]||null)?rm(t.formAction):N.getAttribute("formAction"),t!==null&&(p=t,N=null));var z=new oa("action","action",null,n,c);e.push({event:z,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(ls!==0){var G=N?nm(c,N):new FormData(c);Wl(s,{pending:!0,data:G,method:c.method,action:p},null,G)}}else typeof p=="function"&&(z.preventDefault(),G=N?nm(c,N):new FormData(c),Wl(s,{pending:!0,data:G,method:c.method,action:p},p,G))},currentTarget:c}]})}}for(var Oc=0;Oc<fl.length;Oc++){var Nc=fl[Oc],Kg=Nc.toLowerCase(),Vg=Nc[0].toUpperCase()+Nc.slice(1);ci(Kg,"on"+Vg)}ci(jh,"onAnimationEnd"),ci(Bh,"onAnimationIteration"),ci(zh,"onAnimationStart"),ci("dblclick","onDoubleClick"),ci("focusin","onFocus"),ci("focusout","onBlur"),ci(cg,"onTransitionRun"),ci(ug,"onTransitionStart"),ci(hg,"onTransitionCancel"),ci(Hh,"onTransitionEnd"),Qs("onMouseEnter",["mouseout","mouseover"]),Qs("onMouseLeave",["mouseout","mouseover"]),Qs("onPointerEnter",["pointerout","pointerover"]),Qs("onPointerLeave",["pointerout","pointerover"]),ks("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ks("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ks("onBeforeInput",["compositionend","keypress","textInput","paste"]),ks("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ks("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(" "),Gg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wn));function am(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var n=e[s],c=n.event;n=n.listeners;e:{var p=void 0;if(t)for(var N=n.length-1;0<=N;N--){var z=n[N],G=z.instance,se=z.currentTarget;if(z=z.listener,G!==p&&c.isPropagationStopped())break e;p=z,c.currentTarget=se;try{p(c)}catch(ce){ua(ce)}c.currentTarget=null,p=G}else for(N=0;N<n.length;N++){if(z=n[N],G=z.instance,se=z.currentTarget,z=z.listener,G!==p&&c.isPropagationStopped())break e;p=z,c.currentTarget=se;try{p(c)}catch(ce){ua(ce)}c.currentTarget=null,p=G}}}}function De(e,t){var s=t[qo];s===void 0&&(s=t[qo]=new Set);var n=e+"__bubble";s.has(n)||(om(t,e,2,!1),s.add(n))}function Mc(e,t,s){var n=0;t&&(n|=4),om(s,e,n,t)}var Wa="_reactListening"+Math.random().toString(36).slice(2);function Lc(e){if(!e[Wa]){e[Wa]=!0,Qu.forEach(function(s){s!=="selectionchange"&&(Gg.has(s)||Mc(s,!1,e),Mc(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wa]||(t[Wa]=!0,Mc("selectionchange",!1,t))}}function om(e,t,s,n){switch(Bm(t)){case 2:var c=x0;break;case 8:c=C0;break;default:c=Yc}s=c.bind(null,t,s,e),c=void 0,!el||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),n?c!==void 0?e.addEventListener(t,s,{capture:!0,passive:c}):e.addEventListener(t,s,!0):c!==void 0?e.addEventListener(t,s,{passive:c}):e.addEventListener(t,s,!1)}function jc(e,t,s,n,c){var p=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var N=n.tag;if(N===3||N===4){var z=n.stateNode.containerInfo;if(z===c)break;if(N===4)for(N=n.return;N!==null;){var G=N.tag;if((G===3||G===4)&&N.stateNode.containerInfo===c)return;N=N.return}for(;z!==null;){if(N=Ws(z),N===null)return;if(G=N.tag,G===5||G===6||G===26||G===27){n=p=N;continue e}z=z.parentNode}}n=n.return}hh(function(){var se=p,ce=Jo(s),de=[];e:{var re=Uh.get(e);if(re!==void 0){var oe=oa,ve=e;switch(e){case"keypress":if(na(s)===0)break e;case"keydown":case"keyup":oe=Pv;break;case"focusin":ve="focus",oe=rl;break;case"focusout":ve="blur",oe=rl;break;case"beforeblur":case"afterblur":oe=rl;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=mh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=Rv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=Zv;break;case jh:case Bh:case zh:oe=Nv;break;case Hh:oe=Kv;break;case"scroll":case"scrollend":oe=Tv;break;case"wheel":oe=Gv;break;case"copy":case"cut":case"paste":oe=Lv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=_h;break;case"toggle":case"beforetoggle":oe=Wv}var xe=(t&4)!==0,Ve=!xe&&(e==="scroll"||e==="scrollend"),J=xe?re!==null?re+"Capture":null:re;xe=[];for(var Y=se,te;Y!==null;){var ue=Y;if(te=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||te===null||J===null||(ue=qr(Y,J),ue!=null&&xe.push(En(Y,ue,te))),Ve)break;Y=Y.return}0<xe.length&&(re=new oe(re,ve,null,s,ce),de.push({event:re,listeners:xe}))}}if((t&7)===0){e:{if(re=e==="mouseover"||e==="pointerover",oe=e==="mouseout"||e==="pointerout",re&&s!==Xo&&(ve=s.relatedTarget||s.fromElement)&&(Ws(ve)||ve[Ys]))break e;if((oe||re)&&(re=ce.window===ce?ce:(re=ce.ownerDocument)?re.defaultView||re.parentWindow:window,oe?(ve=s.relatedTarget||s.toElement,oe=se,ve=ve?Ws(ve):null,ve!==null&&(Ve=w(ve),xe=ve.tag,ve!==Ve||xe!==5&&xe!==27&&xe!==6)&&(ve=null)):(oe=null,ve=se),oe!==ve)){if(xe=mh,ue="onMouseLeave",J="onMouseEnter",Y="mouse",(e==="pointerout"||e==="pointerover")&&(xe=_h,ue="onPointerLeave",J="onPointerEnter",Y="pointer"),Ve=oe==null?re:Zr(oe),te=ve==null?re:Zr(ve),re=new xe(ue,Y+"leave",oe,s,ce),re.target=Ve,re.relatedTarget=te,ue=null,Ws(ce)===se&&(xe=new xe(J,Y+"enter",ve,s,ce),xe.target=te,xe.relatedTarget=Ve,ue=xe),Ve=ue,oe&&ve)t:{for(xe=Yg,J=oe,Y=ve,te=0,ue=J;ue;ue=xe(ue))te++;ue=0;for(var Se=Y;Se;Se=xe(Se))ue++;for(;0<te-ue;)J=xe(J),te--;for(;0<ue-te;)Y=xe(Y),ue--;for(;te--;){if(J===Y||Y!==null&&J===Y.alternate){xe=J;break t}J=xe(J),Y=xe(Y)}xe=null}else xe=null;oe!==null&&lm(de,re,oe,xe,!1),ve!==null&&Ve!==null&&lm(de,Ve,ve,xe,!0)}}e:{if(re=se?Zr(se):window,oe=re.nodeName&&re.nodeName.toLowerCase(),oe==="select"||oe==="input"&&re.type==="file")var ze=wh;else if(xh(re))if(Eh)ze=ag;else{ze=rg;var ge=sg}else oe=re.nodeName,!oe||oe.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?se&&Wo(se.elementType)&&(ze=wh):ze=ng;if(ze&&(ze=ze(e,se))){Ch(de,ze,s,ce);break e}ge&&ge(e,re,se),e==="focusout"&&se&&re.type==="number"&&se.memoizedProps.value!=null&&Yo(re,"number",re.value)}switch(ge=se?Zr(se):window,e){case"focusin":(xh(ge)||ge.contentEditable==="true")&&(nr=ge,ul=se,Qr=null);break;case"focusout":Qr=ul=nr=null;break;case"mousedown":hl=!0;break;case"contextmenu":case"mouseup":case"dragend":hl=!1,Mh(de,s,ce);break;case"selectionchange":if(lg)break;case"keydown":case"keyup":Mh(de,s,ce)}var Te;if(al)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else rr?bh(e,s)&&(Me="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Me="onCompositionStart");Me&&(vh&&s.locale!=="ko"&&(rr||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&rr&&(Te=dh()):(Ki=ce,tl="value"in Ki?Ki.value:Ki.textContent,rr=!0)),ge=Xa(se,Me),0<ge.length&&(Me=new ph(Me,e,null,s,ce),de.push({event:Me,listeners:ge}),Te?Me.data=Te:(Te=Sh(s),Te!==null&&(Me.data=Te)))),(Te=Jv?Qv(e,s):eg(e,s))&&(Me=Xa(se,"onBeforeInput"),0<Me.length&&(ge=new ph("onBeforeInput","beforeinput",null,s,ce),de.push({event:ge,listeners:Me}),ge.data=Te)),qg(de,e,se,s,ce)}am(de,t)})}function En(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Xa(e,t){for(var s=t+"Capture",n=[];e!==null;){var c=e,p=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||p===null||(c=qr(e,s),c!=null&&n.unshift(En(e,c,p)),c=qr(e,t),c!=null&&n.push(En(e,c,p))),e.tag===3)return n;e=e.return}return[]}function Yg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function lm(e,t,s,n,c){for(var p=t._reactName,N=[];s!==null&&s!==n;){var z=s,G=z.alternate,se=z.stateNode;if(z=z.tag,G!==null&&G===n)break;z!==5&&z!==26&&z!==27||se===null||(G=se,c?(se=qr(s,p),se!=null&&N.unshift(En(s,se,G))):c||(se=qr(s,p),se!=null&&N.push(En(s,se,G)))),s=s.return}N.length!==0&&e.push({event:t,listeners:N})}var Wg=/\r\n?/g,Xg=/\u0000|\uFFFD/g;function cm(e){return(typeof e=="string"?e:""+e).replace(Wg,`
|
|
49
49
|
`).replace(Xg,"")}function um(e,t){return t=cm(t),cm(e)===t}function Ke(e,t,s,n,c,p){switch(s){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||tr(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&tr(e,""+n);break;case"className":ta(e,"class",n);break;case"tabIndex":ta(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":ta(e,s,n);break;case"style":ch(e,n,p);break;case"data":if(t!=="object"){ta(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(s);break}n=sa(""+n),e.setAttribute(s,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(s,"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 p=="function"&&(s==="formAction"?(t!=="input"&&Ke(e,t,"name",c.name,c,null),Ke(e,t,"formEncType",c.formEncType,c,null),Ke(e,t,"formMethod",c.formMethod,c,null),Ke(e,t,"formTarget",c.formTarget,c,null)):(Ke(e,t,"encType",c.encType,c,null),Ke(e,t,"method",c.method,c,null),Ke(e,t,"target",c.target,c,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(s);break}n=sa(""+n),e.setAttribute(s,n);break;case"onClick":n!=null&&(e.onclick=xi);break;case"onScroll":n!=null&&De("scroll",e);break;case"onScrollEnd":n!=null&&De("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(s=n.__html,s!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}s=sa(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(s,""+n):e.removeAttribute(s);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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":n===!0?e.setAttribute(s,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(s,n):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(s,n):e.removeAttribute(s);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(s):e.setAttribute(s,n);break;case"popover":De("beforetoggle",e),De("toggle",e),ea(e,"popover",n);break;case"xlinkActuate":Si(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Si(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Si(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Si(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Si(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Si(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Si(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Si(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Si(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":ea(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Ev.get(s)||s,ea(e,s,n))}}function Bc(e,t,s,n,c,p){switch(s){case"style":ch(e,n,p);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(s=n.__html,s!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof n=="string"?tr(e,n):(typeof n=="number"||typeof n=="bigint")&&tr(e,""+n);break;case"onScroll":n!=null&&De("scroll",e);break;case"onScrollEnd":n!=null&&De("scrollend",e);break;case"onClick":n!=null&&(e.onclick=xi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!eh.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(c=s.endsWith("Capture"),t=s.slice(2,c?s.length-7:void 0),p=e[Ot]||null,p=p!=null?p[s]:null,typeof p=="function"&&e.removeEventListener(t,p,c),typeof n=="function")){typeof p!="function"&&p!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,n,c);break e}s in e?e[s]=n:n===!0?e.setAttribute(s,""):ea(e,s,n)}}}function Et(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var n=!1,c=!1,p;for(p in s)if(s.hasOwnProperty(p)){var N=s[p];if(N!=null)switch(p){case"src":n=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ke(e,t,p,N,s,null)}}c&&Ke(e,t,"srcSet",s.srcSet,s,null),n&&Ke(e,t,"src",s.src,s,null);return;case"input":De("invalid",e);var z=p=N=c=null,G=null,se=null;for(n in s)if(s.hasOwnProperty(n)){var ce=s[n];if(ce!=null)switch(n){case"name":c=ce;break;case"type":N=ce;break;case"checked":G=ce;break;case"defaultChecked":se=ce;break;case"value":p=ce;break;case"defaultValue":z=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(o(137,t));break;default:Ke(e,t,n,ce,s,null)}}nh(e,p,z,G,se,N,c,!1);return;case"select":De("invalid",e),n=N=p=null;for(c in s)if(s.hasOwnProperty(c)&&(z=s[c],z!=null))switch(c){case"value":p=z;break;case"defaultValue":N=z;break;case"multiple":n=z;default:Ke(e,t,c,z,s,null)}t=p,s=N,e.multiple=!!n,t!=null?er(e,!!n,t,!1):s!=null&&er(e,!!n,s,!0);return;case"textarea":De("invalid",e),p=c=n=null;for(N in s)if(s.hasOwnProperty(N)&&(z=s[N],z!=null))switch(N){case"value":n=z;break;case"defaultValue":c=z;break;case"children":p=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(o(91));break;default:Ke(e,t,N,z,s,null)}oh(e,n,c,p);return;case"option":for(G in s)if(s.hasOwnProperty(G)&&(n=s[G],n!=null))switch(G){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Ke(e,t,G,n,s,null)}return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(n=0;n<wn.length;n++)De(wn[n],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in s)if(s.hasOwnProperty(se)&&(n=s[se],n!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ke(e,t,se,n,s,null)}return;default:if(Wo(t)){for(ce in s)s.hasOwnProperty(ce)&&(n=s[ce],n!==void 0&&Bc(e,t,ce,n,s,void 0));return}}for(z in s)s.hasOwnProperty(z)&&(n=s[z],n!=null&&Ke(e,t,z,n,s,null))}function Jg(e,t,s,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,p=null,N=null,z=null,G=null,se=null,ce=null;for(oe in s){var de=s[oe];if(s.hasOwnProperty(oe)&&de!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":G=de;default:n.hasOwnProperty(oe)||Ke(e,t,oe,null,n,de)}}for(var re in n){var oe=n[re];if(de=s[re],n.hasOwnProperty(re)&&(oe!=null||de!=null))switch(re){case"type":p=oe;break;case"name":c=oe;break;case"checked":se=oe;break;case"defaultChecked":ce=oe;break;case"value":N=oe;break;case"defaultValue":z=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(o(137,t));break;default:oe!==de&&Ke(e,t,re,oe,n,de)}}Go(e,N,z,G,se,ce,p,c);return;case"select":oe=N=z=re=null;for(p in s)if(G=s[p],s.hasOwnProperty(p)&&G!=null)switch(p){case"value":break;case"multiple":oe=G;default:n.hasOwnProperty(p)||Ke(e,t,p,null,n,G)}for(c in n)if(p=n[c],G=s[c],n.hasOwnProperty(c)&&(p!=null||G!=null))switch(c){case"value":re=p;break;case"defaultValue":z=p;break;case"multiple":N=p;default:p!==G&&Ke(e,t,c,p,n,G)}t=z,s=N,n=oe,re!=null?er(e,!!s,re,!1):!!n!=!!s&&(t!=null?er(e,!!s,t,!0):er(e,!!s,s?[]:"",!1));return;case"textarea":oe=re=null;for(z in s)if(c=s[z],s.hasOwnProperty(z)&&c!=null&&!n.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:Ke(e,t,z,null,n,c)}for(N in n)if(c=n[N],p=s[N],n.hasOwnProperty(N)&&(c!=null||p!=null))switch(N){case"value":re=c;break;case"defaultValue":oe=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==p&&Ke(e,t,N,c,n,p)}ah(e,re,oe);return;case"option":for(var ve in s)if(re=s[ve],s.hasOwnProperty(ve)&&re!=null&&!n.hasOwnProperty(ve))switch(ve){case"selected":e.selected=!1;break;default:Ke(e,t,ve,null,n,re)}for(G in n)if(re=n[G],oe=s[G],n.hasOwnProperty(G)&&re!==oe&&(re!=null||oe!=null))switch(G){case"selected":e.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:Ke(e,t,G,re,n,oe)}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 xe in s)re=s[xe],s.hasOwnProperty(xe)&&re!=null&&!n.hasOwnProperty(xe)&&Ke(e,t,xe,null,n,re);for(se in n)if(re=n[se],oe=s[se],n.hasOwnProperty(se)&&re!==oe&&(re!=null||oe!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(o(137,t));break;default:Ke(e,t,se,re,n,oe)}return;default:if(Wo(t)){for(var Ve in s)re=s[Ve],s.hasOwnProperty(Ve)&&re!==void 0&&!n.hasOwnProperty(Ve)&&Bc(e,t,Ve,void 0,n,re);for(ce in n)re=n[ce],oe=s[ce],!n.hasOwnProperty(ce)||re===oe||re===void 0&&oe===void 0||Bc(e,t,ce,re,n,oe);return}}for(var J in s)re=s[J],s.hasOwnProperty(J)&&re!=null&&!n.hasOwnProperty(J)&&Ke(e,t,J,null,n,re);for(de in n)re=n[de],oe=s[de],!n.hasOwnProperty(de)||re===oe||re==null&&oe==null||Ke(e,t,de,re,n,oe)}function hm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Qg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),n=0;n<s.length;n++){var c=s[n],p=c.transferSize,N=c.initiatorType,z=c.duration;if(p&&z&&hm(N)){for(N=0,z=c.responseEnd,n+=1;n<s.length;n++){var G=s[n],se=G.startTime;if(se>z)break;var ce=G.transferSize,de=G.initiatorType;ce&&hm(de)&&(G=G.responseEnd,N+=ce*(G<z?1:(z-se)/(G-se)))}if(--n,t+=8*(p+N)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var zc=null,Hc=null;function Ja(e){return e.nodeType===9?e:e.ownerDocument}function dm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function fm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Uc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ic=null;function e0(){var e=window.event;return e&&e.type==="popstate"?e===Ic?!1:(Ic=e,!0):(Ic=null,!1)}var mm=typeof setTimeout=="function"?setTimeout:void 0,t0=typeof clearTimeout=="function"?clearTimeout:void 0,pm=typeof Promise=="function"?Promise:void 0,i0=typeof queueMicrotask=="function"?queueMicrotask:typeof pm<"u"?function(e){return pm.resolve(null).then(e).catch(s0)}:mm;function s0(e){setTimeout(function(){throw e})}function cs(e){return e==="head"}function _m(e,t){var s=t,n=0;do{var c=s.nextSibling;if(e.removeChild(s),c&&c.nodeType===8)if(s=c.data,s==="/$"||s==="/&"){if(n===0){e.removeChild(c),Nr(t);return}n--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")n++;else if(s==="html")kn(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,kn(s);for(var p=s.firstChild;p;){var N=p.nextSibling,z=p.nodeName;p[Fr]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&p.rel.toLowerCase()==="stylesheet"||s.removeChild(p),p=N}}else s==="body"&&kn(e.ownerDocument.body);s=c}while(s);Nr(t)}function vm(e,t){var s=e;e=0;do{var n=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),n&&n.nodeType===8)if(s=n.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=n}while(s)}function Pc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Pc(s),Ko(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function r0(e,t,s,n){for(;e.nodeType===1;){var c=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Fr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(p=e.getAttribute("rel"),p==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(p!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(p=e.getAttribute("src"),(p!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&p&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var p=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===p)return e}else return e;if(e=ri(e.nextSibling),e===null)break}return null}function n0(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=ri(e.nextSibling),e===null))return null;return e}function gm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ri(e.nextSibling),e===null))return null;return e}function $c(e){return e.data==="$?"||e.data==="$~"}function Fc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function a0(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var n=function(){t(),s.removeEventListener("DOMContentLoaded",n)};s.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function ri(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Zc=null;function ym(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return ri(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function bm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function Sm(e,t,s){switch(t=Ja(s),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function kn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ko(e)}var ni=new Map,xm=new Set;function Qa(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Hi=Q.d;Q.d={f:o0,r:l0,D:c0,C:u0,L:h0,m:d0,X:m0,S:f0,M:p0};function o0(){var e=Hi.f(),t=Za();return e||t}function l0(e){var t=Xs(e);t!==null&&t.tag===5&&t.type==="form"?Hd(t):Hi.r(e)}var Rr=typeof document>"u"?null:document;function Cm(e,t,s){var n=Rr;if(n&&typeof t=="string"&&t){var c=Xt(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof s=="string"&&(c+='[crossorigin="'+s+'"]'),xm.has(c)||(xm.add(c),e={rel:e,crossOrigin:s,href:t},n.querySelector(c)===null&&(t=n.createElement("link"),Et(t,"link",e),yt(t),n.head.appendChild(t)))}}function c0(e){Hi.D(e),Cm("dns-prefetch",e,null)}function u0(e,t){Hi.C(e,t),Cm("preconnect",e,t)}function h0(e,t,s){Hi.L(e,t,s);var n=Rr;if(n&&e&&t){var c='link[rel="preload"][as="'+Xt(t)+'"]';t==="image"&&s&&s.imageSrcSet?(c+='[imagesrcset="'+Xt(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(c+='[imagesizes="'+Xt(s.imageSizes)+'"]')):c+='[href="'+Xt(e)+'"]';var p=c;switch(t){case"style":p=Dr(e);break;case"script":p=Or(e)}ni.has(p)||(e=d({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),ni.set(p,e),n.querySelector(c)!==null||t==="style"&&n.querySelector(Tn(p))||t==="script"&&n.querySelector(An(p))||(t=n.createElement("link"),Et(t,"link",e),yt(t),n.head.appendChild(t)))}}function d0(e,t){Hi.m(e,t);var s=Rr;if(s&&e){var n=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Xt(n)+'"][href="'+Xt(e)+'"]',p=c;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Or(e)}if(!ni.has(p)&&(e=d({rel:"modulepreload",href:e},t),ni.set(p,e),s.querySelector(c)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(An(p)))return}n=s.createElement("link"),Et(n,"link",e),yt(n),s.head.appendChild(n)}}}function f0(e,t,s){Hi.S(e,t,s);var n=Rr;if(n&&e){var c=Js(n).hoistableStyles,p=Dr(e);t=t||"default";var N=c.get(p);if(!N){var z={loading:0,preload:null};if(N=n.querySelector(Tn(p)))z.loading=5;else{e=d({rel:"stylesheet",href:e,"data-precedence":t},s),(s=ni.get(p))&&qc(e,s);var G=N=n.createElement("link");yt(G),Et(G,"link",e),G._p=new Promise(function(se,ce){G.onload=se,G.onerror=ce}),G.addEventListener("load",function(){z.loading|=1}),G.addEventListener("error",function(){z.loading|=2}),z.loading|=4,eo(N,t,n)}N={type:"stylesheet",instance:N,count:1,state:z},c.set(p,N)}}}function m0(e,t){Hi.X(e,t);var s=Rr;if(s&&e){var n=Js(s).hoistableScripts,c=Or(e),p=n.get(c);p||(p=s.querySelector(An(c)),p||(e=d({src:e,async:!0},t),(t=ni.get(c))&&Kc(e,t),p=s.createElement("script"),yt(p),Et(p,"link",e),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},n.set(c,p))}}function p0(e,t){Hi.M(e,t);var s=Rr;if(s&&e){var n=Js(s).hoistableScripts,c=Or(e),p=n.get(c);p||(p=s.querySelector(An(c)),p||(e=d({src:e,async:!0,type:"module"},t),(t=ni.get(c))&&Kc(e,t),p=s.createElement("script"),yt(p),Et(p,"link",e),s.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},n.set(c,p))}}function wm(e,t,s,n){var c=(c=fe.current)?Qa(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Dr(s.href),s=Js(c).hoistableStyles,n=s.get(t),n||(n={type:"style",instance:null,count:0,state:null},s.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Dr(s.href);var p=Js(c).hoistableStyles,N=p.get(e);if(N||(c=c.ownerDocument||c,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,N),(p=c.querySelector(Tn(e)))&&!p._p&&(N.instance=p,N.state.loading=5),ni.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},ni.set(e,s),p||_0(c,e,s,N.state))),t&&n===null)throw Error(o(528,""));return N}if(t&&n!==null)throw Error(o(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Or(s),s=Js(c).hoistableScripts,n=s.get(t),n||(n={type:"script",instance:null,count:0,state:null},s.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Dr(e){return'href="'+Xt(e)+'"'}function Tn(e){return'link[rel="stylesheet"]['+e+"]"}function Em(e){return d({},e,{"data-precedence":e.precedence,precedence:null})}function _0(e,t,s,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Et(t,"link",s),yt(t),e.head.appendChild(t))}function Or(e){return'[src="'+Xt(e)+'"]'}function An(e){return"script[async]"+e}function km(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Xt(s.href)+'"]');if(n)return t.instance=n,yt(n),n;var c=d({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),yt(n),Et(n,"style",c),eo(n,s.precedence,e),t.instance=n;case"stylesheet":c=Dr(s.href);var p=e.querySelector(Tn(c));if(p)return t.state.loading|=4,t.instance=p,yt(p),p;n=Em(s),(c=ni.get(c))&&qc(n,c),p=(e.ownerDocument||e).createElement("link"),yt(p);var N=p;return N._p=new Promise(function(z,G){N.onload=z,N.onerror=G}),Et(p,"link",n),t.state.loading|=4,eo(p,s.precedence,e),t.instance=p;case"script":return p=Or(s.src),(c=e.querySelector(An(p)))?(t.instance=c,yt(c),c):(n=s,(c=ni.get(p))&&(n=d({},s),Kc(n,c)),e=e.ownerDocument||e,c=e.createElement("script"),yt(c),Et(c,"link",n),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,eo(n,s.precedence,e));return t.instance}function eo(e,t,s){for(var n=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=n.length?n[n.length-1]:null,p=c,N=0;N<n.length;N++){var z=n[N];if(z.dataset.precedence===t)p=z;else if(p!==c)break}p?p.parentNode.insertBefore(e,p.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function qc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Kc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var to=null;function Tm(e,t,s){if(to===null){var n=new Map,c=to=new Map;c.set(s,n)}else c=to,n=c.get(s),n||(n=new Map,c.set(s,n));if(n.has(e))return n;for(n.set(e,null),s=s.getElementsByTagName(e),c=0;c<s.length;c++){var p=s[c];if(!(p[Fr]||p[St]||e==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var N=p.getAttribute(t)||"";N=e+N;var z=n.get(N);z?z.push(p):n.set(N,[p])}}return n}function Am(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function v0(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Rm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function g0(e,t,s,n){if(s.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var c=Dr(n.href),p=t.querySelector(Tn(c));if(p){t=p._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=io.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=p,yt(p);return}p=t.ownerDocument||t,n=Em(n),(c=ni.get(c))&&qc(n,c),p=p.createElement("link"),yt(p);var N=p;N._p=new Promise(function(z,G){N.onload=z,N.onerror=G}),Et(p,"link",n),s.instance=p}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=io.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Vc=0;function y0(e,t){return e.stylesheets&&e.count===0&&ro(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var n=setTimeout(function(){if(e.stylesheets&&ro(e,e.stylesheets),e.unsuspend){var p=e.unsuspend;e.unsuspend=null,p()}},6e4+t);0<e.imgBytes&&Vc===0&&(Vc=62500*Qg());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ro(e,e.stylesheets),e.unsuspend)){var p=e.unsuspend;e.unsuspend=null,p()}},(e.imgBytes>Vc?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(c)}}:null}function io(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ro(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var so=null;function ro(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,so=new Map,t.forEach(b0,e),so=null,io.call(e))}function b0(e,t){if(!(t.state.loading&4)){var s=so.get(e);if(s)var n=s.get(null);else{s=new Map,so.set(e,s);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<c.length;p++){var N=c[p];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(s.set(N.dataset.precedence,N),n=N)}n&&s.set(null,n)}c=t.instance,N=c.getAttribute("data-precedence"),p=s.get(N)||n,p===n&&s.set(null,c),s.set(N,c),this.count++,n=io.bind(this),c.addEventListener("load",n),c.addEventListener("error",n),p?p.parentNode.insertBefore(c,p.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Rn={$$typeof:_,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function S0(e,t,s,n,c,p,N,z,G){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=$o(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$o(0),this.hiddenUpdates=$o(null),this.identifierPrefix=n,this.onUncaughtError=c,this.onCaughtError=p,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function Dm(e,t,s,n,c,p,N,z,G,se,ce,de){return e=new S0(e,t,s,N,G,se,ce,de,z),t=1,p===!0&&(t|=24),p=Ft(3,null,null,t),e.current=p,p.stateNode=e,t=kl(),t.refCount++,e.pooledCache=t,t.refCount++,p.memoizedState={element:n,isDehydrated:s,cache:t},Dl(p),e}function Om(e){return e?(e=lr,e):lr}function Nm(e,t,s,n,c,p){c=Om(c),n.context===null?n.context=c:n.pendingContext=c,n=Ji(t),n.payload={element:s},p=p===void 0?null:p,p!==null&&(n.callback=p),s=Qi(e,n,t),s!==null&&(zt(s,e,t),on(s,e,t))}function Mm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Gc(e,t){Mm(e,t),(e=e.alternate)&&Mm(e,t)}function Lm(e){if(e.tag===13||e.tag===31){var t=Ds(e,67108864);t!==null&&zt(t,e,67108864),Gc(e,67108864)}}function jm(e){if(e.tag===13||e.tag===31){var t=Gt();t=Fo(t);var s=Ds(e,t);s!==null&&zt(s,e,t),Gc(e,t)}}var no=!0;function x0(e,t,s,n){var c=V.T;V.T=null;var p=Q.p;try{Q.p=2,Yc(e,t,s,n)}finally{Q.p=p,V.T=c}}function C0(e,t,s,n){var c=V.T;V.T=null;var p=Q.p;try{Q.p=8,Yc(e,t,s,n)}finally{Q.p=p,V.T=c}}function Yc(e,t,s,n){if(no){var c=Wc(n);if(c===null)jc(e,t,n,ao,s),zm(e,n);else if(E0(c,e,t,s,n))n.stopPropagation();else if(zm(e,n),t&4&&-1<w0.indexOf(e)){for(;c!==null;){var p=Xs(c);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var N=Es(p.pendingLanes);if(N!==0){var z=p;for(z.pendingLanes|=2,z.entangledLanes|=2;N;){var G=1<<31-Pt(N);z.entanglements[1]|=G,N&=~G}gi(p),(Ie&6)===0&&($a=vt()+500,Cn(0))}}break;case 31:case 13:z=Ds(p,2),z!==null&&zt(z,p,2),Za(),Gc(p,2)}if(p=Wc(n),p===null&&jc(e,t,n,ao,s),p===c)break;c=p}c!==null&&n.stopPropagation()}else jc(e,t,n,null,s)}}function Wc(e){return e=Jo(e),Xc(e)}var ao=null;function Xc(e){if(ao=null,e=Ws(e),e!==null){var t=w(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=k(t),e!==null)return e;e=null}else if(s===31){if(e=l(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ao=e,null}function Bm(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Yt()){case Fi:return 2;case Vs:return 8;case Ut:case Gs:return 32;case li:return 268435456;default:return 32}default:return 32}}var Jc=!1,us=null,hs=null,ds=null,Dn=new Map,On=new Map,fs=[],w0="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 zm(e,t){switch(e){case"focusin":case"focusout":us=null;break;case"dragenter":case"dragleave":hs=null;break;case"mouseover":case"mouseout":ds=null;break;case"pointerover":case"pointerout":Dn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":On.delete(t.pointerId)}}function Nn(e,t,s,n,c,p){return e===null||e.nativeEvent!==p?(e={blockedOn:t,domEventName:s,eventSystemFlags:n,nativeEvent:p,targetContainers:[c]},t!==null&&(t=Xs(t),t!==null&&Lm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function E0(e,t,s,n,c){switch(t){case"focusin":return us=Nn(us,e,t,s,n,c),!0;case"dragenter":return hs=Nn(hs,e,t,s,n,c),!0;case"mouseover":return ds=Nn(ds,e,t,s,n,c),!0;case"pointerover":var p=c.pointerId;return Dn.set(p,Nn(Dn.get(p)||null,e,t,s,n,c)),!0;case"gotpointercapture":return p=c.pointerId,On.set(p,Nn(On.get(p)||null,e,t,s,n,c)),!0}return!1}function Hm(e){var t=Ws(e.target);if(t!==null){var s=w(t);if(s!==null){if(t=s.tag,t===13){if(t=k(s),t!==null){e.blockedOn=t,Xu(e.priority,function(){jm(s)});return}}else if(t===31){if(t=l(s),t!==null){e.blockedOn=t,Xu(e.priority,function(){jm(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function oo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Wc(e.nativeEvent);if(s===null){s=e.nativeEvent;var n=new s.constructor(s.type,s);Xo=n,s.target.dispatchEvent(n),Xo=null}else return t=Xs(s),t!==null&&Lm(t),e.blockedOn=s,!1;t.shift()}return!0}function Um(e,t,s){oo(e)&&s.delete(t)}function k0(){Jc=!1,us!==null&&oo(us)&&(us=null),hs!==null&&oo(hs)&&(hs=null),ds!==null&&oo(ds)&&(ds=null),Dn.forEach(Um),On.forEach(Um)}function lo(e,t){e.blockedOn===t&&(e.blockedOn=null,Jc||(Jc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,k0)))}var co=null;function Im(e){co!==e&&(co=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){co===e&&(co=null);for(var t=0;t<e.length;t+=3){var s=e[t],n=e[t+1],c=e[t+2];if(typeof n!="function"){if(Xc(n||s)===null)continue;break}var p=Xs(s);p!==null&&(e.splice(t,3),t-=3,Wl(p,{pending:!0,data:c,method:s.method,action:n},n,c))}}))}function Nr(e){function t(G){return lo(G,e)}us!==null&&lo(us,e),hs!==null&&lo(hs,e),ds!==null&&lo(ds,e),Dn.forEach(t),On.forEach(t);for(var s=0;s<fs.length;s++){var n=fs[s];n.blockedOn===e&&(n.blockedOn=null)}for(;0<fs.length&&(s=fs[0],s.blockedOn===null);)Hm(s),s.blockedOn===null&&fs.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(n=0;n<s.length;n+=3){var c=s[n],p=s[n+1],N=c[Ot]||null;if(typeof p=="function")N||Im(s);else if(N){var z=null;if(p&&p.hasAttribute("formAction")){if(c=p,N=p[Ot]||null)z=N.formAction;else if(Xc(c)!==null)continue}else z=N.action;typeof z=="function"?s[n+1]=z:(s.splice(n,3),n-=3),Im(s)}}}function Pm(){function e(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(N){return c=N})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),n||setTimeout(s,20)}function s(){if(!n&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Qc(e){this._internalRoot=e}uo.prototype.render=Qc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,n=Gt();Nm(s,n,e,t,null,null)},uo.prototype.unmount=Qc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nm(e.current,2,null,e,null,null),Za(),t[Ys]=null}};function uo(e){this._internalRoot=e}uo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Wu();e={blockedOn:null,target:e,priority:t};for(var s=0;s<fs.length&&t!==0&&t<fs[s].priority;s++);fs.splice(s,0,e),s===0&&Hm(e)}};var $m=r.version;if($m!=="19.2.4")throw Error(o(527,$m,"19.2.4"));Q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=f(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var T0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ho=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ho.isDisabled&&ho.supportsFiber)try{ws=ho.inject(T0),It=ho}catch{}}return Ln.createRoot=function(e,t){if(!v(e))throw Error(o(299));var s=!1,n="",c=Gd,p=Yd,N=Wd;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(p=t.onCaughtError),t.onRecoverableError!==void 0&&(N=t.onRecoverableError)),t=Dm(e,1,!1,null,null,s,n,null,c,p,N,Pm),e[Ys]=t.current,Lc(e),new Qc(t)},Ln.hydrateRoot=function(e,t,s){if(!v(e))throw Error(o(299));var n=!1,c="",p=Gd,N=Yd,z=Wd,G=null;return s!=null&&(s.unstable_strictMode===!0&&(n=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(N=s.onCaughtError),s.onRecoverableError!==void 0&&(z=s.onRecoverableError),s.formState!==void 0&&(G=s.formState)),t=Dm(e,1,!0,t,s??null,n,c,G,p,N,z,Pm),t.context=Om(null),s=t.current,n=Gt(),n=Fo(n),c=Ji(n),c.callback=null,Qi(s,c,n),s=n,t.current.lanes=s,$r(t,s),gi(t),e[Ys]=t.current,Lc(e),new uo(t)},Ln.version="19.2.4",Ln}var Jm;function U0(){if(Jm)return iu.exports;Jm=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(r){console.error(r)}}return i(),iu.exports=H0(),iu.exports}var I0=U0();const P0=Jp(I0);/**
|
|
50
50
|
* react-router v7.13.2
|
|
51
51
|
*
|
|
@@ -300,13 +300,13 @@ Please change the parent <Route path="${g}"> to <Route path="${g==="/"?"*":`${g}
|
|
|
300
300
|
|
|
301
301
|
`)}E.write("payload.value = newResult;"),E.write("return payload;");const h=E.compile();return(x,A)=>h(S,x,A)};let w;const k=wo,l=!k_.jitless,f=l&&j1.value,y=r.catchall;let d;i._zod.parse=(S,E)=>{d??(d=o.value);const O=S.value;return k(O)?l&&f&&(E==null?void 0:E.async)===!1&&E.jitless!==!0?(w||(w=v(r.shape)),S=w(S,E),y?F_([],O,S,E,d,i):S):a(S,E):(S.issues.push({expected:"object",code:"invalid_type",input:O,inst:i}),S)}});function _p(i,r,a,o){for(const w of i)if(w.issues.length===0)return r.value=w.value,r;const v=i.filter(w=>!Mr(w));return v.length===1?(r.value=v[0].value,v[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:a,errors:i.map(w=>w.issues.map(k=>ys(k,o,gs())))}),r)}const Sx=he("$ZodUnion",(i,r)=>{at.init(i,r),Ze(i._zod,"optin",()=>r.options.some(v=>v._zod.optin==="optional")?"optional":void 0),Ze(i._zod,"optout",()=>r.options.some(v=>v._zod.optout==="optional")?"optional":void 0),Ze(i._zod,"values",()=>{if(r.options.every(v=>v._zod.values))return new Set(r.options.flatMap(v=>Array.from(v._zod.values)))}),Ze(i._zod,"pattern",()=>{if(r.options.every(v=>v._zod.pattern)){const v=r.options.map(w=>w._zod.pattern);return new RegExp(`^(${v.map(w=>Uu(w.source)).join("|")})$`)}});const a=r.options.length===1,o=r.options[0]._zod.run;i._zod.parse=(v,w)=>{if(a)return o(v,w);let k=!1;const l=[];for(const u of r.options){const f=u._zod.run({value:v.value,issues:[]},w);if(f instanceof Promise)l.push(f),k=!0;else{if(f.issues.length===0)return f;l.push(f)}}return k?Promise.all(l).then(u=>_p(u,v,i,w)):_p(l,v,i,w)}}),xx=he("$ZodIntersection",(i,r)=>{at.init(i,r),i._zod.parse=(a,o)=>{const v=a.value,w=r.left._zod.run({value:v,issues:[]},o),k=r.right._zod.run({value:v,issues:[]},o);return w instanceof Promise||k instanceof Promise?Promise.all([w,k]).then(([u,f])=>vp(a,u,f)):vp(a,w,k)}});function xu(i,r){if(i===r)return{valid:!0,data:i};if(i instanceof Date&&r instanceof Date&&+i==+r)return{valid:!0,data:i};if(zr(i)&&zr(r)){const a=Object.keys(r),o=Object.keys(i).filter(w=>a.indexOf(w)!==-1),v={...i,...r};for(const w of o){const k=xu(i[w],r[w]);if(!k.valid)return{valid:!1,mergeErrorPath:[w,...k.mergeErrorPath]};v[w]=k.data}return{valid:!0,data:v}}if(Array.isArray(i)&&Array.isArray(r)){if(i.length!==r.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let o=0;o<i.length;o++){const v=i[o],w=r[o],k=xu(v,w);if(!k.valid)return{valid:!1,mergeErrorPath:[o,...k.mergeErrorPath]};a.push(k.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function vp(i,r,a){const o=new Map;let v;for(const l of r.issues)if(l.code==="unrecognized_keys"){v??(v=l);for(const u of l.keys)o.has(u)||o.set(u,{}),o.get(u).l=!0}else i.issues.push(l);for(const l of a.issues)if(l.code==="unrecognized_keys")for(const u of l.keys)o.has(u)||o.set(u,{}),o.get(u).r=!0;else i.issues.push(l);const w=[...o].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(w.length&&v&&i.issues.push({...v,keys:w}),Mr(i))return i;const k=xu(r.value,a.value);if(!k.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(k.mergeErrorPath)}`);return i.value=k.data,i}const Cx=he("$ZodRecord",(i,r)=>{at.init(i,r),i._zod.parse=(a,o)=>{const v=a.value;if(!zr(v))return a.issues.push({expected:"record",code:"invalid_type",input:v,inst:i}),a;const w=[],k=r.keyType._zod.values;if(k){a.value={};const l=new Set;for(const f of k)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){l.add(typeof f=="number"?f.toString():f);const y=r.valueType._zod.run({value:v[f],issues:[]},o);y instanceof Promise?w.push(y.then(d=>{d.issues.length&&a.issues.push(...Lr(f,d.issues)),a.value[f]=d.value})):(y.issues.length&&a.issues.push(...Lr(f,y.issues)),a.value[f]=y.value)}let u;for(const f in v)l.has(f)||(u=u??[],u.push(f));u&&u.length>0&&a.issues.push({code:"unrecognized_keys",input:v,inst:i,keys:u})}else{a.value={};for(const l of Reflect.ownKeys(v)){if(l==="__proto__")continue;let u=r.keyType._zod.run({value:l,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&B_.test(l)&&u.issues.length){const d=r.keyType._zod.run({value:Number(l),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(u=d)}if(u.issues.length){r.mode==="loose"?a.value[l]=v[l]:a.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(d=>ys(d,o,gs())),input:l,path:[l],inst:i});continue}const y=r.valueType._zod.run({value:v[l],issues:[]},o);y instanceof Promise?w.push(y.then(d=>{d.issues.length&&a.issues.push(...Lr(l,d.issues)),a.value[u.value]=d.value})):(y.issues.length&&a.issues.push(...Lr(l,y.issues)),a.value[u.value]=y.value)}}return w.length?Promise.all(w).then(()=>a):a}}),wx=he("$ZodEnum",(i,r)=>{at.init(i,r);const a=T_(r.entries),o=new Set(a);i._zod.values=o,i._zod.pattern=new RegExp(`^(${a.filter(v=>B1.has(typeof v)).map(v=>typeof v=="string"?Lo(v):v.toString()).join("|")})$`),i._zod.parse=(v,w)=>{const k=v.value;return o.has(k)||v.issues.push({code:"invalid_value",values:a,input:k,inst:i}),v}}),Ex=he("$ZodTransform",(i,r)=>{at.init(i,r),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new E_(i.constructor.name);const v=r.transform(a.value,a);if(o.async)return(v instanceof Promise?v:Promise.resolve(v)).then(k=>(a.value=k,a));if(v instanceof Promise)throw new jr;return a.value=v,a}});function gp(i,r){return i.issues.length&&r===void 0?{issues:[],value:void 0}:i}const Z_=he("$ZodOptional",(i,r)=>{at.init(i,r),i._zod.optin="optional",i._zod.optout="optional",Ze(i._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),Ze(i._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${Uu(a.source)})?$`):void 0}),i._zod.parse=(a,o)=>{if(r.innerType._zod.optin==="optional"){const v=r.innerType._zod.run(a,o);return v instanceof Promise?v.then(w=>gp(w,a.value)):gp(v,a.value)}return a.value===void 0?a:r.innerType._zod.run(a,o)}}),kx=he("$ZodExactOptional",(i,r)=>{Z_.init(i,r),Ze(i._zod,"values",()=>r.innerType._zod.values),Ze(i._zod,"pattern",()=>r.innerType._zod.pattern),i._zod.parse=(a,o)=>r.innerType._zod.run(a,o)}),Tx=he("$ZodNullable",(i,r)=>{at.init(i,r),Ze(i._zod,"optin",()=>r.innerType._zod.optin),Ze(i._zod,"optout",()=>r.innerType._zod.optout),Ze(i._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${Uu(a.source)}|null)$`):void 0}),Ze(i._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,null]):void 0),i._zod.parse=(a,o)=>a.value===null?a:r.innerType._zod.run(a,o)}),Ax=he("$ZodDefault",(i,r)=>{at.init(i,r),i._zod.optin="optional",Ze(i._zod,"values",()=>r.innerType._zod.values),i._zod.parse=(a,o)=>{if(o.direction==="backward")return r.innerType._zod.run(a,o);if(a.value===void 0)return a.value=r.defaultValue,a;const v=r.innerType._zod.run(a,o);return v instanceof Promise?v.then(w=>yp(w,r)):yp(v,r)}});function yp(i,r){return i.value===void 0&&(i.value=r.defaultValue),i}const Rx=he("$ZodPrefault",(i,r)=>{at.init(i,r),i._zod.optin="optional",Ze(i._zod,"values",()=>r.innerType._zod.values),i._zod.parse=(a,o)=>(o.direction==="backward"||a.value===void 0&&(a.value=r.defaultValue),r.innerType._zod.run(a,o))}),Dx=he("$ZodNonOptional",(i,r)=>{at.init(i,r),Ze(i._zod,"values",()=>{const a=r.innerType._zod.values;return a?new Set([...a].filter(o=>o!==void 0)):void 0}),i._zod.parse=(a,o)=>{const v=r.innerType._zod.run(a,o);return v instanceof Promise?v.then(w=>bp(w,i)):bp(v,i)}});function bp(i,r){return!i.issues.length&&i.value===void 0&&i.issues.push({code:"invalid_type",expected:"nonoptional",input:i.value,inst:r}),i}const Ox=he("$ZodCatch",(i,r)=>{at.init(i,r),Ze(i._zod,"optin",()=>r.innerType._zod.optin),Ze(i._zod,"optout",()=>r.innerType._zod.optout),Ze(i._zod,"values",()=>r.innerType._zod.values),i._zod.parse=(a,o)=>{if(o.direction==="backward")return r.innerType._zod.run(a,o);const v=r.innerType._zod.run(a,o);return v instanceof Promise?v.then(w=>(a.value=w.value,w.issues.length&&(a.value=r.catchValue({...a,error:{issues:w.issues.map(k=>ys(k,o,gs()))},input:a.value}),a.issues=[]),a)):(a.value=v.value,v.issues.length&&(a.value=r.catchValue({...a,error:{issues:v.issues.map(w=>ys(w,o,gs()))},input:a.value}),a.issues=[]),a)}}),Nx=he("$ZodPipe",(i,r)=>{at.init(i,r),Ze(i._zod,"values",()=>r.in._zod.values),Ze(i._zod,"optin",()=>r.in._zod.optin),Ze(i._zod,"optout",()=>r.out._zod.optout),Ze(i._zod,"propValues",()=>r.in._zod.propValues),i._zod.parse=(a,o)=>{if(o.direction==="backward"){const w=r.out._zod.run(a,o);return w instanceof Promise?w.then(k=>_o(k,r.in,o)):_o(w,r.in,o)}const v=r.in._zod.run(a,o);return v instanceof Promise?v.then(w=>_o(w,r.out,o)):_o(v,r.out,o)}});function _o(i,r,a){return i.issues.length?(i.aborted=!0,i):r._zod.run({value:i.value,issues:i.issues},a)}const Mx=he("$ZodReadonly",(i,r)=>{at.init(i,r),Ze(i._zod,"propValues",()=>r.innerType._zod.propValues),Ze(i._zod,"values",()=>r.innerType._zod.values),Ze(i._zod,"optin",()=>{var a,o;return(o=(a=r.innerType)==null?void 0:a._zod)==null?void 0:o.optin}),Ze(i._zod,"optout",()=>{var a,o;return(o=(a=r.innerType)==null?void 0:a._zod)==null?void 0:o.optout}),i._zod.parse=(a,o)=>{if(o.direction==="backward")return r.innerType._zod.run(a,o);const v=r.innerType._zod.run(a,o);return v instanceof Promise?v.then(Sp):Sp(v)}});function Sp(i){return i.value=Object.freeze(i.value),i}const Lx=he("$ZodCustom",(i,r)=>{Ht.init(i,r),at.init(i,r),i._zod.parse=(a,o)=>a,i._zod.check=a=>{const o=a.value,v=r.fn(o);if(v instanceof Promise)return v.then(w=>xp(w,a,o,i));xp(v,a,o,i)}});function xp(i,r,a,o){if(!i){const v={code:"custom",input:a,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(v.params=o._zod.def.params),r.issues.push($n(v))}}var Cp;class jx{constructor(){this._map=new WeakMap,this._idmap=new Map}add(r,...a){const o=a[0];return this._map.set(r,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,r),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(r){const a=this._map.get(r);return a&&typeof a=="object"&&"id"in a&&this._idmap.delete(a.id),this._map.delete(r),this}get(r){const a=r._zod.parent;if(a){const o={...this.get(a)??{}};delete o.id;const v={...o,...this._map.get(r)};return Object.keys(v).length?v:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function Bx(){return new jx}(Cp=globalThis).__zod_globalRegistry??(Cp.__zod_globalRegistry=Bx());const Un=globalThis.__zod_globalRegistry;function zx(i,r){return new i({type:"string",...be(r)})}function Hx(i,r){return new i({type:"string",format:"email",check:"string_format",abort:!1,...be(r)})}function wp(i,r){return new i({type:"string",format:"guid",check:"string_format",abort:!1,...be(r)})}function Ux(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,...be(r)})}function Ix(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...be(r)})}function Px(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...be(r)})}function $x(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...be(r)})}function Fx(i,r){return new i({type:"string",format:"url",check:"string_format",abort:!1,...be(r)})}function Zx(i,r){return new i({type:"string",format:"emoji",check:"string_format",abort:!1,...be(r)})}function qx(i,r){return new i({type:"string",format:"nanoid",check:"string_format",abort:!1,...be(r)})}function Kx(i,r){return new i({type:"string",format:"cuid",check:"string_format",abort:!1,...be(r)})}function Vx(i,r){return new i({type:"string",format:"cuid2",check:"string_format",abort:!1,...be(r)})}function Gx(i,r){return new i({type:"string",format:"ulid",check:"string_format",abort:!1,...be(r)})}function Yx(i,r){return new i({type:"string",format:"xid",check:"string_format",abort:!1,...be(r)})}function Wx(i,r){return new i({type:"string",format:"ksuid",check:"string_format",abort:!1,...be(r)})}function Xx(i,r){return new i({type:"string",format:"ipv4",check:"string_format",abort:!1,...be(r)})}function Jx(i,r){return new i({type:"string",format:"ipv6",check:"string_format",abort:!1,...be(r)})}function Qx(i,r){return new i({type:"string",format:"cidrv4",check:"string_format",abort:!1,...be(r)})}function eC(i,r){return new i({type:"string",format:"cidrv6",check:"string_format",abort:!1,...be(r)})}function tC(i,r){return new i({type:"string",format:"base64",check:"string_format",abort:!1,...be(r)})}function iC(i,r){return new i({type:"string",format:"base64url",check:"string_format",abort:!1,...be(r)})}function sC(i,r){return new i({type:"string",format:"e164",check:"string_format",abort:!1,...be(r)})}function rC(i,r){return new i({type:"string",format:"jwt",check:"string_format",abort:!1,...be(r)})}function nC(i,r){return new i({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...be(r)})}function aC(i,r){return new i({type:"string",format:"date",check:"string_format",...be(r)})}function oC(i,r){return new i({type:"string",format:"time",check:"string_format",precision:null,...be(r)})}function lC(i,r){return new i({type:"string",format:"duration",check:"string_format",...be(r)})}function cC(i,r){return new i({type:"number",checks:[],...be(r)})}function uC(i,r){return new i({type:"number",check:"number_format",abort:!1,format:"safeint",...be(r)})}function hC(i,r){return new i({type:"boolean",...be(r)})}function dC(i){return new i({type:"unknown"})}function fC(i,r){return new i({type:"never",...be(r)})}function Ep(i,r){return new H_({check:"less_than",...be(r),value:i,inclusive:!1})}function cu(i,r){return new H_({check:"less_than",...be(r),value:i,inclusive:!0})}function kp(i,r){return new U_({check:"greater_than",...be(r),value:i,inclusive:!1})}function uu(i,r){return new U_({check:"greater_than",...be(r),value:i,inclusive:!0})}function Tp(i,r){return new RS({check:"multiple_of",...be(r),value:i})}function q_(i,r){return new OS({check:"max_length",...be(r),maximum:i})}function ko(i,r){return new NS({check:"min_length",...be(r),minimum:i})}function K_(i,r){return new MS({check:"length_equals",...be(r),length:i})}function mC(i,r){return new LS({check:"string_format",format:"regex",...be(r),pattern:i})}function pC(i){return new jS({check:"string_format",format:"lowercase",...be(i)})}function _C(i){return new BS({check:"string_format",format:"uppercase",...be(i)})}function vC(i,r){return new zS({check:"string_format",format:"includes",...be(r),includes:i})}function gC(i,r){return new HS({check:"string_format",format:"starts_with",...be(r),prefix:i})}function yC(i,r){return new US({check:"string_format",format:"ends_with",...be(r),suffix:i})}function Ir(i){return new IS({check:"overwrite",tx:i})}function bC(i){return Ir(r=>r.normalize(i))}function SC(){return Ir(i=>i.trim())}function xC(){return Ir(i=>i.toLowerCase())}function CC(){return Ir(i=>i.toUpperCase())}function wC(){return Ir(i=>L1(i))}function EC(i,r,a){return new i({type:"array",element:r,...be(a)})}function kC(i,r,a){return new i({type:"custom",check:"custom",fn:r,...be(a)})}function TC(i){const r=AC(a=>(a.addIssue=o=>{if(typeof o=="string")a.issues.push($n(o,a.value,r._zod.def));else{const v=o;v.fatal&&(v.continue=!1),v.code??(v.code="custom"),v.input??(v.input=a.value),v.inst??(v.inst=r),v.continue??(v.continue=!r._zod.def.abort),a.issues.push($n(v))}},i(a.value,a)));return r}function AC(i,r){const a=new Ht({check:"custom",...be(r)});return a._zod.check=i,a}function V_(i){let r=(i==null?void 0:i.target)??"draft-2020-12";return r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),{processors:i.processors??{},metadataRegistry:(i==null?void 0:i.metadata)??Un,target:r,unrepresentable:(i==null?void 0:i.unrepresentable)??"throw",override:(i==null?void 0:i.override)??(()=>{}),io:(i==null?void 0:i.io)??"output",counter:0,seen:new Map,cycles:(i==null?void 0:i.cycles)??"ref",reused:(i==null?void 0:i.reused)??"inline",external:(i==null?void 0:i.external)??void 0}}function _t(i,r,a={path:[],schemaPath:[]}){var y,d;var o;const v=i._zod.def,w=r.seen.get(i);if(w)return w.count++,a.schemaPath.includes(i)&&(w.cycle=a.path),w.schema;const k={schema:{},count:1,cycle:void 0,path:a.path};r.seen.set(i,k);const l=(d=(y=i._zod).toJSONSchema)==null?void 0:d.call(y);if(l)k.schema=l;else{const S={...a,schemaPath:[...a.schemaPath,i],path:a.path};if(i._zod.processJSONSchema)i._zod.processJSONSchema(r,k.schema,S);else{const O=k.schema,C=r.processors[v.type];if(!C)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${v.type}`);C(i,r,O,S)}const E=i._zod.parent;E&&(k.ref||(k.ref=E),_t(E,r,S),r.seen.get(E).isParent=!0)}const u=r.metadataRegistry.get(i);return u&&Object.assign(k.schema,u),r.io==="input"&&At(i)&&(delete k.schema.examples,delete k.schema.default),r.io==="input"&&k.schema._prefault&&((o=k.schema).default??(o.default=k.schema._prefault)),delete k.schema._prefault,r.seen.get(i).schema}function G_(i,r){var k,l,u,f;const a=i.seen.get(r);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const y of i.seen.entries()){const d=(k=i.metadataRegistry.get(y[0]))==null?void 0:k.id;if(d){const S=o.get(d);if(S&&S!==y[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(d,y[0])}}const v=y=>{var C;const d=i.target==="draft-2020-12"?"$defs":"definitions";if(i.external){const m=(C=i.external.registry.get(y[0]))==null?void 0:C.id,g=i.external.uri??(_=>_);if(m)return{ref:g(m)};const h=y[1].defId??y[1].schema.id??`schema${i.counter++}`;return y[1].defId=h,{defId:h,ref:`${g("__shared")}#/${d}/${h}`}}if(y[1]===a)return{ref:"#"};const E=`#/${d}/`,O=y[1].schema.id??`__schema${i.counter++}`;return{defId:O,ref:E+O}},w=y=>{if(y[1].schema.$ref)return;const d=y[1],{ref:S,defId:E}=v(y);d.def={...d.schema},E&&(d.defId=E);const O=d.schema;for(const C in O)delete O[C];O.$ref=S};if(i.cycles==="throw")for(const y of i.seen.entries()){const d=y[1];if(d.cycle)throw new Error(`Cycle detected: #/${(l=d.cycle)==null?void 0:l.join("/")}/<root>
|
|
302
302
|
|
|
303
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of i.seen.entries()){const d=y[1];if(r===y[0]){w(y);continue}if(i.external){const E=(u=i.external.registry.get(y[0]))==null?void 0:u.id;if(r!==y[0]&&E){w(y);continue}}if((f=i.metadataRegistry.get(y[0]))==null?void 0:f.id){w(y);continue}if(d.cycle){w(y);continue}if(d.count>1&&i.reused==="ref"){w(y);continue}}}function Y_(i,r){var k,l,u;const a=i.seen.get(r);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=f=>{const y=i.seen.get(f);if(y.ref===null)return;const d=y.def??y.schema,S={...d},E=y.ref;if(y.ref=null,E){o(E);const C=i.seen.get(E),m=C.schema;if(m.$ref&&(i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(m)):Object.assign(d,m),Object.assign(d,S),f._zod.parent===E)for(const h in d)h==="$ref"||h==="allOf"||h in S||delete d[h];if(m.$ref&&C.def)for(const h in d)h==="$ref"||h==="allOf"||h in C.def&&JSON.stringify(d[h])===JSON.stringify(C.def[h])&&delete d[h]}const O=f._zod.parent;if(O&&O!==E){o(O);const C=i.seen.get(O);if(C!=null&&C.schema.$ref&&(d.$ref=C.schema.$ref,C.def))for(const m in d)m==="$ref"||m==="allOf"||m in C.def&&JSON.stringify(d[m])===JSON.stringify(C.def[m])&&delete d[m]}i.override({zodSchema:f,jsonSchema:d,path:y.path??[]})};for(const f of[...i.seen.entries()].reverse())o(f[0]);const v={};if(i.target==="draft-2020-12"?v.$schema="https://json-schema.org/draft/2020-12/schema":i.target==="draft-07"?v.$schema="http://json-schema.org/draft-07/schema#":i.target==="draft-04"?v.$schema="http://json-schema.org/draft-04/schema#":i.target,(k=i.external)!=null&&k.uri){const f=(l=i.external.registry.get(r))==null?void 0:l.id;if(!f)throw new Error("Schema is missing an `id` property");v.$id=i.external.uri(f)}Object.assign(v,a.def??a.schema);const w=((u=i.external)==null?void 0:u.defs)??{};for(const f of i.seen.entries()){const y=f[1];y.def&&y.defId&&(w[y.defId]=y.def)}i.external||Object.keys(w).length>0&&(i.target==="draft-2020-12"?v.$defs=w:v.definitions=w);try{const f=JSON.parse(JSON.stringify(v));return Object.defineProperty(f,"~standard",{value:{...r["~standard"],jsonSchema:{input:To(r,"input",i.processors),output:To(r,"output",i.processors)}},enumerable:!1,writable:!1}),f}catch{throw new Error("Error converting schema to JSON.")}}function At(i,r){const a=r??{seen:new Set};if(a.seen.has(i))return!1;a.seen.add(i);const o=i._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return At(o.element,a);if(o.type==="set")return At(o.valueType,a);if(o.type==="lazy")return At(o.getter(),a);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return At(o.innerType,a);if(o.type==="intersection")return At(o.left,a)||At(o.right,a);if(o.type==="record"||o.type==="map")return At(o.keyType,a)||At(o.valueType,a);if(o.type==="pipe")return At(o.in,a)||At(o.out,a);if(o.type==="object"){for(const v in o.shape)if(At(o.shape[v],a))return!0;return!1}if(o.type==="union"){for(const v of o.options)if(At(v,a))return!0;return!1}if(o.type==="tuple"){for(const v of o.items)if(At(v,a))return!0;return!!(o.rest&&At(o.rest,a))}return!1}const RC=(i,r={})=>a=>{const o=V_({...a,processors:r});return _t(i,o),G_(o,i),Y_(o,i)},To=(i,r,a={})=>o=>{const{libraryOptions:v,target:w}=o??{},k=V_({...v??{},target:w,io:r,processors:a});return _t(i,k),G_(k,i),Y_(k,i)},DC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},OC=(i,r,a,o)=>{const v=a;v.type="string";const{minimum:w,maximum:k,format:l,patterns:u,contentEncoding:f}=i._zod.bag;if(typeof w=="number"&&(v.minLength=w),typeof k=="number"&&(v.maxLength=k),l&&(v.format=DC[l]??l,v.format===""&&delete v.format,l==="time"&&delete v.format),f&&(v.contentEncoding=f),u&&u.size>0){const y=[...u];y.length===1?v.pattern=y[0].source:y.length>1&&(v.allOf=[...y.map(d=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},NC=(i,r,a,o)=>{const v=a,{minimum:w,maximum:k,format:l,multipleOf:u,exclusiveMaximum:f,exclusiveMinimum:y}=i._zod.bag;typeof l=="string"&&l.includes("int")?v.type="integer":v.type="number",typeof y=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(v.minimum=y,v.exclusiveMinimum=!0):v.exclusiveMinimum=y),typeof w=="number"&&(v.minimum=w,typeof y=="number"&&r.target!=="draft-04"&&(y>=w?delete v.minimum:delete v.exclusiveMinimum)),typeof f=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(v.maximum=f,v.exclusiveMaximum=!0):v.exclusiveMaximum=f),typeof k=="number"&&(v.maximum=k,typeof f=="number"&&r.target!=="draft-04"&&(f<=k?delete v.maximum:delete v.exclusiveMaximum)),typeof u=="number"&&(v.multipleOf=u)},MC=(i,r,a,o)=>{a.type="boolean"},LC=(i,r,a,o)=>{a.not={}},jC=(i,r,a,o)=>{},BC=(i,r,a,o)=>{const v=i._zod.def,w=T_(v.entries);w.every(k=>typeof k=="number")&&(a.type="number"),w.every(k=>typeof k=="string")&&(a.type="string"),a.enum=w},zC=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},HC=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},UC=(i,r,a,o)=>{const v=a,w=i._zod.def,{minimum:k,maximum:l}=i._zod.bag;typeof k=="number"&&(v.minItems=k),typeof l=="number"&&(v.maxItems=l),v.type="array",v.items=_t(w.element,r,{...o,path:[...o.path,"items"]})},IC=(i,r,a,o)=>{var f;const v=a,w=i._zod.def;v.type="object",v.properties={};const k=w.shape;for(const y in k)v.properties[y]=_t(k[y],r,{...o,path:[...o.path,"properties",y]});const l=new Set(Object.keys(k)),u=new Set([...l].filter(y=>{const d=w.shape[y]._zod;return r.io==="input"?d.optin===void 0:d.optout===void 0}));u.size>0&&(v.required=Array.from(u)),((f=w.catchall)==null?void 0:f._zod.def.type)==="never"?v.additionalProperties=!1:w.catchall?w.catchall&&(v.additionalProperties=_t(w.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(v.additionalProperties=!1)},PC=(i,r,a,o)=>{const v=i._zod.def,w=v.inclusive===!1,k=v.options.map((l,u)=>_t(l,r,{...o,path:[...o.path,w?"oneOf":"anyOf",u]}));w?a.oneOf=k:a.anyOf=k},$C=(i,r,a,o)=>{const v=i._zod.def,w=_t(v.left,r,{...o,path:[...o.path,"allOf",0]}),k=_t(v.right,r,{...o,path:[...o.path,"allOf",1]}),l=f=>"allOf"in f&&Object.keys(f).length===1,u=[...l(w)?w.allOf:[w],...l(k)?k.allOf:[k]];a.allOf=u},FC=(i,r,a,o)=>{const v=a,w=i._zod.def;v.type="object";const k=w.keyType,l=k._zod.bag,u=l==null?void 0:l.patterns;if(w.mode==="loose"&&u&&u.size>0){const y=_t(w.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});v.patternProperties={};for(const d of u)v.patternProperties[d.source]=y}else(r.target==="draft-07"||r.target==="draft-2020-12")&&(v.propertyNames=_t(w.keyType,r,{...o,path:[...o.path,"propertyNames"]})),v.additionalProperties=_t(w.valueType,r,{...o,path:[...o.path,"additionalProperties"]});const f=k._zod.values;if(f){const y=[...f].filter(d=>typeof d=="string"||typeof d=="number");y.length>0&&(v.required=y)}},ZC=(i,r,a,o)=>{const v=i._zod.def,w=_t(v.innerType,r,o),k=r.seen.get(i);r.target==="openapi-3.0"?(k.ref=v.innerType,a.nullable=!0):a.anyOf=[w,{type:"null"}]},qC=(i,r,a,o)=>{const v=i._zod.def;_t(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType},KC=(i,r,a,o)=>{const v=i._zod.def;_t(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType,a.default=JSON.parse(JSON.stringify(v.defaultValue))},VC=(i,r,a,o)=>{const v=i._zod.def;_t(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType,r.io==="input"&&(a._prefault=JSON.parse(JSON.stringify(v.defaultValue)))},GC=(i,r,a,o)=>{const v=i._zod.def;_t(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType;let k;try{k=v.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}a.default=k},YC=(i,r,a,o)=>{const v=i._zod.def,w=r.io==="input"?v.in._zod.def.type==="transform"?v.out:v.in:v.out;_t(w,r,o);const k=r.seen.get(i);k.ref=w},WC=(i,r,a,o)=>{const v=i._zod.def;_t(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType,a.readOnly=!0},W_=(i,r,a,o)=>{const v=i._zod.def;_t(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType},XC=he("ZodISODateTime",(i,r)=>{ex.init(i,r),it.init(i,r)});function JC(i){return nC(XC,i)}const QC=he("ZodISODate",(i,r)=>{tx.init(i,r),it.init(i,r)});function e2(i){return aC(QC,i)}const t2=he("ZodISOTime",(i,r)=>{ix.init(i,r),it.init(i,r)});function i2(i){return oC(t2,i)}const s2=he("ZodISODuration",(i,r)=>{sx.init(i,r),it.init(i,r)});function r2(i){return lC(s2,i)}const n2=(i,r)=>{O_.init(i,r),i.name="ZodError",Object.defineProperties(i,{format:{value:a=>V1(i,a)},flatten:{value:a=>K1(i,a)},addIssue:{value:a=>{i.issues.push(a),i.message=JSON.stringify(i.issues,Su,2)}},addIssues:{value:a=>{i.issues.push(...a),i.message=JSON.stringify(i.issues,Su,2)}},isEmpty:{get(){return i.issues.length===0}}})},oi=he("ZodError",n2,{Parent:Error}),a2=Pu(oi),o2=$u(oi),l2=jo(oi),c2=Bo(oi),u2=W1(oi),h2=X1(oi),d2=J1(oi),f2=Q1(oi),m2=eS(oi),p2=tS(oi),_2=iS(oi),v2=sS(oi),ot=he("ZodType",(i,r)=>(at.init(i,r),Object.assign(i["~standard"],{jsonSchema:{input:To(i,"input"),output:To(i,"output")}}),i.toJSONSchema=RC(i,{}),i.def=r,i.type=r.type,Object.defineProperty(i,"_def",{value:r}),i.check=(...a)=>i.clone(Ss(r,{checks:[...r.checks??[],...a.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),i.with=i.check,i.clone=(a,o)=>Pi(i,a,o),i.brand=()=>i,i.register=((a,o)=>(a.add(i,o),i)),i.parse=(a,o)=>a2(i,a,o,{callee:i.parse}),i.safeParse=(a,o)=>l2(i,a,o),i.parseAsync=async(a,o)=>o2(i,a,o,{callee:i.parseAsync}),i.safeParseAsync=async(a,o)=>c2(i,a,o),i.spa=i.safeParseAsync,i.encode=(a,o)=>u2(i,a,o),i.decode=(a,o)=>h2(i,a,o),i.encodeAsync=async(a,o)=>d2(i,a,o),i.decodeAsync=async(a,o)=>f2(i,a,o),i.safeEncode=(a,o)=>m2(i,a,o),i.safeDecode=(a,o)=>p2(i,a,o),i.safeEncodeAsync=async(a,o)=>_2(i,a,o),i.safeDecodeAsync=async(a,o)=>v2(i,a,o),i.refine=(a,o)=>i.check(uw(a,o)),i.superRefine=a=>i.check(hw(a)),i.overwrite=a=>i.check(Ir(a)),i.optional=()=>Dp(i),i.exactOptional=()=>X2(i),i.nullable=()=>Op(i),i.nullish=()=>Dp(Op(i)),i.nonoptional=a=>sw(i,a),i.array=()=>Yn(i),i.or=a=>Z2([i,a]),i.and=a=>K2(i,a),i.transform=a=>Np(i,Y2(a)),i.default=a=>ew(i,a),i.prefault=a=>iw(i,a),i.catch=a=>nw(i,a),i.pipe=a=>Np(i,a),i.readonly=()=>lw(i),i.describe=a=>{const o=i.clone();return Un.add(o,{description:a}),o},Object.defineProperty(i,"description",{get(){var a;return(a=Un.get(i))==null?void 0:a.description},configurable:!0}),i.meta=(...a)=>{if(a.length===0)return Un.get(i);const o=i.clone();return Un.add(o,a[0]),o},i.isOptional=()=>i.safeParse(void 0).success,i.isNullable=()=>i.safeParse(null).success,i.apply=a=>a(i),i)),X_=he("_ZodString",(i,r)=>{Fu.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(o,v,w)=>OC(i,o,v);const a=i._zod.bag;i.format=a.format??null,i.minLength=a.minimum??null,i.maxLength=a.maximum??null,i.regex=(...o)=>i.check(mC(...o)),i.includes=(...o)=>i.check(vC(...o)),i.startsWith=(...o)=>i.check(gC(...o)),i.endsWith=(...o)=>i.check(yC(...o)),i.min=(...o)=>i.check(ko(...o)),i.max=(...o)=>i.check(q_(...o)),i.length=(...o)=>i.check(K_(...o)),i.nonempty=(...o)=>i.check(ko(1,...o)),i.lowercase=o=>i.check(pC(o)),i.uppercase=o=>i.check(_C(o)),i.trim=()=>i.check(SC()),i.normalize=(...o)=>i.check(bC(...o)),i.toLowerCase=()=>i.check(xC()),i.toUpperCase=()=>i.check(CC()),i.slugify=()=>i.check(wC())}),g2=he("ZodString",(i,r)=>{Fu.init(i,r),X_.init(i,r),i.email=a=>i.check(Hx(y2,a)),i.url=a=>i.check(Fx(b2,a)),i.jwt=a=>i.check(rC(j2,a)),i.emoji=a=>i.check(Zx(S2,a)),i.guid=a=>i.check(wp(Ap,a)),i.uuid=a=>i.check(Ux(vo,a)),i.uuidv4=a=>i.check(Ix(vo,a)),i.uuidv6=a=>i.check(Px(vo,a)),i.uuidv7=a=>i.check($x(vo,a)),i.nanoid=a=>i.check(qx(x2,a)),i.guid=a=>i.check(wp(Ap,a)),i.cuid=a=>i.check(Kx(C2,a)),i.cuid2=a=>i.check(Vx(w2,a)),i.ulid=a=>i.check(Gx(E2,a)),i.base64=a=>i.check(tC(N2,a)),i.base64url=a=>i.check(iC(M2,a)),i.xid=a=>i.check(Yx(k2,a)),i.ksuid=a=>i.check(Wx(T2,a)),i.ipv4=a=>i.check(Xx(A2,a)),i.ipv6=a=>i.check(Jx(R2,a)),i.cidrv4=a=>i.check(Qx(D2,a)),i.cidrv6=a=>i.check(eC(O2,a)),i.e164=a=>i.check(sC(L2,a)),i.datetime=a=>i.check(JC(a)),i.date=a=>i.check(e2(a)),i.time=a=>i.check(i2(a)),i.duration=a=>i.check(r2(a))});function Ae(i){return zx(g2,i)}const it=he("ZodStringFormat",(i,r)=>{et.init(i,r),X_.init(i,r)}),y2=he("ZodEmail",(i,r)=>{qS.init(i,r),it.init(i,r)}),Ap=he("ZodGUID",(i,r)=>{FS.init(i,r),it.init(i,r)}),vo=he("ZodUUID",(i,r)=>{ZS.init(i,r),it.init(i,r)}),b2=he("ZodURL",(i,r)=>{KS.init(i,r),it.init(i,r)}),S2=he("ZodEmoji",(i,r)=>{VS.init(i,r),it.init(i,r)}),x2=he("ZodNanoID",(i,r)=>{GS.init(i,r),it.init(i,r)}),C2=he("ZodCUID",(i,r)=>{YS.init(i,r),it.init(i,r)}),w2=he("ZodCUID2",(i,r)=>{WS.init(i,r),it.init(i,r)}),E2=he("ZodULID",(i,r)=>{XS.init(i,r),it.init(i,r)}),k2=he("ZodXID",(i,r)=>{JS.init(i,r),it.init(i,r)}),T2=he("ZodKSUID",(i,r)=>{QS.init(i,r),it.init(i,r)}),A2=he("ZodIPv4",(i,r)=>{rx.init(i,r),it.init(i,r)}),R2=he("ZodIPv6",(i,r)=>{nx.init(i,r),it.init(i,r)}),D2=he("ZodCIDRv4",(i,r)=>{ax.init(i,r),it.init(i,r)}),O2=he("ZodCIDRv6",(i,r)=>{ox.init(i,r),it.init(i,r)}),N2=he("ZodBase64",(i,r)=>{lx.init(i,r),it.init(i,r)}),M2=he("ZodBase64URL",(i,r)=>{ux.init(i,r),it.init(i,r)}),L2=he("ZodE164",(i,r)=>{hx.init(i,r),it.init(i,r)}),j2=he("ZodJWT",(i,r)=>{fx.init(i,r),it.init(i,r)}),J_=he("ZodNumber",(i,r)=>{P_.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(o,v,w)=>NC(i,o,v),i.gt=(o,v)=>i.check(kp(o,v)),i.gte=(o,v)=>i.check(uu(o,v)),i.min=(o,v)=>i.check(uu(o,v)),i.lt=(o,v)=>i.check(Ep(o,v)),i.lte=(o,v)=>i.check(cu(o,v)),i.max=(o,v)=>i.check(cu(o,v)),i.int=o=>i.check(Rp(o)),i.safe=o=>i.check(Rp(o)),i.positive=o=>i.check(kp(0,o)),i.nonnegative=o=>i.check(uu(0,o)),i.negative=o=>i.check(Ep(0,o)),i.nonpositive=o=>i.check(cu(0,o)),i.multipleOf=(o,v)=>i.check(Tp(o,v)),i.step=(o,v)=>i.check(Tp(o,v)),i.finite=()=>i;const a=i._zod.bag;i.minValue=Math.max(a.minimum??Number.NEGATIVE_INFINITY,a.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,i.maxValue=Math.min(a.maximum??Number.POSITIVE_INFINITY,a.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,i.isInt=(a.format??"").includes("int")||Number.isSafeInteger(a.multipleOf??.5),i.isFinite=!0,i.format=a.format??null});function ye(i){return cC(J_,i)}const B2=he("ZodNumberFormat",(i,r)=>{mx.init(i,r),J_.init(i,r)});function Rp(i){return uC(B2,i)}const z2=he("ZodBoolean",(i,r)=>{px.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>MC(i,a,o)});function Ui(i){return hC(z2,i)}const H2=he("ZodUnknown",(i,r)=>{_x.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>jC()});function Ao(){return dC(H2)}const U2=he("ZodNever",(i,r)=>{vx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>LC(i,a,o)});function I2(i){return fC(U2,i)}const P2=he("ZodArray",(i,r)=>{gx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>UC(i,a,o,v),i.element=r.element,i.min=(a,o)=>i.check(ko(a,o)),i.nonempty=a=>i.check(ko(1,a)),i.max=(a,o)=>i.check(q_(a,o)),i.length=(a,o)=>i.check(K_(a,o)),i.unwrap=()=>i.element});function Yn(i,r){return EC(P2,i,r)}const $2=he("ZodObject",(i,r)=>{bx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>IC(i,a,o,v),Ze(i,"shape",()=>r.shape),i.keyof=()=>Fs(Object.keys(i._zod.def.shape)),i.catchall=a=>i.clone({...i._zod.def,catchall:a}),i.passthrough=()=>i.clone({...i._zod.def,catchall:Ao()}),i.loose=()=>i.clone({...i._zod.def,catchall:Ao()}),i.strict=()=>i.clone({...i._zod.def,catchall:I2()}),i.strip=()=>i.clone({...i._zod.def,catchall:void 0}),i.extend=a=>P1(i,a),i.safeExtend=a=>$1(i,a),i.merge=a=>F1(i,a),i.pick=a=>U1(i,a),i.omit=a=>I1(i,a),i.partial=(...a)=>Z1(ev,i,a[0]),i.required=(...a)=>q1(tv,i,a[0])});function Ye(i,r){const a={type:"object",shape:i??{},...be(r)};return new $2(a)}const F2=he("ZodUnion",(i,r)=>{Sx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>PC(i,a,o,v),i.options=r.options});function Z2(i,r){return new F2({type:"union",options:i,...be(r)})}const q2=he("ZodIntersection",(i,r)=>{xx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>$C(i,a,o,v)});function K2(i,r){return new q2({type:"intersection",left:i,right:r})}const Q_=he("ZodRecord",(i,r)=>{Cx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>FC(i,a,o,v),i.keyType=r.keyType,i.valueType=r.valueType});function Ho(i,r,a){return new Q_({type:"record",keyType:i,valueType:r,...be(a)})}function V2(i,r,a){const o=Pi(i);return o._zod.values=void 0,new Q_({type:"record",keyType:o,valueType:r,...be(a)})}const Cu=he("ZodEnum",(i,r)=>{wx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(o,v,w)=>BC(i,o,v),i.enum=r.entries,i.options=Object.values(r.entries);const a=new Set(Object.keys(r.entries));i.extract=(o,v)=>{const w={};for(const k of o)if(a.has(k))w[k]=r.entries[k];else throw new Error(`Key ${k} not found in enum`);return new Cu({...r,checks:[],...be(v),entries:w})},i.exclude=(o,v)=>{const w={...r.entries};for(const k of o)if(a.has(k))delete w[k];else throw new Error(`Key ${k} not found in enum`);return new Cu({...r,checks:[],...be(v),entries:w})}});function Fs(i,r){const a=Array.isArray(i)?Object.fromEntries(i.map(o=>[o,o])):i;return new Cu({type:"enum",entries:a,...be(r)})}const G2=he("ZodTransform",(i,r)=>{Ex.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>HC(i,a),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new E_(i.constructor.name);a.addIssue=w=>{if(typeof w=="string")a.issues.push($n(w,a.value,r));else{const k=w;k.fatal&&(k.continue=!1),k.code??(k.code="custom"),k.input??(k.input=a.value),k.inst??(k.inst=i),a.issues.push($n(k))}};const v=r.transform(a.value,a);return v instanceof Promise?v.then(w=>(a.value=w,a)):(a.value=v,a)}});function Y2(i){return new G2({type:"transform",transform:i})}const ev=he("ZodOptional",(i,r)=>{Z_.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>W_(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function Dp(i){return new ev({type:"optional",innerType:i})}const W2=he("ZodExactOptional",(i,r)=>{kx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>W_(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function X2(i){return new W2({type:"optional",innerType:i})}const J2=he("ZodNullable",(i,r)=>{Tx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>ZC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function Op(i){return new J2({type:"nullable",innerType:i})}const Q2=he("ZodDefault",(i,r)=>{Ax.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>KC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType,i.removeDefault=i.unwrap});function ew(i,r){return new Q2({type:"default",innerType:i,get defaultValue(){return typeof r=="function"?r():R_(r)}})}const tw=he("ZodPrefault",(i,r)=>{Rx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>VC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function iw(i,r){return new tw({type:"prefault",innerType:i,get defaultValue(){return typeof r=="function"?r():R_(r)}})}const tv=he("ZodNonOptional",(i,r)=>{Dx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>qC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function sw(i,r){return new tv({type:"nonoptional",innerType:i,...be(r)})}const rw=he("ZodCatch",(i,r)=>{Ox.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>GC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType,i.removeCatch=i.unwrap});function nw(i,r){return new rw({type:"catch",innerType:i,catchValue:typeof r=="function"?r:()=>r})}const aw=he("ZodPipe",(i,r)=>{Nx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>YC(i,a,o,v),i.in=r.in,i.out=r.out});function Np(i,r){return new aw({type:"pipe",in:i,out:r})}const ow=he("ZodReadonly",(i,r)=>{Mx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>WC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function lw(i){return new ow({type:"readonly",innerType:i})}const cw=he("ZodCustom",(i,r)=>{Lx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>zC(i,a)});function uw(i,r={}){return kC(cw,i,r)}function hw(i){return TC(i)}const Uo=Fs(["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"]),dw=Fs(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]),Zu=Ye({ok:Ui()}),fw=Ye({id:Ae(),name:Ae(),createdAt:ye(),lastUsedAt:ye(),rateLimit:ye()}),mw=Ye({id:Ae(),name:Ae(),key:Ae()}),pw=Zu.extend({delivered:Ui(),attempts:ye()}),_w=Ye({status:Ae(),version:Ae(),platform:dw,uptime:ye(),sessions:Ye({active:ye(),total:ye()}),timestamp:Ae()}),Io=Ye({id:Ae(),windowId:Ae(),windowName:Ae(),workDir:Ae(),claudeSessionId:Ae().optional(),jsonlPath:Ae().optional(),byteOffset:ye(),monitorOffset:ye(),status:Uo,createdAt:ye(),lastActivity:ye(),stallThresholdMs:ye(),permissionMode:Ae(),autoApprove:Ui().optional(),settingsPatched:Ui().optional(),promptDelivery:Ye({delivered:Ui(),attempts:ye()}).optional(),actionHints:Ho(Ae(),Ye({method:Ae(),url:Ae(),description:Ae()})).optional()}),vw=Ye({sessions:Yn(Io),pagination:Ye({page:ye(),limit:ye(),total:ye(),totalPages:ye()})}),gw=Ye({active:ye(),byStatus:V2(Uo,ye()),totalCreated:ye(),totalCompleted:ye(),totalFailed:ye()}),yw=Ye({alive:Ui(),windowExists:Ui(),claudeRunning:Ui(),paneCommand:Ae().nullable(),status:Uo,hasTranscript:Ui(),lastActivity:ye(),lastActivityAgo:ye(),sessionAge:ye(),details:Ae(),actionHints:Ho(Ae(),Ye({method:Ae(),url:Ae(),description:Ae()})).optional()}),bw=Ye({durationSec:ye(),messages:ye(),toolCalls:ye(),approvals:ye(),autoApprovals:ye(),statusChanges:Yn(Ae()),tokenUsage:Ye({inputTokens:ye(),outputTokens:ye(),cacheCreationTokens:ye(),cacheReadTokens:ye(),estimatedCostUsd:ye()}).optional()}),vs=Ye({min:ye().nullable(),max:ye().nullable(),avg:ye().nullable(),count:ye()}),Sw=Ye({sessionId:Ae(),realtime:Ye({hook_latency_ms:ye().nullable(),state_change_detection_ms:ye().nullable(),permission_response_ms:ye().nullable()}).nullable(),aggregated:Ye({hook_latency_ms:vs,state_change_detection_ms:vs,permission_response_ms:vs,channel_delivery_ms:vs}).nullable()}),xw=Ye({role:Fs(["user","assistant","system"]),contentType:Fs(["text","thinking","tool_use","tool_result","tool_error","permission_request","progress"]),text:Ae(),toolName:Ae().optional(),toolUseId:Ae().optional(),timestamp:Ae().optional()}),Cw=Ye({messages:Yn(xw),status:Uo,statusText:Ae().nullable(),interactiveContent:Ae().nullable()}),ww=Ye({uptime:ye(),sessions:Ye({total_created:ye(),currently_active:ye(),completed:ye(),failed:ye(),avg_duration_sec:ye(),avg_messages_per_session:ye()}),auto_approvals:ye(),webhooks_sent:ye(),webhooks_failed:ye(),screenshots_taken:ye(),pipelines_created:ye(),batches_created:ye(),prompt_delivery:Ye({sent:ye(),delivered:ye(),failed:ye(),success_rate:ye().nullable()}),latency:Ye({hook_latency_ms:vs,state_change_detection_ms:vs,permission_response_ms:vs,channel_delivery_ms:vs})}),Ew=Fs(["status","message","approval","ended","heartbeat","stall","dead","system","hook","subagent_start","subagent_stop","verification","permission_denied"]),kw=Ye({event:Ew,sessionId:Ae(),timestamp:Ae(),data:Ho(Ae(),Ao())}),Tw=Fs(["session_status_change","session_message","session_approval","session_ended","session_created","session_stall","session_dead","session_subagent_start","session_subagent_stop","session_verification"]),Aw=Ye({event:Tw,sessionId:Ae(),timestamp:Ae(),data:Ho(Ae(),Ao())}),Rw=3e4,Dw=300*1e3;class Ro{constructor(r,a,o={}){pt(this,"eventSource",null);pt(this,"consecutiveFailures",0);pt(this,"failStartTime",null);pt(this,"destroyed",!1);pt(this,"gaveUp",!1);pt(this,"reconnectTimer",null);pt(this,"url");pt(this,"callbacks");pt(this,"onMessage");this.url=r,this.onMessage=a,this.callbacks=o,this.connect()}connect(){this.destroyed||(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.eventSource=new EventSource(this.url),this.eventSource.onmessage=this.onMessage,this.eventSource.onopen=()=>{var r,a;this.destroyed||(this.consecutiveFailures=0,this.failStartTime=null,this.gaveUp=!1,(a=(r=this.callbacks).onOpen)==null||a.call(r))},this.eventSource.onerror=()=>{var a,o,v,w,k,l,u;if(this.destroyed)return;if((a=this.eventSource)==null||a.close(),this.eventSource=null,this.failStartTime===null&&(this.failStartTime=Date.now()),Date.now()-this.failStartTime>=Dw){this.gaveUp||(this.gaveUp=!0,(v=(o=this.callbacks).onGiveUp)==null||v.call(o),(k=(w=this.callbacks).onClose)==null||k.call(w));return}this.consecutiveFailures++;const r=Math.min(Rw,1e3*Math.pow(2,this.consecutiveFailures-1));(u=(l=this.callbacks).onReconnecting)==null||u.call(l,this.consecutiveFailures,r),this.reconnectTimer=setTimeout(()=>this.connect(),r)})}close(){var r;this.destroyed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(r=this.eventSource)==null||r.close(),this.eventSource=null}}const Ow="",Nw=["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"];function Mw(i){if(!i)return{};if(i instanceof Headers){const r={};return i.forEach((a,o)=>{r[o]=a}),r}return i}function Lw(i,r,a){const o=r.safeParse(i);if(o.success)return o.data;throw console.error(`[aegis] API response validation failed (${a}):`,o.error.issues),new Error(`API response validation failed for ${a}: ${o.error.issues.map(v=>v.message).join(", ")}`)}function jw(i){return!(i.name==="AbortError"||!i.message||i.message.includes("HTTP "))}async function Ue(i,r={}){const a=localStorage.getItem("aegis_token"),o={"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{},...Mw(r.headers)},{retries:v=0,schema:w,schemaContext:k,...l}=r;let u=null;for(let f=0;f<=v;f++)try{const y=await fetch(`${Ow}${i}`,{...l,headers:o});if(!y.ok){const S=await y.json().catch(()=>({error:y.statusText})),E=new Error(S.error??`HTTP ${y.status}`);throw E.statusCode=y.status,E}const d=await y.json();return w?Lw(d,w,k??i):d}catch(y){if(u=y,f<v&&jw(u))await new Promise(d=>setTimeout(d,1e3*Math.pow(2,f)));else throw u}throw u}function iv(){return Ue("/v1/health",{schema:_w,schemaContext:"getHealth"})}const sv="aegis-bridge",Bw=`https://registry.npmjs.org/${sv}/latest`,zw=`https://www.npmjs.com/package/${sv}`;function Do(i){return i.trim().replace(/^v/i,"")}function Hw(i,r){const a=Do(i).split(".").map(w=>Number.parseInt(w,10)||0),o=Do(r).split(".").map(w=>Number.parseInt(w,10)||0),v=Math.max(a.length,o.length);for(let w=0;w<v;w++){const k=a[w]??0,l=o[w]??0;if(k>l)return 1;if(k<l)return-1}return 0}async function Uw(i){const r=await fetch(Bw,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`Update check failed (HTTP ${r.status})`);const a=await r.json(),o=Do(a.version??i),v=Do(i);return{currentVersion:v,latestVersion:o,updateAvailable:Hw(o,v)>0,releaseUrl:zw}}function Iw(){return Ue("/v1/metrics",{schema:ww,schemaContext:"getMetrics"})}function Pw(i={}){const r=new URLSearchParams;i.page!==void 0&&r.set("page",String(i.page)),i.limit!==void 0&&r.set("limit",String(i.limit)),i.status&&r.set("status",i.status);const a=r.toString(),o=a?`/v1/sessions?${a}`:"/v1/sessions";return Ue(o,{schema:vw,schemaContext:"getSessions"})}async function $w(){const i=await Ue("/v1/sessions/stats",{schema:gw,schemaContext:"getSessionStatusCounts"}),r={all:i.active,idle:0,working:0,compacting:0,context_warning:0,waiting_for_input:0,permission_prompt:0,plan_mode:0,ask_question:0,bash_approval:0,settings:0,error:0,unknown:0};return Nw.forEach(a=>{r[a]=i.byStatus[a]??0}),r}function Fw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}`,{schema:Io,schemaContext:"getSession"})}function Mp(i){const{signal:r,...a}=i;return Ue("/v1/sessions",{method:"POST",body:JSON.stringify(a),signal:r,schema:Io,schemaContext:"createSession"})}function wu(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}`,{method:"DELETE",schema:Zu,schemaContext:"killSession"})}function Zw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/health`,{schema:yw,schemaContext:"getSessionHealth"})}function qw(){return Ue("/v1/sessions/health")}function Kw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/read`,{schema:Cw,schemaContext:"getSessionMessages"})}function Vw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/metrics`,{schema:bw,schemaContext:"getSessionMetrics"})}function Gw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/latency`,{schema:Sw,schemaContext:"getSessionLatency"})}function Yw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/pane`)}function Ww(i,r){return Ue(`/v1/sessions/${encodeURIComponent(i)}/send`,{method:"POST",body:JSON.stringify({text:r}),schema:pw,schemaContext:"sendMessage"})}function rv(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/approve`,{method:"POST"})}function Xw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/reject`,{method:"POST"})}function Eu(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/interrupt`,{method:"POST"})}function Jw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/escape`,{method:"POST"})}function Qw(i,r={}){return Ue(`/v1/sessions/${encodeURIComponent(i)}/fork`,{method:"POST",body:JSON.stringify(r),schema:Io,schemaContext:"forkSession"})}const Lp=3,eE=1e3;async function nv(i,r){for(let a=0;a<Lp;a++){if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");try{return await cE(r)}catch{if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");if(a<Lp-1){const o=eE*Math.pow(2,a);await new Promise(v=>{const w=setTimeout(v,o);r==null||r.addEventListener("abort",()=>{clearTimeout(w),v(void 0)},{once:!0})})}}}throw i==null||i(),new Error("Real-time updates unavailable")}function av(i,r,a,o){const v=`/v1/sessions/${encodeURIComponent(i)}/events`;let w=null,k=!1;const l=new AbortController;return a?nv(o==null?void 0:o.onGiveUp,l.signal).then(u=>{if(k)return;const f=`${v}?token=${encodeURIComponent(u.token)}`;w=new Ro(f,r,o)}).catch(()=>{}):w=new Ro(v,r,o),()=>{k=!0,l.abort(),w==null||w.close()}}function tE(i,r,a){const o="/v1/events";let v=null,w=!1;const k=new AbortController,l=u=>{try{const f=Aw.safeParse(JSON.parse(u.data));if(!f.success){console.warn("Global SSE event failed validation",f.error.message);return}i(f.data)}catch{}};return r?nv(a==null?void 0:a.onGiveUp,k.signal).then(u=>{if(w)return;const f=`${o}?token=${encodeURIComponent(u.token)}`;v=new Ro(f,l,a)}).catch(()=>{}):v=new Ro(o,l,a),()=>{var u;w=!0,k.abort(),(u=a==null?void 0:a.onClose)==null||u.call(a),v==null||v.close()}}function iE(i,r){return Ue(`/v1/sessions/${encodeURIComponent(i)}/command`,{method:"POST",body:JSON.stringify({command:r})})}function sE(i,r){return Ue(`/v1/sessions/${encodeURIComponent(i)}/bash`,{method:"POST",body:JSON.stringify({command:r})})}function rE(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/screenshot`,{method:"POST"})}function nE(i){const{signal:r,...a}=i;return Ue("/v1/sessions/batch",{method:"POST",signal:r,body:JSON.stringify(a)})}function aE(i){return Ue("/v1/pipelines",{method:"POST",body:JSON.stringify(i)})}function oE(){return Ue("/v1/pipelines")}function lE(i){return Ue(`/v1/pipelines/${encodeURIComponent(i)}`)}function cE(i){return Ue("/v1/auth/sse-token",{method:"POST",signal:i})}function uE(i){return Ue("/v1/auth/keys",{method:"POST",body:JSON.stringify({name:i}),schema:mw,schemaContext:"createAuthKey"})}function hE(){return Ue("/v1/auth/keys",{schema:Yn(fw),schemaContext:"getAuthKeys"})}function dE(i){return Ue(`/v1/auth/keys/${encodeURIComponent(i)}`,{method:"DELETE",schema:Zu,schemaContext:"revokeAuthKey"})}function fE(i){return Ue("/v1/templates",{method:"POST",body:JSON.stringify(i)})}function mE(){return Ue("/v1/templates")}const go=new Map;let pE=0;const $i=w_(i=>({toasts:[],addToast:(r,a,o)=>{const v=`toast-${++pE}`,w=setTimeout(()=>{go.delete(v),i(k=>({toasts:k.toasts.filter(l=>l.id!==v)}))},4e3);return go.set(v,w),i(k=>({toasts:[...k.toasts,{id:v,type:r,title:a,description:o}]})),v},removeToast:r=>{const a=go.get(r);a&&(clearTimeout(a),go.delete(r)),i(o=>({toasts:o.toasts.filter(v=>v.id!==r)}))}})),_E={error:"border-red-500/50 bg-red-950/80 text-red-200",success:"border-green-500/50 bg-green-950/80 text-green-200",info:"border-cyan-500/50 bg-cyan-950/80 text-cyan-200",warning:"border-yellow-500/50 bg-yellow-950/80 text-yellow-200"};function vE({id:i,type:r,title:a,description:o}){const v=$i(w=>w.removeToast);return b.jsxs("div",{role:"alert",className:`flex items-start gap-3 rounded-lg border px-4 py-3 shadow-lg backdrop-blur-sm animate-slide-in ${_E[r]}`,children:[b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("p",{className:"text-sm font-medium",children:a}),o&&b.jsx("p",{className:"mt-0.5 text-xs opacity-80",children:o})]}),b.jsx("button",{onClick:()=>v(i),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:b.jsx(Gn,{className:"h-3.5 w-3.5"})})]})}function gE(){const i=$i(r=>r.toasts);return i.length===0?null:b.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none",children:i.map(r=>b.jsx("div",{className:"pointer-events-auto",children:b.jsx(vE,{id:r.id,type:r.type,title:r.title,description:r.description})},r.id))})}const yE=[{to:"/",label:"Overview",icon:Yb},{to:"/pipelines",label:"Pipelines",icon:b_},{to:"/auth/keys",label:"Auth Keys",icon:yu}],bE=5,SE=1e3,jp="aegis:update-check:v1",xE=720*60*1e3,CE="Reconnecting to real-time updates. Overview widgets are using fallback polling where available.",Bp="Real-time updates unavailable. Overview widgets are using fallback polling where available.",wE="Connecting real-time updates failed. Retrying now.";function EE(){const i=Fe(A=>A.sseConnected),r=Fe(A=>A.setSseConnected),a=Fe(A=>A.sseError),o=Fe(A=>A.setSseError),v=Fe(A=>A.addActivity),w=Fe(A=>A.token),[k,l]=P.useState(0),[u,f]=P.useState("..."),[y,d]=P.useState(!1),[S,E]=P.useState(null),[O,C]=P.useState(null);function m(A){try{const R=localStorage.getItem(jp);if(!R)return null;const D=JSON.parse(R);return D.sourceVersion!==A||Date.now()-D.checkedAt>xE?null:{currentVersion:D.currentVersion,latestVersion:D.latestVersion,updateAvailable:D.updateAvailable,releaseUrl:D.releaseUrl}}catch{return null}}function g(A,R){try{const D={...R,checkedAt:Date.now(),sourceVersion:A};localStorage.setItem(jp,JSON.stringify(D))}catch{}}async function h(A,R){if(!(!A||A==="..."||A==="unknown")){if(!R){const D=m(A);if(D){C(D),E(null);return}}d(!0),E(null);try{const D=await Uw(A);C(D),g(A,D)}catch(D){E(D instanceof Error?D.message:"Failed to check updates"),C(null)}finally{d(!1)}}}P.useEffect(()=>{let A=!1;return(async()=>{try{const D=await iv();A||(f(D.version),h(D.version,!1))}catch(D){console.warn("Failed to load Aegis version",D),A||f("unknown")}})(),()=>{A=!0}},[]);const _=async()=>{await h(u,!0)};P.useEffect(()=>{let A=!1,R,D=null;function T(M){if(!A)try{R=tE($=>{$.sessionId&&v($)},w,{onOpen:()=>{r(!0),o(null),l(0)},onReconnecting:$=>{r(!1),l($),o(CE)},onClose:()=>{r(!1)},onGiveUp:()=>{l(0),o(Bp),r(!1)}})}catch($){if(console.error("Failed to subscribe to global SSE (attempt %d):",M+1,$),r(!1),M<bE){const Z=SE*Math.pow(2,M);l(M+1),o(wE),D=setTimeout(()=>T(M+1),Z)}else l(0),o(Bp),r(!1)}}return T(0),()=>{A=!0,D&&clearTimeout(D),R==null||R()}},[r,o,v,w]);const x=i?"SSE Live":a?k>0?`SSE Reconnecting (retry ${k})`:"SSE Degraded":"SSE Off";return b.jsxs("div",{className:"flex h-screen overflow-hidden bg-void",children:[b.jsxs("aside",{className:"flex w-56 flex-col border-r border-void-lighter bg-void-light shrink-0",children:[b.jsxs("div",{className:"flex items-center gap-2 px-4 py-5 border-b border-void-lighter",children:[b.jsx(f1,{className:"h-6 w-6 text-blue-500"}),b.jsx("span",{className:"text-lg font-semibold tracking-tight text-gray-100",children:"Aegis"})]}),b.jsxs("nav",{className:"flex flex-col gap-1 px-2 py-4 flex-1",children:[yE.map(({to:A,label:R,icon:D})=>b.jsxs(v_,{to:A,end:A==="/",className:({isActive:T})=>`flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${T?"bg-cyan/10 text-cyan":"text-gray-400 hover:bg-void-lighter hover:text-gray-200"}`,children:[b.jsx(D,{className:"h-4 w-4"}),R]},A)),b.jsx("div",{className:"mt-4 border-t border-void-lighter pt-4 opacity-40",children:b.jsxs("button",{type:"button",disabled:!0,"aria-disabled":"true",title:"Sessions navigation is not available yet",className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left text-sm text-gray-500",children:[b.jsx(v1,{className:"h-4 w-4"}),"Sessions"]})})]})]}),b.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[b.jsxs("header",{className:"flex items-center justify-between border-b border-void-lighter bg-void-light px-6 py-3 shrink-0",children:[b.jsx("h1",{className:"text-sm font-medium text-gray-300",children:"Aegis Dashboard"}),b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-400",children:[b.jsxs("span",{className:"rounded-md border border-void-lighter px-2 py-1 bg-void",children:["Version ",u]}),b.jsxs("button",{type:"button",onClick:_,disabled:y||u==="...",className:"inline-flex items-center gap-1 rounded-md border border-void-lighter px-2 py-1 text-gray-300 hover:bg-void-lighter disabled:opacity-50 disabled:cursor-not-allowed",children:[b.jsx(Lu,{className:`h-3 w-3 ${y?"animate-spin":""}`}),y?"Checking...":"Check updates"]})]}),O&&b.jsx("div",{className:"text-xs text-gray-400",children:O.updateAvailable?b.jsxs("a",{href:O.releaseUrl,target:"_blank",rel:"noreferrer",className:"text-cyan hover:underline",children:["Update available: v",O.latestVersion]}):b.jsxs("span",{children:["Up to date (v",O.currentVersion,")"]})}),S&&b.jsx("div",{className:"text-xs text-amber-500",title:S,children:"Update check failed"}),b.jsx("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",title:a??void 0,children:a?b.jsxs(b.Fragment,{children:[b.jsx(Bu,{className:"h-3 w-3 text-amber-500"}),b.jsx("span",{className:"text-amber-500",children:x})]}):b.jsxs(b.Fragment,{children:[b.jsx("span",{className:`status-dot ${i?"status-dot--idle":""}`,style:i?void 0:{backgroundColor:"#666"}}),x]})})]})]}),b.jsx("main",{className:"flex-1 overflow-auto p-6",children:b.jsx(Uy,{})})]}),b.jsx(gE,{})]})}function kE(i){if(i<0)return"0s";const r=Math.floor(i/3600),a=Math.floor(i%3600/60);return r>0&&a>0?`${r}h ${a}m`:r>0?`${r}h`:a>0?`${a}m`:`${Math.floor(i)}s`}function Zs(i){const r=Date.now()-i;if(r<0)return"just now";const a=Math.floor(r/1e3);if(a<60)return`${a}s ago`;const o=Math.floor(a/60);if(o<60)return`${o}m ago`;const v=Math.floor(o/60);return v<24?`${v}h ago`:`${Math.floor(v/24)}d ago`}function TE(i){if(i<0)return"0s";const r=Math.floor(i/1e3);if(r<60)return`${r}s`;const a=Math.floor(r/60),o=r%60;if(a<60)return`${a}m ${o.toString().padStart(2,"0")}s`;const v=Math.floor(a/60),w=a%60;return`${v}h ${w.toString().padStart(2,"0")}m`}const AE=15e3,RE=6e4;function DE(i){return new Date(i).toLocaleString()}function OE(i){return i.length<=12?"•".repeat(i.length):`${i.slice(0,8)}${"•".repeat(Math.max(8,i.length-12))}${i.slice(-4)}`}function NE(){const[i,r]=P.useState([]),[a,o]=P.useState(!0),[v,w]=P.useState(null),[k,l]=P.useState(""),[u,f]=P.useState(!1),[y,d]=P.useState(!1),[S,E]=P.useState(null),[O,C]=P.useState(null),[m,g]=P.useState(!1),h=$i(D=>D.addToast),_=P.useCallback(async(D=!1)=>{D?d(!0):o(!0);try{const T=await hE();r(T.slice().sort((M,$)=>$.createdAt-M.createdAt)),w(null)}catch(T){const M=T instanceof Error?T.message:"Failed to load auth keys";w(M),h("error","Failed to load auth keys",M)}finally{D?d(!1):o(!1)}},[h]);P.useEffect(()=>{_();const D=setInterval(()=>{_(!0)},AE);return()=>clearInterval(D)},[_]),P.useEffect(()=>{if(!O)return;const D=setTimeout(()=>{C(null),g(!1)},RE);return()=>clearTimeout(D)},[O]);async function x(D){D.preventDefault();const T=k.trim();if(T){f(!0);try{const M=await uE(T);C(M),g(!1),l(""),h("success","Auth key created","Store the secret now. It is only shown once."),await _(!0)}catch(M){h("error","Failed to create auth key",M instanceof Error?M.message:void 0)}finally{f(!1)}}}async function A(){var D;if(O)try{if(!((D=navigator.clipboard)!=null&&D.writeText))throw new Error("Clipboard access is unavailable in this browser");await navigator.clipboard.writeText(O.key),h("success","Auth key copied")}catch(T){h("warning","Failed to copy auth key",T instanceof Error?T.message:void 0)}}async function R(D,T){if(window.confirm(`Revoke auth key "${T}"? This cannot be undone.`)){E(D);try{await dE(D),r(M=>M.filter($=>$.id!==D)),(O==null?void 0:O.id)===D&&(C(null),g(!1)),h("success","Auth key revoked")}catch(M){h("error","Failed to revoke auth key",M instanceof Error?M.message:void 0)}finally{E(null)}}}return b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Auth Keys"}),b.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Create, review, and revoke dashboard API keys without exposing stored secrets."})]}),b.jsxs("button",{type:"button",onClick:()=>void _(!0),disabled:y,className:"flex min-h-[44px] items-center justify-center gap-2 rounded border border-[#1a1a2e] bg-[#111118] px-3 py-2 text-xs font-medium text-gray-300 transition-colors hover:border-[#00e5ff]/30 hover:text-[#00e5ff] disabled:cursor-not-allowed disabled:opacity-60",children:[b.jsx(Lu,{className:`h-3.5 w-3.5 ${y?"animate-spin":""}`}),"Refresh"]})]}),b.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,360px)_minmax(0,1fr)]",children:[b.jsxs("section",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-5",children:[b.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-gray-100",children:[b.jsx(Vn,{className:"h-4 w-4 text-[#00e5ff]"}),"Create Key"]}),b.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"New secrets are never persisted in the dashboard and are cleared from view after one minute."}),b.jsxs("form",{className:"mt-4 space-y-4",onSubmit:x,children:[b.jsxs("div",{children:[b.jsx("label",{className:"mb-1.5 block text-xs font-medium text-gray-400",htmlFor:"auth-key-name",children:"Key Name"}),b.jsx("input",{id:"auth-key-name",type:"text",value:k,onChange:D=>l(D.target.value),placeholder:"ops-primary",className:"min-h-[44px] w-full rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2.5 text-sm text-gray-200 placeholder-gray-600 focus:border-[#00e5ff] focus:outline-none"})]}),b.jsxs("button",{type:"submit",disabled:u||!k.trim(),className:"flex min-h-[44px] w-full items-center justify-center gap-2 rounded border border-[#00e5ff]/30 bg-[#00e5ff]/10 px-3 py-2 text-sm font-medium text-[#00e5ff] transition-colors hover:bg-[#00e5ff]/20 disabled:cursor-not-allowed disabled:opacity-60",children:[b.jsx(yu,{className:"h-4 w-4"}),u?"Creating…":"Create Auth Key"]})]}),O?b.jsxs("div",{className:"mt-5 rounded-lg border border-emerald-500/20 bg-emerald-500/5 p-4",role:"status",children:[b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsxs("div",{children:[b.jsx("h3",{className:"text-sm font-semibold text-emerald-300",children:"Store this key now"}),b.jsx("p",{className:"mt-1 text-xs text-emerald-200/80",children:"This secret is shown once and is hidden by default."})]}),b.jsx("button",{type:"button",onClick:()=>{C(null),g(!1)},className:"text-xs font-medium text-emerald-200/80 transition-colors hover:text-emerald-200",children:"Dismiss"})]}),b.jsxs("dl",{className:"mt-4 space-y-3 text-sm text-gray-200",children:[b.jsxs("div",{children:[b.jsx("dt",{className:"text-xs uppercase tracking-wide text-gray-500",children:"Name"}),b.jsx("dd",{className:"mt-1 font-medium text-gray-100",children:O.name})]}),b.jsxs("div",{children:[b.jsx("dt",{className:"text-xs uppercase tracking-wide text-gray-500",children:"Secret"}),b.jsx("dd",{className:"mt-1 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 font-mono text-xs text-[#9af5ff]",children:m?O.key:OE(O.key)})]})]}),b.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[b.jsxs("button",{type:"button",onClick:()=>g(D=>!D),className:"flex min-h-[40px] items-center gap-2 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs font-medium text-gray-300 transition-colors hover:border-[#00e5ff]/30 hover:text-[#00e5ff]",children:[m?b.jsx(Pb,{className:"h-3.5 w-3.5"}):b.jsx(Fb,{className:"h-3.5 w-3.5"}),m?"Hide secret":"Reveal secret"]}),b.jsxs("button",{type:"button",onClick:()=>void A(),className:"flex min-h-[40px] items-center gap-2 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs font-medium text-gray-300 transition-colors hover:border-[#00e5ff]/30 hover:text-[#00e5ff]",children:[b.jsx(zb,{className:"h-3.5 w-3.5"}),"Copy secret"]})]})]}):null]}),b.jsxs("section",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-5",children:[b.jsx("div",{className:"flex items-center justify-between gap-3 border-b border-[#1a1a2e] pb-4",children:b.jsxs("div",{children:[b.jsx("h3",{className:"text-sm font-semibold text-gray-100",children:"Existing Keys"}),b.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[i.length," key",i.length===1?"":"s"," configured"]})]})}),a?b.jsx("div",{className:"flex min-h-[240px] items-center justify-center text-sm text-gray-500",children:b.jsx("div",{className:"animate-pulse",children:"Loading auth keys…"})}):v?b.jsxs("div",{className:"mt-4 rounded-lg border border-amber-500/20 bg-amber-500/5 p-4 text-sm text-amber-200",children:[b.jsx("p",{className:"font-medium",children:"Unable to load auth keys"}),b.jsx("p",{className:"mt-1 text-amber-200/80",children:v}),b.jsx("button",{type:"button",onClick:()=>void _(),className:"mt-4 rounded border border-amber-500/30 px-3 py-2 text-xs font-medium text-amber-200 transition-colors hover:bg-amber-500/10",children:"Retry"})]}):i.length===0?b.jsxs("div",{className:"flex min-h-[240px] flex-col items-center justify-center rounded-lg border border-dashed border-[#1a1a2e] bg-[#0a0a0f] px-6 text-center",children:[b.jsx(yu,{className:"h-8 w-8 text-gray-600"}),b.jsx("p",{className:"mt-4 text-sm font-medium text-gray-300",children:"No auth keys yet"}),b.jsx("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:"Create a key to grant API access without sharing the dashboard bearer token."})]}):b.jsx("div",{className:"mt-4 space-y-3",children:i.map(D=>b.jsx("article",{className:"rounded-lg border border-[#1a1a2e] bg-[#0a0a0f] p-4",children:b.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[b.jsxs("div",{className:"min-w-0",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("span",{className:"truncate font-medium text-gray-100",children:D.name}),b.jsx("span",{className:"rounded-full border border-[#1a1a2e] bg-[#111118] px-2 py-0.5 font-mono text-[11px] text-gray-500",children:D.id})]}),b.jsxs("p",{className:"mt-2 text-sm text-gray-400",children:["Created ",b.jsx("span",{title:DE(D.createdAt),children:Zs(D.createdAt)})]})]}),b.jsxs("button",{type:"button",onClick:()=>void R(D.id,D.name),disabled:S===D.id,className:"flex min-h-[40px] items-center justify-center gap-2 rounded border border-red-500/20 bg-red-500/5 px-3 py-2 text-xs font-medium text-red-300 transition-colors hover:bg-red-500/10 disabled:cursor-not-allowed disabled:opacity-60",children:[b.jsx(ju,{className:"h-3.5 w-3.5"}),S===D.id?"Revoking…":"Revoke"]})]})},D.id))})]})]})]})}const ME=1e3;function ov({refresh:i,sseConnected:r,eventTrigger:a,fallbackPollIntervalMs:o,healthyPollIntervalMs:v,eventDebounceMs:w=ME}){const k=P.useRef(!1),l=P.useRef(!1),u=P.useRef(!1),f=P.useRef(null),y=P.useRef(null),d=P.useRef(a),S=P.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null),y.current&&(clearTimeout(y.current),y.current=null)},[]),E=P.useCallback(async()=>{if(!k.current){if(l.current){u.current=!0;return}l.current=!0;try{await i()}finally{l.current=!1,u.current&&!k.current&&(u.current=!1,E())}}},[i]);P.useEffect(()=>(k.current=!1,()=>{k.current=!0,S()}),[S]),P.useEffect(()=>{let O=!1;const C=async()=>{await E(),!(O||k.current)&&(f.current=setTimeout(()=>{C()},r?v:o))};return C(),()=>{O=!0,f.current&&(clearTimeout(f.current),f.current=null)}},[o,v,E,r]),P.useEffect(()=>{if(!r){d.current=a,y.current&&(clearTimeout(y.current),y.current=null);return}typeof a>"u"||Object.is(a,d.current)||(d.current=a,!y.current&&(y.current=setTimeout(()=>{y.current=null,E()},w)))},[w,a,E,r])}const LE={blue:"text-[#3b82f6]",green:"text-[#22c55e]",amber:"text-[#f59e0b]",red:"text-[#ef4444]",purple:"text-[#a78bfa]"},jE={blue:"bg-[#3b82f6]",green:"bg-[#22c55e]",amber:"bg-[#f59e0b]",red:"bg-[#ef4444]",purple:"bg-[#a78bfa]"};function ut({label:i,value:r,icon:a,suffix:o,subLabel:v,color:w="blue",bar:k}){return b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[b.jsxs("div",{className:"mb-2 flex items-center gap-2 text-sm text-[#888]",children:[a,i]}),b.jsxs("div",{className:`font-mono text-2xl ${LE[w]}`,children:[r,o&&b.jsx("span",{className:"ml-1 text-base text-[#666]",children:o})]}),k!==void 0&&b.jsx("div",{className:"mt-2 h-1.5 w-full overflow-hidden rounded-full bg-[#1e1e2a]",children:b.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${jE[w]}`,style:{width:`${Math.min(100,Math.max(0,k))}%`}})}),v&&b.jsx("div",{className:"mt-1.5 text-xs text-[#666]",children:v})]})}const BE={polling:"Polling fallback",paused:"Live updates paused"};function qu({mode:i,message:r}){return b.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-[11px] font-medium text-amber-300",title:r,children:BE[i]})}function zp(i,r){return r instanceof Error&&r.message?`${i}: ${r.message}`:i}const zE=1e4,HE=3e4;function UE(){var U,L,H;const i=Fe(q=>q.metrics),r=Fe(q=>q.activities[0]??null),a=Fe(q=>q.sseError),o=Fe(q=>q.setMetrics),v=Fe(q=>q.sseConnected),[w,k]=P.useState(null),[l,u]=P.useState(!0),[f,y]=P.useState(null),d=P.useCallback(async()=>{const[q,W]=await Promise.allSettled([Iw(),iv()]);q.status==="fulfilled"&&o(q.value),W.status==="fulfilled"&&k(W.value),q.status==="rejected"&&W.status==="rejected"?y(zp("Unable to load overview metrics",q.reason)):q.status==="rejected"?y(zp("Detailed metrics unavailable. Showing health-based totals",q.reason)):y(null),u(!1)},[o]);if(ov({refresh:d,sseConnected:v,eventTrigger:r,fallbackPollIntervalMs:zE,healthyPollIntervalMs:HE}),l&&!i&&!w)return b.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-6 text-sm text-gray-400",children:"Loading overview metrics..."});if(f&&!i&&!w)return b.jsx("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 p-6 text-sm text-amber-200",children:f});const S=i,E=(S==null?void 0:S.sessions.currently_active)??(w==null?void 0:w.sessions.active)??0,O=(S==null?void 0:S.sessions.total_created)??(w==null?void 0:w.sessions.total)??0,C=(S==null?void 0:S.sessions.completed)??0,m=(S==null?void 0:S.sessions.failed)??0,h=(S==null?void 0:S.prompt_delivery.success_rate)??null,_=(S==null?void 0:S.prompt_delivery.delivered)??0,x=(S==null?void 0:S.prompt_delivery.failed)??0,A=(S==null?void 0:S.prompt_delivery.sent)??0,R=(w==null?void 0:w.uptime)??(S==null?void 0:S.uptime)??0,D=((U=S==null?void 0:S.latency)==null?void 0:U.hook_latency_ms.avg)??null,T=((L=S==null?void 0:S.latency)==null?void 0:L.permission_response_ms.avg)??null,M=((H=S==null?void 0:S.latency)==null?void 0:H.channel_delivery_ms.avg)??null,$=(S==null?void 0:S.webhooks_sent)??0,Z=(S==null?void 0:S.webhooks_failed)??0,K=(S==null?void 0:S.auto_approvals)??0,F=(S==null?void 0:S.pipelines_created)??0,X=(S==null?void 0:S.batches_created)??0,ee=(S==null?void 0:S.screenshots_taken)??0,V=(S==null?void 0:S.sessions.avg_messages_per_session)??0,Q=q=>q===null?"—":`${Math.round(q)} ms`,ae=h===null?"blue":h>=99?"green":h>=90?"amber":"red",j=!!f||!!(!v&&a);return b.jsxs("div",{className:"space-y-3",children:[j&&b.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-void-lighter bg-[#111118] px-4 py-3",children:[b.jsx("div",{className:"text-xs text-gray-400",children:f??"Overview widgets are using the latest available data."}),!v&&a&&b.jsx(qu,{mode:"polling",message:a})]}),b.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-4",children:[b.jsx(ut,{label:"Active Sessions",value:E,icon:b.jsx(b_,{className:"h-4 w-4"})}),b.jsx(ut,{label:"Total Created",value:O,icon:b.jsx(ap,{className:"h-4 w-4"}),subLabel:O>0?`${V} avg msgs/session`:void 0}),C>0&&b.jsx(ut,{label:"Completed",value:C,icon:b.jsx(Mu,{className:"h-4 w-4"}),color:"green"}),m>0&&b.jsx(ut,{label:"Failed",value:m,icon:b.jsx(Bu,{className:"h-4 w-4"}),color:"red"}),b.jsx(ut,{label:"Delivery Rate",value:h!==null?h.toFixed(1):"—",suffix:"%",icon:b.jsx(k1,{className:"h-4 w-4"}),color:ae,bar:h??void 0}),_>0&&b.jsx(ut,{label:"Prompts Delivered",value:_,subLabel:A>0?`${A} sent total`:void 0,icon:b.jsx(bu,{className:"h-4 w-4"}),color:"green"}),x>0&&b.jsx(ut,{label:"Prompts Failed",value:x,icon:b.jsx(Br,{className:"h-4 w-4"}),color:"red"}),$>0&&b.jsx(ut,{label:"Webhooks Sent",value:$,icon:b.jsx(bu,{className:"h-4 w-4"}),color:"green",subLabel:Z>0?`${Z} failed`:"0 failed"}),Z>0&&$===0&&b.jsx(ut,{label:"Webhooks Failed",value:Z,icon:b.jsx(Br,{className:"h-4 w-4"}),color:"red"}),K>0&&b.jsx(ut,{label:"Auto-Approvals",value:K,icon:b.jsx(h1,{className:"h-4 w-4"}),color:"purple"}),F>0&&b.jsx(ut,{label:"Pipelines Created",value:F,icon:b.jsx(qb,{className:"h-4 w-4"}),color:"purple"}),X>0&&b.jsx(ut,{label:"Batches Created",value:X,icon:b.jsx(ap,{className:"h-4 w-4"}),color:"purple"}),ee>0&&b.jsx(ut,{label:"Screenshots",value:ee,icon:b.jsx(x_,{className:"h-4 w-4"})}),b.jsx(ut,{label:"Avg Hook Latency",value:Q(D),icon:b.jsx(mo,{className:"h-4 w-4"})}),b.jsx(ut,{label:"Avg Permission Latency",value:Q(T),icon:b.jsx(mo,{className:"h-4 w-4"})}),b.jsx(ut,{label:"Avg Channel Latency",value:Q(M),icon:b.jsx(mo,{className:"h-4 w-4"})}),b.jsx(ut,{label:"Uptime",value:kE(R),icon:b.jsx(mo,{className:"h-4 w-4"})})]})]})}const Hp={idle:"#10b981",working:"#3b82f6",permission_prompt:"#f59e0b",bash_approval:"#f59e0b",plan_mode:"#ff8800",ask_question:"#ef4444",settings:"#3b82f6",error:"#ff0000",compacting:"#f59e0b",context_warning:"#f59e0b",waiting_for_input:"#f59e0b",unknown:"#666666"},IE=new Set(["working","permission_prompt","bash_approval","ask_question"]),Up={idle:"Idle",working:"Working",permission_prompt:"Permission prompt",bash_approval:"Bash approval",plan_mode:"Plan mode",ask_question:"Awaiting question",settings:"Settings",error:"Error",compacting:"Compacting",context_warning:"Context warning",waiting_for_input:"Waiting for input",unknown:"Unknown"};function Po({status:i}){const r=Hp[i]??Hp.unknown,a=IE.has(i),o=Up[i]??Up.unknown;return b.jsx("span",{role:"img","aria-label":`Status: ${o}`,title:o,style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:r,boxShadow:`0 0 6px ${r}66`,animation:a?"pulse 1.5s ease-in-out infinite":void 0}})}const PE=5e3,$E=3e4,Ip=20,Pp=100,FE={all:0,idle:0,working:0,compacting:0,context_warning:0,waiting_for_input:0,permission_prompt:0,plan_mode:0,ask_question:0,bash_approval:0,settings:0,error:0,unknown:0},$p=["all","idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"],lv=i=>i.status==="permission_prompt"||i.status==="bash_approval",cv=(i,r=40)=>i.length>r?`…${i.slice(i.length-r+1)}`:i;function Fp(i){return i==="all"?"All":i.split("_").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function ZE(i,r){return r?`${i.windowName} ${i.id} ${i.workDir}`.toLowerCase().includes(r):!0}function qE(i,r){return i.id===r.id&&i.windowName===r.windowName&&i.workDir===r.workDir&&i.status===r.status&&i.createdAt===r.createdAt&&i.lastActivity===r.lastActivity&&i.permissionMode===r.permissionMode}function uv(i,r){return qE(i.session,r.session)&&i.isAlive===r.isAlive&&i.selected===r.selected&&i.currentAction===r.currentAction}const KE=P.memo(function({session:r,isAlive:a,selected:o,currentAction:v,onToggleSelect:w,onApprove:k,onInterrupt:l,onKill:u}){return b.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors active:bg-[#1a1a2e]/50",children:[b.jsxs("div",{className:"mb-2 flex items-start justify-between gap-3",children:[b.jsxs("label",{className:"flex min-w-0 flex-1 items-center gap-3 text-sm text-gray-200",children:[b.jsx("input",{type:"checkbox","aria-label":`Select session ${r.windowName||r.id}`,checked:o,onChange:f=>w(r.id,f.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"}),b.jsxs("div",{className:"min-w-0",children:[b.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[b.jsx(Po,{status:r.status}),b.jsx(di,{to:`/sessions/${encodeURIComponent(r.id)}`,className:"truncate font-medium text-gray-200 transition-colors hover:text-cyan",children:r.windowName||r.id}),!a&&b.jsx(Br,{className:"h-3.5 w-3.5 shrink-0 text-red-400"})]}),b.jsx("div",{className:"mt-1 truncate font-mono text-xs text-gray-500",children:cv(r.workDir,50)})]})]}),b.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[lv(r)&&b.jsx("button",{onClick:f=>k(f,r.id),disabled:v==="approve",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-green-900/30 p-2 text-green-400 transition-colors hover:bg-green-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Approve",children:b.jsx(C_,{className:"h-4 w-4"})}),b.jsx("button",{onClick:f=>l(f,r.id),disabled:v==="interrupt"||v==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-yellow-900/30 p-2 text-yellow-400 transition-colors hover:bg-yellow-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Interrupt",children:b.jsx(S_,{className:"h-4 w-4"})}),b.jsx("button",{onClick:f=>u(f,r.id),disabled:v==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-red-900/30 p-2 text-red-400 transition-colors hover:bg-red-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Kill",children:b.jsx(Br,{className:"h-4 w-4"})})]})]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-gray-500",children:[b.jsxs("span",{children:["Age: ",Zs(r.createdAt)]}),b.jsxs("span",{children:["Active: ",Zs(r.lastActivity)]}),r.permissionMode&&r.permissionMode!=="default"?b.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-900/30 px-2 py-0.5 text-green-400",children:[b.jsx(Mu,{className:"h-3 w-3"})," ",r.permissionMode]}):b.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-void-lighter px-2 py-0.5 text-gray-500",children:"default"})]})]})},uv),VE=P.memo(function({session:r,isAlive:a,selected:o,currentAction:v,onToggleSelect:w,onApprove:k,onInterrupt:l,onKill:u}){return b.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[b.jsx("td",{className:"px-4 py-3",children:b.jsx("input",{type:"checkbox","aria-label":`Select session ${r.windowName||r.id}`,checked:o,onChange:f=>w(r.id,f.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"})}),b.jsx("td",{className:"px-4 py-3",children:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(Po,{status:r.status}),!a&&b.jsx(Br,{className:"h-3.5 w-3.5 text-red-400"})]})}),b.jsx("td",{className:"px-4 py-3",children:b.jsx(di,{to:`/sessions/${encodeURIComponent(r.id)}`,className:"font-medium text-gray-200 transition-colors hover:text-cyan",children:r.windowName||r.id})}),b.jsx("td",{className:"max-w-[200px] truncate px-4 py-3 font-mono text-xs text-gray-400",title:r.workDir,children:cv(r.workDir)}),b.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:Zs(r.createdAt)}),b.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:Zs(r.lastActivity)}),b.jsx("td",{className:"px-4 py-3",children:r.permissionMode&&r.permissionMode!=="default"?b.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-900/30 px-2 py-0.5 text-xs text-green-400",children:[b.jsx(Mu,{className:"h-3 w-3"}),r.permissionMode]}):b.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-void-lighter px-2 py-0.5 text-xs text-gray-500",children:"default"})}),b.jsx("td",{className:"px-4 py-3",children:b.jsxs("div",{className:"flex items-center gap-1.5",children:[lv(r)&&b.jsx("button",{onClick:f=>k(f,r.id),disabled:v==="approve",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-green-900/30 text-xs font-medium text-green-400 transition-colors hover:bg-green-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Approve",children:b.jsx(C_,{className:"h-3 w-3"})}),b.jsx("button",{onClick:f=>l(f,r.id),disabled:v==="interrupt"||v==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-yellow-900/30 text-xs font-medium text-yellow-400 transition-colors hover:bg-yellow-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Interrupt",children:b.jsx(S_,{className:"h-3 w-3"})}),b.jsx("button",{onClick:f=>u(f,r.id),disabled:v==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-red-900/30 text-xs font-medium text-red-400 transition-colors hover:bg-red-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Kill",children:b.jsx(Br,{className:"h-3 w-3"})})]})})]})},uv);function GE(){const i=Fe(I=>I.sessions),r=Fe(I=>I.healthMap),a=Fe(I=>I.sseConnected),o=Fe(I=>I.activities[0]??null),v=Fe(I=>I.sseError),w=Fe(I=>I.setSessionsAndHealth),k=$i(I=>I.addToast),[l,u]=P.useState({}),[f,y]=P.useState([]),[d,S]=P.useState(null),[E,O]=P.useState("all"),[C,m]=P.useState(FE),[g,h]=P.useState(""),_=P.useDeferredValue(g.trim().toLowerCase()),[x,A]=P.useState({page:1,limit:Ip,total:0,totalPages:0}),[R,D]=P.useState(1),[T,M]=P.useState(!0),[$,Z]=P.useState(!1),[K,F]=P.useState(null),X=P.useCallback(async()=>{M(!0);try{const I=_.length>0,B=Pw({page:I?1:R,limit:I?Pp:Ip,status:E==="all"?void 0:E}),[ie,ne]=await Promise.all([B,$w()]),me=I?ie.sessions.filter(Ee=>ZE(Ee,_)):ie.sessions;let pe={};try{const Ee=await qw(),je=new Set(me.map(Be=>Be.id));for(const[Be,st]of Object.entries(Ee))je.has(Be)&&(pe[Be]={alive:st.alive,loading:!1})}catch{}w(me,pe),m(ne),Z(I&&ie.pagination.total>ie.sessions.length),F(null),A(I?{page:1,limit:me.length,total:me.length,totalPages:me.length>0?1:0}:ie.pagination)}catch(I){F(I instanceof Error&&I.message?`Unable to load sessions: ${I.message}`:"Unable to load sessions.")}finally{M(!1)}},[_,R,w,E]);ov({refresh:X,sseConnected:a,eventTrigger:o,fallbackPollIntervalMs:PE,healthyPollIntervalMs:$E}),P.useEffect(()=>{const I=new Set(i.map(B=>B.id));y(B=>B.filter(ie=>I.has(ie)))},[i]);const ee=P.useCallback(async(I,B,ie)=>{u(ne=>({...ne,[I]:B}));try{await ie()}finally{u(ne=>({...ne,[I]:null}))}},[]),V=P.useCallback(async(I,B)=>{I.preventDefault(),await ee(B,"approve",async()=>{try{await rv(B),await X()}catch(ie){k("error","Approve failed",ie instanceof Error?ie.message:void 0)}})},[k,X,ee]),Q=P.useCallback(async(I,B)=>{I.preventDefault(),await ee(B,"interrupt",async()=>{try{await Eu(B),await X()}catch(ie){k("error","Interrupt failed",ie instanceof Error?ie.message:void 0)}})},[k,X,ee]),ae=P.useCallback(async(I,B)=>{I.preventDefault(),confirm("Kill this session?")&&await ee(B,"kill",async()=>{try{await wu(B),await X()}catch(ie){k("error","Failed to kill session",ie instanceof Error?ie.message:void 0)}})},[k,X,ee]),j=P.useCallback((I,B)=>{y(ie=>B?ie.includes(I)?ie:[...ie,I]:ie.filter(ne=>ne!==I))},[]),U=P.useCallback(I=>{if(!I){y([]);return}y(i.map(B=>B.id))},[i]),L=P.useCallback(async I=>{if(f.length!==0&&!(I==="kill"&&!confirm(`Kill ${f.length} selected session${f.length===1?"":"s"}?`))){S(I),u(B=>{const ie={...B};for(const ne of f)ie[ne]=I;return ie});try{const B=await Promise.allSettled(f.map(me=>I==="interrupt"?Eu(me):wu(me))),ie=B.filter(me=>me.status==="fulfilled").length,ne=B.length-ie;ie>0&&k("success",I==="interrupt"?"Bulk interrupt complete":"Bulk kill complete",`${ie} session${ie===1?"":"s"} updated.`),ne>0&&k("warning",`Some sessions failed to ${I}`,`${ne} session${ne===1?"":"s"} could not be updated.`),y([]),await X()}finally{S(null),u(B=>{const ie={...B};for(const ne of f)ie[ne]=null;return ie})}}},[k,X,f]),H=P.useMemo(()=>new Set(f),[f]),q=P.useMemo(()=>i.map(I=>{const B=r[I.id];return{session:I,isAlive:B?B.alive:!0,selected:H.has(I.id),currentAction:l[I.id]??null}}),[l,r,H,i]),W=i.length>0&&i.every(I=>H.has(I.id)),le=E!=="all"||_.length>0;if(T&&i.length===0&&!K)return b.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:b.jsx("p",{className:"text-gray-500",children:"Loading sessions..."})});if(K&&i.length===0)return b.jsx("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 p-6",children:b.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[b.jsx("p",{className:"text-sm text-amber-200",children:K}),b.jsx("button",{type:"button",onClick:()=>{M(!0),F(null),X()},className:"rounded-md border border-amber-400/40 px-3 py-2 text-sm text-amber-100 transition-colors hover:border-amber-300 hover:text-white",children:"Retry"})]})});const fe=!!K||!!(!a&&v);return b.jsxs("div",{className:"space-y-4",children:[b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[b.jsxs("div",{className:"flex flex-col gap-4 xl:flex-row xl:items-start xl:justify-between",children:[b.jsxs("div",{className:"flex-1 space-y-3",children:[b.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center",children:[b.jsxs("label",{className:"flex min-w-0 flex-1 items-center gap-2 rounded-md border border-void-lighter bg-void px-3 py-2 text-sm text-gray-300 focus-within:border-cyan",children:[b.jsx(o1,{className:"h-4 w-4 text-gray-500"}),b.jsx("input",{value:g,onChange:I=>{h(I.target.value),D(1)},placeholder:"Search by session name or work directory",className:"w-full bg-transparent text-sm text-gray-100 outline-none placeholder:text-gray-500","aria-label":"Search sessions"})]}),b.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-400",children:[b.jsx("span",{children:"Status"}),b.jsx("select",{value:E,onChange:I=>{O(I.target.value),D(1)},"aria-label":"Filter by status",className:"rounded-md border border-void-lighter bg-void px-3 py-2 text-sm text-gray-100 outline-none focus:border-cyan",children:$p.map(I=>b.jsxs("option",{value:I,children:[Fp(I)," (",C[I]??0,")"]},I))})]})]}),b.jsx("div",{className:"flex flex-wrap gap-2",children:$p.filter(I=>I==="all"||(C[I]??0)>0).map(I=>{const B=E===I;return b.jsxs("button",{type:"button",onClick:()=>{O(I),D(1)},className:`rounded-full border px-3 py-1 text-xs transition-colors ${B?"border-cyan bg-cyan/10 text-cyan":"border-void-lighter bg-void text-gray-400 hover:border-cyan/40 hover:text-gray-200"}`,children:[Fp(I)," ",b.jsx("span",{className:"text-gray-500",children:C[I]??0})]},I)})})]}),b.jsxs("div",{className:"text-right text-xs text-gray-500",children:[b.jsxs("div",{children:["Showing ",b.jsx("span",{className:"text-gray-300",children:i.length}),_.length>0?` matching session${i.length===1?"":"s"}`:` of ${x.total} session${x.total===1?"":"s"}`]}),$&&b.jsxs("div",{className:"mt-1 text-amber-400",children:["Search scans the first ",Pp," sessions in the selected status."]})]})]}),fe&&b.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-2 rounded-md border border-void-lighter bg-void px-3 py-2",children:[b.jsx("div",{className:"text-xs text-gray-400",children:K??"Session data is using polling fallback while real-time updates recover."}),!a&&v&&b.jsx(qu,{mode:"polling",message:v})]}),f.length>0&&b.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-md border border-cyan/20 bg-cyan/5 p-3 lg:flex-row lg:items-center lg:justify-between",children:[b.jsxs("div",{className:"text-sm text-gray-300",children:[f.length," session",f.length===1?"":"s"," selected"]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b.jsx("button",{type:"button",onClick:()=>L("interrupt"),disabled:d!==null,className:"rounded-md bg-yellow-900/30 px-3 py-2 text-sm font-medium text-yellow-300 transition-colors hover:bg-yellow-900/50 disabled:pointer-events-none disabled:opacity-40",children:"Interrupt Selected"}),b.jsx("button",{type:"button",onClick:()=>L("kill"),disabled:d!==null,className:"rounded-md bg-red-900/30 px-3 py-2 text-sm font-medium text-red-300 transition-colors hover:bg-red-900/50 disabled:pointer-events-none disabled:opacity-40",children:"Kill Selected"}),b.jsx("button",{type:"button",onClick:()=>y([]),disabled:d!==null,className:"rounded-md border border-void-lighter px-3 py-2 text-sm text-gray-400 transition-colors hover:border-gray-500 hover:text-gray-200 disabled:pointer-events-none disabled:opacity-40",children:"Clear"})]})]})]}),i.length===0?b.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:b.jsx("p",{className:"text-gray-400",children:le?"No sessions match the current filter.":"No active sessions"})}):b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"space-y-3 md:hidden",children:[b.jsxs("div",{className:"flex items-center justify-between rounded-md border border-void-lighter bg-[#111118] px-4 py-3 text-sm text-gray-400",children:[b.jsxs("label",{className:"flex items-center gap-2",children:[b.jsx("input",{type:"checkbox","aria-label":"Select all visible sessions",checked:W,onChange:I=>U(I.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"}),"Select visible"]}),b.jsxs("span",{children:[i.length," visible"]})]}),q.map(I=>b.jsx(KE,{session:I.session,isAlive:I.isAlive,selected:I.selected,currentAction:I.currentAction,onToggleSelect:j,onApprove:V,onInterrupt:Q,onKill:ae},I.session.id))]}),b.jsx("div",{className:"hidden overflow-x-auto rounded-lg border border-void-lighter bg-[#111118] md:block",children:b.jsxs("table",{className:"w-full text-left text-sm",children:[b.jsx("thead",{children:b.jsxs("tr",{className:"border-b border-void-lighter text-[#666]",children:[b.jsx("th",{className:"px-4 py-3 font-medium",children:b.jsx("input",{type:"checkbox","aria-label":"Select all visible sessions",checked:W,onChange:I=>U(I.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"})}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"WorkDir"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Age"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Last Activity"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Permission"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Actions"})]})}),b.jsx("tbody",{children:q.map(I=>b.jsx(VE,{session:I.session,isAlive:I.isAlive,selected:I.selected,currentAction:I.currentAction,onToggleSelect:j,onApprove:V,onInterrupt:Q,onKill:ae},I.session.id))})]})}),_.length===0&&x.totalPages>1&&b.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-void-lighter bg-[#111118] px-4 py-3 text-sm text-gray-400",children:[b.jsxs("span",{children:["Page ",x.page," of ",x.totalPages]}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsxs("button",{type:"button",onClick:()=>D(I=>Math.max(1,I-1)),disabled:x.page<=1,className:"flex items-center gap-1 rounded-md border border-void-lighter px-3 py-2 transition-colors hover:border-gray-500 hover:text-gray-200 disabled:pointer-events-none disabled:opacity-40",children:[b.jsx(Ab,{className:"h-4 w-4"})," Previous"]}),b.jsxs("button",{type:"button",onClick:()=>D(I=>Math.min(x.totalPages,I+1)),disabled:x.page>=x.totalPages,className:"flex items-center gap-1 rounded-md border border-void-lighter px-3 py-2 transition-colors hover:border-gray-500 hover:text-gray-200 disabled:pointer-events-none disabled:opacity-40",children:["Next ",b.jsx(Db,{className:"h-4 w-4"})]})]})]})]})]})}const hu={session_status_change:{icon:Lu,label:"Status",color:"#3b82f6"},session_message:{icon:Jb,label:"Message",color:"#10b981"},session_approval:{icon:op,label:"Approval",color:"#f59e0b"},session_ended:{icon:r1,label:"Ended",color:"#ef4444"},session_created:{icon:Mb,label:"Created",color:"#6366f1"},session_stall:{icon:Bu,label:"Stall",color:"#d97706"},session_dead:{icon:p1,label:"Dead",color:"#dc2626"},session_subagent_start:{icon:C1,label:"Subagent",color:"#3b82f6"},session_subagent_stop:{icon:S1,label:"Subagent Done",color:"#10b981"},session_verification:{icon:op,label:"Verification",color:"#0891b2"}};function ps(i,r="unknown"){return typeof i!="string"?r:Fn(i)||r}function Fn(i){return i.replace(/\r\n?/g," ").replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F]/g,"").replace(/\uFFFD+/g,"").replace(/\s+/g," ").trim()}function du(i){return Fn(JSON.stringify(i??""))}function YE(i){const r=i.data;switch(i.event){case"session_status_change":{const a=ps(r.status),o=typeof r.detail=="string"?`: ${r.detail}`:"";return`Status -> ${a}${o}`}case"session_message":{const a=r.role==="user"?"User":r.role==="assistant"?"Claude":"System",o=typeof r.text=="string"?Fn(r.text):du(r.text);return`${a}: ${Zp(o,80)}`}case"session_approval":{const a=typeof r.prompt=="string"?Fn(r.prompt):du(r.prompt);return`Approval needed: ${Zp(a,80)}`}case"session_ended":return`Session ended: ${ps(r.reason)}`;case"session_created":return`Created in ${ps(r.workDir,"unknown dir")}`;case"session_stall":return`Session stalled: ${ps(r.stallType)}`;case"session_dead":return`Session dead: ${ps(r.stallType)}`;case"session_subagent_start":return`Subagent started: ${ps(r.name)}`;case"session_subagent_stop":return`Subagent finished: ${ps(r.name)}`;case"session_verification":return`Verification: ${ps(r.summary??r.status,"completed")}`;default:return du(r)}}function Zp(i,r){const a=Fn(i);return a.length>r?a.slice(0,r)+"...":a}function WE(i){try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function XE(){const i=Fe(d=>d.activities),r=Fe(d=>d.sseConnected),a=Fe(d=>d.sseError),o=Fe(d=>d.activityFilterSession),v=Fe(d=>d.activityFilterType),w=Fe(d=>d.setActivityFilterSession),k=Fe(d=>d.setActivityFilterType),l=Fe(d=>d.sessions),u=P.useMemo(()=>i.filter(d=>!(o&&d.sessionId!==o||v&&d.event!==v)),[i,o,v]),f=P.useMemo(()=>{const d=new Map;for(const S of l)d.set(S.id,S.windowName??S.id.slice(0,8));return d},[l]),y=d=>f.get(d)??(d??"unknown").slice(0,8);return b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg w-full",children:[b.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 px-3 sm:px-4 py-3 border-b border-[#1a1a2e]",children:[b.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Activity Stream"}),b.jsxs("div",{className:"flex items-center gap-2",children:[!r&&a&&b.jsx(qu,{mode:"paused",message:a}),b.jsxs("select",{value:o??"",onChange:d=>w(d.target.value||null),className:"min-h-[44px] text-xs bg-[#0a0a0f] border border-[#1a1a2e] rounded px-2 py-2 text-gray-400 focus:outline-none focus:border-[#3b82f6]",children:[b.jsx("option",{value:"",children:"All sessions"}),l.map(d=>b.jsx("option",{value:d.id,children:d.windowName||d.id.slice(0,8)},d.id))]}),b.jsxs("select",{value:v??"",onChange:d=>k(d.target.value||null),className:"min-h-[44px] text-xs bg-[#0a0a0f] border border-[#1a1a2e] rounded px-2 py-2 text-gray-400 focus:outline-none focus:border-[#3b82f6]",children:[b.jsx("option",{value:"",children:"All types"}),Object.entries(hu).map(([d,S])=>b.jsx("option",{value:d,children:S.label},d))]}),(o||v)&&b.jsx("button",{onClick:()=>{w(null),k(null)},className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300",children:b.jsx(Gn,{className:"h-4 w-4"})})]})]}),b.jsxs("div",{className:"max-h-[360px] overflow-y-auto divide-y divide-[#1a1a2e]/50",children:[u.length===0&&b.jsx("div",{className:"px-4 py-8 text-center text-sm text-[#555]",children:!r&&a?"Real-time activity is paused while the SSE connection recovers.":"No activity yet"}),u.map(d=>{const S=hu[d.event]??hu.session_status_change,E=S.icon;return b.jsxs("div",{className:"flex items-start gap-2 sm:gap-3 px-3 sm:px-4 py-2 sm:py-2.5 hover:bg-[#1a1a2e]/30 transition-colors",children:[b.jsx(E,{className:"h-4 w-4 mt-0.5 shrink-0",style:{color:S.color}}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[b.jsx("span",{className:"text-xs font-medium text-gray-300 truncate",children:y(d.sessionId)}),b.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded hidden sm:inline-block",style:{backgroundColor:`${S.color}15`,color:S.color},children:S.label})]}),b.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:YE(d)})]}),b.jsx("span",{className:"text-[10px] text-[#444] shrink-0 tabular-nums mt-0.5",children:WE(d.timestamp)})]},d.renderKey)})]})]})}let JE=0;function Bn(){return{workDir:"",name:"",prompt:"",_key:JE++}}function QE({open:i,onClose:r}){const a=No(),o=P.useRef(null),v=P.useRef(null),w=P.useCallback(()=>{Q(),r()},[r]),k=P.useRef(null);P.useEffect(()=>{if(!i)return;const q=W=>{var le;W.key==="Escape"&&((le=v.current)==null||le.abort(),w())};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[i,w]),P.useEffect(()=>{if(!i)return;const q=k.current;if(!q)return;const W='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',le=fe=>{if(fe.key!=="Tab")return;const I=Array.from(q.querySelectorAll(W));if(I.length===0)return;const B=I[0],ie=I[I.length-1];fe.shiftKey?document.activeElement===B&&(fe.preventDefault(),ie.focus()):document.activeElement===ie&&(fe.preventDefault(),B.focus())};return q.addEventListener("keydown",le),()=>q.removeEventListener("keydown",le)},[i]),P.useEffect(()=>{if(i){const q=setTimeout(()=>{var W;return(W=o.current)==null?void 0:W.focus()},50);return()=>clearTimeout(q)}},[i]);const[l,u]=P.useState([]),[f,y]=P.useState(!1);P.useEffect(()=>{i&&(y(!0),mE().then(u).catch(()=>u([])).finally(()=>y(!1)))},[i]);const[d,S]=P.useState(""),[E,O]=P.useState(""),[C,m]=P.useState(""),[g,h]=P.useState("default"),[_,x]=P.useState(!1),[A,R]=P.useState(null),[D,T]=P.useState("single"),[M,$]=P.useState(""),[Z,K]=P.useState([Bn(),Bn()]),[F,X]=P.useState(""),[ee,V]=P.useState(null);function Q(){S(""),O(""),m(""),h("default"),x(!1),R(null),K([Bn(),Bn()]),X(""),V(null),T("single"),$("")}function ae(){Z.length>=10||K([...Z,Bn()])}function j(q){Z.length<=1||K(Z.filter((W,le)=>le!==q))}function U(q,W,le){K(Z.map((fe,I)=>I===q?{...fe,[W]:le}:fe))}async function L(q){var fe;q.preventDefault(),R(null),V(null);const W=Z.filter(I=>I.workDir.trim());if(W.length===0){R("At least one working directory is required");return}x(!0),(fe=v.current)==null||fe.abort();const le=new AbortController;v.current=le;try{const I=await nE({sessions:W.map(B=>({workDir:B.workDir.trim(),name:B.name.trim()||void 0,prompt:B.prompt.trim()||F.trim()||void 0,permissionMode:g})),signal:le.signal});V(I)}catch(I){if(le.signal.aborted)return;R(I instanceof Error?I.message:"Failed to create sessions")}finally{v.current===le&&(v.current=null,x(!1))}}if(!i)return null;async function H(q){var le;if(q.preventDefault(),R(null),!d.trim()){R("Working directory is required");return}x(!0),(le=v.current)==null||le.abort();const W=new AbortController;v.current=W;try{const fe=await Mp({workDir:d.trim(),name:E.trim()||void 0,prompt:C.trim()||void 0,permissionMode:g,signal:W.signal});Q(),r(),a(`/sessions/${fe.id}`)}catch(fe){if(W.signal.aborted)return;R(fe instanceof Error?fe.message:"Failed to create session")}finally{v.current===W&&(v.current=null,x(!1))}}return b.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[b.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:w}),b.jsxs("div",{ref:k,role:"dialog","aria-modal":"true","aria-label":"Create new session",className:`relative w-full ${D==="batch"?"max-w-2xl":"max-w-md"} mx-4 bg-[#111118] border border-[#1a1a2e] rounded-lg shadow-2xl max-h-[90vh] overflow-y-auto`,children:[b.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[b.jsxs("div",{className:"flex items-center gap-4",children:[b.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Session"}),b.jsxs("div",{className:"flex rounded bg-[#0a0a0f] p-0.5",children:[b.jsx("button",{type:"button",onClick:()=>T("single"),className:`px-3 py-1 text-xs rounded transition-colors ${D==="single"?"bg-[#3b82f6]/10 text-[#3b82f6]":"text-gray-500 hover:text-gray-300"}`,children:"Single"}),b.jsx("button",{type:"button",onClick:()=>T("batch"),className:`px-3 py-1 text-xs rounded transition-colors ${D==="batch"?"bg-[#3b82f6]/10 text-[#3b82f6]":"text-gray-500 hover:text-gray-300"}`,children:"Batch"}),l.length>0&&b.jsx("button",{type:"button",onClick:()=>T("template"),className:`px-3 py-1 text-xs rounded transition-colors ${D==="template"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Template"})]})]}),b.jsx("button",{onClick:w,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:b.jsx(Gn,{className:"h-4 w-4"})})]}),D==="single"&&b.jsxs("form",{onSubmit:H,className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Working Directory ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("input",{type:"text",ref:o,value:d,onChange:q=>S(q.target.value),placeholder:"/home/user/project",className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6] font-mono"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Session Name"}),b.jsx("input",{type:"text",value:E,onChange:q=>O(q.target.value),placeholder:"my-session",className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Initial Prompt"}),b.jsx("textarea",{value:C,onChange:q=>m(q.target.value),placeholder:"Fix the login bug...",rows:3,className:"w-full min-h-[88px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6] resize-none"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),b.jsxs("select",{value:g,onChange:q=>h(q.target.value),className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 focus:outline-none focus:border-[#3b82f6]",children:[b.jsx("option",{value:"default",children:"default - asks for everything"}),b.jsx("option",{value:"plan",children:"plan - auto-reads, asks for writes"}),b.jsx("option",{value:"acceptEdits",children:"acceptEdits - auto-edits, asks for bash"}),b.jsx("option",{value:"bypassPermissions",children:"bypassPermissions - never asks"}),b.jsx("option",{value:"auto",children:"auto - auto-approve in sandbox"})]})]}),A&&b.jsx("div",{className:"text-xs text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-2",children:A}),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:w,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Cancel"}),b.jsxs("button",{type:"submit",disabled:_||!d.trim(),className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#3b82f6]/10 hover:bg-[#3b82f6]/20 text-[#3b82f6] border border-[#3b82f6]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[_&&b.jsx(In,{className:"h-3 w-3 animate-spin"}),"Create Session"]})]})]}),D==="batch"&&!ee&&b.jsxs("form",{onSubmit:L,className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Shared Prompt"}),b.jsx("textarea",{value:F,onChange:q=>X(q.target.value),placeholder:"Apply to all sessions without a per-row prompt...",rows:2,className:"w-full min-h-[88px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6] resize-none"})]}),b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[b.jsxs("span",{children:["Working Directory ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("span",{children:"Name"}),b.jsx("span",{children:"Prompt (override)"}),b.jsx("span",{})]}),b.jsx("div",{className:"space-y-2",children:Z.map((q,W)=>b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[b.jsx("input",{type:"text",value:q.workDir,onChange:le=>U(W,"workDir",le.target.value),placeholder:"/home/user/project",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6] font-mono"}),b.jsx("input",{type:"text",value:q.name,onChange:le=>U(W,"name",le.target.value),placeholder:"name",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"}),b.jsx("input",{type:"text",value:q.prompt,onChange:le=>U(W,"prompt",le.target.value),placeholder:"Override prompt...",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"}),b.jsx("button",{type:"button",onClick:()=>j(W),disabled:Z.length<=1,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ef4444] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:b.jsx(ju,{className:"h-3.5 w-3.5"})})]},q._key))}),Z.length<10&&b.jsxs("button",{type:"button",onClick:ae,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[b.jsx(Vn,{className:"h-3.5 w-3.5"}),"Add session"]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),b.jsxs("select",{value:g,onChange:q=>h(q.target.value),className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 focus:outline-none focus:border-[#3b82f6]",children:[b.jsx("option",{value:"default",children:"default - asks for everything"}),b.jsx("option",{value:"plan",children:"plan - auto-reads, asks for writes"}),b.jsx("option",{value:"acceptEdits",children:"acceptEdits - auto-edits, asks for bash"}),b.jsx("option",{value:"bypassPermissions",children:"bypassPermissions - never asks"}),b.jsx("option",{value:"auto",children:"auto - auto-approve in sandbox"})]})]}),A&&b.jsx("div",{className:"text-xs text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-2",children:A}),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:w,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Cancel"}),b.jsxs("button",{type:"submit",disabled:_||!Z.some(q=>q.workDir.trim()),className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#3b82f6]/10 hover:bg-[#3b82f6]/20 text-[#3b82f6] border border-[#3b82f6]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[_&&b.jsx(In,{className:"h-3 w-3 animate-spin"}),"Create ",Z.filter(q=>q.workDir.trim()).length," Session(s)"]})]})]}),D==="template"&&b.jsxs("form",{onSubmit:async q=>{var fe;q.preventDefault(),R(null);const W=l.find(I=>I.id===M);if(!W){R("Please select a template");return}x(!0),(fe=v.current)==null||fe.abort();const le=new AbortController;v.current=le;try{const I=await Mp({workDir:W.workDir,prompt:W.prompt,claudeCommand:W.claudeCommand,env:W.env,stallThresholdMs:W.stallThresholdMs,permissionMode:W.permissionMode,autoApprove:W.autoApprove,signal:le.signal});Q(),r(),a(`/sessions/${I.id}`)}catch(I){if(le.signal.aborted)return;R(I instanceof Error?I.message:"Failed to create session from template")}finally{v.current===le&&(v.current=null,x(!1))}},className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsx("label",{htmlFor:"template-select",className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Select Template"}),f?b.jsx("div",{className:"text-xs text-gray-500 italic",children:"Loading templates…"}):l.length===0?b.jsx("div",{className:"text-xs text-gray-500 italic",children:"No templates available"}):b.jsxs("select",{id:"template-select",value:M,onChange:q=>$(q.target.value),className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 focus:outline-none focus:border-[#00e5ff]",children:[b.jsx("option",{value:"",children:"— Choose a template —"}),l.map(q=>b.jsxs("option",{value:q.id,children:[q.name," ",q.description?`— ${q.description}`:""]},q.id))]})]}),A&&b.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:A}),M&&l.find(q=>q.id===M)&&(()=>{const q=l.find(W=>W.id===M);return b.jsxs("div",{className:"text-xs space-y-1 p-3 bg-[#0a0a0f] rounded border border-[#1a1a2e]",children:[b.jsxs("div",{className:"text-gray-400",children:[b.jsx("strong",{children:"WorkDir:"})," ",b.jsx("span",{className:"font-mono text-gray-500",children:q.workDir})]}),q.stallThresholdMs&&b.jsxs("div",{className:"text-gray-400",children:[b.jsx("strong",{children:"Stall Threshold:"})," ",b.jsxs("span",{className:"text-gray-500",children:[q.stallThresholdMs,"ms"]})]}),q.permissionMode&&q.permissionMode!=="default"&&b.jsxs("div",{className:"text-gray-400",children:[b.jsx("strong",{children:"Permission Mode:"})," ",b.jsx("span",{className:"text-gray-500",children:q.permissionMode})]})]})})(),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:w,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Cancel"}),b.jsxs("button",{type:"submit",disabled:_||!M,className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[_&&b.jsx(In,{className:"h-3 w-3 animate-spin"}),"Create from Template"]})]})]}),ee&&b.jsxs("div",{className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[ee.created>0&&b.jsxs("span",{className:"text-xs font-medium text-emerald-400 bg-emerald-400/10 border border-emerald-400/20 rounded px-3 py-1.5",children:[ee.created," created"]}),ee.failed>0&&b.jsxs("span",{className:"text-xs font-medium text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-1.5",children:[ee.failed," failed"]})]}),ee.sessions.length>0&&b.jsxs("div",{className:"space-y-1",children:[b.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Created sessions"}),b.jsx("ul",{className:"space-y-1",children:ee.sessions.map(q=>b.jsx("li",{children:b.jsxs("button",{type:"button",onClick:()=>{w(),a(`/sessions/${q.id}`)},className:"text-xs text-[#3b82f6] hover:underline font-mono",children:[q.id.slice(0,8),"...",q.name?` - ${q.name}`:""]})},q.id))})]}),ee.errors.length>0&&b.jsxs("div",{className:"space-y-1",children:[b.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Errors"}),b.jsx("ul",{className:"space-y-1",children:ee.errors.map((q,W)=>b.jsx("li",{className:"text-xs text-[#ef4444]",children:q},W))})]}),b.jsx("div",{className:"flex justify-end pt-2",children:b.jsx("button",{type:"button",onClick:w,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Close"})})]})]})]})}function e4(){const[i,r]=P.useState(!1);return b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Overview"}),b.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Aegis session monitoring and metrics"})]}),b.jsxs("button",{onClick:()=>r(!0),className:"flex items-center gap-1.5 px-3 py-2 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors",children:[b.jsx(Vn,{className:"h-3.5 w-3.5"}),"New Session"]})]}),b.jsx(UE,{}),b.jsxs("div",{children:[b.jsx("h3",{className:"mb-3 text-lg font-semibold text-gray-200",children:"Sessions"}),b.jsx(GE,{})]}),b.jsx(XE,{}),b.jsx(QE,{open:i,onClose:()=>r(!1)})]})}function qp(i){return i instanceof Error&&"statusCode"in i}function t4(i){const r=Fe(j=>j.token),a=$i(j=>j.addToast),[o,v]=P.useState(null),[w,k]=P.useState(null),[l,u]=P.useState(!1),[f,y]=P.useState(!0),[d,S]=P.useState(""),[E,O]=P.useState(!0),[C,m]=P.useState(null),[g,h]=P.useState(!0),[_,x]=P.useState(null),[A,R]=P.useState(!0),D=P.useRef(i);D.current=i;const T=P.useRef(!1),M=P.useRef(0),$=P.useRef(void 0),Z=P.useRef(void 0),K=P.useCallback(async()=>{try{const[j,U]=await Promise.allSettled([Fw(D.current),Zw(D.current)]);if(j.status==="rejected"&&qp(j.reason)&&j.reason.statusCode===404||U.status==="rejected"&&qp(U.reason)&&U.reason.statusCode===404){u(!0);return}j.status==="fulfilled"&&v(j.value),U.status==="fulfilled"&&k(U.value)}catch(j){a("error","Failed to load session",j instanceof Error?j.message:void 0)}finally{y(!1)}},[a]);$.current=K;const F=P.useCallback(async()=>{if(T.current)return;const j=D.current;try{const U=await Yw(j);T.current||S(U.pane??"")}catch(U){a("warning","Failed to load terminal pane",U instanceof Error?U.message:void 0)}finally{T.current||O(!1)}try{const U=await Vw(j);T.current||m(U)}catch(U){a("warning","Failed to load session metrics",U instanceof Error?U.message:void 0)}finally{T.current||h(!1)}try{const U=await Gw(j);T.current||x(U)}catch(U){a("warning","Failed to load session latency",U instanceof Error?U.message:void 0)}finally{T.current||R(!1)}},[a]);Z.current=F;const X=P.useRef(void 0),ee=P.useRef(void 0),V=P.useCallback(()=>{X.current&&(clearTimeout(X.current),X.current=void 0),ee.current&&(clearTimeout(ee.current),ee.current=void 0)},[]);P.useEffect(()=>(T.current=!1,M.current++,y(!0),O(!0),h(!0),R(!0),K(),F(),()=>{T.current=!0,V()}),[i,K,F,V]);const Q=P.useCallback(()=>{X.current&&clearTimeout(X.current);const j=M.current;X.current=setTimeout(()=>{var U;M.current===j&&((U=Z.current)==null||U.call(Z))},1e3)},[]),ae=P.useCallback(()=>{ee.current&&clearTimeout(ee.current);const j=M.current;ee.current=setTimeout(()=>{var U;M.current===j&&((U=$.current)==null||U.call($))},1e3)},[]);return P.useEffect(()=>{if(!i)return;let j=!0;const U=av(i,L=>{var H,q;if(j)try{const W=kw.safeParse(JSON.parse(L.data));if(!W.success){console.warn("SSE event failed validation",W.error.message);return}switch(W.data.event){case"status":case"approval":case"stall":case"dead":ae(),Q();break;case"message":Q();break;case"ended":(H=$.current)==null||H.call($),(q=Z.current)==null||q.call(Z);break}}catch{}},r);return()=>{j=!1,V(),U()}},[i,r,ae,Q,V]),{session:o,health:w,notFound:l,loading:f,paneContent:d,paneLoading:E,metrics:C,metricsLoading:g,latency:_,latencyLoading:A,refetchPaneAndMetrics:F}}const i4={idle:"Idle",working:"Working",permission_prompt:"Permission",plan_mode:"Planning",ask_question:"Question",bash_approval:"Bash Approval",settings:"Settings",error:"Error",compacting:"Compacting",context_warning:"Context Warning",waiting_for_input:"Waiting",unknown:"Unknown"};function Kp(i,r){if(i.length<=r)return i;const a=i.slice(0,Math.ceil(r/2)-1),o=i.slice(-(Math.floor(r/2)-2));return`${a}…${o}`}function Vp(i){return new Date(i).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function s4({session:i,health:r,onApprove:a,onReject:o,onInterrupt:v,onKill:w,onSaveTemplate:k}){const[l,u]=P.useState(!1),f=r.status==="permission_prompt"||r.status==="bash_approval";return b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3 sm:p-4",children:[b.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[b.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[b.jsx(Po,{status:r.status}),b.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:i4[r.status]})]}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("h1",{className:"text-base sm:text-lg font-semibold text-[#e0e0e0] truncate",children:i.windowName||"Untitled Session"}),b.jsx("div",{className:"text-xs text-[#555] font-mono truncate mt-0.5",children:Kp(i.workDir,40)})]}),b.jsxs("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[i.permissionMode&&i.permissionMode!=="default"&&b.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#003322] text-[#10b981] border border-[#10b981]/30",children:i.permissionMode}),r.alive?b.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#111118] text-[#888] border border-[#1a1a2e]",children:"Alive"}):b.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#331111] text-[#ef4444] border border-[#ef4444]/30",children:"Dead"})]})]}),b.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 text-[11px] text-[#555] mb-3 flex-wrap",children:[b.jsxs("span",{children:["Created: ",Vp(i.createdAt)]}),b.jsxs("span",{className:"hidden sm:inline",children:["Last activity: ",Vp(i.lastActivity)]}),b.jsxs("span",{className:"font-mono hidden sm:inline",children:["ID: ",Kp(i.id,16)]}),r.details&&b.jsx("span",{className:"text-[#888] italic",children:r.details})]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f&&b.jsxs(b.Fragment,{children:[b.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#10b981] border border-[#10b981]/30 transition-colors",children:"Approve"}),b.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ef4444] border border-[#ef4444]/30 transition-colors",children:"Reject"})]}),b.jsx("button",{onClick:v,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors",children:"Interrupt"}),b.jsx("button",{onClick:k,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors",title:"Save this session as a template",children:"Save as Template"}),l?b.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[b.jsx("span",{className:"text-xs text-[#ef4444]",children:"Confirm kill?"}),b.jsx("button",{onClick:()=>{w==null||w(),u(!1)},className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] text-[#ef4444] border border-[#ef4444]/30 transition-colors",children:"Yes, Kill"}),b.jsx("button",{onClick:()=>u(!1),className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors",children:"Cancel"})]}):b.jsx("button",{onClick:()=>u(!0),className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors ml-auto",children:"Kill"})]})]})}var fu={exports:{}},Gp;function r4(){return Gp||(Gp=1,(function(i,r){(function(a,o){i.exports=o()})(globalThis,(()=>(()=>{var a={4567:function(k,l,u){var f=this&&this.__decorate||function(h,_,x,A){var R,D=arguments.length,T=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,x):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,_,x,A);else for(var M=h.length-1;M>=0;M--)(R=h[M])&&(T=(D<3?R(T):D>3?R(_,x,T):R(_,x))||T);return D>3&&T&&Object.defineProperty(_,x,T),T},y=this&&this.__param||function(h,_){return function(x,A){_(x,A,h)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const d=u(9042),S=u(9924),E=u(844),O=u(4725),C=u(2585),m=u(3656);let g=l.AccessibilityManager=class extends E.Disposable{constructor(h,_,x,A){super(),this._terminal=h,this._coreBrowserService=x,this._renderService=A,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new S.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
303
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of i.seen.entries()){const d=y[1];if(r===y[0]){w(y);continue}if(i.external){const E=(u=i.external.registry.get(y[0]))==null?void 0:u.id;if(r!==y[0]&&E){w(y);continue}}if((f=i.metadataRegistry.get(y[0]))==null?void 0:f.id){w(y);continue}if(d.cycle){w(y);continue}if(d.count>1&&i.reused==="ref"){w(y);continue}}}function Y_(i,r){var k,l,u;const a=i.seen.get(r);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=f=>{const y=i.seen.get(f);if(y.ref===null)return;const d=y.def??y.schema,S={...d},E=y.ref;if(y.ref=null,E){o(E);const C=i.seen.get(E),m=C.schema;if(m.$ref&&(i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(m)):Object.assign(d,m),Object.assign(d,S),f._zod.parent===E)for(const h in d)h==="$ref"||h==="allOf"||h in S||delete d[h];if(m.$ref&&C.def)for(const h in d)h==="$ref"||h==="allOf"||h in C.def&&JSON.stringify(d[h])===JSON.stringify(C.def[h])&&delete d[h]}const O=f._zod.parent;if(O&&O!==E){o(O);const C=i.seen.get(O);if(C!=null&&C.schema.$ref&&(d.$ref=C.schema.$ref,C.def))for(const m in d)m==="$ref"||m==="allOf"||m in C.def&&JSON.stringify(d[m])===JSON.stringify(C.def[m])&&delete d[m]}i.override({zodSchema:f,jsonSchema:d,path:y.path??[]})};for(const f of[...i.seen.entries()].reverse())o(f[0]);const v={};if(i.target==="draft-2020-12"?v.$schema="https://json-schema.org/draft/2020-12/schema":i.target==="draft-07"?v.$schema="http://json-schema.org/draft-07/schema#":i.target==="draft-04"?v.$schema="http://json-schema.org/draft-04/schema#":i.target,(k=i.external)!=null&&k.uri){const f=(l=i.external.registry.get(r))==null?void 0:l.id;if(!f)throw new Error("Schema is missing an `id` property");v.$id=i.external.uri(f)}Object.assign(v,a.def??a.schema);const w=((u=i.external)==null?void 0:u.defs)??{};for(const f of i.seen.entries()){const y=f[1];y.def&&y.defId&&(w[y.defId]=y.def)}i.external||Object.keys(w).length>0&&(i.target==="draft-2020-12"?v.$defs=w:v.definitions=w);try{const f=JSON.parse(JSON.stringify(v));return Object.defineProperty(f,"~standard",{value:{...r["~standard"],jsonSchema:{input:To(r,"input",i.processors),output:To(r,"output",i.processors)}},enumerable:!1,writable:!1}),f}catch{throw new Error("Error converting schema to JSON.")}}function At(i,r){const a=r??{seen:new Set};if(a.seen.has(i))return!1;a.seen.add(i);const o=i._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return At(o.element,a);if(o.type==="set")return At(o.valueType,a);if(o.type==="lazy")return At(o.getter(),a);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return At(o.innerType,a);if(o.type==="intersection")return At(o.left,a)||At(o.right,a);if(o.type==="record"||o.type==="map")return At(o.keyType,a)||At(o.valueType,a);if(o.type==="pipe")return At(o.in,a)||At(o.out,a);if(o.type==="object"){for(const v in o.shape)if(At(o.shape[v],a))return!0;return!1}if(o.type==="union"){for(const v of o.options)if(At(v,a))return!0;return!1}if(o.type==="tuple"){for(const v of o.items)if(At(v,a))return!0;return!!(o.rest&&At(o.rest,a))}return!1}const RC=(i,r={})=>a=>{const o=V_({...a,processors:r});return _t(i,o),G_(o,i),Y_(o,i)},To=(i,r,a={})=>o=>{const{libraryOptions:v,target:w}=o??{},k=V_({...v??{},target:w,io:r,processors:a});return _t(i,k),G_(k,i),Y_(k,i)},DC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},OC=(i,r,a,o)=>{const v=a;v.type="string";const{minimum:w,maximum:k,format:l,patterns:u,contentEncoding:f}=i._zod.bag;if(typeof w=="number"&&(v.minLength=w),typeof k=="number"&&(v.maxLength=k),l&&(v.format=DC[l]??l,v.format===""&&delete v.format,l==="time"&&delete v.format),f&&(v.contentEncoding=f),u&&u.size>0){const y=[...u];y.length===1?v.pattern=y[0].source:y.length>1&&(v.allOf=[...y.map(d=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},NC=(i,r,a,o)=>{const v=a,{minimum:w,maximum:k,format:l,multipleOf:u,exclusiveMaximum:f,exclusiveMinimum:y}=i._zod.bag;typeof l=="string"&&l.includes("int")?v.type="integer":v.type="number",typeof y=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(v.minimum=y,v.exclusiveMinimum=!0):v.exclusiveMinimum=y),typeof w=="number"&&(v.minimum=w,typeof y=="number"&&r.target!=="draft-04"&&(y>=w?delete v.minimum:delete v.exclusiveMinimum)),typeof f=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(v.maximum=f,v.exclusiveMaximum=!0):v.exclusiveMaximum=f),typeof k=="number"&&(v.maximum=k,typeof f=="number"&&r.target!=="draft-04"&&(f<=k?delete v.maximum:delete v.exclusiveMaximum)),typeof u=="number"&&(v.multipleOf=u)},MC=(i,r,a,o)=>{a.type="boolean"},LC=(i,r,a,o)=>{a.not={}},jC=(i,r,a,o)=>{},BC=(i,r,a,o)=>{const v=i._zod.def,w=T_(v.entries);w.every(k=>typeof k=="number")&&(a.type="number"),w.every(k=>typeof k=="string")&&(a.type="string"),a.enum=w},zC=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},HC=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},UC=(i,r,a,o)=>{const v=a,w=i._zod.def,{minimum:k,maximum:l}=i._zod.bag;typeof k=="number"&&(v.minItems=k),typeof l=="number"&&(v.maxItems=l),v.type="array",v.items=_t(w.element,r,{...o,path:[...o.path,"items"]})},IC=(i,r,a,o)=>{var f;const v=a,w=i._zod.def;v.type="object",v.properties={};const k=w.shape;for(const y in k)v.properties[y]=_t(k[y],r,{...o,path:[...o.path,"properties",y]});const l=new Set(Object.keys(k)),u=new Set([...l].filter(y=>{const d=w.shape[y]._zod;return r.io==="input"?d.optin===void 0:d.optout===void 0}));u.size>0&&(v.required=Array.from(u)),((f=w.catchall)==null?void 0:f._zod.def.type)==="never"?v.additionalProperties=!1:w.catchall?w.catchall&&(v.additionalProperties=_t(w.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(v.additionalProperties=!1)},PC=(i,r,a,o)=>{const v=i._zod.def,w=v.inclusive===!1,k=v.options.map((l,u)=>_t(l,r,{...o,path:[...o.path,w?"oneOf":"anyOf",u]}));w?a.oneOf=k:a.anyOf=k},$C=(i,r,a,o)=>{const v=i._zod.def,w=_t(v.left,r,{...o,path:[...o.path,"allOf",0]}),k=_t(v.right,r,{...o,path:[...o.path,"allOf",1]}),l=f=>"allOf"in f&&Object.keys(f).length===1,u=[...l(w)?w.allOf:[w],...l(k)?k.allOf:[k]];a.allOf=u},FC=(i,r,a,o)=>{const v=a,w=i._zod.def;v.type="object";const k=w.keyType,l=k._zod.bag,u=l==null?void 0:l.patterns;if(w.mode==="loose"&&u&&u.size>0){const y=_t(w.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});v.patternProperties={};for(const d of u)v.patternProperties[d.source]=y}else(r.target==="draft-07"||r.target==="draft-2020-12")&&(v.propertyNames=_t(w.keyType,r,{...o,path:[...o.path,"propertyNames"]})),v.additionalProperties=_t(w.valueType,r,{...o,path:[...o.path,"additionalProperties"]});const f=k._zod.values;if(f){const y=[...f].filter(d=>typeof d=="string"||typeof d=="number");y.length>0&&(v.required=y)}},ZC=(i,r,a,o)=>{const v=i._zod.def,w=_t(v.innerType,r,o),k=r.seen.get(i);r.target==="openapi-3.0"?(k.ref=v.innerType,a.nullable=!0):a.anyOf=[w,{type:"null"}]},qC=(i,r,a,o)=>{const v=i._zod.def;_t(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType},KC=(i,r,a,o)=>{const v=i._zod.def;_t(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType,a.default=JSON.parse(JSON.stringify(v.defaultValue))},VC=(i,r,a,o)=>{const v=i._zod.def;_t(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType,r.io==="input"&&(a._prefault=JSON.parse(JSON.stringify(v.defaultValue)))},GC=(i,r,a,o)=>{const v=i._zod.def;_t(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType;let k;try{k=v.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}a.default=k},YC=(i,r,a,o)=>{const v=i._zod.def,w=r.io==="input"?v.in._zod.def.type==="transform"?v.out:v.in:v.out;_t(w,r,o);const k=r.seen.get(i);k.ref=w},WC=(i,r,a,o)=>{const v=i._zod.def;_t(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType,a.readOnly=!0},W_=(i,r,a,o)=>{const v=i._zod.def;_t(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType},XC=he("ZodISODateTime",(i,r)=>{ex.init(i,r),it.init(i,r)});function JC(i){return nC(XC,i)}const QC=he("ZodISODate",(i,r)=>{tx.init(i,r),it.init(i,r)});function e2(i){return aC(QC,i)}const t2=he("ZodISOTime",(i,r)=>{ix.init(i,r),it.init(i,r)});function i2(i){return oC(t2,i)}const s2=he("ZodISODuration",(i,r)=>{sx.init(i,r),it.init(i,r)});function r2(i){return lC(s2,i)}const n2=(i,r)=>{O_.init(i,r),i.name="ZodError",Object.defineProperties(i,{format:{value:a=>V1(i,a)},flatten:{value:a=>K1(i,a)},addIssue:{value:a=>{i.issues.push(a),i.message=JSON.stringify(i.issues,Su,2)}},addIssues:{value:a=>{i.issues.push(...a),i.message=JSON.stringify(i.issues,Su,2)}},isEmpty:{get(){return i.issues.length===0}}})},oi=he("ZodError",n2,{Parent:Error}),a2=Pu(oi),o2=$u(oi),l2=jo(oi),c2=Bo(oi),u2=W1(oi),h2=X1(oi),d2=J1(oi),f2=Q1(oi),m2=eS(oi),p2=tS(oi),_2=iS(oi),v2=sS(oi),ot=he("ZodType",(i,r)=>(at.init(i,r),Object.assign(i["~standard"],{jsonSchema:{input:To(i,"input"),output:To(i,"output")}}),i.toJSONSchema=RC(i,{}),i.def=r,i.type=r.type,Object.defineProperty(i,"_def",{value:r}),i.check=(...a)=>i.clone(Ss(r,{checks:[...r.checks??[],...a.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),i.with=i.check,i.clone=(a,o)=>Pi(i,a,o),i.brand=()=>i,i.register=((a,o)=>(a.add(i,o),i)),i.parse=(a,o)=>a2(i,a,o,{callee:i.parse}),i.safeParse=(a,o)=>l2(i,a,o),i.parseAsync=async(a,o)=>o2(i,a,o,{callee:i.parseAsync}),i.safeParseAsync=async(a,o)=>c2(i,a,o),i.spa=i.safeParseAsync,i.encode=(a,o)=>u2(i,a,o),i.decode=(a,o)=>h2(i,a,o),i.encodeAsync=async(a,o)=>d2(i,a,o),i.decodeAsync=async(a,o)=>f2(i,a,o),i.safeEncode=(a,o)=>m2(i,a,o),i.safeDecode=(a,o)=>p2(i,a,o),i.safeEncodeAsync=async(a,o)=>_2(i,a,o),i.safeDecodeAsync=async(a,o)=>v2(i,a,o),i.refine=(a,o)=>i.check(uw(a,o)),i.superRefine=a=>i.check(hw(a)),i.overwrite=a=>i.check(Ir(a)),i.optional=()=>Dp(i),i.exactOptional=()=>X2(i),i.nullable=()=>Op(i),i.nullish=()=>Dp(Op(i)),i.nonoptional=a=>sw(i,a),i.array=()=>Yn(i),i.or=a=>Z2([i,a]),i.and=a=>K2(i,a),i.transform=a=>Np(i,Y2(a)),i.default=a=>ew(i,a),i.prefault=a=>iw(i,a),i.catch=a=>nw(i,a),i.pipe=a=>Np(i,a),i.readonly=()=>lw(i),i.describe=a=>{const o=i.clone();return Un.add(o,{description:a}),o},Object.defineProperty(i,"description",{get(){var a;return(a=Un.get(i))==null?void 0:a.description},configurable:!0}),i.meta=(...a)=>{if(a.length===0)return Un.get(i);const o=i.clone();return Un.add(o,a[0]),o},i.isOptional=()=>i.safeParse(void 0).success,i.isNullable=()=>i.safeParse(null).success,i.apply=a=>a(i),i)),X_=he("_ZodString",(i,r)=>{Fu.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(o,v,w)=>OC(i,o,v);const a=i._zod.bag;i.format=a.format??null,i.minLength=a.minimum??null,i.maxLength=a.maximum??null,i.regex=(...o)=>i.check(mC(...o)),i.includes=(...o)=>i.check(vC(...o)),i.startsWith=(...o)=>i.check(gC(...o)),i.endsWith=(...o)=>i.check(yC(...o)),i.min=(...o)=>i.check(ko(...o)),i.max=(...o)=>i.check(q_(...o)),i.length=(...o)=>i.check(K_(...o)),i.nonempty=(...o)=>i.check(ko(1,...o)),i.lowercase=o=>i.check(pC(o)),i.uppercase=o=>i.check(_C(o)),i.trim=()=>i.check(SC()),i.normalize=(...o)=>i.check(bC(...o)),i.toLowerCase=()=>i.check(xC()),i.toUpperCase=()=>i.check(CC()),i.slugify=()=>i.check(wC())}),g2=he("ZodString",(i,r)=>{Fu.init(i,r),X_.init(i,r),i.email=a=>i.check(Hx(y2,a)),i.url=a=>i.check(Fx(b2,a)),i.jwt=a=>i.check(rC(j2,a)),i.emoji=a=>i.check(Zx(S2,a)),i.guid=a=>i.check(wp(Ap,a)),i.uuid=a=>i.check(Ux(vo,a)),i.uuidv4=a=>i.check(Ix(vo,a)),i.uuidv6=a=>i.check(Px(vo,a)),i.uuidv7=a=>i.check($x(vo,a)),i.nanoid=a=>i.check(qx(x2,a)),i.guid=a=>i.check(wp(Ap,a)),i.cuid=a=>i.check(Kx(C2,a)),i.cuid2=a=>i.check(Vx(w2,a)),i.ulid=a=>i.check(Gx(E2,a)),i.base64=a=>i.check(tC(N2,a)),i.base64url=a=>i.check(iC(M2,a)),i.xid=a=>i.check(Yx(k2,a)),i.ksuid=a=>i.check(Wx(T2,a)),i.ipv4=a=>i.check(Xx(A2,a)),i.ipv6=a=>i.check(Jx(R2,a)),i.cidrv4=a=>i.check(Qx(D2,a)),i.cidrv6=a=>i.check(eC(O2,a)),i.e164=a=>i.check(sC(L2,a)),i.datetime=a=>i.check(JC(a)),i.date=a=>i.check(e2(a)),i.time=a=>i.check(i2(a)),i.duration=a=>i.check(r2(a))});function Ae(i){return zx(g2,i)}const it=he("ZodStringFormat",(i,r)=>{et.init(i,r),X_.init(i,r)}),y2=he("ZodEmail",(i,r)=>{qS.init(i,r),it.init(i,r)}),Ap=he("ZodGUID",(i,r)=>{FS.init(i,r),it.init(i,r)}),vo=he("ZodUUID",(i,r)=>{ZS.init(i,r),it.init(i,r)}),b2=he("ZodURL",(i,r)=>{KS.init(i,r),it.init(i,r)}),S2=he("ZodEmoji",(i,r)=>{VS.init(i,r),it.init(i,r)}),x2=he("ZodNanoID",(i,r)=>{GS.init(i,r),it.init(i,r)}),C2=he("ZodCUID",(i,r)=>{YS.init(i,r),it.init(i,r)}),w2=he("ZodCUID2",(i,r)=>{WS.init(i,r),it.init(i,r)}),E2=he("ZodULID",(i,r)=>{XS.init(i,r),it.init(i,r)}),k2=he("ZodXID",(i,r)=>{JS.init(i,r),it.init(i,r)}),T2=he("ZodKSUID",(i,r)=>{QS.init(i,r),it.init(i,r)}),A2=he("ZodIPv4",(i,r)=>{rx.init(i,r),it.init(i,r)}),R2=he("ZodIPv6",(i,r)=>{nx.init(i,r),it.init(i,r)}),D2=he("ZodCIDRv4",(i,r)=>{ax.init(i,r),it.init(i,r)}),O2=he("ZodCIDRv6",(i,r)=>{ox.init(i,r),it.init(i,r)}),N2=he("ZodBase64",(i,r)=>{lx.init(i,r),it.init(i,r)}),M2=he("ZodBase64URL",(i,r)=>{ux.init(i,r),it.init(i,r)}),L2=he("ZodE164",(i,r)=>{hx.init(i,r),it.init(i,r)}),j2=he("ZodJWT",(i,r)=>{fx.init(i,r),it.init(i,r)}),J_=he("ZodNumber",(i,r)=>{P_.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(o,v,w)=>NC(i,o,v),i.gt=(o,v)=>i.check(kp(o,v)),i.gte=(o,v)=>i.check(uu(o,v)),i.min=(o,v)=>i.check(uu(o,v)),i.lt=(o,v)=>i.check(Ep(o,v)),i.lte=(o,v)=>i.check(cu(o,v)),i.max=(o,v)=>i.check(cu(o,v)),i.int=o=>i.check(Rp(o)),i.safe=o=>i.check(Rp(o)),i.positive=o=>i.check(kp(0,o)),i.nonnegative=o=>i.check(uu(0,o)),i.negative=o=>i.check(Ep(0,o)),i.nonpositive=o=>i.check(cu(0,o)),i.multipleOf=(o,v)=>i.check(Tp(o,v)),i.step=(o,v)=>i.check(Tp(o,v)),i.finite=()=>i;const a=i._zod.bag;i.minValue=Math.max(a.minimum??Number.NEGATIVE_INFINITY,a.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,i.maxValue=Math.min(a.maximum??Number.POSITIVE_INFINITY,a.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,i.isInt=(a.format??"").includes("int")||Number.isSafeInteger(a.multipleOf??.5),i.isFinite=!0,i.format=a.format??null});function ye(i){return cC(J_,i)}const B2=he("ZodNumberFormat",(i,r)=>{mx.init(i,r),J_.init(i,r)});function Rp(i){return uC(B2,i)}const z2=he("ZodBoolean",(i,r)=>{px.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>MC(i,a,o)});function Ui(i){return hC(z2,i)}const H2=he("ZodUnknown",(i,r)=>{_x.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>jC()});function Ao(){return dC(H2)}const U2=he("ZodNever",(i,r)=>{vx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>LC(i,a,o)});function I2(i){return fC(U2,i)}const P2=he("ZodArray",(i,r)=>{gx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>UC(i,a,o,v),i.element=r.element,i.min=(a,o)=>i.check(ko(a,o)),i.nonempty=a=>i.check(ko(1,a)),i.max=(a,o)=>i.check(q_(a,o)),i.length=(a,o)=>i.check(K_(a,o)),i.unwrap=()=>i.element});function Yn(i,r){return EC(P2,i,r)}const $2=he("ZodObject",(i,r)=>{bx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>IC(i,a,o,v),Ze(i,"shape",()=>r.shape),i.keyof=()=>Fs(Object.keys(i._zod.def.shape)),i.catchall=a=>i.clone({...i._zod.def,catchall:a}),i.passthrough=()=>i.clone({...i._zod.def,catchall:Ao()}),i.loose=()=>i.clone({...i._zod.def,catchall:Ao()}),i.strict=()=>i.clone({...i._zod.def,catchall:I2()}),i.strip=()=>i.clone({...i._zod.def,catchall:void 0}),i.extend=a=>P1(i,a),i.safeExtend=a=>$1(i,a),i.merge=a=>F1(i,a),i.pick=a=>U1(i,a),i.omit=a=>I1(i,a),i.partial=(...a)=>Z1(ev,i,a[0]),i.required=(...a)=>q1(tv,i,a[0])});function Ye(i,r){const a={type:"object",shape:i??{},...be(r)};return new $2(a)}const F2=he("ZodUnion",(i,r)=>{Sx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>PC(i,a,o,v),i.options=r.options});function Z2(i,r){return new F2({type:"union",options:i,...be(r)})}const q2=he("ZodIntersection",(i,r)=>{xx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>$C(i,a,o,v)});function K2(i,r){return new q2({type:"intersection",left:i,right:r})}const Q_=he("ZodRecord",(i,r)=>{Cx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>FC(i,a,o,v),i.keyType=r.keyType,i.valueType=r.valueType});function Ho(i,r,a){return new Q_({type:"record",keyType:i,valueType:r,...be(a)})}function V2(i,r,a){const o=Pi(i);return o._zod.values=void 0,new Q_({type:"record",keyType:o,valueType:r,...be(a)})}const Cu=he("ZodEnum",(i,r)=>{wx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(o,v,w)=>BC(i,o,v),i.enum=r.entries,i.options=Object.values(r.entries);const a=new Set(Object.keys(r.entries));i.extract=(o,v)=>{const w={};for(const k of o)if(a.has(k))w[k]=r.entries[k];else throw new Error(`Key ${k} not found in enum`);return new Cu({...r,checks:[],...be(v),entries:w})},i.exclude=(o,v)=>{const w={...r.entries};for(const k of o)if(a.has(k))delete w[k];else throw new Error(`Key ${k} not found in enum`);return new Cu({...r,checks:[],...be(v),entries:w})}});function Fs(i,r){const a=Array.isArray(i)?Object.fromEntries(i.map(o=>[o,o])):i;return new Cu({type:"enum",entries:a,...be(r)})}const G2=he("ZodTransform",(i,r)=>{Ex.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>HC(i,a),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new E_(i.constructor.name);a.addIssue=w=>{if(typeof w=="string")a.issues.push($n(w,a.value,r));else{const k=w;k.fatal&&(k.continue=!1),k.code??(k.code="custom"),k.input??(k.input=a.value),k.inst??(k.inst=i),a.issues.push($n(k))}};const v=r.transform(a.value,a);return v instanceof Promise?v.then(w=>(a.value=w,a)):(a.value=v,a)}});function Y2(i){return new G2({type:"transform",transform:i})}const ev=he("ZodOptional",(i,r)=>{Z_.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>W_(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function Dp(i){return new ev({type:"optional",innerType:i})}const W2=he("ZodExactOptional",(i,r)=>{kx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>W_(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function X2(i){return new W2({type:"optional",innerType:i})}const J2=he("ZodNullable",(i,r)=>{Tx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>ZC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function Op(i){return new J2({type:"nullable",innerType:i})}const Q2=he("ZodDefault",(i,r)=>{Ax.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>KC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType,i.removeDefault=i.unwrap});function ew(i,r){return new Q2({type:"default",innerType:i,get defaultValue(){return typeof r=="function"?r():R_(r)}})}const tw=he("ZodPrefault",(i,r)=>{Rx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>VC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function iw(i,r){return new tw({type:"prefault",innerType:i,get defaultValue(){return typeof r=="function"?r():R_(r)}})}const tv=he("ZodNonOptional",(i,r)=>{Dx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>qC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function sw(i,r){return new tv({type:"nonoptional",innerType:i,...be(r)})}const rw=he("ZodCatch",(i,r)=>{Ox.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>GC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType,i.removeCatch=i.unwrap});function nw(i,r){return new rw({type:"catch",innerType:i,catchValue:typeof r=="function"?r:()=>r})}const aw=he("ZodPipe",(i,r)=>{Nx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>YC(i,a,o,v),i.in=r.in,i.out=r.out});function Np(i,r){return new aw({type:"pipe",in:i,out:r})}const ow=he("ZodReadonly",(i,r)=>{Mx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>WC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function lw(i){return new ow({type:"readonly",innerType:i})}const cw=he("ZodCustom",(i,r)=>{Lx.init(i,r),ot.init(i,r),i._zod.processJSONSchema=(a,o,v)=>zC(i,a)});function uw(i,r={}){return kC(cw,i,r)}function hw(i){return TC(i)}const Uo=Fs(["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"]),dw=Fs(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]),Zu=Ye({ok:Ui()}),fw=Ye({id:Ae(),name:Ae(),createdAt:ye(),lastUsedAt:ye(),rateLimit:ye()}),mw=Ye({id:Ae(),name:Ae(),key:Ae()}),pw=Zu.extend({delivered:Ui(),attempts:ye()}),_w=Ye({status:Ae(),version:Ae(),platform:dw,uptime:ye(),sessions:Ye({active:ye(),total:ye()}),timestamp:Ae()}),Io=Ye({id:Ae(),windowId:Ae(),windowName:Ae(),workDir:Ae(),claudeSessionId:Ae().optional(),jsonlPath:Ae().optional(),byteOffset:ye(),monitorOffset:ye(),status:Uo,createdAt:ye(),lastActivity:ye(),stallThresholdMs:ye(),permissionMode:Ae(),autoApprove:Ui().optional(),settingsPatched:Ui().optional(),promptDelivery:Ye({delivered:Ui(),attempts:ye()}).optional(),actionHints:Ho(Ae(),Ye({method:Ae(),url:Ae(),description:Ae()})).optional()}),vw=Ye({sessions:Yn(Io),pagination:Ye({page:ye(),limit:ye(),total:ye(),totalPages:ye()})}),gw=Ye({active:ye(),byStatus:V2(Uo,ye()),totalCreated:ye(),totalCompleted:ye(),totalFailed:ye()}),yw=Ye({alive:Ui(),windowExists:Ui(),claudeRunning:Ui(),paneCommand:Ae().nullable(),status:Uo,hasTranscript:Ui(),lastActivity:ye(),lastActivityAgo:ye(),sessionAge:ye(),details:Ae(),actionHints:Ho(Ae(),Ye({method:Ae(),url:Ae(),description:Ae()})).optional()}),bw=Ye({durationSec:ye(),messages:ye(),toolCalls:ye(),approvals:ye(),autoApprovals:ye(),statusChanges:Yn(Ae()),tokenUsage:Ye({inputTokens:ye(),outputTokens:ye(),cacheCreationTokens:ye(),cacheReadTokens:ye(),estimatedCostUsd:ye()}).optional()}),vs=Ye({min:ye().nullable(),max:ye().nullable(),avg:ye().nullable(),count:ye()}),Sw=Ye({sessionId:Ae(),realtime:Ye({hook_latency_ms:ye().nullable(),state_change_detection_ms:ye().nullable(),permission_response_ms:ye().nullable()}).nullable(),aggregated:Ye({hook_latency_ms:vs,state_change_detection_ms:vs,permission_response_ms:vs,channel_delivery_ms:vs}).nullable()}),xw=Ye({role:Fs(["user","assistant","system"]),contentType:Fs(["text","thinking","tool_use","tool_result","tool_error","permission_request","progress"]),text:Ae(),toolName:Ae().optional(),toolUseId:Ae().optional(),timestamp:Ae().optional()}),Cw=Ye({messages:Yn(xw),status:Uo,statusText:Ae().nullable(),interactiveContent:Ae().nullable()}),ww=Ye({uptime:ye(),sessions:Ye({total_created:ye(),currently_active:ye(),completed:ye(),failed:ye(),avg_duration_sec:ye(),avg_messages_per_session:ye()}),auto_approvals:ye(),webhooks_sent:ye(),webhooks_failed:ye(),screenshots_taken:ye(),pipelines_created:ye(),batches_created:ye(),prompt_delivery:Ye({sent:ye(),delivered:ye(),failed:ye(),success_rate:ye().nullable()}),latency:Ye({hook_latency_ms:vs,state_change_detection_ms:vs,permission_response_ms:vs,channel_delivery_ms:vs})}),Ew=Fs(["status","message","approval","ended","heartbeat","stall","dead","system","hook","subagent_start","subagent_stop","verification","permission_denied"]),kw=Ye({event:Ew,sessionId:Ae(),timestamp:Ae(),data:Ho(Ae(),Ao())}),Tw=Fs(["session_status_change","session_message","session_approval","session_ended","session_created","session_stall","session_dead","session_subagent_start","session_subagent_stop","session_verification"]),Aw=Ye({event:Tw,sessionId:Ae(),timestamp:Ae(),data:Ho(Ae(),Ao())}),Rw=3e4,Dw=300*1e3;class Ro{constructor(r,a,o={}){pt(this,"eventSource",null);pt(this,"consecutiveFailures",0);pt(this,"failStartTime",null);pt(this,"destroyed",!1);pt(this,"gaveUp",!1);pt(this,"reconnectTimer",null);pt(this,"url");pt(this,"callbacks");pt(this,"onMessage");this.url=r,this.onMessage=a,this.callbacks=o,this.connect()}connect(){this.destroyed||(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.eventSource=new EventSource(this.url),this.eventSource.onmessage=this.onMessage,this.eventSource.onopen=()=>{var r,a;this.destroyed||(this.consecutiveFailures=0,this.failStartTime=null,this.gaveUp=!1,(a=(r=this.callbacks).onOpen)==null||a.call(r))},this.eventSource.onerror=()=>{var a,o,v,w,k,l,u;if(this.destroyed)return;if((a=this.eventSource)==null||a.close(),this.eventSource=null,this.failStartTime===null&&(this.failStartTime=Date.now()),Date.now()-this.failStartTime>=Dw){this.gaveUp||(this.gaveUp=!0,(v=(o=this.callbacks).onGiveUp)==null||v.call(o),(k=(w=this.callbacks).onClose)==null||k.call(w));return}this.consecutiveFailures++;const r=Math.min(Rw,1e3*Math.pow(2,this.consecutiveFailures-1));(u=(l=this.callbacks).onReconnecting)==null||u.call(l,this.consecutiveFailures,r),this.reconnectTimer=setTimeout(()=>this.connect(),r)})}close(){var r;this.destroyed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(r=this.eventSource)==null||r.close(),this.eventSource=null}}const Ow="",Nw=["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"];function Mw(i){if(!i)return{};if(i instanceof Headers){const r={};return i.forEach((a,o)=>{r[o]=a}),r}return i}function Lw(i,r,a){const o=r.safeParse(i);if(o.success)return o.data;throw console.error(`[aegis] API response validation failed (${a}):`,o.error.issues),new Error(`API response validation failed for ${a}: ${o.error.issues.map(v=>v.message).join(", ")}`)}function jw(i){return!(i.name==="AbortError"||!i.message||i.message.includes("HTTP "))}async function Ue(i,r={}){const a=localStorage.getItem("aegis_token"),o={"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{},...Mw(r.headers)},{retries:v=0,schema:w,schemaContext:k,...l}=r;let u=null;for(let f=0;f<=v;f++)try{const y=await fetch(`${Ow}${i}`,{...l,headers:o});if(!y.ok){const S=await y.json().catch(()=>({error:y.statusText})),E=new Error(S.error??`HTTP ${y.status}`);throw E.statusCode=y.status,E}const d=await y.json();return w?Lw(d,w,k??i):d}catch(y){if(u=y,f<v&&jw(u))await new Promise(d=>setTimeout(d,1e3*Math.pow(2,f)));else throw u}throw u}function iv(){return Ue("/v1/health",{schema:_w,schemaContext:"getHealth"})}const sv="aegis-bridge",Bw=`https://registry.npmjs.org/${sv}/latest`,zw=`https://www.npmjs.com/package/${sv}`;function Do(i){return i.trim().replace(/^v/i,"")}function Hw(i,r){const a=Do(i).split(".").map(w=>Number.parseInt(w,10)||0),o=Do(r).split(".").map(w=>Number.parseInt(w,10)||0),v=Math.max(a.length,o.length);for(let w=0;w<v;w++){const k=a[w]??0,l=o[w]??0;if(k>l)return 1;if(k<l)return-1}return 0}async function Uw(i){const r=await fetch(Bw,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`Update check failed (HTTP ${r.status})`);const a=await r.json(),o=Do(a.version??i),v=Do(i);return{currentVersion:v,latestVersion:o,updateAvailable:Hw(o,v)>0,releaseUrl:zw}}function Iw(){return Ue("/v1/metrics",{schema:ww,schemaContext:"getMetrics"})}function Pw(i={}){const r=new URLSearchParams;i.page!==void 0&&r.set("page",String(i.page)),i.limit!==void 0&&r.set("limit",String(i.limit)),i.status&&r.set("status",i.status);const a=r.toString(),o=a?`/v1/sessions?${a}`:"/v1/sessions";return Ue(o,{schema:vw,schemaContext:"getSessions"})}async function $w(){const i=await Ue("/v1/sessions/stats",{schema:gw,schemaContext:"getSessionStatusCounts"}),r={all:i.active,idle:0,working:0,compacting:0,context_warning:0,waiting_for_input:0,permission_prompt:0,plan_mode:0,ask_question:0,bash_approval:0,settings:0,error:0,unknown:0};return Nw.forEach(a=>{r[a]=i.byStatus[a]??0}),r}function Fw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}`,{schema:Io,schemaContext:"getSession"})}function Mp(i){const{signal:r,...a}=i;return Ue("/v1/sessions",{method:"POST",body:JSON.stringify(a),signal:r,schema:Io,schemaContext:"createSession"})}function wu(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}`,{method:"DELETE",schema:Zu,schemaContext:"killSession"})}function Zw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/health`,{schema:yw,schemaContext:"getSessionHealth"})}function qw(){return Ue("/v1/sessions/health")}function Kw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/read`,{schema:Cw,schemaContext:"getSessionMessages"})}function Vw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/metrics`,{schema:bw,schemaContext:"getSessionMetrics"})}function Gw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/latency`,{schema:Sw,schemaContext:"getSessionLatency"})}function Yw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/pane`)}function Ww(i,r){return Ue(`/v1/sessions/${encodeURIComponent(i)}/send`,{method:"POST",body:JSON.stringify({text:r}),schema:pw,schemaContext:"sendMessage"})}function rv(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/approve`,{method:"POST"})}function Xw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/reject`,{method:"POST"})}function Eu(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/interrupt`,{method:"POST"})}function Jw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/escape`,{method:"POST"})}function Qw(i,r={}){return Ue(`/v1/sessions/${encodeURIComponent(i)}/fork`,{method:"POST",body:JSON.stringify(r),schema:Io,schemaContext:"forkSession"})}const Lp=3,eE=1e3;async function nv(i,r){for(let a=0;a<Lp;a++){if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");try{return await cE(r)}catch{if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");if(a<Lp-1){const o=eE*Math.pow(2,a);await new Promise(v=>{const w=setTimeout(v,o);r==null||r.addEventListener("abort",()=>{clearTimeout(w),v(void 0)},{once:!0})})}}}throw i==null||i(),new Error("Real-time updates unavailable")}function av(i,r,a,o){const v=`/v1/sessions/${encodeURIComponent(i)}/events`;let w=null,k=!1;const l=new AbortController;return a?nv(o==null?void 0:o.onGiveUp,l.signal).then(u=>{if(k)return;const f=`${v}?token=${encodeURIComponent(u.token)}`;w=new Ro(f,r,o)}).catch(()=>{}):w=new Ro(v,r,o),()=>{k=!0,l.abort(),w==null||w.close()}}function tE(i,r,a){const o="/v1/events";let v=null,w=!1;const k=new AbortController,l=u=>{try{const f=Aw.safeParse(JSON.parse(u.data));if(!f.success){console.warn("Global SSE event failed validation",f.error.message);return}i(f.data)}catch{}};return r?nv(a==null?void 0:a.onGiveUp,k.signal).then(u=>{if(w)return;const f=`${o}?token=${encodeURIComponent(u.token)}`;v=new Ro(f,l,a)}).catch(()=>{}):v=new Ro(o,l,a),()=>{var u;w=!0,k.abort(),(u=a==null?void 0:a.onClose)==null||u.call(a),v==null||v.close()}}function iE(i,r){return Ue(`/v1/sessions/${encodeURIComponent(i)}/command`,{method:"POST",body:JSON.stringify({command:r})})}function sE(i,r){return Ue(`/v1/sessions/${encodeURIComponent(i)}/bash`,{method:"POST",body:JSON.stringify({command:r})})}function rE(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/screenshot`,{method:"POST"})}function nE(i){const{signal:r,...a}=i;return Ue("/v1/sessions/batch",{method:"POST",signal:r,body:JSON.stringify(a)})}function aE(i){return Ue("/v1/pipelines",{method:"POST",body:JSON.stringify(i)})}function oE(){return Ue("/v1/pipelines")}function lE(i){return Ue(`/v1/pipelines/${encodeURIComponent(i)}`)}function cE(i){return Ue("/v1/auth/sse-token",{method:"POST",signal:i})}function uE(i){return Ue("/v1/auth/keys",{method:"POST",body:JSON.stringify({name:i}),schema:mw,schemaContext:"createAuthKey"})}function hE(){return Ue("/v1/auth/keys",{schema:Yn(fw),schemaContext:"getAuthKeys"})}function dE(i){return Ue(`/v1/auth/keys/${encodeURIComponent(i)}`,{method:"DELETE",schema:Zu,schemaContext:"revokeAuthKey"})}function fE(i){return Ue("/v1/templates",{method:"POST",body:JSON.stringify(i)})}function mE(){return Ue("/v1/templates")}const go=new Map;let pE=0;const $i=w_(i=>({toasts:[],addToast:(r,a,o)=>{const v=`toast-${++pE}`,w=setTimeout(()=>{go.delete(v),i(k=>({toasts:k.toasts.filter(l=>l.id!==v)}))},4e3);return go.set(v,w),i(k=>({toasts:[...k.toasts,{id:v,type:r,title:a,description:o}]})),v},removeToast:r=>{const a=go.get(r);a&&(clearTimeout(a),go.delete(r)),i(o=>({toasts:o.toasts.filter(v=>v.id!==r)}))}})),_E={error:"border-red-500/50 bg-red-950/80 text-red-200",success:"border-green-500/50 bg-green-950/80 text-green-200",info:"border-cyan-500/50 bg-cyan-950/80 text-cyan-200",warning:"border-yellow-500/50 bg-yellow-950/80 text-yellow-200"};function vE({id:i,type:r,title:a,description:o}){const v=$i(w=>w.removeToast);return b.jsxs("div",{role:"alert",className:`flex items-start gap-3 rounded-lg border px-4 py-3 shadow-lg backdrop-blur-sm animate-slide-in ${_E[r]}`,children:[b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("p",{className:"text-sm font-medium",children:a}),o&&b.jsx("p",{className:"mt-0.5 text-xs opacity-80",children:o})]}),b.jsx("button",{onClick:()=>v(i),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:b.jsx(Gn,{className:"h-3.5 w-3.5"})})]})}function gE(){const i=$i(r=>r.toasts);return i.length===0?null:b.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none",children:i.map(r=>b.jsx("div",{className:"pointer-events-auto",children:b.jsx(vE,{id:r.id,type:r.type,title:r.title,description:r.description})},r.id))})}const yE=[{to:"/",label:"Overview",icon:Yb},{to:"/pipelines",label:"Pipelines",icon:b_},{to:"/auth/keys",label:"Auth Keys",icon:yu}],bE=5,SE=1e3,jp="aegis:update-check:v1",xE=720*60*1e3,CE="Reconnecting to real-time updates. Overview widgets are using fallback polling where available.",Bp="Real-time updates unavailable. Overview widgets are using fallback polling where available.",wE="Connecting real-time updates failed. Retrying now.";function EE(){const i=Fe(A=>A.sseConnected),r=Fe(A=>A.setSseConnected),a=Fe(A=>A.sseError),o=Fe(A=>A.setSseError),v=Fe(A=>A.addActivity),w=Fe(A=>A.token),[k,l]=P.useState(0),[u,f]=P.useState("..."),[y,d]=P.useState(!1),[S,E]=P.useState(null),[O,C]=P.useState(null);function m(A){try{const R=localStorage.getItem(jp);if(!R)return null;const D=JSON.parse(R);return D.sourceVersion!==A||Date.now()-D.checkedAt>xE?null:{currentVersion:D.currentVersion,latestVersion:D.latestVersion,updateAvailable:D.updateAvailable,releaseUrl:D.releaseUrl}}catch{return null}}function g(A,R){try{const D={...R,checkedAt:Date.now(),sourceVersion:A};localStorage.setItem(jp,JSON.stringify(D))}catch{}}async function h(A,R){if(!(!A||A==="..."||A==="unknown")){if(!R){const D=m(A);if(D){C(D),E(null);return}}d(!0),E(null);try{const D=await Uw(A);C(D),g(A,D)}catch(D){E(D instanceof Error?D.message:"Failed to check updates"),C(null)}finally{d(!1)}}}P.useEffect(()=>{let A=!1;return(async()=>{try{const D=await iv();A||(f(D.version),h(D.version,!1))}catch(D){console.warn("Failed to load Aegis version",D),A||f("unknown")}})(),()=>{A=!0}},[]);const _=async()=>{await h(u,!0)};P.useEffect(()=>{let A=!1,R,D=null;function T(M){if(!A)try{R=tE($=>{$.sessionId&&v($)},w,{onOpen:()=>{r(!0),o(null),l(0)},onReconnecting:$=>{r(!1),l($),o(CE)},onClose:()=>{r(!1)},onGiveUp:()=>{l(0),o(Bp),r(!1)}})}catch($){if(console.error("Failed to subscribe to global SSE (attempt %d):",M+1,$),r(!1),M<bE){const Z=SE*Math.pow(2,M);l(M+1),o(wE),D=setTimeout(()=>T(M+1),Z)}else l(0),o(Bp),r(!1)}}return T(0),()=>{A=!0,D&&clearTimeout(D),R==null||R()}},[r,o,v,w]);const x=i?"SSE Live":a?k>0?`SSE Reconnecting (retry ${k})`:"SSE Degraded":"SSE Off";return b.jsxs("div",{className:"flex h-screen overflow-hidden bg-void",children:[b.jsxs("aside",{className:"flex w-56 flex-col border-r border-void-lighter bg-void-light shrink-0",children:[b.jsxs("div",{className:"flex items-center gap-2 px-4 py-5 border-b border-void-lighter",children:[b.jsx(f1,{className:"h-6 w-6 text-blue-500"}),b.jsx("span",{className:"text-lg font-semibold tracking-tight text-gray-100",children:"Aegis"})]}),b.jsxs("nav",{className:"flex flex-col gap-1 px-2 py-4 flex-1",children:[yE.map(({to:A,label:R,icon:D})=>b.jsxs(v_,{to:A,end:A==="/",className:({isActive:T})=>`flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${T?"bg-cyan/10 text-cyan":"text-gray-400 hover:bg-void-lighter hover:text-gray-200"}`,children:[b.jsx(D,{className:"h-4 w-4"}),R]},A)),b.jsx("div",{className:"mt-4 border-t border-void-lighter pt-4 opacity-40",children:b.jsxs("button",{type:"button",disabled:!0,"aria-disabled":"true",title:"Sessions navigation is not available yet",className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left text-sm text-gray-500",children:[b.jsx(v1,{className:"h-4 w-4"}),"Sessions"]})})]})]}),b.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[b.jsxs("header",{className:"flex items-center justify-between border-b border-void-lighter bg-void-light px-6 py-3 shrink-0",children:[b.jsx("h1",{className:"text-sm font-medium text-gray-300",children:"Aegis Dashboard"}),b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-400",children:[b.jsxs("span",{className:"rounded-md border border-void-lighter px-2 py-1 bg-void",children:["Version ",u]}),b.jsxs("button",{type:"button",onClick:_,disabled:y||u==="...",className:"inline-flex items-center gap-1 rounded-md border border-void-lighter px-2 py-1 text-gray-300 hover:bg-void-lighter disabled:opacity-50 disabled:cursor-not-allowed",children:[b.jsx(Lu,{className:`h-3 w-3 ${y?"animate-spin":""}`}),y?"Checking...":"Check updates"]})]}),O&&b.jsx("div",{className:"text-xs text-gray-400",children:O.updateAvailable?b.jsxs("a",{href:O.releaseUrl,target:"_blank",rel:"noreferrer",className:"text-cyan hover:underline",children:["Update available: v",O.latestVersion]}):b.jsxs("span",{children:["Up to date (v",O.currentVersion,")"]})}),S&&b.jsx("div",{className:"text-xs text-amber-500",title:S,children:"Update check failed"}),b.jsx("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",title:a??void 0,children:a?b.jsxs(b.Fragment,{children:[b.jsx(Bu,{className:"h-3 w-3 text-amber-500"}),b.jsx("span",{className:"text-amber-500",children:x})]}):b.jsxs(b.Fragment,{children:[b.jsx("span",{className:`status-dot ${i?"status-dot--idle":""}`,style:i?void 0:{backgroundColor:"#666"}}),x]})})]})]}),b.jsx("main",{className:"flex-1 overflow-auto p-6",children:b.jsx(Uy,{})})]}),b.jsx(gE,{})]})}function kE(i){if(i<0)return"0s";const r=Math.floor(i/3600),a=Math.floor(i%3600/60);return r>0&&a>0?`${r}h ${a}m`:r>0?`${r}h`:a>0?`${a}m`:`${Math.floor(i)}s`}function Zs(i){const r=Date.now()-i;if(r<0)return"just now";const a=Math.floor(r/1e3);if(a<60)return`${a}s ago`;const o=Math.floor(a/60);if(o<60)return`${o}m ago`;const v=Math.floor(o/60);return v<24?`${v}h ago`:`${Math.floor(v/24)}d ago`}function TE(i){if(i<0)return"0s";const r=Math.floor(i/1e3);if(r<60)return`${r}s`;const a=Math.floor(r/60),o=r%60;if(a<60)return`${a}m ${o.toString().padStart(2,"0")}s`;const v=Math.floor(a/60),w=a%60;return`${v}h ${w.toString().padStart(2,"0")}m`}const AE=15e3,RE=6e4;function DE(i){return new Date(i).toLocaleString()}function OE(i){return i.length<=12?"•".repeat(i.length):`${i.slice(0,8)}${"•".repeat(Math.max(8,i.length-12))}${i.slice(-4)}`}function NE(){const[i,r]=P.useState([]),[a,o]=P.useState(!0),[v,w]=P.useState(null),[k,l]=P.useState(""),[u,f]=P.useState(!1),[y,d]=P.useState(!1),[S,E]=P.useState(null),[O,C]=P.useState(null),[m,g]=P.useState(!1),h=$i(D=>D.addToast),_=P.useCallback(async(D=!1)=>{D?d(!0):o(!0);try{const T=await hE();r(T.slice().sort((M,$)=>$.createdAt-M.createdAt)),w(null)}catch(T){const M=T instanceof Error?T.message:"Failed to load auth keys";w(M),h("error","Failed to load auth keys",M)}finally{D?d(!1):o(!1)}},[h]);P.useEffect(()=>{_();const D=setInterval(()=>{_(!0)},AE);return()=>clearInterval(D)},[_]),P.useEffect(()=>{if(!O)return;const D=setTimeout(()=>{C(null),g(!1)},RE);return()=>clearTimeout(D)},[O]);async function x(D){D.preventDefault();const T=k.trim();if(T){f(!0);try{const M=await uE(T);C(M),g(!1),l(""),h("success","Auth key created","Store the secret now. It is only shown once."),await _(!0)}catch(M){h("error","Failed to create auth key",M instanceof Error?M.message:void 0)}finally{f(!1)}}}async function A(){var D;if(O)try{if(!((D=navigator.clipboard)!=null&&D.writeText))throw new Error("Clipboard access is unavailable in this browser");await navigator.clipboard.writeText(O.key),h("success","Auth key copied")}catch(T){h("warning","Failed to copy auth key",T instanceof Error?T.message:void 0)}}async function R(D,T){if(window.confirm(`Revoke auth key "${T}"? This cannot be undone.`)){E(D);try{await dE(D),r(M=>M.filter($=>$.id!==D)),(O==null?void 0:O.id)===D&&(C(null),g(!1)),h("success","Auth key revoked")}catch(M){h("error","Failed to revoke auth key",M instanceof Error?M.message:void 0)}finally{E(null)}}}return b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Auth Keys"}),b.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Create, review, and revoke dashboard API keys without exposing stored secrets."})]}),b.jsxs("button",{type:"button",onClick:()=>void _(!0),disabled:y,className:"flex min-h-[44px] items-center justify-center gap-2 rounded border border-[#1a1a2e] bg-[#111118] px-3 py-2 text-xs font-medium text-gray-300 transition-colors hover:border-[#00e5ff]/30 hover:text-[#00e5ff] disabled:cursor-not-allowed disabled:opacity-60",children:[b.jsx(Lu,{className:`h-3.5 w-3.5 ${y?"animate-spin":""}`}),"Refresh"]})]}),b.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,360px)_minmax(0,1fr)]",children:[b.jsxs("section",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-5",children:[b.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-gray-100",children:[b.jsx(Vn,{className:"h-4 w-4 text-[#00e5ff]"}),"Create Key"]}),b.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"New secrets are never persisted in the dashboard and are cleared from view after one minute."}),b.jsxs("form",{className:"mt-4 space-y-4",onSubmit:x,children:[b.jsxs("div",{children:[b.jsx("label",{className:"mb-1.5 block text-xs font-medium text-gray-400",htmlFor:"auth-key-name",children:"Key Name"}),b.jsx("input",{id:"auth-key-name",type:"text",value:k,onChange:D=>l(D.target.value),placeholder:"ops-primary",className:"min-h-[44px] w-full rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2.5 text-sm text-gray-200 placeholder-gray-600 focus:border-[#00e5ff] focus:outline-none"})]}),b.jsxs("button",{type:"submit",disabled:u||!k.trim(),className:"flex min-h-[44px] w-full items-center justify-center gap-2 rounded border border-[#00e5ff]/30 bg-[#00e5ff]/10 px-3 py-2 text-sm font-medium text-[#00e5ff] transition-colors hover:bg-[#00e5ff]/20 disabled:cursor-not-allowed disabled:opacity-60",children:[b.jsx(yu,{className:"h-4 w-4"}),u?"Creating…":"Create Auth Key"]})]}),O?b.jsxs("div",{className:"mt-5 rounded-lg border border-emerald-500/20 bg-emerald-500/5 p-4",role:"status",children:[b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsxs("div",{children:[b.jsx("h3",{className:"text-sm font-semibold text-emerald-300",children:"Store this key now"}),b.jsx("p",{className:"mt-1 text-xs text-emerald-200/80",children:"This secret is shown once and is hidden by default."})]}),b.jsx("button",{type:"button",onClick:()=>{C(null),g(!1)},className:"text-xs font-medium text-emerald-200/80 transition-colors hover:text-emerald-200",children:"Dismiss"})]}),b.jsxs("dl",{className:"mt-4 space-y-3 text-sm text-gray-200",children:[b.jsxs("div",{children:[b.jsx("dt",{className:"text-xs uppercase tracking-wide text-gray-500",children:"Name"}),b.jsx("dd",{className:"mt-1 font-medium text-gray-100",children:O.name})]}),b.jsxs("div",{children:[b.jsx("dt",{className:"text-xs uppercase tracking-wide text-gray-500",children:"Secret"}),b.jsx("dd",{className:"mt-1 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 font-mono text-xs text-[#9af5ff]",children:m?O.key:OE(O.key)})]})]}),b.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[b.jsxs("button",{type:"button",onClick:()=>g(D=>!D),className:"flex min-h-[40px] items-center gap-2 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs font-medium text-gray-300 transition-colors hover:border-[#00e5ff]/30 hover:text-[#00e5ff]",children:[m?b.jsx(Pb,{className:"h-3.5 w-3.5"}):b.jsx(Fb,{className:"h-3.5 w-3.5"}),m?"Hide secret":"Reveal secret"]}),b.jsxs("button",{type:"button",onClick:()=>void A(),className:"flex min-h-[40px] items-center gap-2 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs font-medium text-gray-300 transition-colors hover:border-[#00e5ff]/30 hover:text-[#00e5ff]",children:[b.jsx(zb,{className:"h-3.5 w-3.5"}),"Copy secret"]})]})]}):null]}),b.jsxs("section",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-5",children:[b.jsx("div",{className:"flex items-center justify-between gap-3 border-b border-[#1a1a2e] pb-4",children:b.jsxs("div",{children:[b.jsx("h3",{className:"text-sm font-semibold text-gray-100",children:"Existing Keys"}),b.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[i.length," key",i.length===1?"":"s"," configured"]})]})}),a?b.jsx("div",{className:"flex min-h-[240px] items-center justify-center text-sm text-gray-500",children:b.jsx("div",{className:"animate-pulse",children:"Loading auth keys…"})}):v?b.jsxs("div",{className:"mt-4 rounded-lg border border-amber-500/20 bg-amber-500/5 p-4 text-sm text-amber-200",children:[b.jsx("p",{className:"font-medium",children:"Unable to load auth keys"}),b.jsx("p",{className:"mt-1 text-amber-200/80",children:v}),b.jsx("button",{type:"button",onClick:()=>void _(),className:"mt-4 rounded border border-amber-500/30 px-3 py-2 text-xs font-medium text-amber-200 transition-colors hover:bg-amber-500/10",children:"Retry"})]}):i.length===0?b.jsxs("div",{className:"flex min-h-[240px] flex-col items-center justify-center rounded-lg border border-dashed border-[#1a1a2e] bg-[#0a0a0f] px-6 text-center",children:[b.jsx(yu,{className:"h-8 w-8 text-gray-600"}),b.jsx("p",{className:"mt-4 text-sm font-medium text-gray-300",children:"No auth keys yet"}),b.jsx("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:"Create a key to grant API access without sharing the dashboard bearer token."})]}):b.jsx("div",{className:"mt-4 space-y-3",children:i.map(D=>b.jsx("article",{className:"rounded-lg border border-[#1a1a2e] bg-[#0a0a0f] p-4",children:b.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[b.jsxs("div",{className:"min-w-0",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("span",{className:"truncate font-medium text-gray-100",children:D.name}),b.jsx("span",{className:"rounded-full border border-[#1a1a2e] bg-[#111118] px-2 py-0.5 font-mono text-[11px] text-gray-500",children:D.id})]}),b.jsxs("p",{className:"mt-2 text-sm text-gray-400",children:["Created ",b.jsx("span",{title:DE(D.createdAt),children:Zs(D.createdAt)})]})]}),b.jsxs("button",{type:"button",onClick:()=>void R(D.id,D.name),disabled:S===D.id,className:"flex min-h-[40px] items-center justify-center gap-2 rounded border border-red-500/20 bg-red-500/5 px-3 py-2 text-xs font-medium text-red-300 transition-colors hover:bg-red-500/10 disabled:cursor-not-allowed disabled:opacity-60",children:[b.jsx(ju,{className:"h-3.5 w-3.5"}),S===D.id?"Revoking…":"Revoke"]})]})},D.id))})]})]})]})}const ME=1e3;function ov({refresh:i,sseConnected:r,eventTrigger:a,fallbackPollIntervalMs:o,healthyPollIntervalMs:v,eventDebounceMs:w=ME}){const k=P.useRef(!1),l=P.useRef(!1),u=P.useRef(!1),f=P.useRef(null),y=P.useRef(null),d=P.useRef(a),S=P.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null),y.current&&(clearTimeout(y.current),y.current=null)},[]),E=P.useCallback(async()=>{if(!k.current){if(l.current){u.current=!0;return}l.current=!0;try{await i()}finally{l.current=!1,u.current&&!k.current&&(u.current=!1,E())}}},[i]);P.useEffect(()=>(k.current=!1,()=>{k.current=!0,S()}),[S]),P.useEffect(()=>{let O=!1;const C=async()=>{await E(),!(O||k.current)&&(f.current=setTimeout(()=>{C()},r?v:o))};return C(),()=>{O=!0,f.current&&(clearTimeout(f.current),f.current=null)}},[o,v,E,r]),P.useEffect(()=>{if(!r){d.current=a,y.current&&(clearTimeout(y.current),y.current=null);return}typeof a>"u"||Object.is(a,d.current)||(d.current=a,!y.current&&(y.current=setTimeout(()=>{y.current=null,E()},w)))},[w,a,E,r])}const LE={blue:"text-[#3b82f6]",green:"text-[#22c55e]",amber:"text-[#f59e0b]",red:"text-[#ef4444]",purple:"text-[#a78bfa]"},jE={blue:"bg-[#3b82f6]",green:"bg-[#22c55e]",amber:"bg-[#f59e0b]",red:"bg-[#ef4444]",purple:"bg-[#a78bfa]"};function ut({label:i,value:r,icon:a,suffix:o,subLabel:v,color:w="blue",bar:k}){return b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[b.jsxs("div",{className:"mb-2 flex items-center gap-2 text-sm text-[#888]",children:[a,i]}),b.jsxs("div",{className:`font-mono text-2xl ${LE[w]}`,children:[r,o&&b.jsx("span",{className:"ml-1 text-base text-[#666]",children:o})]}),k!==void 0&&b.jsx("div",{className:"mt-2 h-1.5 w-full overflow-hidden rounded-full bg-[#1e1e2a]",children:b.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${jE[w]}`,style:{width:`${Math.min(100,Math.max(0,k))}%`}})}),v&&b.jsx("div",{className:"mt-1.5 text-xs text-[#666]",children:v})]})}const BE={polling:"Polling fallback",paused:"Live updates paused"};function qu({mode:i,message:r}){return b.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-[11px] font-medium text-amber-300",title:r,children:BE[i]})}function zp(i,r){return r instanceof Error&&r.message?`${i}: ${r.message}`:i}const zE=1e4,HE=3e4;function UE(){var I,L,H;const i=Fe(q=>q.metrics),r=Fe(q=>q.activities[0]??null),a=Fe(q=>q.sseError),o=Fe(q=>q.setMetrics),v=Fe(q=>q.sseConnected),[w,k]=P.useState(null),[l,u]=P.useState(!0),[f,y]=P.useState(null),d=P.useCallback(async()=>{const[q,W]=await Promise.allSettled([Iw(),iv()]);q.status==="fulfilled"&&o(q.value),W.status==="fulfilled"&&k(W.value),q.status==="rejected"&&W.status==="rejected"?y(zp("Unable to load overview metrics",q.reason)):q.status==="rejected"?y(zp("Detailed metrics unavailable. Showing health-based totals",q.reason)):y(null),u(!1)},[o]);if(ov({refresh:d,sseConnected:v,eventTrigger:r,fallbackPollIntervalMs:zE,healthyPollIntervalMs:HE}),l&&!i&&!w)return b.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-6 text-sm text-gray-400",children:"Loading overview metrics..."});if(f&&!i&&!w)return b.jsx("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 p-6 text-sm text-amber-200",children:f});const S=i,E=(S==null?void 0:S.sessions.currently_active)??(w==null?void 0:w.sessions.active)??0,O=(S==null?void 0:S.sessions.total_created)??(w==null?void 0:w.sessions.total)??0,C=(S==null?void 0:S.sessions.completed)??0,m=(S==null?void 0:S.sessions.failed)??0,h=(S==null?void 0:S.prompt_delivery.success_rate)??null,_=(S==null?void 0:S.prompt_delivery.delivered)??0,x=(S==null?void 0:S.prompt_delivery.failed)??0,A=(S==null?void 0:S.prompt_delivery.sent)??0,R=(w==null?void 0:w.uptime)??(S==null?void 0:S.uptime)??0,D=((I=S==null?void 0:S.latency)==null?void 0:I.hook_latency_ms.avg)??null,T=((L=S==null?void 0:S.latency)==null?void 0:L.permission_response_ms.avg)??null,M=((H=S==null?void 0:S.latency)==null?void 0:H.channel_delivery_ms.avg)??null,$=(S==null?void 0:S.webhooks_sent)??0,Z=(S==null?void 0:S.webhooks_failed)??0,K=(S==null?void 0:S.auto_approvals)??0,F=(S==null?void 0:S.pipelines_created)??0,X=(S==null?void 0:S.batches_created)??0,ee=(S==null?void 0:S.screenshots_taken)??0,V=(S==null?void 0:S.sessions.avg_messages_per_session)??0,Q=q=>q===null?"—":`${Math.round(q)} ms`,ae=h===null?"blue":h>=99?"green":h>=90?"amber":"red",j=!!f||!!(!v&&a);return b.jsxs("div",{className:"space-y-3",children:[j&&b.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-void-lighter bg-[#111118] px-4 py-3",children:[b.jsx("div",{className:"text-xs text-gray-400",children:f??"Overview widgets are using the latest available data."}),!v&&a&&b.jsx(qu,{mode:"polling",message:a})]}),b.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-4",children:[b.jsx(ut,{label:"Active Sessions",value:E,icon:b.jsx(b_,{className:"h-4 w-4"})}),b.jsx(ut,{label:"Total Created",value:O,icon:b.jsx(ap,{className:"h-4 w-4"}),subLabel:O>0?`${V} avg msgs/session`:void 0}),C>0&&b.jsx(ut,{label:"Completed",value:C,icon:b.jsx(Mu,{className:"h-4 w-4"}),color:"green"}),m>0&&b.jsx(ut,{label:"Failed",value:m,icon:b.jsx(Bu,{className:"h-4 w-4"}),color:"red"}),b.jsx(ut,{label:"Delivery Rate",value:h!==null?h.toFixed(1):"—",suffix:"%",icon:b.jsx(k1,{className:"h-4 w-4"}),color:ae,bar:h??void 0}),_>0&&b.jsx(ut,{label:"Prompts Delivered",value:_,subLabel:A>0?`${A} sent total`:void 0,icon:b.jsx(bu,{className:"h-4 w-4"}),color:"green"}),x>0&&b.jsx(ut,{label:"Prompts Failed",value:x,icon:b.jsx(Br,{className:"h-4 w-4"}),color:"red"}),$>0&&b.jsx(ut,{label:"Webhooks Sent",value:$,icon:b.jsx(bu,{className:"h-4 w-4"}),color:"green",subLabel:Z>0?`${Z} failed`:"0 failed"}),Z>0&&$===0&&b.jsx(ut,{label:"Webhooks Failed",value:Z,icon:b.jsx(Br,{className:"h-4 w-4"}),color:"red"}),K>0&&b.jsx(ut,{label:"Auto-Approvals",value:K,icon:b.jsx(h1,{className:"h-4 w-4"}),color:"purple"}),F>0&&b.jsx(ut,{label:"Pipelines Created",value:F,icon:b.jsx(qb,{className:"h-4 w-4"}),color:"purple"}),X>0&&b.jsx(ut,{label:"Batches Created",value:X,icon:b.jsx(ap,{className:"h-4 w-4"}),color:"purple"}),ee>0&&b.jsx(ut,{label:"Screenshots",value:ee,icon:b.jsx(x_,{className:"h-4 w-4"})}),b.jsx(ut,{label:"Avg Hook Latency",value:Q(D),icon:b.jsx(mo,{className:"h-4 w-4"})}),b.jsx(ut,{label:"Avg Permission Latency",value:Q(T),icon:b.jsx(mo,{className:"h-4 w-4"})}),b.jsx(ut,{label:"Avg Channel Latency",value:Q(M),icon:b.jsx(mo,{className:"h-4 w-4"})}),b.jsx(ut,{label:"Uptime",value:kE(R),icon:b.jsx(mo,{className:"h-4 w-4"})})]})]})}const Hp={idle:"#10b981",working:"#3b82f6",permission_prompt:"#f59e0b",bash_approval:"#f59e0b",plan_mode:"#ff8800",ask_question:"#ef4444",settings:"#3b82f6",error:"#ff0000",compacting:"#f59e0b",context_warning:"#f59e0b",waiting_for_input:"#f59e0b",unknown:"#666666"},IE=new Set(["working","permission_prompt","bash_approval","ask_question"]),Up={idle:"Idle",working:"Working",permission_prompt:"Permission prompt",bash_approval:"Bash approval",plan_mode:"Plan mode",ask_question:"Awaiting question",settings:"Settings",error:"Error",compacting:"Compacting",context_warning:"Context warning",waiting_for_input:"Waiting for input",unknown:"Unknown"};function Po({status:i}){const r=Hp[i]??Hp.unknown,a=IE.has(i),o=Up[i]??Up.unknown;return b.jsx("span",{role:"img","aria-label":`Status: ${o}`,title:o,style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:r,boxShadow:`0 0 6px ${r}66`,animation:a?"pulse 1.5s ease-in-out infinite":void 0}})}const PE=5e3,$E=3e4,Ip=20,Pp=100,FE={all:0,idle:0,working:0,compacting:0,context_warning:0,waiting_for_input:0,permission_prompt:0,plan_mode:0,ask_question:0,bash_approval:0,settings:0,error:0,unknown:0},$p=["all","idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"],lv=i=>i.status==="permission_prompt"||i.status==="bash_approval",cv=(i,r=40)=>i.length>r?`…${i.slice(i.length-r+1)}`:i;function Fp(i){return i==="all"?"All":i.split("_").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function ZE(i,r){return r?`${i.windowName} ${i.id} ${i.workDir}`.toLowerCase().includes(r):!0}function qE(i,r){return i.id===r.id&&i.windowName===r.windowName&&i.workDir===r.workDir&&i.status===r.status&&i.createdAt===r.createdAt&&i.lastActivity===r.lastActivity&&i.permissionMode===r.permissionMode}function uv(i,r){return qE(i.session,r.session)&&i.isAlive===r.isAlive&&i.selected===r.selected&&i.currentAction===r.currentAction}const KE=P.memo(function({session:r,isAlive:a,selected:o,currentAction:v,onToggleSelect:w,onApprove:k,onInterrupt:l,onKill:u}){return b.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors active:bg-[#1a1a2e]/50",children:[b.jsxs("div",{className:"mb-2 flex items-start justify-between gap-3",children:[b.jsxs("label",{className:"flex min-w-0 flex-1 items-center gap-3 text-sm text-gray-200",children:[b.jsx("input",{type:"checkbox","aria-label":`Select session ${r.windowName||r.id}`,checked:o,onChange:f=>w(r.id,f.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"}),b.jsxs("div",{className:"min-w-0",children:[b.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[b.jsx(Po,{status:r.status}),b.jsx(di,{to:`/sessions/${encodeURIComponent(r.id)}`,className:"truncate font-medium text-gray-200 transition-colors hover:text-cyan",children:r.windowName||r.id}),!a&&b.jsx(Br,{className:"h-3.5 w-3.5 shrink-0 text-red-400"})]}),b.jsx("div",{className:"mt-1 truncate font-mono text-xs text-gray-500",children:cv(r.workDir,50)})]})]}),b.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[lv(r)&&b.jsx("button",{onClick:f=>k(f,r.id),disabled:v==="approve",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-green-900/30 p-2 text-green-400 transition-colors hover:bg-green-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Approve",children:b.jsx(C_,{className:"h-4 w-4"})}),b.jsx("button",{onClick:f=>l(f,r.id),disabled:v==="interrupt"||v==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-yellow-900/30 p-2 text-yellow-400 transition-colors hover:bg-yellow-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Interrupt",children:b.jsx(S_,{className:"h-4 w-4"})}),b.jsx("button",{onClick:f=>u(f,r.id),disabled:v==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-red-900/30 p-2 text-red-400 transition-colors hover:bg-red-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Kill",children:b.jsx(Br,{className:"h-4 w-4"})})]})]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-gray-500",children:[b.jsxs("span",{children:["Age: ",Zs(r.createdAt)]}),b.jsxs("span",{children:["Active: ",Zs(r.lastActivity)]}),r.permissionMode&&r.permissionMode!=="default"?b.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-900/30 px-2 py-0.5 text-green-400",children:[b.jsx(Mu,{className:"h-3 w-3"})," ",r.permissionMode]}):b.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-void-lighter px-2 py-0.5 text-gray-500",children:"default"})]})]})},uv),VE=P.memo(function({session:r,isAlive:a,selected:o,currentAction:v,onToggleSelect:w,onApprove:k,onInterrupt:l,onKill:u}){return b.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[b.jsx("td",{className:"px-4 py-3",children:b.jsx("input",{type:"checkbox","aria-label":`Select session ${r.windowName||r.id}`,checked:o,onChange:f=>w(r.id,f.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"})}),b.jsx("td",{className:"px-4 py-3",children:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(Po,{status:r.status}),!a&&b.jsx(Br,{className:"h-3.5 w-3.5 text-red-400"})]})}),b.jsx("td",{className:"px-4 py-3",children:b.jsx(di,{to:`/sessions/${encodeURIComponent(r.id)}`,className:"font-medium text-gray-200 transition-colors hover:text-cyan",children:r.windowName||r.id})}),b.jsx("td",{className:"max-w-[200px] truncate px-4 py-3 font-mono text-xs text-gray-400",title:r.workDir,children:cv(r.workDir)}),b.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:Zs(r.createdAt)}),b.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:Zs(r.lastActivity)}),b.jsx("td",{className:"px-4 py-3",children:r.permissionMode&&r.permissionMode!=="default"?b.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-900/30 px-2 py-0.5 text-xs text-green-400",children:[b.jsx(Mu,{className:"h-3 w-3"}),r.permissionMode]}):b.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-void-lighter px-2 py-0.5 text-xs text-gray-500",children:"default"})}),b.jsx("td",{className:"px-4 py-3",children:b.jsxs("div",{className:"flex items-center gap-1.5",children:[lv(r)&&b.jsx("button",{onClick:f=>k(f,r.id),disabled:v==="approve",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-green-900/30 text-xs font-medium text-green-400 transition-colors hover:bg-green-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Approve",children:b.jsx(C_,{className:"h-3 w-3"})}),b.jsx("button",{onClick:f=>l(f,r.id),disabled:v==="interrupt"||v==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-yellow-900/30 text-xs font-medium text-yellow-400 transition-colors hover:bg-yellow-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Interrupt",children:b.jsx(S_,{className:"h-3 w-3"})}),b.jsx("button",{onClick:f=>u(f,r.id),disabled:v==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-red-900/30 text-xs font-medium text-red-400 transition-colors hover:bg-red-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Kill",children:b.jsx(Br,{className:"h-3 w-3"})})]})})]})},uv);function GE(){const i=Fe(U=>U.sessions),r=Fe(U=>U.healthMap),a=Fe(U=>U.sseConnected),o=Fe(U=>U.activities[0]??null),v=Fe(U=>U.sseError),w=Fe(U=>U.setSessionsAndHealth),k=$i(U=>U.addToast),[l,u]=P.useState({}),[f,y]=P.useState([]),[d,S]=P.useState(null),[E,O]=P.useState("all"),[C,m]=P.useState(FE),[g,h]=P.useState(""),_=P.useDeferredValue(g.trim().toLowerCase()),[x,A]=P.useState({page:1,limit:Ip,total:0,totalPages:0}),[R,D]=P.useState(1),[T,M]=P.useState(!0),[$,Z]=P.useState(!1),[K,F]=P.useState(null),X=P.useCallback(async()=>{M(!0);try{const U=_.length>0,B=Pw({page:U?1:R,limit:U?Pp:Ip,status:E==="all"?void 0:E}),[ie,ne]=await Promise.all([B,$w()]),me=U?ie.sessions.filter(Ee=>ZE(Ee,_)):ie.sessions;let pe={};try{const Ee=await qw(),je=new Set(me.map(Be=>Be.id));for(const[Be,st]of Object.entries(Ee))je.has(Be)&&(pe[Be]={alive:st.alive,loading:!1})}catch{}w(me,pe),m(ne),Z(U&&ie.pagination.total>ie.sessions.length),F(null),A(U?{page:1,limit:me.length,total:me.length,totalPages:me.length>0?1:0}:ie.pagination)}catch(U){F(U instanceof Error&&U.message?`Unable to load sessions: ${U.message}`:"Unable to load sessions.")}finally{M(!1)}},[_,R,w,E]);ov({refresh:X,sseConnected:a,eventTrigger:o,fallbackPollIntervalMs:PE,healthyPollIntervalMs:$E}),P.useEffect(()=>{const U=new Set(i.map(B=>B.id));y(B=>B.filter(ie=>U.has(ie)))},[i]);const ee=P.useCallback(async(U,B,ie)=>{u(ne=>({...ne,[U]:B}));try{await ie()}finally{u(ne=>({...ne,[U]:null}))}},[]),V=P.useCallback(async(U,B)=>{U.preventDefault(),await ee(B,"approve",async()=>{try{await rv(B),await X()}catch(ie){k("error","Approve failed",ie instanceof Error?ie.message:void 0)}})},[k,X,ee]),Q=P.useCallback(async(U,B)=>{U.preventDefault(),await ee(B,"interrupt",async()=>{try{await Eu(B),await X()}catch(ie){k("error","Interrupt failed",ie instanceof Error?ie.message:void 0)}})},[k,X,ee]),ae=P.useCallback(async(U,B)=>{U.preventDefault(),confirm("Kill this session?")&&await ee(B,"kill",async()=>{try{await wu(B),await X()}catch(ie){k("error","Failed to kill session",ie instanceof Error?ie.message:void 0)}})},[k,X,ee]),j=P.useCallback((U,B)=>{y(ie=>B?ie.includes(U)?ie:[...ie,U]:ie.filter(ne=>ne!==U))},[]),I=P.useCallback(U=>{if(!U){y([]);return}y(i.map(B=>B.id))},[i]),L=P.useCallback(async U=>{if(f.length!==0&&!(U==="kill"&&!confirm(`Kill ${f.length} selected session${f.length===1?"":"s"}?`))){S(U),u(B=>{const ie={...B};for(const ne of f)ie[ne]=U;return ie});try{const B=await Promise.allSettled(f.map(me=>U==="interrupt"?Eu(me):wu(me))),ie=B.filter(me=>me.status==="fulfilled").length,ne=B.length-ie;ie>0&&k("success",U==="interrupt"?"Bulk interrupt complete":"Bulk kill complete",`${ie} session${ie===1?"":"s"} updated.`),ne>0&&k("warning",`Some sessions failed to ${U}`,`${ne} session${ne===1?"":"s"} could not be updated.`),y([]),await X()}finally{S(null),u(B=>{const ie={...B};for(const ne of f)ie[ne]=null;return ie})}}},[k,X,f]),H=P.useMemo(()=>new Set(f),[f]),q=P.useMemo(()=>i.map(U=>{const B=r[U.id];return{session:U,isAlive:B?B.alive:!0,selected:H.has(U.id),currentAction:l[U.id]??null}}),[l,r,H,i]),W=i.length>0&&i.every(U=>H.has(U.id)),le=E!=="all"||_.length>0;if(T&&i.length===0&&!K)return b.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:b.jsx("p",{className:"text-gray-500",children:"Loading sessions..."})});if(K&&i.length===0)return b.jsx("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 p-6",children:b.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[b.jsx("p",{className:"text-sm text-amber-200",children:K}),b.jsx("button",{type:"button",onClick:()=>{M(!0),F(null),X()},className:"rounded-md border border-amber-400/40 px-3 py-2 text-sm text-amber-100 transition-colors hover:border-amber-300 hover:text-white",children:"Retry"})]})});const fe=!!K||!!(!a&&v);return b.jsxs("div",{className:"space-y-4",children:[b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[b.jsxs("div",{className:"flex flex-col gap-4 xl:flex-row xl:items-start xl:justify-between",children:[b.jsxs("div",{className:"flex-1 space-y-3",children:[b.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center",children:[b.jsxs("label",{className:"flex min-w-0 flex-1 items-center gap-2 rounded-md border border-void-lighter bg-void px-3 py-2 text-sm text-gray-300 focus-within:border-cyan",children:[b.jsx(o1,{className:"h-4 w-4 text-gray-500"}),b.jsx("input",{value:g,onChange:U=>{h(U.target.value),D(1)},placeholder:"Search by session name or work directory",className:"w-full bg-transparent text-sm text-gray-100 outline-none placeholder:text-gray-500","aria-label":"Search sessions"})]}),b.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-400",children:[b.jsx("span",{children:"Status"}),b.jsx("select",{value:E,onChange:U=>{O(U.target.value),D(1)},"aria-label":"Filter by status",className:"rounded-md border border-void-lighter bg-void px-3 py-2 text-sm text-gray-100 outline-none focus:border-cyan",children:$p.map(U=>b.jsxs("option",{value:U,children:[Fp(U)," (",C[U]??0,")"]},U))})]})]}),b.jsx("div",{className:"flex flex-wrap gap-2",children:$p.filter(U=>U==="all"||(C[U]??0)>0).map(U=>{const B=E===U;return b.jsxs("button",{type:"button",onClick:()=>{O(U),D(1)},className:`rounded-full border px-3 py-1 text-xs transition-colors ${B?"border-cyan bg-cyan/10 text-cyan":"border-void-lighter bg-void text-gray-400 hover:border-cyan/40 hover:text-gray-200"}`,children:[Fp(U)," ",b.jsx("span",{className:"text-gray-500",children:C[U]??0})]},U)})})]}),b.jsxs("div",{className:"text-right text-xs text-gray-500",children:[b.jsxs("div",{children:["Showing ",b.jsx("span",{className:"text-gray-300",children:i.length}),_.length>0?` matching session${i.length===1?"":"s"}`:` of ${x.total} session${x.total===1?"":"s"}`]}),$&&b.jsxs("div",{className:"mt-1 text-amber-400",children:["Search scans the first ",Pp," sessions in the selected status."]})]})]}),fe&&b.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-2 rounded-md border border-void-lighter bg-void px-3 py-2",children:[b.jsx("div",{className:"text-xs text-gray-400",children:K??"Session data is using polling fallback while real-time updates recover."}),!a&&v&&b.jsx(qu,{mode:"polling",message:v})]}),f.length>0&&b.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-md border border-cyan/20 bg-cyan/5 p-3 lg:flex-row lg:items-center lg:justify-between",children:[b.jsxs("div",{className:"text-sm text-gray-300",children:[f.length," session",f.length===1?"":"s"," selected"]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b.jsx("button",{type:"button",onClick:()=>L("interrupt"),disabled:d!==null,className:"rounded-md bg-yellow-900/30 px-3 py-2 text-sm font-medium text-yellow-300 transition-colors hover:bg-yellow-900/50 disabled:pointer-events-none disabled:opacity-40",children:"Interrupt Selected"}),b.jsx("button",{type:"button",onClick:()=>L("kill"),disabled:d!==null,className:"rounded-md bg-red-900/30 px-3 py-2 text-sm font-medium text-red-300 transition-colors hover:bg-red-900/50 disabled:pointer-events-none disabled:opacity-40",children:"Kill Selected"}),b.jsx("button",{type:"button",onClick:()=>y([]),disabled:d!==null,className:"rounded-md border border-void-lighter px-3 py-2 text-sm text-gray-400 transition-colors hover:border-gray-500 hover:text-gray-200 disabled:pointer-events-none disabled:opacity-40",children:"Clear"})]})]})]}),i.length===0?b.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:b.jsx("p",{className:"text-gray-400",children:le?"No sessions match the current filter.":"No active sessions"})}):b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"space-y-3 md:hidden",children:[b.jsxs("div",{className:"flex items-center justify-between rounded-md border border-void-lighter bg-[#111118] px-4 py-3 text-sm text-gray-400",children:[b.jsxs("label",{className:"flex items-center gap-2",children:[b.jsx("input",{type:"checkbox","aria-label":"Select all visible sessions",checked:W,onChange:U=>I(U.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"}),"Select visible"]}),b.jsxs("span",{children:[i.length," visible"]})]}),q.map(U=>b.jsx(KE,{session:U.session,isAlive:U.isAlive,selected:U.selected,currentAction:U.currentAction,onToggleSelect:j,onApprove:V,onInterrupt:Q,onKill:ae},U.session.id))]}),b.jsx("div",{className:"hidden overflow-x-auto rounded-lg border border-void-lighter bg-[#111118] md:block",children:b.jsxs("table",{className:"w-full text-left text-sm",children:[b.jsx("thead",{children:b.jsxs("tr",{className:"border-b border-void-lighter text-[#666]",children:[b.jsx("th",{className:"px-4 py-3 font-medium",children:b.jsx("input",{type:"checkbox","aria-label":"Select all visible sessions",checked:W,onChange:U=>I(U.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"})}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"WorkDir"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Age"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Last Activity"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Permission"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Actions"})]})}),b.jsx("tbody",{children:q.map(U=>b.jsx(VE,{session:U.session,isAlive:U.isAlive,selected:U.selected,currentAction:U.currentAction,onToggleSelect:j,onApprove:V,onInterrupt:Q,onKill:ae},U.session.id))})]})}),_.length===0&&x.totalPages>1&&b.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-void-lighter bg-[#111118] px-4 py-3 text-sm text-gray-400",children:[b.jsxs("span",{children:["Page ",x.page," of ",x.totalPages]}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsxs("button",{type:"button",onClick:()=>D(U=>Math.max(1,U-1)),disabled:x.page<=1,className:"flex items-center gap-1 rounded-md border border-void-lighter px-3 py-2 transition-colors hover:border-gray-500 hover:text-gray-200 disabled:pointer-events-none disabled:opacity-40",children:[b.jsx(Ab,{className:"h-4 w-4"})," Previous"]}),b.jsxs("button",{type:"button",onClick:()=>D(U=>Math.min(x.totalPages,U+1)),disabled:x.page>=x.totalPages,className:"flex items-center gap-1 rounded-md border border-void-lighter px-3 py-2 transition-colors hover:border-gray-500 hover:text-gray-200 disabled:pointer-events-none disabled:opacity-40",children:["Next ",b.jsx(Db,{className:"h-4 w-4"})]})]})]})]})]})}const hu={session_status_change:{icon:Lu,label:"Status",color:"#3b82f6"},session_message:{icon:Jb,label:"Message",color:"#10b981"},session_approval:{icon:op,label:"Approval",color:"#f59e0b"},session_ended:{icon:r1,label:"Ended",color:"#ef4444"},session_created:{icon:Mb,label:"Created",color:"#6366f1"},session_stall:{icon:Bu,label:"Stall",color:"#d97706"},session_dead:{icon:p1,label:"Dead",color:"#dc2626"},session_subagent_start:{icon:C1,label:"Subagent",color:"#3b82f6"},session_subagent_stop:{icon:S1,label:"Subagent Done",color:"#10b981"},session_verification:{icon:op,label:"Verification",color:"#0891b2"}};function ps(i,r="unknown"){return typeof i!="string"?r:Fn(i)||r}function Fn(i){return i.replace(/\r\n?/g," ").replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F]/g,"").replace(/\uFFFD+/g,"").replace(/\s+/g," ").trim()}function du(i){return Fn(JSON.stringify(i??""))}function YE(i){const r=i.data;switch(i.event){case"session_status_change":{const a=ps(r.status),o=typeof r.detail=="string"?`: ${r.detail}`:"";return`Status -> ${a}${o}`}case"session_message":{const a=r.role==="user"?"User":r.role==="assistant"?"Claude":"System",o=typeof r.text=="string"?Fn(r.text):du(r.text);return`${a}: ${Zp(o,80)}`}case"session_approval":{const a=typeof r.prompt=="string"?Fn(r.prompt):du(r.prompt);return`Approval needed: ${Zp(a,80)}`}case"session_ended":return`Session ended: ${ps(r.reason)}`;case"session_created":return`Created in ${ps(r.workDir,"unknown dir")}`;case"session_stall":return`Session stalled: ${ps(r.stallType)}`;case"session_dead":return`Session dead: ${ps(r.stallType)}`;case"session_subagent_start":return`Subagent started: ${ps(r.name)}`;case"session_subagent_stop":return`Subagent finished: ${ps(r.name)}`;case"session_verification":return`Verification: ${ps(r.summary??r.status,"completed")}`;default:return du(r)}}function Zp(i,r){const a=Fn(i);return a.length>r?a.slice(0,r)+"...":a}function WE(i){try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function XE(){const i=Fe(d=>d.activities),r=Fe(d=>d.sseConnected),a=Fe(d=>d.sseError),o=Fe(d=>d.activityFilterSession),v=Fe(d=>d.activityFilterType),w=Fe(d=>d.setActivityFilterSession),k=Fe(d=>d.setActivityFilterType),l=Fe(d=>d.sessions),u=P.useMemo(()=>i.filter(d=>!(o&&d.sessionId!==o||v&&d.event!==v)),[i,o,v]),f=P.useMemo(()=>{const d=new Map;for(const S of l)d.set(S.id,S.windowName??S.id.slice(0,8));return d},[l]),y=d=>f.get(d)??(d??"unknown").slice(0,8);return b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg w-full",children:[b.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 px-3 sm:px-4 py-3 border-b border-[#1a1a2e]",children:[b.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Activity Stream"}),b.jsxs("div",{className:"flex items-center gap-2",children:[!r&&a&&b.jsx(qu,{mode:"paused",message:a}),b.jsxs("select",{value:o??"",onChange:d=>w(d.target.value||null),className:"min-h-[44px] text-xs bg-[#0a0a0f] border border-[#1a1a2e] rounded px-2 py-2 text-gray-400 focus:outline-none focus:border-[#3b82f6]",children:[b.jsx("option",{value:"",children:"All sessions"}),l.map(d=>b.jsx("option",{value:d.id,children:d.windowName||d.id.slice(0,8)},d.id))]}),b.jsxs("select",{value:v??"",onChange:d=>k(d.target.value||null),className:"min-h-[44px] text-xs bg-[#0a0a0f] border border-[#1a1a2e] rounded px-2 py-2 text-gray-400 focus:outline-none focus:border-[#3b82f6]",children:[b.jsx("option",{value:"",children:"All types"}),Object.entries(hu).map(([d,S])=>b.jsx("option",{value:d,children:S.label},d))]}),(o||v)&&b.jsx("button",{onClick:()=>{w(null),k(null)},className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300",children:b.jsx(Gn,{className:"h-4 w-4"})})]})]}),b.jsxs("div",{className:"max-h-[360px] overflow-y-auto divide-y divide-[#1a1a2e]/50",children:[u.length===0&&b.jsx("div",{className:"px-4 py-8 text-center text-sm text-[#555]",children:!r&&a?"Real-time activity is paused while the SSE connection recovers.":"No activity yet"}),u.map(d=>{const S=hu[d.event]??hu.session_status_change,E=S.icon;return b.jsxs("div",{className:"flex items-start gap-2 sm:gap-3 px-3 sm:px-4 py-2 sm:py-2.5 hover:bg-[#1a1a2e]/30 transition-colors",children:[b.jsx(E,{className:"h-4 w-4 mt-0.5 shrink-0",style:{color:S.color}}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[b.jsx("span",{className:"text-xs font-medium text-gray-300 truncate",children:y(d.sessionId)}),b.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded hidden sm:inline-block",style:{backgroundColor:`${S.color}15`,color:S.color},children:S.label})]}),b.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:YE(d)})]}),b.jsx("span",{className:"text-[10px] text-[#444] shrink-0 tabular-nums mt-0.5",children:WE(d.timestamp)})]},d.renderKey)})]})]})}let JE=0;function Bn(){return{workDir:"",name:"",prompt:"",_key:JE++}}function QE({open:i,onClose:r}){const a=No(),o=P.useRef(null),v=P.useRef(null),w=P.useCallback(()=>{Q(),r()},[r]),k=P.useRef(null);P.useEffect(()=>{if(!i)return;const q=W=>{var le;W.key==="Escape"&&((le=v.current)==null||le.abort(),w())};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[i,w]),P.useEffect(()=>{if(!i)return;const q=k.current;if(!q)return;const W='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',le=fe=>{if(fe.key!=="Tab")return;const U=Array.from(q.querySelectorAll(W));if(U.length===0)return;const B=U[0],ie=U[U.length-1];fe.shiftKey?document.activeElement===B&&(fe.preventDefault(),ie.focus()):document.activeElement===ie&&(fe.preventDefault(),B.focus())};return q.addEventListener("keydown",le),()=>q.removeEventListener("keydown",le)},[i]),P.useEffect(()=>{if(i){const q=setTimeout(()=>{var W;return(W=o.current)==null?void 0:W.focus()},50);return()=>clearTimeout(q)}},[i]);const[l,u]=P.useState([]),[f,y]=P.useState(!1);P.useEffect(()=>{i&&(y(!0),mE().then(u).catch(()=>u([])).finally(()=>y(!1)))},[i]);const[d,S]=P.useState(""),[E,O]=P.useState(""),[C,m]=P.useState(""),[g,h]=P.useState("default"),[_,x]=P.useState(!1),[A,R]=P.useState(null),[D,T]=P.useState("single"),[M,$]=P.useState(""),[Z,K]=P.useState([Bn(),Bn()]),[F,X]=P.useState(""),[ee,V]=P.useState(null);function Q(){S(""),O(""),m(""),h("default"),x(!1),R(null),K([Bn(),Bn()]),X(""),V(null),T("single"),$("")}function ae(){Z.length>=10||K([...Z,Bn()])}function j(q){Z.length<=1||K(Z.filter((W,le)=>le!==q))}function I(q,W,le){K(Z.map((fe,U)=>U===q?{...fe,[W]:le}:fe))}async function L(q){var fe;q.preventDefault(),R(null),V(null);const W=Z.filter(U=>U.workDir.trim());if(W.length===0){R("At least one working directory is required");return}x(!0),(fe=v.current)==null||fe.abort();const le=new AbortController;v.current=le;try{const U=await nE({sessions:W.map(B=>({workDir:B.workDir.trim(),name:B.name.trim()||void 0,prompt:B.prompt.trim()||F.trim()||void 0,permissionMode:g})),signal:le.signal});V(U)}catch(U){if(le.signal.aborted)return;R(U instanceof Error?U.message:"Failed to create sessions")}finally{v.current===le&&(v.current=null,x(!1))}}if(!i)return null;async function H(q){var le;if(q.preventDefault(),R(null),!d.trim()){R("Working directory is required");return}x(!0),(le=v.current)==null||le.abort();const W=new AbortController;v.current=W;try{const fe=await Mp({workDir:d.trim(),name:E.trim()||void 0,prompt:C.trim()||void 0,permissionMode:g,signal:W.signal});Q(),r(),a(`/sessions/${fe.id}`)}catch(fe){if(W.signal.aborted)return;R(fe instanceof Error?fe.message:"Failed to create session")}finally{v.current===W&&(v.current=null,x(!1))}}return b.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[b.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:w}),b.jsxs("div",{ref:k,role:"dialog","aria-modal":"true","aria-label":"Create new session",className:`relative w-full ${D==="batch"?"max-w-2xl":"max-w-md"} mx-4 bg-[#111118] border border-[#1a1a2e] rounded-lg shadow-2xl max-h-[90vh] overflow-y-auto`,children:[b.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[b.jsxs("div",{className:"flex items-center gap-4",children:[b.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Session"}),b.jsxs("div",{className:"flex rounded bg-[#0a0a0f] p-0.5",children:[b.jsx("button",{type:"button",onClick:()=>T("single"),className:`px-3 py-1 text-xs rounded transition-colors ${D==="single"?"bg-[#3b82f6]/10 text-[#3b82f6]":"text-gray-500 hover:text-gray-300"}`,children:"Single"}),b.jsx("button",{type:"button",onClick:()=>T("batch"),className:`px-3 py-1 text-xs rounded transition-colors ${D==="batch"?"bg-[#3b82f6]/10 text-[#3b82f6]":"text-gray-500 hover:text-gray-300"}`,children:"Batch"}),l.length>0&&b.jsx("button",{type:"button",onClick:()=>T("template"),className:`px-3 py-1 text-xs rounded transition-colors ${D==="template"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Template"})]})]}),b.jsx("button",{onClick:w,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:b.jsx(Gn,{className:"h-4 w-4"})})]}),D==="single"&&b.jsxs("form",{onSubmit:H,className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Working Directory ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("input",{type:"text",ref:o,value:d,onChange:q=>S(q.target.value),placeholder:"/home/user/project",className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6] font-mono"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Session Name"}),b.jsx("input",{type:"text",value:E,onChange:q=>O(q.target.value),placeholder:"my-session",className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Initial Prompt"}),b.jsx("textarea",{value:C,onChange:q=>m(q.target.value),placeholder:"Fix the login bug...",rows:3,className:"w-full min-h-[88px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6] resize-none"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),b.jsxs("select",{value:g,onChange:q=>h(q.target.value),className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 focus:outline-none focus:border-[#3b82f6]",children:[b.jsx("option",{value:"default",children:"default - asks for everything"}),b.jsx("option",{value:"plan",children:"plan - auto-reads, asks for writes"}),b.jsx("option",{value:"acceptEdits",children:"acceptEdits - auto-edits, asks for bash"}),b.jsx("option",{value:"bypassPermissions",children:"bypassPermissions - never asks"}),b.jsx("option",{value:"auto",children:"auto - auto-approve in sandbox"})]})]}),A&&b.jsx("div",{className:"text-xs text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-2",children:A}),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:w,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Cancel"}),b.jsxs("button",{type:"submit",disabled:_||!d.trim(),className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#3b82f6]/10 hover:bg-[#3b82f6]/20 text-[#3b82f6] border border-[#3b82f6]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[_&&b.jsx(In,{className:"h-3 w-3 animate-spin"}),"Create Session"]})]})]}),D==="batch"&&!ee&&b.jsxs("form",{onSubmit:L,className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Shared Prompt"}),b.jsx("textarea",{value:F,onChange:q=>X(q.target.value),placeholder:"Apply to all sessions without a per-row prompt...",rows:2,className:"w-full min-h-[88px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6] resize-none"})]}),b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[b.jsxs("span",{children:["Working Directory ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("span",{children:"Name"}),b.jsx("span",{children:"Prompt (override)"}),b.jsx("span",{})]}),b.jsx("div",{className:"space-y-2",children:Z.map((q,W)=>b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[b.jsx("input",{type:"text",value:q.workDir,onChange:le=>I(W,"workDir",le.target.value),placeholder:"/home/user/project",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6] font-mono"}),b.jsx("input",{type:"text",value:q.name,onChange:le=>I(W,"name",le.target.value),placeholder:"name",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"}),b.jsx("input",{type:"text",value:q.prompt,onChange:le=>I(W,"prompt",le.target.value),placeholder:"Override prompt...",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"}),b.jsx("button",{type:"button",onClick:()=>j(W),disabled:Z.length<=1,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ef4444] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:b.jsx(ju,{className:"h-3.5 w-3.5"})})]},q._key))}),Z.length<10&&b.jsxs("button",{type:"button",onClick:ae,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[b.jsx(Vn,{className:"h-3.5 w-3.5"}),"Add session"]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),b.jsxs("select",{value:g,onChange:q=>h(q.target.value),className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 focus:outline-none focus:border-[#3b82f6]",children:[b.jsx("option",{value:"default",children:"default - asks for everything"}),b.jsx("option",{value:"plan",children:"plan - auto-reads, asks for writes"}),b.jsx("option",{value:"acceptEdits",children:"acceptEdits - auto-edits, asks for bash"}),b.jsx("option",{value:"bypassPermissions",children:"bypassPermissions - never asks"}),b.jsx("option",{value:"auto",children:"auto - auto-approve in sandbox"})]})]}),A&&b.jsx("div",{className:"text-xs text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-2",children:A}),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:w,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Cancel"}),b.jsxs("button",{type:"submit",disabled:_||!Z.some(q=>q.workDir.trim()),className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#3b82f6]/10 hover:bg-[#3b82f6]/20 text-[#3b82f6] border border-[#3b82f6]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[_&&b.jsx(In,{className:"h-3 w-3 animate-spin"}),"Create ",Z.filter(q=>q.workDir.trim()).length," Session(s)"]})]})]}),D==="template"&&b.jsxs("form",{onSubmit:async q=>{var fe;q.preventDefault(),R(null);const W=l.find(U=>U.id===M);if(!W){R("Please select a template");return}x(!0),(fe=v.current)==null||fe.abort();const le=new AbortController;v.current=le;try{const U=await Mp({workDir:W.workDir,prompt:W.prompt,claudeCommand:W.claudeCommand,env:W.env,stallThresholdMs:W.stallThresholdMs,permissionMode:W.permissionMode,autoApprove:W.autoApprove,signal:le.signal});Q(),r(),a(`/sessions/${U.id}`)}catch(U){if(le.signal.aborted)return;R(U instanceof Error?U.message:"Failed to create session from template")}finally{v.current===le&&(v.current=null,x(!1))}},className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsx("label",{htmlFor:"template-select",className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Select Template"}),f?b.jsx("div",{className:"text-xs text-gray-500 italic",children:"Loading templates…"}):l.length===0?b.jsx("div",{className:"text-xs text-gray-500 italic",children:"No templates available"}):b.jsxs("select",{id:"template-select",value:M,onChange:q=>$(q.target.value),className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 focus:outline-none focus:border-[#00e5ff]",children:[b.jsx("option",{value:"",children:"— Choose a template —"}),l.map(q=>b.jsxs("option",{value:q.id,children:[q.name," ",q.description?`— ${q.description}`:""]},q.id))]})]}),A&&b.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:A}),M&&l.find(q=>q.id===M)&&(()=>{const q=l.find(W=>W.id===M);return b.jsxs("div",{className:"text-xs space-y-1 p-3 bg-[#0a0a0f] rounded border border-[#1a1a2e]",children:[b.jsxs("div",{className:"text-gray-400",children:[b.jsx("strong",{children:"WorkDir:"})," ",b.jsx("span",{className:"font-mono text-gray-500",children:q.workDir})]}),q.stallThresholdMs&&b.jsxs("div",{className:"text-gray-400",children:[b.jsx("strong",{children:"Stall Threshold:"})," ",b.jsxs("span",{className:"text-gray-500",children:[q.stallThresholdMs,"ms"]})]}),q.permissionMode&&q.permissionMode!=="default"&&b.jsxs("div",{className:"text-gray-400",children:[b.jsx("strong",{children:"Permission Mode:"})," ",b.jsx("span",{className:"text-gray-500",children:q.permissionMode})]})]})})(),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:w,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Cancel"}),b.jsxs("button",{type:"submit",disabled:_||!M,className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[_&&b.jsx(In,{className:"h-3 w-3 animate-spin"}),"Create from Template"]})]})]}),ee&&b.jsxs("div",{className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[ee.created>0&&b.jsxs("span",{className:"text-xs font-medium text-emerald-400 bg-emerald-400/10 border border-emerald-400/20 rounded px-3 py-1.5",children:[ee.created," created"]}),ee.failed>0&&b.jsxs("span",{className:"text-xs font-medium text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-1.5",children:[ee.failed," failed"]})]}),ee.sessions.length>0&&b.jsxs("div",{className:"space-y-1",children:[b.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Created sessions"}),b.jsx("ul",{className:"space-y-1",children:ee.sessions.map(q=>b.jsx("li",{children:b.jsxs("button",{type:"button",onClick:()=>{w(),a(`/sessions/${q.id}`)},className:"text-xs text-[#3b82f6] hover:underline font-mono",children:[q.id.slice(0,8),"...",q.name?` - ${q.name}`:""]})},q.id))})]}),ee.errors.length>0&&b.jsxs("div",{className:"space-y-1",children:[b.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Errors"}),b.jsx("ul",{className:"space-y-1",children:ee.errors.map((q,W)=>b.jsx("li",{className:"text-xs text-[#ef4444]",children:q},W))})]}),b.jsx("div",{className:"flex justify-end pt-2",children:b.jsx("button",{type:"button",onClick:w,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Close"})})]})]})]})}function e4(){const[i,r]=P.useState(!1);return b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Overview"}),b.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Aegis session monitoring and metrics"})]}),b.jsxs("button",{onClick:()=>r(!0),className:"flex items-center gap-1.5 px-3 py-2 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors",children:[b.jsx(Vn,{className:"h-3.5 w-3.5"}),"New Session"]})]}),b.jsx(UE,{}),b.jsxs("div",{children:[b.jsx("h3",{className:"mb-3 text-lg font-semibold text-gray-200",children:"Sessions"}),b.jsx(GE,{})]}),b.jsx(XE,{}),b.jsx(QE,{open:i,onClose:()=>r(!1)})]})}function qp(i){return i instanceof Error&&"statusCode"in i}function t4(i){const r=Fe(j=>j.token),a=$i(j=>j.addToast),[o,v]=P.useState(null),[w,k]=P.useState(null),[l,u]=P.useState(!1),[f,y]=P.useState(!0),[d,S]=P.useState(""),[E,O]=P.useState(!0),[C,m]=P.useState(null),[g,h]=P.useState(!0),[_,x]=P.useState(null),[A,R]=P.useState(!0),D=P.useRef(i);D.current=i;const T=P.useRef(!1),M=P.useRef(0),$=P.useRef(void 0),Z=P.useRef(void 0),K=P.useCallback(async()=>{try{const[j,I]=await Promise.allSettled([Fw(D.current),Zw(D.current)]);if(j.status==="rejected"&&qp(j.reason)&&j.reason.statusCode===404||I.status==="rejected"&&qp(I.reason)&&I.reason.statusCode===404){u(!0);return}j.status==="fulfilled"&&v(j.value),I.status==="fulfilled"&&k(I.value)}catch(j){a("error","Failed to load session",j instanceof Error?j.message:void 0)}finally{y(!1)}},[a]);$.current=K;const F=P.useCallback(async()=>{if(T.current)return;const j=D.current,[I,L,H]=await Promise.allSettled([Yw(j),Vw(j),Gw(j)]);I.status==="fulfilled"?T.current||S(I.value.pane??""):a("warning","Failed to load terminal pane",I.reason instanceof Error?I.reason.message:void 0),T.current||O(!1),L.status==="fulfilled"?T.current||m(L.value):a("warning","Failed to load session metrics",L.reason instanceof Error?L.reason.message:void 0),T.current||h(!1),H.status==="fulfilled"?T.current||x(H.value):a("warning","Failed to load session latency",H.reason instanceof Error?H.reason.message:void 0),T.current||R(!1)},[a]);Z.current=F;const X=P.useRef(void 0),ee=P.useRef(void 0),V=P.useCallback(()=>{X.current&&(clearTimeout(X.current),X.current=void 0),ee.current&&(clearTimeout(ee.current),ee.current=void 0)},[]);P.useEffect(()=>(T.current=!1,M.current++,y(!0),O(!0),h(!0),R(!0),K(),F(),()=>{T.current=!0,V()}),[i,K,F,V]);const Q=P.useCallback(()=>{X.current&&clearTimeout(X.current);const j=M.current;X.current=setTimeout(()=>{var I;M.current===j&&((I=Z.current)==null||I.call(Z))},1e3)},[]),ae=P.useCallback(()=>{ee.current&&clearTimeout(ee.current);const j=M.current;ee.current=setTimeout(()=>{var I;M.current===j&&((I=$.current)==null||I.call($))},1e3)},[]);return P.useEffect(()=>{if(!i)return;let j=!0;const I=av(i,L=>{var H,q;if(j)try{const W=kw.safeParse(JSON.parse(L.data));if(!W.success){console.warn("SSE event failed validation",W.error.message);return}switch(W.data.event){case"status":case"approval":case"stall":case"dead":ae(),Q();break;case"message":Q();break;case"ended":(H=$.current)==null||H.call($),(q=Z.current)==null||q.call(Z);break}}catch{}},r);return()=>{j=!1,V(),I()}},[i,r,ae,Q,V]),{session:o,health:w,notFound:l,loading:f,paneContent:d,paneLoading:E,metrics:C,metricsLoading:g,latency:_,latencyLoading:A,refetchPaneAndMetrics:F}}const i4={idle:"Idle",working:"Working",permission_prompt:"Permission",plan_mode:"Planning",ask_question:"Question",bash_approval:"Bash Approval",settings:"Settings",error:"Error",compacting:"Compacting",context_warning:"Context Warning",waiting_for_input:"Waiting",unknown:"Unknown"};function Kp(i,r){if(i.length<=r)return i;const a=i.slice(0,Math.ceil(r/2)-1),o=i.slice(-(Math.floor(r/2)-2));return`${a}…${o}`}function Vp(i){return new Date(i).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function s4({session:i,health:r,onApprove:a,onReject:o,onInterrupt:v,onKill:w,onSaveTemplate:k}){const[l,u]=P.useState(!1),f=r.status==="permission_prompt"||r.status==="bash_approval";return b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3 sm:p-4",children:[b.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[b.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[b.jsx(Po,{status:r.status}),b.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:i4[r.status]})]}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("h1",{className:"text-base sm:text-lg font-semibold text-[#e0e0e0] truncate",children:i.windowName||"Untitled Session"}),b.jsx("div",{className:"text-xs text-[#555] font-mono truncate mt-0.5",children:Kp(i.workDir,40)})]}),b.jsxs("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[i.permissionMode&&i.permissionMode!=="default"&&b.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#003322] text-[#10b981] border border-[#10b981]/30",children:i.permissionMode}),r.alive?b.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#111118] text-[#888] border border-[#1a1a2e]",children:"Alive"}):b.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#331111] text-[#ef4444] border border-[#ef4444]/30",children:"Dead"})]})]}),b.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 text-[11px] text-[#555] mb-3 flex-wrap",children:[b.jsxs("span",{children:["Created: ",Vp(i.createdAt)]}),b.jsxs("span",{className:"hidden sm:inline",children:["Last activity: ",Vp(i.lastActivity)]}),b.jsxs("span",{className:"font-mono hidden sm:inline",children:["ID: ",Kp(i.id,16)]}),r.details&&b.jsx("span",{className:"text-[#888] italic",children:r.details})]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f&&b.jsxs(b.Fragment,{children:[b.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#10b981] border border-[#10b981]/30 transition-colors",children:"Approve"}),b.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ef4444] border border-[#ef4444]/30 transition-colors",children:"Reject"})]}),b.jsx("button",{onClick:v,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors",children:"Interrupt"}),b.jsx("button",{onClick:k,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors",title:"Save this session as a template",children:"Save as Template"}),l?b.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[b.jsx("span",{className:"text-xs text-[#ef4444]",children:"Confirm kill?"}),b.jsx("button",{onClick:()=>{w==null||w(),u(!1)},className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] text-[#ef4444] border border-[#ef4444]/30 transition-colors",children:"Yes, Kill"}),b.jsx("button",{onClick:()=>u(!1),className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors",children:"Cancel"})]}):b.jsx("button",{onClick:()=>u(!0),className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors ml-auto",children:"Kill"})]})]})}var fu={exports:{}},Gp;function r4(){return Gp||(Gp=1,(function(i,r){(function(a,o){i.exports=o()})(globalThis,(()=>(()=>{var a={4567:function(k,l,u){var f=this&&this.__decorate||function(h,_,x,A){var R,D=arguments.length,T=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,x):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,_,x,A);else for(var M=h.length-1;M>=0;M--)(R=h[M])&&(T=(D<3?R(T):D>3?R(_,x,T):R(_,x))||T);return D>3&&T&&Object.defineProperty(_,x,T),T},y=this&&this.__param||function(h,_){return function(x,A){_(x,A,h)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const d=u(9042),S=u(9924),E=u(844),O=u(4725),C=u(2585),m=u(3656);let g=l.AccessibilityManager=class extends E.Disposable{constructor(h,_,x,A){super(),this._terminal=h,this._coreBrowserService=x,this._renderService=A,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new S.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
304
304
|
`)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,m.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,E.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(h){for(let _=0;_<h;_++)this._handleChar(" ")}_handleChar(h){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==h&&(this._charsToAnnounce+=h):this._charsToAnnounce+=h,h===`
|
|
305
305
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(h){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(h)||this._charsToConsume.push(h)}_refreshRows(h,_){this._liveRegionDebouncer.refresh(h,_,this._terminal.rows)}_renderRows(h,_){const x=this._terminal.buffer,A=x.lines.length.toString();for(let R=h;R<=_;R++){const D=x.lines.get(x.ydisp+R),T=[],M=(D==null?void 0:D.translateToString(!0,void 0,void 0,T))||"",$=(x.ydisp+R+1).toString(),Z=this._rowElements[R];Z&&(M.length===0?(Z.innerText=" ",this._rowColumns.set(Z,[0,1])):(Z.textContent=M,this._rowColumns.set(Z,T)),Z.setAttribute("aria-posinset",$),Z.setAttribute("aria-setsize",A))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(h,_){const x=h.target,A=this._rowElements[_===0?1:this._rowElements.length-2];if(x.getAttribute("aria-posinset")===(_===0?"1":`${this._terminal.buffer.lines.length}`)||h.relatedTarget!==A)return;let R,D;if(_===0?(R=x,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(R=this._rowElements.shift(),D=x,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),_===0){const T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(_===0?-1:1),this._rowElements[_===0?1:this._rowElements.length-2].focus(),h.preventDefault(),h.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const h=document.getSelection();if(!h)return;if(h.isCollapsed)return void(this._rowContainer.contains(h.anchorNode)&&this._terminal.clearSelection());if(!h.anchorNode||!h.focusNode)return void console.error("anchorNode and/or focusNode are null");let _={node:h.anchorNode,offset:h.anchorOffset},x={node:h.focusNode,offset:h.focusOffset};if((_.node.compareDocumentPosition(x.node)&Node.DOCUMENT_POSITION_PRECEDING||_.node===x.node&&_.offset>x.offset)&&([_,x]=[x,_]),_.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(_={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(_.node))return;const A=this._rowElements.slice(-1)[0];if(x.node.compareDocumentPosition(A)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(x={node:A,offset:((M=A.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(x.node))return;const R=({node:$,offset:Z})=>{const K=$ instanceof Text?$.parentNode:$;let F=parseInt(K==null?void 0:K.getAttribute("aria-posinset"),10)-1;if(isNaN(F))return console.warn("row is invalid. Race condition?"),null;const X=this._rowColumns.get(K);if(!X)return console.warn("columns is null. Race condition?"),null;let ee=Z<X.length?X[Z]:X.slice(-1)[0]+1;return ee>=this._terminal.cols&&(++F,ee=0),{row:F,column:ee}},D=R(_),T=R(x);if(D&&T){if(D.row>T.row||D.row===T.row&&D.column>=T.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(T.row-D.row)*this._terminal.cols-D.column+T.column)}}_handleResize(h){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let _=this._rowContainer.children.length;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);for(;this._rowElements.length>h;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const h=this._coreBrowserService.mainDocument.createElement("div");return h.setAttribute("role","listitem"),h.tabIndex=-1,this._refreshRowDimensions(h),h}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let h=0;h<this._terminal.rows;h++)this._refreshRowDimensions(this._rowElements[h])}}_refreshRowDimensions(h){h.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=g=f([y(1,C.IInstantiationService),y(2,O.ICoreBrowserService),y(3,O.IRenderService)],g)},3614:(k,l)=>{function u(S){return S.replace(/\r?\n/g,"\r")}function f(S,E){return E?"\x1B[200~"+S+"\x1B[201~":S}function y(S,E,O,C){S=f(S=u(S),O.decPrivateModes.bracketedPasteMode&&C.rawOptions.ignoreBracketedPasteMode!==!0),O.triggerDataEvent(S,!0),E.value=""}function d(S,E,O){const C=O.getBoundingClientRect(),m=S.clientX-C.left-10,g=S.clientY-C.top-10;E.style.width="20px",E.style.height="20px",E.style.left=`${m}px`,E.style.top=`${g}px`,E.style.zIndex="1000",E.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=u,l.bracketTextForPaste=f,l.copyHandler=function(S,E){S.clipboardData&&S.clipboardData.setData("text/plain",E.selectionText),S.preventDefault()},l.handlePasteEvent=function(S,E,O,C){S.stopPropagation(),S.clipboardData&&y(S.clipboardData.getData("text/plain"),E,O,C)},l.paste=y,l.moveTextAreaUnderMouseCursor=d,l.rightClickHandler=function(S,E,O,C,m){d(S,E,O),m&&C.rightClickSelect(S),E.value=C.selectionText,E.select()}},7239:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const f=u(1505);l.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(y,d,S){this._css.set(y,d,S)}getCss(y,d){return this._css.get(y,d)}setColor(y,d,S){this._color.set(y,d,S)}getColor(y,d){return this._color.get(y,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(u,f,y,d){u.addEventListener(f,y,d);let S=!1;return{dispose:()=>{S||(S=!0,u.removeEventListener(f,y,d))}}}},3551:function(k,l,u){var f=this&&this.__decorate||function(g,h,_,x){var A,R=arguments.length,D=R<3?h:x===null?x=Object.getOwnPropertyDescriptor(h,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,h,_,x);else for(var T=g.length-1;T>=0;T--)(A=g[T])&&(D=(R<3?A(D):R>3?A(h,_,D):A(h,_))||D);return R>3&&D&&Object.defineProperty(h,_,D),D},y=this&&this.__param||function(g,h){return function(_,x){h(_,x,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const d=u(3656),S=u(8460),E=u(844),O=u(2585),C=u(4725);let m=l.Linkifier=class extends E.Disposable{get currentLink(){return this._currentLink}constructor(g,h,_,x,A){super(),this._element=g,this._mouseService=h,this._renderService=_,this._bufferService=x,this._linkProviderService=A,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new S.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new S.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,E.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,E.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(g){this._lastMouseEvent=g;const h=this._positionFromMouseEvent(g,this._element,this._mouseService);if(!h)return;this._isMouseOut=!1;const _=g.composedPath();for(let x=0;x<_.length;x++){const A=_[x];if(A.classList.contains("xterm"))break;if(A.classList.contains("xterm-hover"))return}this._lastBufferCell&&h.x===this._lastBufferCell.x&&h.y===this._lastBufferCell.y||(this._handleHover(h),this._lastBufferCell=h)}_handleHover(g){if(this._activeLine!==g.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(g,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,g)||(this._clearCurrentLink(),this._askForLink(g,!0))}_askForLink(g,h){var x,A;this._activeProviderReplies&&h||((x=this._activeProviderReplies)==null||x.forEach((R=>{R==null||R.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=g.y);let _=!1;for(const[R,D]of this._linkProviderService.linkProviders.entries())h?(A=this._activeProviderReplies)!=null&&A.get(R)&&(_=this._checkLinkProviderResult(R,g,_)):D.provideLinks(g.y,(T=>{var $,Z;if(this._isMouseOut)return;const M=T==null?void 0:T.map((K=>({link:K})));($=this._activeProviderReplies)==null||$.set(R,M),_=this._checkLinkProviderResult(R,g,_),((Z=this._activeProviderReplies)==null?void 0:Z.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(g.y,this._activeProviderReplies)}))}_removeIntersectingLinks(g,h){const _=new Set;for(let x=0;x<h.size;x++){const A=h.get(x);if(A)for(let R=0;R<A.length;R++){const D=A[R],T=D.link.range.start.y<g?0:D.link.range.start.x,M=D.link.range.end.y>g?this._bufferService.cols:D.link.range.end.x;for(let $=T;$<=M;$++){if(_.has($)){A.splice(R--,1);break}_.add($)}}}}_checkLinkProviderResult(g,h,_){var R;if(!this._activeProviderReplies)return _;const x=this._activeProviderReplies.get(g);let A=!1;for(let D=0;D<g;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(A=!0);if(!A&&x){const D=x.find((T=>this._linkAtPosition(T.link,h)));D&&(_=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!_)for(let D=0;D<this._activeProviderReplies.size;D++){const T=(R=this._activeProviderReplies.get(D))==null?void 0:R.find((M=>this._linkAtPosition(M.link,h)));if(T){_=!0,this._handleNewLink(T);break}}return _}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(g){if(!this._currentLink)return;const h=this._positionFromMouseEvent(g,this._element,this._mouseService);h&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,h)&&this._currentLink.link.activate(g,this._currentLink.link.text)}_clearCurrentLink(g,h){this._currentLink&&this._lastMouseEvent&&(!g||!h||this._currentLink.link.range.start.y>=g&&this._currentLink.link.range.end.y<=h)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,E.disposeArray)(this._linkCacheDisposables))}_handleNewLink(g){if(!this._lastMouseEvent)return;const h=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);h&&this._linkAtPosition(g.link,h)&&(this._currentLink=g,this._currentLink.state={decorations:{underline:g.link.decorations===void 0||g.link.decorations.underline,pointerCursor:g.link.decorations===void 0||g.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,g.link,this._lastMouseEvent),g.link.decorations={},Object.defineProperties(g.link.decorations,{pointerCursor:{get:()=>{var _,x;return(x=(_=this._currentLink)==null?void 0:_.state)==null?void 0:x.decorations.pointerCursor},set:_=>{var x;(x=this._currentLink)!=null&&x.state&&this._currentLink.state.decorations.pointerCursor!==_&&(this._currentLink.state.decorations.pointerCursor=_,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",_))}},underline:{get:()=>{var _,x;return(x=(_=this._currentLink)==null?void 0:_.state)==null?void 0:x.decorations.underline},set:_=>{var x,A,R;(x=this._currentLink)!=null&&x.state&&((R=(A=this._currentLink)==null?void 0:A.state)==null?void 0:R.decorations.underline)!==_&&(this._currentLink.state.decorations.underline=_,this._currentLink.state.isHovered&&this._fireUnderlineEvent(g.link,_))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((_=>{if(!this._currentLink)return;const x=_.start===0?0:_.start+1+this._bufferService.buffer.ydisp,A=this._bufferService.buffer.ydisp+1+_.end;if(this._currentLink.link.range.start.y>=x&&this._currentLink.link.range.end.y<=A&&(this._clearCurrentLink(x,A),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(g,h,_){var x;(x=this._currentLink)!=null&&x.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!0),this._currentLink.state.decorations.pointerCursor&&g.classList.add("xterm-cursor-pointer")),h.hover&&h.hover(_,h.text)}_fireUnderlineEvent(g,h){const _=g.range,x=this._bufferService.buffer.ydisp,A=this._createLinkUnderlineEvent(_.start.x-1,_.start.y-x-1,_.end.x,_.end.y-x-1,void 0);(h?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(A)}_linkLeave(g,h,_){var x;(x=this._currentLink)!=null&&x.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!1),this._currentLink.state.decorations.pointerCursor&&g.classList.remove("xterm-cursor-pointer")),h.leave&&h.leave(_,h.text)}_linkAtPosition(g,h){const _=g.range.start.y*this._bufferService.cols+g.range.start.x,x=g.range.end.y*this._bufferService.cols+g.range.end.x,A=h.y*this._bufferService.cols+h.x;return _<=A&&A<=x}_positionFromMouseEvent(g,h,_){const x=_.getCoords(g,h,this._bufferService.cols,this._bufferService.rows);if(x)return{x:x[0],y:x[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(g,h,_,x,A){return{x1:g,y1:h,x2:_,y2:x,cols:this._bufferService.cols,fg:A}}};l.Linkifier=m=f([y(1,C.IMouseService),y(2,C.IRenderService),y(3,O.IBufferService),y(4,C.ILinkProviderService)],m)},9042:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(k,l,u){var f=this&&this.__decorate||function(C,m,g,h){var _,x=arguments.length,A=x<3?m:h===null?h=Object.getOwnPropertyDescriptor(m,g):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(C,m,g,h);else for(var R=C.length-1;R>=0;R--)(_=C[R])&&(A=(x<3?_(A):x>3?_(m,g,A):_(m,g))||A);return x>3&&A&&Object.defineProperty(m,g,A),A},y=this&&this.__param||function(C,m){return function(g,h){m(g,h,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const d=u(511),S=u(2585);let E=l.OscLinkProvider=class{constructor(C,m,g){this._bufferService=C,this._optionsService=m,this._oscLinkService=g}provideLinks(C,m){var M;const g=this._bufferService.buffer.lines.get(C-1);if(!g)return void m(void 0);const h=[],_=this._optionsService.rawOptions.linkHandler,x=new d.CellData,A=g.getTrimmedLength();let R=-1,D=-1,T=!1;for(let $=0;$<A;$++)if(D!==-1||g.hasContent($)){if(g.loadCell($,x),x.hasExtendedAttrs()&&x.extended.urlId){if(D===-1){D=$,R=x.extended.urlId;continue}T=x.extended.urlId!==R}else D!==-1&&(T=!0);if(T||D!==-1&&$===A-1){const Z=(M=this._oscLinkService.getLinkData(R))==null?void 0:M.uri;if(Z){const K={start:{x:D+1,y:C},end:{x:$+(T||$!==A-1?0:1),y:C}};let F=!1;if(!(_!=null&&_.allowNonHttpProtocols))try{const X=new URL(Z);["http:","https:"].includes(X.protocol)||(F=!0)}catch{F=!0}F||h.push({text:Z,range:K,activate:(X,ee)=>_?_.activate(X,ee,K):O(0,ee),hover:(X,ee)=>{var V;return(V=_==null?void 0:_.hover)==null?void 0:V.call(_,X,ee,K)},leave:(X,ee)=>{var V;return(V=_==null?void 0:_.leave)==null?void 0:V.call(_,X,ee,K)}})}T=!1,x.hasExtendedAttrs()&&x.extended.urlId?(D=$,R=x.extended.urlId):(D=-1,R=-1)}}m(h)}};function O(C,m){if(confirm(`Do you want to navigate to ${m}?
|
|
306
306
|
|
|
307
|
-
WARNING: This link could potentially be dangerous`)){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=m}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=E=f([y(0,S.IBufferService),y(1,S.IOptionsService),y(2,S.IOscLinkService)],E)},6193:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(u,f){this._renderCallback=u,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,f,y){this._rowCount=y,u=u!==void 0?u:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const f=u(3614),y=u(3656),d=u(3551),S=u(9042),E=u(3730),O=u(1680),C=u(3107),m=u(5744),g=u(2950),h=u(1296),_=u(428),x=u(4269),A=u(5114),R=u(8934),D=u(3230),T=u(9312),M=u(4725),$=u(6731),Z=u(8055),K=u(8969),F=u(8460),X=u(844),ee=u(6114),V=u(8437),Q=u(2584),ae=u(7399),j=u(5941),U=u(9074),L=u(2585),H=u(5435),q=u(4567),W=u(779);class le extends K.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(I={}){super(I),this.browser=ee,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new X.MutableDisposable),this._onCursorMove=this.register(new F.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new F.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new F.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new F.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new F.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new F.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new F.EventEmitter),this._onBlur=this.register(new F.EventEmitter),this._onA11yCharEmitter=this.register(new F.EventEmitter),this._onA11yTabEmitter=this.register(new F.EventEmitter),this._onWillOpen=this.register(new F.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(U.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(W.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(E.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((B,ie)=>this.refresh(B,ie)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((B=>this._reportWindowsOptions(B)))),this.register(this._inputHandler.onColor((B=>this._handleColorEvent(B)))),this.register((0,F.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,F.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((B=>this._afterResize(B.cols,B.rows)))),this.register((0,X.toDisposable)((()=>{var B,ie;this._customKeyEventHandler=void 0,(ie=(B=this.element)==null?void 0:B.parentNode)==null||ie.removeChild(this.element)})))}_handleColorEvent(I){if(this._themeService)for(const B of I){let ie,ne="";switch(B.index){case 256:ie="foreground",ne="10";break;case 257:ie="background",ne="11";break;case 258:ie="cursor",ne="12";break;default:ie="ansi",ne="4;"+B.index}switch(B.type){case 0:const me=Z.color.toColorRGB(ie==="ansi"?this._themeService.colors.ansi[B.index]:this._themeService.colors[ie]);this.coreService.triggerDataEvent(`${Q.C0.ESC}]${ne};${(0,j.toRgbString)(me)}${Q.C1_ESCAPED.ST}`);break;case 1:if(ie==="ansi")this._themeService.modifyColors((pe=>pe.ansi[B.index]=Z.channels.toColor(...B.color)));else{const pe=ie;this._themeService.modifyColors((Ee=>Ee[pe]=Z.channels.toColor(...B.color)))}break;case 2:this._themeService.restoreColor(B.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(I){I?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(I){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var I;return(I=this.textarea)==null?void 0:I.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const I=this.buffer.ybase+this.buffer.y,B=this.buffer.lines.get(I);if(!B)return;const ie=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,me=B.getWidth(ie),pe=this._renderService.dimensions.css.cell.width*me,Ee=this.buffer.y*this._renderService.dimensions.css.cell.height,je=ie*this._renderService.dimensions.css.cell.width;this.textarea.style.left=je+"px",this.textarea.style.top=Ee+"px",this.textarea.style.width=pe+"px",this.textarea.style.height=ne+"px",this.textarea.style.lineHeight=ne+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(B=>{this.hasSelection()&&(0,f.copyHandler)(B,this._selectionService)})));const I=B=>(0,f.handlePasteEvent)(B,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",I)),this.register((0,y.addDisposableDomListener)(this.element,"paste",I)),ee.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(B=>{B.button===2&&(0,f.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(B=>{(0,f.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ee.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(B=>{B.button===1&&(0,f.moveTextAreaUnderMouseCursor)(B,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(I=>this._keyUp(I)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(I=>this._keyDown(I)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(I=>this._keyPress(I)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(I=>this._compositionHelper.compositionupdate(I)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(I=>this._inputEvent(I)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(I){var ie;if(!I)throw new Error("Terminal requires a parent element.");if(I.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ie=this.element)==null?void 0:ie.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=I.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"),I.appendChild(this.element);const B=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,y.addDisposableDomListener)(this.screenElement,"mousemove",(ne=>this.updateCursorStyle(ne)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),B.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",S.promptLabel),ee.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(A.CoreBrowserService,this.textarea,I.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(ne=>this._handleTextAreaFocus(ne)))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(_.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance($.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(x.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ne=>this._onRender.fire(ne)))),this.onResize((ne=>this._renderService.resize(ne.cols,ne.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(g.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(B);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(O.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(T.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ne=>this._renderService.handleSelectionChanged(ne.start,ne.end,ne.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ne=>{this.textarea.value=ne,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ne=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(C.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(ne=>this._selectionService.handleMouseDown(ne)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(q.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ne=>this._handleScreenReaderModeOptionChange(ne)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ne=>{!this._overviewRulerRenderer&&ne&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(h.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const I=this,B=this.element;function ie(pe){const Ee=I._mouseService.getMouseReportCoords(pe,I.screenElement);if(!Ee)return!1;let je,Be;switch(pe.overrideType||pe.type){case"mousemove":Be=32,pe.buttons===void 0?(je=3,pe.button!==void 0&&(je=pe.button<3?pe.button:3)):je=1&pe.buttons?0:4&pe.buttons?1:2&pe.buttons?2:3;break;case"mouseup":Be=0,je=pe.button<3?pe.button:3;break;case"mousedown":Be=1,je=pe.button<3?pe.button:3;break;case"wheel":if(I._customWheelEventHandler&&I._customWheelEventHandler(pe)===!1||I.viewport.getLinesScrolled(pe)===0)return!1;Be=pe.deltaY<0?0:1,je=4;break;default:return!1}return!(Be===void 0||je===void 0||je>4)&&I.coreMouseService.triggerMouseEvent({col:Ee.col,row:Ee.row,x:Ee.x,y:Ee.y,button:je,action:Be,ctrl:pe.ctrlKey,alt:pe.altKey,shift:pe.shiftKey})}const ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},me={mouseup:pe=>(ie(pe),pe.buttons||(this._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.removeEventListener("mousemove",ne.mousedrag)),this.cancel(pe)),wheel:pe=>(ie(pe),this.cancel(pe,!0)),mousedrag:pe=>{pe.buttons&&ie(pe)},mousemove:pe=>{pe.buttons||ie(pe)}};this.register(this.coreMouseService.onProtocolChange((pe=>{pe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(pe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&pe?ne.mousemove||(B.addEventListener("mousemove",me.mousemove),ne.mousemove=me.mousemove):(B.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&pe?ne.wheel||(B.addEventListener("wheel",me.wheel,{passive:!1}),ne.wheel=me.wheel):(B.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&pe?ne.mouseup||(ne.mouseup=me.mouseup):(this._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&pe?ne.mousedrag||(ne.mousedrag=me.mousedrag):(this._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(B,"mousedown",(pe=>{if(pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(pe))return ie(pe),ne.mouseup&&this._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.addEventListener("mousemove",ne.mousedrag),this.cancel(pe)}))),this.register((0,y.addDisposableDomListener)(B,"wheel",(pe=>{if(!ne.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(pe)===!1)return!1;if(!this.buffer.hasScrollback){const Ee=this.viewport.getLinesScrolled(pe);if(Ee===0)return;const je=Q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(pe.deltaY<0?"A":"B");let Be="";for(let st=0;st<Math.abs(Ee);st++)Be+=je;return this.coreService.triggerDataEvent(Be,!0),this.cancel(pe,!0)}return this.viewport.handleWheel(pe)?this.cancel(pe):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(B,"touchstart",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(pe),this.cancel(pe)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(B,"touchmove",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(pe)?void 0:this.cancel(pe)}),{passive:!1}))}refresh(I,B){var ie;(ie=this._renderService)==null||ie.refreshRows(I,B)}updateCursorStyle(I){var B;(B=this._selectionService)!=null&&B.shouldColumnSelect(I)?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(I,B,ie=0){var ne;ie===1?(super.scrollLines(I,B,ie),this.refresh(0,this.rows-1)):(ne=this.viewport)==null||ne.scrollLines(I)}paste(I){(0,f.paste)(I,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(I){this._customKeyEventHandler=I}attachCustomWheelEventHandler(I){this._customWheelEventHandler=I}registerLinkProvider(I){return this._linkProviderService.registerLinkProvider(I)}registerCharacterJoiner(I){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const B=this._characterJoinerService.register(I);return this.refresh(0,this.rows-1),B}deregisterCharacterJoiner(I){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(I)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(I){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+I)}registerDecoration(I){return this._decorationService.registerDecoration(I)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(I,B,ie){this._selectionService.setSelection(I,B,ie)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var I;(I=this._selectionService)==null||I.clearSelection()}selectAll(){var I;(I=this._selectionService)==null||I.selectAll()}selectLines(I,B){var ie;(ie=this._selectionService)==null||ie.selectLines(I,B)}_keyDown(I){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;const B=this.browser.isMac&&this.options.macOptionIsMeta&&I.altKey;if(!B&&!this._compositionHelper.keydown(I))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;B||I.key!=="Dead"&&I.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ie=(0,ae.evaluateKeyboardEvent)(I,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(I),ie.type===3||ie.type===2){const ne=this.rows-1;return this.scrollLines(ie.type===2?-ne:ne),this.cancel(I,!0)}return ie.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,I)||(ie.cancel&&this.cancel(I,!0),!ie.key||!!(I.key&&!I.ctrlKey&&!I.altKey&&!I.metaKey&&I.key.length===1&&I.key.charCodeAt(0)>=65&&I.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ie.key!==Q.C0.ETX&&ie.key!==Q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ie.key,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(ie.key,!0),!this.optionsService.rawOptions.screenReaderMode||I.altKey||I.ctrlKey?this.cancel(I,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(I,B){const ie=I.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||I.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey||I.isWindows&&B.getModifierState("AltGraph");return B.type==="keypress"?ie:ie&&(!B.keyCode||B.keyCode>47)}_keyUp(I){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1||((function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18})(I)||this.focus(),this.updateCursorStyle(I),this._keyPressHandled=!1)}_keyPress(I){let B;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;if(this.cancel(I),I.charCode)B=I.charCode;else if(I.which===null||I.which===void 0)B=I.keyCode;else{if(I.which===0||I.charCode===0)return!1;B=I.which}return!(!B||(I.altKey||I.ctrlKey||I.metaKey)&&!this._isThirdLevelShift(this.browser,I)||(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(B,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(I){if(I.data&&I.inputType==="insertText"&&(!I.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const B=I.data;return this.coreService.triggerDataEvent(B,!0),this.cancel(I),!0}return!1}resize(I,B){I!==this.cols||B!==this.rows?super.resize(I,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(I,B){var ie,ne;(ie=this._charSizeService)==null||ie.measure(),(ne=this.viewport)==null||ne.syncScrollArea(!0)}clear(){var I;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 B=1;B<this.rows;B++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(I=this.viewport)==null||I.reset(),this.refresh(0,this.rows-1)}}reset(){var B,ie;this.options.rows=this.rows,this.options.cols=this.cols;const I=this._customKeyEventHandler;this._setup(),super.reset(),(B=this._selectionService)==null||B.reset(),this._decorationService.reset(),(ie=this.viewport)==null||ie.reset(),this._customKeyEventHandler=I,this.refresh(0,this.rows-1)}clearTextureAtlas(){var I;(I=this._renderService)==null||I.clearTextureAtlas()}_reportFocus(){var I;(I=this.element)!=null&&I.classList.contains("focus")?this.coreService.triggerDataEvent(Q.C0.ESC+"[I"):this.coreService.triggerDataEvent(Q.C0.ESC+"[O")}_reportWindowsOptions(I){if(this._renderService)switch(I){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const B=this._renderService.dimensions.css.canvas.width.toFixed(0),ie=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[4;${ie};${B}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ne=this._renderService.dimensions.css.cell.width.toFixed(0),me=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[6;${me};${ne}t`)}}cancel(I,B){if(this.options.cancelEvents||B)return I.preventDefault(),I.stopPropagation(),!1}}l.Terminal=le},9924:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(u,f=1e3){this._renderCallback=u,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,f,y){this._rowCount=y,u=u!==void 0?u:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const S=d-this._lastRefreshMs,E=this._debounceThresholdMS-S;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),E)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f)}}},1680:function(k,l,u){var f=this&&this.__decorate||function(g,h,_,x){var A,R=arguments.length,D=R<3?h:x===null?x=Object.getOwnPropertyDescriptor(h,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,h,_,x);else for(var T=g.length-1;T>=0;T--)(A=g[T])&&(D=(R<3?A(D):R>3?A(h,_,D):A(h,_))||D);return R>3&&D&&Object.defineProperty(h,_,D),D},y=this&&this.__param||function(g,h){return function(_,x){h(_,x,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const d=u(3656),S=u(4725),E=u(8460),O=u(844),C=u(2585);let m=l.Viewport=class extends O.Disposable{constructor(g,h,_,x,A,R,D,T){super(),this._viewportElement=g,this._scrollArea=h,this._bufferService=_,this._optionsService=x,this._charSizeService=A,this._renderService=R,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(T.colors),this.register(T.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(g){this._viewportElement.style.backgroundColor=g.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(g){if(g)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const h=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==h&&(this._lastRecordedBufferHeight=h,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const g=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==g&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=g),this._refreshAnimationFrame=null}syncScrollArea(g=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(g);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(g)}_handleScroll(g){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const h=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const g=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(g*(this._smoothScrollState.target-this._smoothScrollState.origin)),g<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(g,h){const _=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(h<0&&this._viewportElement.scrollTop!==0||h>0&&_<this._lastRecordedBufferHeight)||(g.cancelable&&g.preventDefault(),!1)}handleWheel(g){const h=this._getPixelsScrolled(g);return h!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+h:this._smoothScrollState.target+=h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=h,this._bubbleScroll(g,h))}scrollLines(g){if(g!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const h=g*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!1})}_getPixelsScrolled(g){if(g.deltaY===0||g.shiftKey)return 0;let h=this._applyScrollModifier(g.deltaY,g);return g.deltaMode===WheelEvent.DOM_DELTA_LINE?h*=this._currentRowHeight:g.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._currentRowHeight*this._bufferService.rows),h}getBufferElements(g,h){var T;let _,x="";const A=[],R=h??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let M=g;M<R;M++){const $=D.get(M);if(!$)continue;const Z=(T=D.get(M+1))==null?void 0:T.isWrapped;if(x+=$.translateToString(!Z),!Z||M===D.length-1){const K=document.createElement("div");K.textContent=x,A.push(K),x.length>0&&(_=K),x=""}}return{bufferElements:A,cursorElement:_}}getLinesScrolled(g){if(g.deltaY===0||g.shiftKey)return 0;let h=this._applyScrollModifier(g.deltaY,g);return g.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(h/=this._currentRowHeight+0,this._wheelPartialScroll+=h,h=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):g.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._bufferService.rows),h}_applyScrollModifier(g,h){const _=this._optionsService.rawOptions.fastScrollModifier;return _==="alt"&&h.altKey||_==="ctrl"&&h.ctrlKey||_==="shift"&&h.shiftKey?g*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:g*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(g){this._lastTouchY=g.touches[0].pageY}handleTouchMove(g){const h=this._lastTouchY-g.touches[0].pageY;return this._lastTouchY=g.touches[0].pageY,h!==0&&(this._viewportElement.scrollTop+=h,this._bubbleScroll(g,h))}};l.Viewport=m=f([y(2,C.IBufferService),y(3,C.IOptionsService),y(4,S.ICharSizeService),y(5,S.IRenderService),y(6,S.ICoreBrowserService),y(7,S.IThemeService)],m)},3107:function(k,l,u){var f=this&&this.__decorate||function(C,m,g,h){var _,x=arguments.length,A=x<3?m:h===null?h=Object.getOwnPropertyDescriptor(m,g):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(C,m,g,h);else for(var R=C.length-1;R>=0;R--)(_=C[R])&&(A=(x<3?_(A):x>3?_(m,g,A):_(m,g))||A);return x>3&&A&&Object.defineProperty(m,g,A),A},y=this&&this.__param||function(C,m){return function(g,h){m(g,h,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const d=u(4725),S=u(844),E=u(2585);let O=l.BufferDecorationRenderer=class extends S.Disposable{constructor(C,m,g,h,_){super(),this._screenElement=C,this._bufferService=m,this._coreBrowserService=g,this._decorationService=h,this._renderService=_,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((x=>this._removeDecoration(x)))),this.register((0,S.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const C of this._decorationService.decorations)this._renderDecoration(C);this._dimensionsChanged=!1}_renderDecoration(C){this._refreshStyle(C),this._dimensionsChanged&&this._refreshXPosition(C)}_createElement(C){var h;const m=this._coreBrowserService.mainDocument.createElement("div");m.classList.add("xterm-decoration"),m.classList.toggle("xterm-decoration-top-layer",((h=C==null?void 0:C.options)==null?void 0:h.layer)==="top"),m.style.width=`${Math.round((C.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,m.style.height=(C.options.height||1)*this._renderService.dimensions.css.cell.height+"px",m.style.top=(C.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",m.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const g=C.options.x??0;return g&&g>this._bufferService.cols&&(m.style.display="none"),this._refreshXPosition(C,m),m}_refreshStyle(C){const m=C.marker.line-this._bufferService.buffers.active.ydisp;if(m<0||m>=this._bufferService.rows)C.element&&(C.element.style.display="none",C.onRenderEmitter.fire(C.element));else{let g=this._decorationElements.get(C);g||(g=this._createElement(C),C.element=g,this._decorationElements.set(C,g),this._container.appendChild(g),C.onDispose((()=>{this._decorationElements.delete(C),g.remove()}))),g.style.top=m*this._renderService.dimensions.css.cell.height+"px",g.style.display=this._altBufferIsActive?"none":"block",C.onRenderEmitter.fire(g)}}_refreshXPosition(C,m=C.element){if(!m)return;const g=C.options.x??0;(C.options.anchor||"left")==="right"?m.style.right=g?g*this._renderService.dimensions.css.cell.width+"px":"":m.style.left=g?g*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(C){var m;(m=this._decorationElements.get(C))==null||m.remove(),this._decorationElements.delete(C),C.dispose()}};l.BufferDecorationRenderer=O=f([y(1,E.IBufferService),y(2,d.ICoreBrowserService),y(3,E.IDecorationService),y(4,d.IRenderService)],O)},5871:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const f of this._zones)if(f.color===u.options.overviewRulerOptions.color&&f.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,u.marker.line))return;if(this._lineAdjacentToZone(f,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(f,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,f){return f>=u.startBufferLine&&f<=u.endBufferLine}_lineAdjacentToZone(u,f,y){return f>=u.startBufferLine-this._linePadding[y||"full"]&&f<=u.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(u,f){u.startBufferLine=Math.min(u.startBufferLine,f),u.endBufferLine=Math.max(u.endBufferLine,f)}}},5744:function(k,l,u){var f=this&&this.__decorate||function(_,x,A,R){var D,T=arguments.length,M=T<3?x:R===null?R=Object.getOwnPropertyDescriptor(x,A):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(_,x,A,R);else for(var $=_.length-1;$>=0;$--)(D=_[$])&&(M=(T<3?D(M):T>3?D(x,A,M):D(x,A))||M);return T>3&&M&&Object.defineProperty(x,A,M),M},y=this&&this.__param||function(_,x){return function(A,R){x(A,R,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const d=u(5871),S=u(4725),E=u(844),O=u(2585),C={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0},g={full:0,left:0,center:0,right:0};let h=l.OverviewRulerRenderer=class extends E.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(_,x,A,R,D,T,M){var Z;super(),this._viewportElement=_,this._screenElement=x,this._bufferService=A,this._decorationService=R,this._renderService=D,this._optionsService=T,this._coreBrowserService=M,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(Z=this._viewportElement.parentElement)==null||Z.insertBefore(this._canvas,this._viewportElement);const $=this._canvas.getContext("2d");if(!$)throw new Error("Ctx cannot be null");this._ctx=$,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,E.toDisposable)((()=>{var K;(K=this._canvas)==null||K.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const _=Math.floor(this._canvas.width/3),x=Math.ceil(this._canvas.width/3);m.full=this._canvas.width,m.left=_,m.center=x,m.right=_,this._refreshDrawHeightConstants(),g.full=0,g.left=0,g.center=m.left,g.right=m.left+m.center}_refreshDrawHeightConstants(){C.full=Math.round(2*this._coreBrowserService.dpr);const _=this._canvas.height/this._bufferService.buffer.lines.length,x=Math.round(Math.max(Math.min(_,12),6)*this._coreBrowserService.dpr);C.left=x,C.center=x,C.right=x}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const x of this._decorationService.decorations)this._colorZoneStore.addDecoration(x);this._ctx.lineWidth=1;const _=this._colorZoneStore.zones;for(const x of _)x.position!=="full"&&this._renderColorZone(x);for(const x of _)x.position==="full"&&this._renderColorZone(x);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(_){this._ctx.fillStyle=_.color,this._ctx.fillRect(g[_.position||"full"],Math.round((this._canvas.height-1)*(_.startBufferLine/this._bufferService.buffers.active.lines.length)-C[_.position||"full"]/2),m[_.position||"full"],Math.round((this._canvas.height-1)*((_.endBufferLine-_.startBufferLine)/this._bufferService.buffers.active.lines.length)+C[_.position||"full"]))}_queueRefresh(_,x){this._shouldUpdateDimensions=_||this._shouldUpdateDimensions,this._shouldUpdateAnchor=x||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=h=f([y(2,O.IBufferService),y(3,O.IDecorationService),y(4,S.IRenderService),y(5,O.IOptionsService),y(6,S.ICoreBrowserService)],h)},2950:function(k,l,u){var f=this&&this.__decorate||function(C,m,g,h){var _,x=arguments.length,A=x<3?m:h===null?h=Object.getOwnPropertyDescriptor(m,g):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(C,m,g,h);else for(var R=C.length-1;R>=0;R--)(_=C[R])&&(A=(x<3?_(A):x>3?_(m,g,A):_(m,g))||A);return x>3&&A&&Object.defineProperty(m,g,A),A},y=this&&this.__param||function(C,m){return function(g,h){m(g,h,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const d=u(4725),S=u(2585),E=u(2584);let O=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(C,m,g,h,_,x){this._textarea=C,this._compositionView=m,this._bufferService=g,this._optionsService=h,this._coreService=_,this._renderService=x,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(C){this._compositionView.textContent=C.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(C){if(this._isComposing||this._isSendingComposition){if(C.keyCode===229||C.keyCode===16||C.keyCode===17||C.keyCode===18)return!1;this._finalizeComposition(!1)}return C.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(C){if(this._compositionView.classList.remove("active"),this._isComposing=!1,C){const m={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let g;this._isSendingComposition=!1,m.start+=this._dataAlreadySent.length,g=this._isComposing?this._textarea.value.substring(m.start,m.end):this._textarea.value.substring(m.start),g.length>0&&this._coreService.triggerDataEvent(g,!0)}}),0)}else{this._isSendingComposition=!1;const m=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(m,!0)}}_handleAnyTextareaChanges(){const C=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const m=this._textarea.value,g=m.replace(C,"");this._dataAlreadySent=g,m.length>C.length?this._coreService.triggerDataEvent(g,!0):m.length<C.length?this._coreService.triggerDataEvent(`${E.C0.DEL}`,!0):m.length===C.length&&m!==C&&this._coreService.triggerDataEvent(m,!0)}}),0)}updateCompositionElements(C){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const m=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),g=this._renderService.dimensions.css.cell.height,h=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,_=m*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=_+"px",this._compositionView.style.top=h+"px",this._compositionView.style.height=g+"px",this._compositionView.style.lineHeight=g+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const x=this._compositionView.getBoundingClientRect();this._textarea.style.left=_+"px",this._textarea.style.top=h+"px",this._textarea.style.width=Math.max(x.width,1)+"px",this._textarea.style.height=Math.max(x.height,1)+"px",this._textarea.style.lineHeight=x.height+"px"}C||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=O=f([y(2,S.IBufferService),y(3,S.IOptionsService),y(4,S.ICoreService),y(5,d.IRenderService)],O)},9806:(k,l)=>{function u(f,y,d){const S=d.getBoundingClientRect(),E=f.getComputedStyle(d),O=parseInt(E.getPropertyValue("padding-left")),C=parseInt(E.getPropertyValue("padding-top"));return[y.clientX-S.left-O,y.clientY-S.top-C]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=u,l.getCoords=function(f,y,d,S,E,O,C,m,g){if(!O)return;const h=u(f,y,d);return h?(h[0]=Math.ceil((h[0]+(g?C/2:0))/C),h[1]=Math.ceil(h[1]/m),h[0]=Math.min(Math.max(h[0],1),S+(g?1:0)),h[1]=Math.min(Math.max(h[1],1),E),h):void 0}},9504:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const f=u(2584);function y(m,g,h,_){const x=m-d(m,h),A=g-d(g,h),R=Math.abs(x-A)-(function(D,T,M){let $=0;const Z=D-d(D,M),K=T-d(T,M);for(let F=0;F<Math.abs(Z-K);F++){const X=S(D,T)==="A"?-1:1,ee=M.buffer.lines.get(Z+X*F);ee!=null&&ee.isWrapped&&$++}return $})(m,g,h);return C(R,O(S(m,g),_))}function d(m,g){let h=0,_=g.buffer.lines.get(m),x=_==null?void 0:_.isWrapped;for(;x&&m>=0&&m<g.rows;)h++,_=g.buffer.lines.get(--m),x=_==null?void 0:_.isWrapped;return h}function S(m,g){return m>g?"A":"B"}function E(m,g,h,_,x,A){let R=m,D=g,T="";for(;R!==h||D!==_;)R+=x?1:-1,x&&R>A.cols-1?(T+=A.buffer.translateBufferLineToString(D,!1,m,R),R=0,m=0,D++):!x&&R<0&&(T+=A.buffer.translateBufferLineToString(D,!1,0,m+1),R=A.cols-1,m=R,D--);return T+A.buffer.translateBufferLineToString(D,!1,m,R)}function O(m,g){const h=g?"O":"[";return f.C0.ESC+h+m}function C(m,g){m=Math.floor(m);let h="";for(let _=0;_<m;_++)h+=g;return h}l.moveToCellSequence=function(m,g,h,_){const x=h.buffer.x,A=h.buffer.y;if(!h.buffer.hasScrollback)return(function(T,M,$,Z,K,F){return y(M,Z,K,F).length===0?"":C(E(T,M,T,M-d(M,K),!1,K).length,O("D",F))})(x,A,0,g,h,_)+y(A,g,h,_)+(function(T,M,$,Z,K,F){let X;X=y(M,Z,K,F).length>0?Z-d(Z,K):M;const ee=Z,V=(function(Q,ae,j,U,L,H){let q;return q=y(j,U,L,H).length>0?U-d(U,L):ae,Q<j&&q<=U||Q>=j&&q<U?"C":"D"})(T,M,$,Z,K,F);return C(E(T,X,$,ee,V==="C",K).length,O(V,F))})(x,A,m,g,h,_);let R;if(A===g)return R=x>m?"D":"C",C(Math.abs(x-m),O(R,_));R=A>g?"D":"C";const D=Math.abs(A-g);return C((function(T,M){return M.cols-T})(A>g?m:x,h)+(D-1)*h.cols+1+((A>g?x:m)-1),O(R,_))}},1296:function(k,l,u){var f=this&&this.__decorate||function(F,X,ee,V){var Q,ae=arguments.length,j=ae<3?X:V===null?V=Object.getOwnPropertyDescriptor(X,ee):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(F,X,ee,V);else for(var U=F.length-1;U>=0;U--)(Q=F[U])&&(j=(ae<3?Q(j):ae>3?Q(X,ee,j):Q(X,ee))||j);return ae>3&&j&&Object.defineProperty(X,ee,j),j},y=this&&this.__param||function(F,X){return function(ee,V){X(ee,V,F)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const d=u(3787),S=u(2550),E=u(2223),O=u(6171),C=u(6052),m=u(4725),g=u(8055),h=u(8460),_=u(844),x=u(2585),A="xterm-dom-renderer-owner-",R="xterm-rows",D="xterm-fg-",T="xterm-bg-",M="xterm-focus",$="xterm-selection";let Z=1,K=l.DomRenderer=class extends _.Disposable{constructor(F,X,ee,V,Q,ae,j,U,L,H,q,W,le){super(),this._terminal=F,this._document=X,this._element=ee,this._screenElement=V,this._viewportElement=Q,this._helperContainer=ae,this._linkifier2=j,this._charSizeService=L,this._optionsService=H,this._bufferService=q,this._coreBrowserService=W,this._themeService=le,this._terminalClass=Z++,this._rowElements=[],this._selectionRenderModel=(0,C.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new h.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add($),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,O.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((fe=>this._injectCss(fe)))),this._injectCss(this._themeService.colors),this._rowFactory=U.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(A+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((fe=>this._handleLinkHover(fe)))),this.register(this._linkifier2.onHideLinkUnderline((fe=>this._handleLinkLeave(fe)))),this.register((0,_.toDisposable)((()=>{this._element.classList.remove(A+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new S.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const F=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*F,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*F),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/F),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/F),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const ee of this._rowElements)ee.style.width=`${this.dimensions.css.canvas.width}px`,ee.style.height=`${this.dimensions.css.cell.height}px`,ee.style.lineHeight=`${this.dimensions.css.cell.height}px`,ee.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const X=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=X,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(F){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let X=`${this._terminalSelector} .${R} { color: ${F.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;X+=`${this._terminalSelector} .${R} .xterm-dim { color: ${g.color.multiplyOpacity(F.foreground,.5).css};}`,X+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const ee=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,Q=`blink_block_${this._terminalClass}`;X+=`@keyframes ${ee} { 50% { border-bottom-style: hidden; }}`,X+=`@keyframes ${V} { 50% { box-shadow: none; }}`,X+=`@keyframes ${Q} { 0% { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css}; } 50% { background-color: inherit; color: ${F.cursor.css}; }}`,X+=`${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${ee} 1s step-end infinite;}${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${F.cursor.css} !important; color: ${F.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${F.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${F.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${F.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,X+=`${this._terminalSelector} .${$} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${$} div { position: absolute; background-color: ${F.selectionBackgroundOpaque.css};}${this._terminalSelector} .${$} div { position: absolute; background-color: ${F.selectionInactiveBackgroundOpaque.css};}`;for(const[ae,j]of F.ansi.entries())X+=`${this._terminalSelector} .${D}${ae} { color: ${j.css}; }${this._terminalSelector} .${D}${ae}.xterm-dim { color: ${g.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${T}${ae} { background-color: ${j.css}; }`;X+=`${this._terminalSelector} .${D}${E.INVERTED_DEFAULT_COLOR} { color: ${g.color.opaque(F.background).css}; }${this._terminalSelector} .${D}${E.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${g.color.multiplyOpacity(g.color.opaque(F.background),.5).css}; }${this._terminalSelector} .${T}${E.INVERTED_DEFAULT_COLOR} { background-color: ${F.foreground.css}; }`,this._themeStyleElement.textContent=X}_setDefaultSpacing(){const F=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${F}px`,this._rowFactory.defaultSpacing=F}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(F,X){for(let ee=this._rowElements.length;ee<=X;ee++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>X;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(F,X){this._refreshRowElements(F,X),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(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(F,X,ee){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(F,X,ee),this.renderRows(0,this._bufferService.rows-1),!F||!X)return;this._selectionRenderModel.update(this._terminal,F,X,ee);const V=this._selectionRenderModel.viewportStartRow,Q=this._selectionRenderModel.viewportEndRow,ae=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(ae>=this._bufferService.rows||j<0)return;const U=this._document.createDocumentFragment();if(ee){const L=F[0]>X[0];U.appendChild(this._createSelectionElement(ae,L?X[0]:F[0],L?F[0]:X[0],j-ae+1))}else{const L=V===ae?F[0]:0,H=ae===Q?X[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(ae,L,H));const q=j-ae-1;if(U.appendChild(this._createSelectionElement(ae+1,0,this._bufferService.cols,q)),ae!==j){const W=Q===j?X[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(j,0,W))}}this._selectionContainer.appendChild(U)}_createSelectionElement(F,X,ee,V=1){const Q=this._document.createElement("div"),ae=X*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(ee-X);return ae+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-ae),Q.style.height=V*this.dimensions.css.cell.height+"px",Q.style.top=F*this.dimensions.css.cell.height+"px",Q.style.left=`${ae}px`,Q.style.width=`${j}px`,Q}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const F of this._rowElements)F.replaceChildren()}renderRows(F,X){const ee=this._bufferService.buffer,V=ee.ybase+ee.y,Q=Math.min(ee.x,this._bufferService.cols-1),ae=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=F;L<=X;L++){const H=L+ee.ydisp,q=this._rowElements[L],W=ee.lines.get(H);if(!q||!W)break;q.replaceChildren(...this._rowFactory.createRow(W,H,H===V,j,U,Q,ae,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${A}${this._terminalClass}`}_handleLinkHover(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!0)}_handleLinkLeave(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!1)}_setCellUnderline(F,X,ee,V,Q,ae){ee<0&&(F=0),V<0&&(X=0);const j=this._bufferService.rows-1;ee=Math.max(Math.min(ee,j),0),V=Math.max(Math.min(V,j),0),Q=Math.min(Q,this._bufferService.cols);const U=this._bufferService.buffer,L=U.ybase+U.y,H=Math.min(U.x,Q-1),q=this._optionsService.rawOptions.cursorBlink,W=this._optionsService.rawOptions.cursorStyle,le=this._optionsService.rawOptions.cursorInactiveStyle;for(let fe=ee;fe<=V;++fe){const I=fe+U.ydisp,B=this._rowElements[fe],ie=U.lines.get(I);if(!B||!ie)break;B.replaceChildren(...this._rowFactory.createRow(ie,I,I===L,W,le,H,q,this.dimensions.css.cell.width,this._widthCache,ae?fe===ee?F:0:-1,ae?(fe===V?X:Q)-1:-1))}}};l.DomRenderer=K=f([y(7,x.IInstantiationService),y(8,m.ICharSizeService),y(9,x.IOptionsService),y(10,x.IBufferService),y(11,m.ICoreBrowserService),y(12,m.IThemeService)],K)},3787:function(k,l,u){var f=this&&this.__decorate||function(R,D,T,M){var $,Z=arguments.length,K=Z<3?D:M===null?M=Object.getOwnPropertyDescriptor(D,T):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(R,D,T,M);else for(var F=R.length-1;F>=0;F--)($=R[F])&&(K=(Z<3?$(K):Z>3?$(D,T,K):$(D,T))||K);return Z>3&&K&&Object.defineProperty(D,T,K),K},y=this&&this.__param||function(R,D){return function(T,M){D(T,M,R)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const d=u(2223),S=u(643),E=u(511),O=u(2585),C=u(8055),m=u(4725),g=u(4269),h=u(6171),_=u(3734);let x=l.DomRendererRowFactory=class{constructor(R,D,T,M,$,Z,K){this._document=R,this._characterJoinerService=D,this._optionsService=T,this._coreBrowserService=M,this._coreService=$,this._decorationService=Z,this._themeService=K,this._workCell=new E.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,D,T){this._selectionStart=R,this._selectionEnd=D,this._columnSelectMode=T}createRow(R,D,T,M,$,Z,K,F,X,ee,V){const Q=[],ae=this._characterJoinerService.getJoinedCharacters(D),j=this._themeService.colors;let U,L=R.getNoBgTrimmedLength();T&&L<Z+1&&(L=Z+1);let H=0,q="",W=0,le=0,fe=0,I=!1,B=0,ie=!1,ne=0;const me=[],pe=ee!==-1&&V!==-1;for(let Ee=0;Ee<L;Ee++){R.loadCell(Ee,this._workCell);let je=this._workCell.getWidth();if(je===0)continue;let Be=!1,st=Ee,Ce=this._workCell;if(ae.length>0&&Ee===ae[0][0]){Be=!0;const We=ae.shift();Ce=new g.JoinedCellData(this._workCell,R.translateToString(!0,We[0],We[1]),We[1]-We[0]),st=We[1]-1,je=Ce.getWidth()}const _e=this._isCellInSelection(Ee,D),Rt=T&&Ee===Z,mi=pe&&Ee>=ee&&Ee<=V;let xs=!1;this._decorationService.forEachDecorationAtCell(Ee,D,void 0,(We=>{xs=!0}));let Ks=Ce.getChars()||S.WHITESPACE_CELL_CHAR;if(Ks===" "&&(Ce.isUnderline()||Ce.isOverline())&&(Ks=" "),ne=je*F-X.get(Ks,Ce.isBold(),Ce.isItalic()),U){if(H&&(_e&&ie||!_e&&!ie&&Ce.bg===W)&&(_e&&ie&&j.selectionForeground||Ce.fg===le)&&Ce.extended.ext===fe&&mi===I&&ne===B&&!Rt&&!Be&&!xs){Ce.isInvisible()?q+=S.WHITESPACE_CELL_CHAR:q+=Ks,H++;continue}H&&(U.textContent=q),U=this._document.createElement("span"),H=0,q=""}else U=this._document.createElement("span");if(W=Ce.bg,le=Ce.fg,fe=Ce.extended.ext,I=mi,B=ne,ie=_e,Be&&Z>=Ee&&Z<=st&&(Z=Ee),!this._coreService.isCursorHidden&&Rt&&this._coreService.isCursorInitialized){if(me.push("xterm-cursor"),this._coreBrowserService.isFocused)K&&me.push("xterm-cursor-blink"),me.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if($)switch($){case"outline":me.push("xterm-cursor-outline");break;case"block":me.push("xterm-cursor-block");break;case"bar":me.push("xterm-cursor-bar");break;case"underline":me.push("xterm-cursor-underline")}}if(Ce.isBold()&&me.push("xterm-bold"),Ce.isItalic()&&me.push("xterm-italic"),Ce.isDim()&&me.push("xterm-dim"),q=Ce.isInvisible()?S.WHITESPACE_CELL_CHAR:Ce.getChars()||S.WHITESPACE_CELL_CHAR,Ce.isUnderline()&&(me.push(`xterm-underline-${Ce.extended.underlineStyle}`),q===" "&&(q=" "),!Ce.isUnderlineColorDefault()))if(Ce.isUnderlineColorRGB())U.style.textDecorationColor=`rgb(${_.AttributeData.toColorRGB(Ce.getUnderlineColor()).join(",")})`;else{let We=Ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ce.isBold()&&We<8&&(We+=8),U.style.textDecorationColor=j.ansi[We].css}Ce.isOverline()&&(me.push("xterm-overline"),q===" "&&(q=" ")),Ce.isStrikethrough()&&me.push("xterm-strikethrough"),mi&&(U.style.textDecoration="underline");let Dt=Ce.getFgColor(),vt=Ce.getFgColorMode(),Yt=Ce.getBgColor(),Fi=Ce.getBgColorMode();const Vs=!!Ce.isInverse();if(Vs){const We=Dt;Dt=Yt,Yt=We;const ws=vt;vt=Fi,Fi=ws}let Ut,Gs,li,Cs=!1;switch(this._decorationService.forEachDecorationAtCell(Ee,D,void 0,(We=>{We.options.layer!=="top"&&Cs||(We.backgroundColorRGB&&(Fi=50331648,Yt=We.backgroundColorRGB.rgba>>8&16777215,Ut=We.backgroundColorRGB),We.foregroundColorRGB&&(vt=50331648,Dt=We.foregroundColorRGB.rgba>>8&16777215,Gs=We.foregroundColorRGB),Cs=We.options.layer==="top")})),!Cs&&_e&&(Ut=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,Yt=Ut.rgba>>8&16777215,Fi=50331648,Cs=!0,j.selectionForeground&&(vt=50331648,Dt=j.selectionForeground.rgba>>8&16777215,Gs=j.selectionForeground)),Cs&&me.push("xterm-decoration-top"),Fi){case 16777216:case 33554432:li=j.ansi[Yt],me.push(`xterm-bg-${Yt}`);break;case 50331648:li=C.channels.toColor(Yt>>16,Yt>>8&255,255&Yt),this._addStyle(U,`background-color:#${A((Yt>>>0).toString(16),"0",6)}`);break;default:Vs?(li=j.foreground,me.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):li=j.background}switch(Ut||Ce.isDim()&&(Ut=C.color.multiplyOpacity(li,.5)),vt){case 16777216:case 33554432:Ce.isBold()&&Dt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Dt+=8),this._applyMinimumContrast(U,li,j.ansi[Dt],Ce,Ut,void 0)||me.push(`xterm-fg-${Dt}`);break;case 50331648:const We=C.channels.toColor(Dt>>16&255,Dt>>8&255,255&Dt);this._applyMinimumContrast(U,li,We,Ce,Ut,Gs)||this._addStyle(U,`color:#${A(Dt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(U,li,j.foreground,Ce,Ut,Gs)||Vs&&me.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}me.length&&(U.className=me.join(" "),me.length=0),Rt||Be||xs?U.textContent=q:H++,ne!==this.defaultSpacing&&(U.style.letterSpacing=`${ne}px`),Q.push(U),Ee=st}return U&&H&&(U.textContent=q),Q}_applyMinimumContrast(R,D,T,M,$,Z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,h.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const K=this._getContrastCache(M);let F;if($||Z||(F=K.getColor(D.rgba,T.rgba)),F===void 0){const X=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);F=C.color.ensureContrastRatio($||D,Z||T,X),K.setColor(($||D).rgba,(Z||T).rgba,F??null)}return!!F&&(this._addStyle(R,`color:${F.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,D){R.setAttribute("style",`${R.getAttribute("style")||""}${D};`)}_isCellInSelection(R,D){const T=this._selectionStart,M=this._selectionEnd;return!(!T||!M)&&(this._columnSelectMode?T[0]<=M[0]?R>=T[0]&&D>=T[1]&&R<M[0]&&D<=M[1]:R<T[0]&&D>=T[1]&&R>=M[0]&&D<=M[1]:D>T[1]&&D<M[1]||T[1]===M[1]&&D===T[1]&&R>=T[0]&&R<M[0]||T[1]<M[1]&&D===M[1]&&R<M[0]||T[1]<M[1]&&D===T[1]&&R>=T[0])}};function A(R,D,T){for(;R.length<T;)R=D+R;return R}l.DomRendererRowFactory=x=f([y(1,m.ICharacterJoinerService),y(2,O.IOptionsService),y(3,m.ICoreBrowserService),y(4,O.ICoreService),y(5,O.IDecorationService),y(6,m.IThemeService)],x)},2550:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(u,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const y=u.createElement("span");y.classList.add("xterm-char-measure-element");const d=u.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const S=u.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontStyle="italic";const E=u.createElement("span");E.classList.add("xterm-char-measure-element"),E.style.fontWeight="bold",E.style.fontStyle="italic",this._measureElements=[y,d,S,E],this._container.appendChild(y),this._container.appendChild(d),this._container.appendChild(S),this._container.appendChild(E),f.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(u,f,y,d){u===this._font&&f===this._fontSize&&y===this._weight&&d===this._weightBold||(this._font=u,this._fontSize=f,this._weight=y,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(u,f,y){let d=0;if(!f&&!y&&u.length===1&&(d=u.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const O=this._measure(u,0);return O>0&&(this._flat[d]=O),O}let S=u;f&&(S+="B"),y&&(S+="I");let E=this._holey.get(S);if(E===void 0){let O=0;f&&(O|=1),y&&(O|=2),E=this._measure(u,O),E>0&&this._holey.set(S,E)}return E}_measure(u,f){const y=this._measureElements[f];return y.textContent=u.repeat(32),y.offsetWidth/32}}},2223:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const f=u(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(k,l)=>{function u(y){return 57508<=y&&y<=57558}function f(y){return y>=128512&&y<=128591||y>=127744&&y<=128511||y>=128640&&y<=128767||y>=9728&&y<=9983||y>=9984&&y<=10175||y>=65024&&y<=65039||y>=129280&&y<=129535||y>=127462&&y<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(y){if(!y)throw new Error("value must not be falsy");return y},l.isPowerlineGlyph=u,l.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},l.isEmoji=f,l.allowRescaling=function(y,d,S,E){return d===1&&S>Math.ceil(1.5*E)&&y!==void 0&&y>255&&!f(y)&&!u(y)&&!(function(O){return 57344<=O&&O<=63743})(y)},l.treatGlyphAsBackgroundColor=function(y){return u(y)||(function(d){return 9472<=d&&d<=9631})(y)},l.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},l.computeNextVariantOffset=function(y,d,S=0){return(y-(2*Math.round(d)-S))%(2*Math.round(d))}},6052:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class u{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(y,d,S,E=!1){if(this.selectionStart=d,this.selectionEnd=S,!d||!S||d[0]===S[0]&&d[1]===S[1])return void this.clear();const O=y.buffers.active.ydisp,C=d[1]-O,m=S[1]-O,g=Math.max(C,0),h=Math.min(m,y.rows-1);g>=y.rows||h<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=E,this.viewportStartRow=C,this.viewportEndRow=m,this.viewportCappedStartRow=g,this.viewportCappedEndRow=h,this.startCol=d[0],this.endCol=S[0])}isCellSelected(y,d,S){return!!this.hasSelection&&(S-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&S>=this.viewportCappedStartRow&&d<this.endCol&&S<=this.viewportCappedEndRow:d<this.startCol&&S>=this.viewportCappedStartRow&&d>=this.endCol&&S<=this.viewportCappedEndRow:S>this.viewportStartRow&&S<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&S===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportStartRow&&d>=this.startCol)}}l.createSelectionRenderModel=function(){return new u}},456:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,f=this.selectionEnd;return!(!u||!f)&&(u[1]>f[1]||u[1]===f[1]&&u[0]>f[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(k,l,u){var f=this&&this.__decorate||function(h,_,x,A){var R,D=arguments.length,T=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,x):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,_,x,A);else for(var M=h.length-1;M>=0;M--)(R=h[M])&&(T=(D<3?R(T):D>3?R(_,x,T):R(_,x))||T);return D>3&&T&&Object.defineProperty(_,x,T),T},y=this&&this.__param||function(h,_){return function(x,A){_(x,A,h)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const d=u(2585),S=u(8460),E=u(844);let O=l.CharSizeService=class extends E.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(h,_,x){super(),this._optionsService=x,this.width=0,this.height=0,this._onCharSizeChange=this.register(new S.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new g(this._optionsService))}catch{this._measureStrategy=this.register(new m(h,_,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const h=this._measureStrategy.measure();h.width===this.width&&h.height===this.height||(this.width=h.width,this.height=h.height,this._onCharSizeChange.fire())}};l.CharSizeService=O=f([y(2,d.IOptionsService)],O);class C extends E.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(_,x){_!==void 0&&_>0&&x!==void 0&&x>0&&(this._result.width=_,this._result.height=x)}}class m extends C{constructor(_,x,A){super(),this._document=_,this._parentElement=x,this._optionsService=A,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class g extends C{constructor(_){super(),this._optionsService=_,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const x=this._ctx.measureText("W");if(!("width"in x&&"fontBoundingBoxAscent"in x&&"fontBoundingBoxDescent"in x))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const _=this._ctx.measureText("W");return this._validateAndSet(_.width,_.fontBoundingBoxAscent+_.fontBoundingBoxDescent),this._result}}},4269:function(k,l,u){var f=this&&this.__decorate||function(g,h,_,x){var A,R=arguments.length,D=R<3?h:x===null?x=Object.getOwnPropertyDescriptor(h,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,h,_,x);else for(var T=g.length-1;T>=0;T--)(A=g[T])&&(D=(R<3?A(D):R>3?A(h,_,D):A(h,_))||D);return R>3&&D&&Object.defineProperty(h,_,D),D},y=this&&this.__param||function(g,h){return function(_,x){h(_,x,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const d=u(3734),S=u(643),E=u(511),O=u(2585);class C extends d.AttributeData{constructor(h,_,x){super(),this.content=0,this.combinedData="",this.fg=h.fg,this.bg=h.bg,this.combinedData=_,this._width=x}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(h){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=C;let m=l.CharacterJoinerService=class hv{constructor(h){this._bufferService=h,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new E.CellData}register(h){const _={id:this._nextCharacterJoinerId++,handler:h};return this._characterJoiners.push(_),_.id}deregister(h){for(let _=0;_<this._characterJoiners.length;_++)if(this._characterJoiners[_].id===h)return this._characterJoiners.splice(_,1),!0;return!1}getJoinedCharacters(h){if(this._characterJoiners.length===0)return[];const _=this._bufferService.buffer.lines.get(h);if(!_||_.length===0)return[];const x=[],A=_.translateToString(!0);let R=0,D=0,T=0,M=_.getFg(0),$=_.getBg(0);for(let Z=0;Z<_.getTrimmedLength();Z++)if(_.loadCell(Z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==M||this._workCell.bg!==$){if(Z-R>1){const K=this._getJoinedRanges(A,T,D,_,R);for(let F=0;F<K.length;F++)x.push(K[F])}R=Z,T=D,M=this._workCell.fg,$=this._workCell.bg}D+=this._workCell.getChars().length||S.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const Z=this._getJoinedRanges(A,T,D,_,R);for(let K=0;K<Z.length;K++)x.push(Z[K])}return x}_getJoinedRanges(h,_,x,A,R){const D=h.substring(_,x);let T=[];try{T=this._characterJoiners[0].handler(D)}catch(M){console.error(M)}for(let M=1;M<this._characterJoiners.length;M++)try{const $=this._characterJoiners[M].handler(D);for(let Z=0;Z<$.length;Z++)hv._mergeRanges(T,$[Z])}catch($){console.error($)}return this._stringRangesToCellRanges(T,A,R),T}_stringRangesToCellRanges(h,_,x){let A=0,R=!1,D=0,T=h[A];if(T){for(let M=x;M<this._bufferService.cols;M++){const $=_.getWidth(M),Z=_.getString(M).length||S.WHITESPACE_CELL_CHAR.length;if($!==0){if(!R&&T[0]<=D&&(T[0]=M,R=!0),T[1]<=D){if(T[1]=M,T=h[++A],!T)break;T[0]<=D?(T[0]=M,R=!0):R=!1}D+=Z}}T&&(T[1]=this._bufferService.cols)}}static _mergeRanges(h,_){let x=!1;for(let A=0;A<h.length;A++){const R=h[A];if(x){if(_[1]<=R[0])return h[A-1][1]=_[1],h;if(_[1]<=R[1])return h[A-1][1]=Math.max(_[1],R[1]),h.splice(A,1),h;h.splice(A,1),A--}else{if(_[1]<=R[0])return h.splice(A,0,_),h;if(_[1]<=R[1])return R[0]=Math.min(_[0],R[0]),h;_[0]<R[1]&&(R[0]=Math.min(_[0],R[0]),x=!0)}}return x?h[h.length-1][1]=_[1]:h.push(_),h}};l.CharacterJoinerService=m=f([y(0,O.IBufferService)],m)},5114:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const f=u(844),y=u(8460),d=u(3656);class S extends f.Disposable{constructor(C,m,g){super(),this._textarea=C,this._window=m,this.mainDocument=g,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new E(this._window),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new y.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((h=>this._screenDprMonitor.setWindow(h)))),this.register((0,y.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(C){this._window!==C&&(this._window=C,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}}l.CoreBrowserService=S;class E extends f.Disposable{constructor(C){super(),this._parentWindow=C,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)((()=>this.clearListener())))}setWindow(C){this._parentWindow=C,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var C;this._outerListener&&((C=this._resolutionMediaMatchList)==null||C.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const f=u(844);class y extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(S){return this.linkProviders.push(S),{dispose:()=>{const E=this.linkProviders.indexOf(S);E!==-1&&this.linkProviders.splice(E,1)}}}}l.LinkProviderService=y},8934:function(k,l,u){var f=this&&this.__decorate||function(O,C,m,g){var h,_=arguments.length,x=_<3?C:g===null?g=Object.getOwnPropertyDescriptor(C,m):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(O,C,m,g);else for(var A=O.length-1;A>=0;A--)(h=O[A])&&(x=(_<3?h(x):_>3?h(C,m,x):h(C,m))||x);return _>3&&x&&Object.defineProperty(C,m,x),x},y=this&&this.__param||function(O,C){return function(m,g){C(m,g,O)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const d=u(4725),S=u(9806);let E=l.MouseService=class{constructor(O,C){this._renderService=O,this._charSizeService=C}getCoords(O,C,m,g,h){return(0,S.getCoords)(window,O,C,m,g,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,h)}getMouseReportCoords(O,C){const m=(0,S.getCoordsRelativeToElement)(window,O,C);if(this._charSizeService.hasValidSize)return m[0]=Math.min(Math.max(m[0],0),this._renderService.dimensions.css.canvas.width-1),m[1]=Math.min(Math.max(m[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(m[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(m[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(m[0]),y:Math.floor(m[1])}}};l.MouseService=E=f([y(0,d.IRenderService),y(1,d.ICharSizeService)],E)},3230:function(k,l,u){var f=this&&this.__decorate||function(h,_,x,A){var R,D=arguments.length,T=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,x):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,_,x,A);else for(var M=h.length-1;M>=0;M--)(R=h[M])&&(T=(D<3?R(T):D>3?R(_,x,T):R(_,x))||T);return D>3&&T&&Object.defineProperty(_,x,T),T},y=this&&this.__param||function(h,_){return function(x,A){_(x,A,h)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const d=u(6193),S=u(4725),E=u(8460),O=u(844),C=u(7226),m=u(2585);let g=l.RenderService=class extends O.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(h,_,x,A,R,D,T,M){super(),this._rowCount=h,this._charSizeService=A,this._renderer=this.register(new O.MutableDisposable),this._pausedResizeTask=new C.DebouncedIdleTask,this._observerDisposable=this.register(new O.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new E.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new E.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new E.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new E.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer((($,Z)=>this._renderRows($,Z)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var $;return($=this._renderer.value)==null?void 0:$.clear()}))),this.register(x.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(x.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(x.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,_),this.register(T.onWindowChange(($=>this._registerIntersectionObserver($,_))))}_registerIntersectionObserver(h,_){if("IntersectionObserver"in h){const x=new h.IntersectionObserver((A=>this._handleIntersectionChange(A[A.length-1])),{threshold:0});x.observe(_),this._observerDisposable.value=(0,O.toDisposable)((()=>x.disconnect()))}}_handleIntersectionChange(h){this._isPaused=h.isIntersecting===void 0?h.intersectionRatio===0:!h.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(h,_,x=!1){this._isPaused?this._needsFullRefresh=!0:(x||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(h,_,this._rowCount))}_renderRows(h,_){this._renderer.value&&(h=Math.min(h,this._rowCount-1),_=Math.min(_,this._rowCount-1),this._renderer.value.renderRows(h,_),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:h,end:_}),this._onRender.fire({start:h,end:_}),this._isNextRenderRedrawOnly=!0)}resize(h,_){this._rowCount=_,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(h){this._renderer.value=h,this._renderer.value&&(this._renderer.value.onRequestRedraw((_=>this.refreshRows(_.start,_.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(h){return this._renderDebouncer.addRefreshCallback(h)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var h,_;this._renderer.value&&((_=(h=this._renderer.value).clearTextureAtlas)==null||_.call(h),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(h,_){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var x;return(x=this._renderer.value)==null?void 0:x.handleResize(h,_)})):this._renderer.value.handleResize(h,_),this._fullRefresh())}handleCharSizeChanged(){var h;(h=this._renderer.value)==null||h.handleCharSizeChanged()}handleBlur(){var h;(h=this._renderer.value)==null||h.handleBlur()}handleFocus(){var h;(h=this._renderer.value)==null||h.handleFocus()}handleSelectionChanged(h,_,x){var A;this._selectionState.start=h,this._selectionState.end=_,this._selectionState.columnSelectMode=x,(A=this._renderer.value)==null||A.handleSelectionChanged(h,_,x)}handleCursorMove(){var h;(h=this._renderer.value)==null||h.handleCursorMove()}clear(){var h;(h=this._renderer.value)==null||h.clear()}};l.RenderService=g=f([y(2,m.IOptionsService),y(3,S.ICharSizeService),y(4,m.IDecorationService),y(5,m.IBufferService),y(6,S.ICoreBrowserService),y(7,S.IThemeService)],g)},9312:function(k,l,u){var f=this&&this.__decorate||function(T,M,$,Z){var K,F=arguments.length,X=F<3?M:Z===null?Z=Object.getOwnPropertyDescriptor(M,$):Z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(T,M,$,Z);else for(var ee=T.length-1;ee>=0;ee--)(K=T[ee])&&(X=(F<3?K(X):F>3?K(M,$,X):K(M,$))||X);return F>3&&X&&Object.defineProperty(M,$,X),X},y=this&&this.__param||function(T,M){return function($,Z){M($,Z,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const d=u(9806),S=u(9504),E=u(456),O=u(4725),C=u(8460),m=u(844),g=u(6114),h=u(4841),_=u(511),x=u(2585),A=" ",R=new RegExp(A,"g");let D=l.SelectionService=class extends m.Disposable{constructor(T,M,$,Z,K,F,X,ee,V){super(),this._element=T,this._screenElement=M,this._linkifier=$,this._bufferService=Z,this._coreService=K,this._mouseService=F,this._optionsService=X,this._renderService=ee,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new _.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new C.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new C.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Q=>this._handleMouseMove(Q),this._mouseUpListener=Q=>this._handleMouseUp(Q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Q=>this._handleTrim(Q))),this.register(this._bufferService.buffers.onBufferActivate((Q=>this._handleBufferActivate(Q)))),this.enable(),this._model=new E.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,m.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const T=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!T||!M||T[0]===M[0]&&T[1]===M[1])}get selectionText(){const T=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!T||!M)return"";const $=this._bufferService.buffer,Z=[];if(this._activeSelectionMode===3){if(T[0]===M[0])return"";const K=T[0]<M[0]?T[0]:M[0],F=T[0]<M[0]?M[0]:T[0];for(let X=T[1];X<=M[1];X++){const ee=$.translateBufferLineToString(X,!0,K,F);Z.push(ee)}}else{const K=T[1]===M[1]?M[0]:void 0;Z.push($.translateBufferLineToString(T[1],!0,T[0],K));for(let F=T[1]+1;F<=M[1]-1;F++){const X=$.lines.get(F),ee=$.translateBufferLineToString(F,!0);X!=null&&X.isWrapped?Z[Z.length-1]+=ee:Z.push(ee)}if(T[1]!==M[1]){const F=$.lines.get(M[1]),X=$.translateBufferLineToString(M[1],!0,0,M[0]);F&&F.isWrapped?Z[Z.length-1]+=X:Z.push(X)}}return Z.map((K=>K.replace(R," "))).join(g.isWindows?`\r
|
|
307
|
+
WARNING: This link could potentially be dangerous`)){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=m}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=E=f([y(0,S.IBufferService),y(1,S.IOptionsService),y(2,S.IOscLinkService)],E)},6193:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(u,f){this._renderCallback=u,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,f,y){this._rowCount=y,u=u!==void 0?u:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const f=u(3614),y=u(3656),d=u(3551),S=u(9042),E=u(3730),O=u(1680),C=u(3107),m=u(5744),g=u(2950),h=u(1296),_=u(428),x=u(4269),A=u(5114),R=u(8934),D=u(3230),T=u(9312),M=u(4725),$=u(6731),Z=u(8055),K=u(8969),F=u(8460),X=u(844),ee=u(6114),V=u(8437),Q=u(2584),ae=u(7399),j=u(5941),I=u(9074),L=u(2585),H=u(5435),q=u(4567),W=u(779);class le extends K.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(U={}){super(U),this.browser=ee,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new X.MutableDisposable),this._onCursorMove=this.register(new F.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new F.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new F.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new F.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new F.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new F.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new F.EventEmitter),this._onBlur=this.register(new F.EventEmitter),this._onA11yCharEmitter=this.register(new F.EventEmitter),this._onA11yTabEmitter=this.register(new F.EventEmitter),this._onWillOpen=this.register(new F.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(I.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(W.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(E.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((B,ie)=>this.refresh(B,ie)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((B=>this._reportWindowsOptions(B)))),this.register(this._inputHandler.onColor((B=>this._handleColorEvent(B)))),this.register((0,F.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,F.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((B=>this._afterResize(B.cols,B.rows)))),this.register((0,X.toDisposable)((()=>{var B,ie;this._customKeyEventHandler=void 0,(ie=(B=this.element)==null?void 0:B.parentNode)==null||ie.removeChild(this.element)})))}_handleColorEvent(U){if(this._themeService)for(const B of U){let ie,ne="";switch(B.index){case 256:ie="foreground",ne="10";break;case 257:ie="background",ne="11";break;case 258:ie="cursor",ne="12";break;default:ie="ansi",ne="4;"+B.index}switch(B.type){case 0:const me=Z.color.toColorRGB(ie==="ansi"?this._themeService.colors.ansi[B.index]:this._themeService.colors[ie]);this.coreService.triggerDataEvent(`${Q.C0.ESC}]${ne};${(0,j.toRgbString)(me)}${Q.C1_ESCAPED.ST}`);break;case 1:if(ie==="ansi")this._themeService.modifyColors((pe=>pe.ansi[B.index]=Z.channels.toColor(...B.color)));else{const pe=ie;this._themeService.modifyColors((Ee=>Ee[pe]=Z.channels.toColor(...B.color)))}break;case 2:this._themeService.restoreColor(B.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(U){U?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(U){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var U;return(U=this.textarea)==null?void 0:U.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const U=this.buffer.ybase+this.buffer.y,B=this.buffer.lines.get(U);if(!B)return;const ie=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,me=B.getWidth(ie),pe=this._renderService.dimensions.css.cell.width*me,Ee=this.buffer.y*this._renderService.dimensions.css.cell.height,je=ie*this._renderService.dimensions.css.cell.width;this.textarea.style.left=je+"px",this.textarea.style.top=Ee+"px",this.textarea.style.width=pe+"px",this.textarea.style.height=ne+"px",this.textarea.style.lineHeight=ne+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(B=>{this.hasSelection()&&(0,f.copyHandler)(B,this._selectionService)})));const U=B=>(0,f.handlePasteEvent)(B,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",U)),this.register((0,y.addDisposableDomListener)(this.element,"paste",U)),ee.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(B=>{B.button===2&&(0,f.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(B=>{(0,f.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ee.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(B=>{B.button===1&&(0,f.moveTextAreaUnderMouseCursor)(B,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(U=>this._keyUp(U)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(U=>this._keyDown(U)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(U=>this._keyPress(U)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(U=>this._compositionHelper.compositionupdate(U)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(U=>this._inputEvent(U)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(U){var ie;if(!U)throw new Error("Terminal requires a parent element.");if(U.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ie=this.element)==null?void 0:ie.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=U.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"),U.appendChild(this.element);const B=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,y.addDisposableDomListener)(this.screenElement,"mousemove",(ne=>this.updateCursorStyle(ne)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),B.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",S.promptLabel),ee.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(A.CoreBrowserService,this.textarea,U.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(ne=>this._handleTextAreaFocus(ne)))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(_.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance($.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(x.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ne=>this._onRender.fire(ne)))),this.onResize((ne=>this._renderService.resize(ne.cols,ne.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(g.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(B);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(O.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(T.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ne=>this._renderService.handleSelectionChanged(ne.start,ne.end,ne.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ne=>{this.textarea.value=ne,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ne=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(C.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(ne=>this._selectionService.handleMouseDown(ne)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(q.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ne=>this._handleScreenReaderModeOptionChange(ne)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ne=>{!this._overviewRulerRenderer&&ne&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(h.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const U=this,B=this.element;function ie(pe){const Ee=U._mouseService.getMouseReportCoords(pe,U.screenElement);if(!Ee)return!1;let je,Be;switch(pe.overrideType||pe.type){case"mousemove":Be=32,pe.buttons===void 0?(je=3,pe.button!==void 0&&(je=pe.button<3?pe.button:3)):je=1&pe.buttons?0:4&pe.buttons?1:2&pe.buttons?2:3;break;case"mouseup":Be=0,je=pe.button<3?pe.button:3;break;case"mousedown":Be=1,je=pe.button<3?pe.button:3;break;case"wheel":if(U._customWheelEventHandler&&U._customWheelEventHandler(pe)===!1||U.viewport.getLinesScrolled(pe)===0)return!1;Be=pe.deltaY<0?0:1,je=4;break;default:return!1}return!(Be===void 0||je===void 0||je>4)&&U.coreMouseService.triggerMouseEvent({col:Ee.col,row:Ee.row,x:Ee.x,y:Ee.y,button:je,action:Be,ctrl:pe.ctrlKey,alt:pe.altKey,shift:pe.shiftKey})}const ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},me={mouseup:pe=>(ie(pe),pe.buttons||(this._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.removeEventListener("mousemove",ne.mousedrag)),this.cancel(pe)),wheel:pe=>(ie(pe),this.cancel(pe,!0)),mousedrag:pe=>{pe.buttons&&ie(pe)},mousemove:pe=>{pe.buttons||ie(pe)}};this.register(this.coreMouseService.onProtocolChange((pe=>{pe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(pe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&pe?ne.mousemove||(B.addEventListener("mousemove",me.mousemove),ne.mousemove=me.mousemove):(B.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&pe?ne.wheel||(B.addEventListener("wheel",me.wheel,{passive:!1}),ne.wheel=me.wheel):(B.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&pe?ne.mouseup||(ne.mouseup=me.mouseup):(this._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&pe?ne.mousedrag||(ne.mousedrag=me.mousedrag):(this._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(B,"mousedown",(pe=>{if(pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(pe))return ie(pe),ne.mouseup&&this._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.addEventListener("mousemove",ne.mousedrag),this.cancel(pe)}))),this.register((0,y.addDisposableDomListener)(B,"wheel",(pe=>{if(!ne.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(pe)===!1)return!1;if(!this.buffer.hasScrollback){const Ee=this.viewport.getLinesScrolled(pe);if(Ee===0)return;const je=Q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(pe.deltaY<0?"A":"B");let Be="";for(let st=0;st<Math.abs(Ee);st++)Be+=je;return this.coreService.triggerDataEvent(Be,!0),this.cancel(pe,!0)}return this.viewport.handleWheel(pe)?this.cancel(pe):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(B,"touchstart",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(pe),this.cancel(pe)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(B,"touchmove",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(pe)?void 0:this.cancel(pe)}),{passive:!1}))}refresh(U,B){var ie;(ie=this._renderService)==null||ie.refreshRows(U,B)}updateCursorStyle(U){var B;(B=this._selectionService)!=null&&B.shouldColumnSelect(U)?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(U,B,ie=0){var ne;ie===1?(super.scrollLines(U,B,ie),this.refresh(0,this.rows-1)):(ne=this.viewport)==null||ne.scrollLines(U)}paste(U){(0,f.paste)(U,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(U){this._customKeyEventHandler=U}attachCustomWheelEventHandler(U){this._customWheelEventHandler=U}registerLinkProvider(U){return this._linkProviderService.registerLinkProvider(U)}registerCharacterJoiner(U){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const B=this._characterJoinerService.register(U);return this.refresh(0,this.rows-1),B}deregisterCharacterJoiner(U){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(U)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(U){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+U)}registerDecoration(U){return this._decorationService.registerDecoration(U)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(U,B,ie){this._selectionService.setSelection(U,B,ie)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var U;(U=this._selectionService)==null||U.clearSelection()}selectAll(){var U;(U=this._selectionService)==null||U.selectAll()}selectLines(U,B){var ie;(ie=this._selectionService)==null||ie.selectLines(U,B)}_keyDown(U){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(U)===!1)return!1;const B=this.browser.isMac&&this.options.macOptionIsMeta&&U.altKey;if(!B&&!this._compositionHelper.keydown(U))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;B||U.key!=="Dead"&&U.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ie=(0,ae.evaluateKeyboardEvent)(U,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(U),ie.type===3||ie.type===2){const ne=this.rows-1;return this.scrollLines(ie.type===2?-ne:ne),this.cancel(U,!0)}return ie.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,U)||(ie.cancel&&this.cancel(U,!0),!ie.key||!!(U.key&&!U.ctrlKey&&!U.altKey&&!U.metaKey&&U.key.length===1&&U.key.charCodeAt(0)>=65&&U.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ie.key!==Q.C0.ETX&&ie.key!==Q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ie.key,domEvent:U}),this._showCursor(),this.coreService.triggerDataEvent(ie.key,!0),!this.optionsService.rawOptions.screenReaderMode||U.altKey||U.ctrlKey?this.cancel(U,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(U,B){const ie=U.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||U.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey||U.isWindows&&B.getModifierState("AltGraph");return B.type==="keypress"?ie:ie&&(!B.keyCode||B.keyCode>47)}_keyUp(U){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(U)===!1||((function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18})(U)||this.focus(),this.updateCursorStyle(U),this._keyPressHandled=!1)}_keyPress(U){let B;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(U)===!1)return!1;if(this.cancel(U),U.charCode)B=U.charCode;else if(U.which===null||U.which===void 0)B=U.keyCode;else{if(U.which===0||U.charCode===0)return!1;B=U.which}return!(!B||(U.altKey||U.ctrlKey||U.metaKey)&&!this._isThirdLevelShift(this.browser,U)||(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:U}),this._showCursor(),this.coreService.triggerDataEvent(B,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(U){if(U.data&&U.inputType==="insertText"&&(!U.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const B=U.data;return this.coreService.triggerDataEvent(B,!0),this.cancel(U),!0}return!1}resize(U,B){U!==this.cols||B!==this.rows?super.resize(U,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(U,B){var ie,ne;(ie=this._charSizeService)==null||ie.measure(),(ne=this.viewport)==null||ne.syncScrollArea(!0)}clear(){var U;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 B=1;B<this.rows;B++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(U=this.viewport)==null||U.reset(),this.refresh(0,this.rows-1)}}reset(){var B,ie;this.options.rows=this.rows,this.options.cols=this.cols;const U=this._customKeyEventHandler;this._setup(),super.reset(),(B=this._selectionService)==null||B.reset(),this._decorationService.reset(),(ie=this.viewport)==null||ie.reset(),this._customKeyEventHandler=U,this.refresh(0,this.rows-1)}clearTextureAtlas(){var U;(U=this._renderService)==null||U.clearTextureAtlas()}_reportFocus(){var U;(U=this.element)!=null&&U.classList.contains("focus")?this.coreService.triggerDataEvent(Q.C0.ESC+"[I"):this.coreService.triggerDataEvent(Q.C0.ESC+"[O")}_reportWindowsOptions(U){if(this._renderService)switch(U){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const B=this._renderService.dimensions.css.canvas.width.toFixed(0),ie=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[4;${ie};${B}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ne=this._renderService.dimensions.css.cell.width.toFixed(0),me=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[6;${me};${ne}t`)}}cancel(U,B){if(this.options.cancelEvents||B)return U.preventDefault(),U.stopPropagation(),!1}}l.Terminal=le},9924:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(u,f=1e3){this._renderCallback=u,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,f,y){this._rowCount=y,u=u!==void 0?u:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const S=d-this._lastRefreshMs,E=this._debounceThresholdMS-S;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),E)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f)}}},1680:function(k,l,u){var f=this&&this.__decorate||function(g,h,_,x){var A,R=arguments.length,D=R<3?h:x===null?x=Object.getOwnPropertyDescriptor(h,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,h,_,x);else for(var T=g.length-1;T>=0;T--)(A=g[T])&&(D=(R<3?A(D):R>3?A(h,_,D):A(h,_))||D);return R>3&&D&&Object.defineProperty(h,_,D),D},y=this&&this.__param||function(g,h){return function(_,x){h(_,x,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const d=u(3656),S=u(4725),E=u(8460),O=u(844),C=u(2585);let m=l.Viewport=class extends O.Disposable{constructor(g,h,_,x,A,R,D,T){super(),this._viewportElement=g,this._scrollArea=h,this._bufferService=_,this._optionsService=x,this._charSizeService=A,this._renderService=R,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(T.colors),this.register(T.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(g){this._viewportElement.style.backgroundColor=g.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(g){if(g)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const h=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==h&&(this._lastRecordedBufferHeight=h,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const g=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==g&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=g),this._refreshAnimationFrame=null}syncScrollArea(g=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(g);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(g)}_handleScroll(g){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const h=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const g=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(g*(this._smoothScrollState.target-this._smoothScrollState.origin)),g<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(g,h){const _=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(h<0&&this._viewportElement.scrollTop!==0||h>0&&_<this._lastRecordedBufferHeight)||(g.cancelable&&g.preventDefault(),!1)}handleWheel(g){const h=this._getPixelsScrolled(g);return h!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+h:this._smoothScrollState.target+=h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=h,this._bubbleScroll(g,h))}scrollLines(g){if(g!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const h=g*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!1})}_getPixelsScrolled(g){if(g.deltaY===0||g.shiftKey)return 0;let h=this._applyScrollModifier(g.deltaY,g);return g.deltaMode===WheelEvent.DOM_DELTA_LINE?h*=this._currentRowHeight:g.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._currentRowHeight*this._bufferService.rows),h}getBufferElements(g,h){var T;let _,x="";const A=[],R=h??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let M=g;M<R;M++){const $=D.get(M);if(!$)continue;const Z=(T=D.get(M+1))==null?void 0:T.isWrapped;if(x+=$.translateToString(!Z),!Z||M===D.length-1){const K=document.createElement("div");K.textContent=x,A.push(K),x.length>0&&(_=K),x=""}}return{bufferElements:A,cursorElement:_}}getLinesScrolled(g){if(g.deltaY===0||g.shiftKey)return 0;let h=this._applyScrollModifier(g.deltaY,g);return g.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(h/=this._currentRowHeight+0,this._wheelPartialScroll+=h,h=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):g.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._bufferService.rows),h}_applyScrollModifier(g,h){const _=this._optionsService.rawOptions.fastScrollModifier;return _==="alt"&&h.altKey||_==="ctrl"&&h.ctrlKey||_==="shift"&&h.shiftKey?g*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:g*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(g){this._lastTouchY=g.touches[0].pageY}handleTouchMove(g){const h=this._lastTouchY-g.touches[0].pageY;return this._lastTouchY=g.touches[0].pageY,h!==0&&(this._viewportElement.scrollTop+=h,this._bubbleScroll(g,h))}};l.Viewport=m=f([y(2,C.IBufferService),y(3,C.IOptionsService),y(4,S.ICharSizeService),y(5,S.IRenderService),y(6,S.ICoreBrowserService),y(7,S.IThemeService)],m)},3107:function(k,l,u){var f=this&&this.__decorate||function(C,m,g,h){var _,x=arguments.length,A=x<3?m:h===null?h=Object.getOwnPropertyDescriptor(m,g):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(C,m,g,h);else for(var R=C.length-1;R>=0;R--)(_=C[R])&&(A=(x<3?_(A):x>3?_(m,g,A):_(m,g))||A);return x>3&&A&&Object.defineProperty(m,g,A),A},y=this&&this.__param||function(C,m){return function(g,h){m(g,h,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const d=u(4725),S=u(844),E=u(2585);let O=l.BufferDecorationRenderer=class extends S.Disposable{constructor(C,m,g,h,_){super(),this._screenElement=C,this._bufferService=m,this._coreBrowserService=g,this._decorationService=h,this._renderService=_,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((x=>this._removeDecoration(x)))),this.register((0,S.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const C of this._decorationService.decorations)this._renderDecoration(C);this._dimensionsChanged=!1}_renderDecoration(C){this._refreshStyle(C),this._dimensionsChanged&&this._refreshXPosition(C)}_createElement(C){var h;const m=this._coreBrowserService.mainDocument.createElement("div");m.classList.add("xterm-decoration"),m.classList.toggle("xterm-decoration-top-layer",((h=C==null?void 0:C.options)==null?void 0:h.layer)==="top"),m.style.width=`${Math.round((C.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,m.style.height=(C.options.height||1)*this._renderService.dimensions.css.cell.height+"px",m.style.top=(C.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",m.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const g=C.options.x??0;return g&&g>this._bufferService.cols&&(m.style.display="none"),this._refreshXPosition(C,m),m}_refreshStyle(C){const m=C.marker.line-this._bufferService.buffers.active.ydisp;if(m<0||m>=this._bufferService.rows)C.element&&(C.element.style.display="none",C.onRenderEmitter.fire(C.element));else{let g=this._decorationElements.get(C);g||(g=this._createElement(C),C.element=g,this._decorationElements.set(C,g),this._container.appendChild(g),C.onDispose((()=>{this._decorationElements.delete(C),g.remove()}))),g.style.top=m*this._renderService.dimensions.css.cell.height+"px",g.style.display=this._altBufferIsActive?"none":"block",C.onRenderEmitter.fire(g)}}_refreshXPosition(C,m=C.element){if(!m)return;const g=C.options.x??0;(C.options.anchor||"left")==="right"?m.style.right=g?g*this._renderService.dimensions.css.cell.width+"px":"":m.style.left=g?g*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(C){var m;(m=this._decorationElements.get(C))==null||m.remove(),this._decorationElements.delete(C),C.dispose()}};l.BufferDecorationRenderer=O=f([y(1,E.IBufferService),y(2,d.ICoreBrowserService),y(3,E.IDecorationService),y(4,d.IRenderService)],O)},5871:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const f of this._zones)if(f.color===u.options.overviewRulerOptions.color&&f.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,u.marker.line))return;if(this._lineAdjacentToZone(f,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(f,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,f){return f>=u.startBufferLine&&f<=u.endBufferLine}_lineAdjacentToZone(u,f,y){return f>=u.startBufferLine-this._linePadding[y||"full"]&&f<=u.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(u,f){u.startBufferLine=Math.min(u.startBufferLine,f),u.endBufferLine=Math.max(u.endBufferLine,f)}}},5744:function(k,l,u){var f=this&&this.__decorate||function(_,x,A,R){var D,T=arguments.length,M=T<3?x:R===null?R=Object.getOwnPropertyDescriptor(x,A):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(_,x,A,R);else for(var $=_.length-1;$>=0;$--)(D=_[$])&&(M=(T<3?D(M):T>3?D(x,A,M):D(x,A))||M);return T>3&&M&&Object.defineProperty(x,A,M),M},y=this&&this.__param||function(_,x){return function(A,R){x(A,R,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const d=u(5871),S=u(4725),E=u(844),O=u(2585),C={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0},g={full:0,left:0,center:0,right:0};let h=l.OverviewRulerRenderer=class extends E.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(_,x,A,R,D,T,M){var Z;super(),this._viewportElement=_,this._screenElement=x,this._bufferService=A,this._decorationService=R,this._renderService=D,this._optionsService=T,this._coreBrowserService=M,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(Z=this._viewportElement.parentElement)==null||Z.insertBefore(this._canvas,this._viewportElement);const $=this._canvas.getContext("2d");if(!$)throw new Error("Ctx cannot be null");this._ctx=$,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,E.toDisposable)((()=>{var K;(K=this._canvas)==null||K.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const _=Math.floor(this._canvas.width/3),x=Math.ceil(this._canvas.width/3);m.full=this._canvas.width,m.left=_,m.center=x,m.right=_,this._refreshDrawHeightConstants(),g.full=0,g.left=0,g.center=m.left,g.right=m.left+m.center}_refreshDrawHeightConstants(){C.full=Math.round(2*this._coreBrowserService.dpr);const _=this._canvas.height/this._bufferService.buffer.lines.length,x=Math.round(Math.max(Math.min(_,12),6)*this._coreBrowserService.dpr);C.left=x,C.center=x,C.right=x}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const x of this._decorationService.decorations)this._colorZoneStore.addDecoration(x);this._ctx.lineWidth=1;const _=this._colorZoneStore.zones;for(const x of _)x.position!=="full"&&this._renderColorZone(x);for(const x of _)x.position==="full"&&this._renderColorZone(x);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(_){this._ctx.fillStyle=_.color,this._ctx.fillRect(g[_.position||"full"],Math.round((this._canvas.height-1)*(_.startBufferLine/this._bufferService.buffers.active.lines.length)-C[_.position||"full"]/2),m[_.position||"full"],Math.round((this._canvas.height-1)*((_.endBufferLine-_.startBufferLine)/this._bufferService.buffers.active.lines.length)+C[_.position||"full"]))}_queueRefresh(_,x){this._shouldUpdateDimensions=_||this._shouldUpdateDimensions,this._shouldUpdateAnchor=x||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=h=f([y(2,O.IBufferService),y(3,O.IDecorationService),y(4,S.IRenderService),y(5,O.IOptionsService),y(6,S.ICoreBrowserService)],h)},2950:function(k,l,u){var f=this&&this.__decorate||function(C,m,g,h){var _,x=arguments.length,A=x<3?m:h===null?h=Object.getOwnPropertyDescriptor(m,g):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(C,m,g,h);else for(var R=C.length-1;R>=0;R--)(_=C[R])&&(A=(x<3?_(A):x>3?_(m,g,A):_(m,g))||A);return x>3&&A&&Object.defineProperty(m,g,A),A},y=this&&this.__param||function(C,m){return function(g,h){m(g,h,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const d=u(4725),S=u(2585),E=u(2584);let O=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(C,m,g,h,_,x){this._textarea=C,this._compositionView=m,this._bufferService=g,this._optionsService=h,this._coreService=_,this._renderService=x,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(C){this._compositionView.textContent=C.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(C){if(this._isComposing||this._isSendingComposition){if(C.keyCode===229||C.keyCode===16||C.keyCode===17||C.keyCode===18)return!1;this._finalizeComposition(!1)}return C.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(C){if(this._compositionView.classList.remove("active"),this._isComposing=!1,C){const m={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let g;this._isSendingComposition=!1,m.start+=this._dataAlreadySent.length,g=this._isComposing?this._textarea.value.substring(m.start,m.end):this._textarea.value.substring(m.start),g.length>0&&this._coreService.triggerDataEvent(g,!0)}}),0)}else{this._isSendingComposition=!1;const m=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(m,!0)}}_handleAnyTextareaChanges(){const C=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const m=this._textarea.value,g=m.replace(C,"");this._dataAlreadySent=g,m.length>C.length?this._coreService.triggerDataEvent(g,!0):m.length<C.length?this._coreService.triggerDataEvent(`${E.C0.DEL}`,!0):m.length===C.length&&m!==C&&this._coreService.triggerDataEvent(m,!0)}}),0)}updateCompositionElements(C){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const m=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),g=this._renderService.dimensions.css.cell.height,h=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,_=m*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=_+"px",this._compositionView.style.top=h+"px",this._compositionView.style.height=g+"px",this._compositionView.style.lineHeight=g+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const x=this._compositionView.getBoundingClientRect();this._textarea.style.left=_+"px",this._textarea.style.top=h+"px",this._textarea.style.width=Math.max(x.width,1)+"px",this._textarea.style.height=Math.max(x.height,1)+"px",this._textarea.style.lineHeight=x.height+"px"}C||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=O=f([y(2,S.IBufferService),y(3,S.IOptionsService),y(4,S.ICoreService),y(5,d.IRenderService)],O)},9806:(k,l)=>{function u(f,y,d){const S=d.getBoundingClientRect(),E=f.getComputedStyle(d),O=parseInt(E.getPropertyValue("padding-left")),C=parseInt(E.getPropertyValue("padding-top"));return[y.clientX-S.left-O,y.clientY-S.top-C]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=u,l.getCoords=function(f,y,d,S,E,O,C,m,g){if(!O)return;const h=u(f,y,d);return h?(h[0]=Math.ceil((h[0]+(g?C/2:0))/C),h[1]=Math.ceil(h[1]/m),h[0]=Math.min(Math.max(h[0],1),S+(g?1:0)),h[1]=Math.min(Math.max(h[1],1),E),h):void 0}},9504:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const f=u(2584);function y(m,g,h,_){const x=m-d(m,h),A=g-d(g,h),R=Math.abs(x-A)-(function(D,T,M){let $=0;const Z=D-d(D,M),K=T-d(T,M);for(let F=0;F<Math.abs(Z-K);F++){const X=S(D,T)==="A"?-1:1,ee=M.buffer.lines.get(Z+X*F);ee!=null&&ee.isWrapped&&$++}return $})(m,g,h);return C(R,O(S(m,g),_))}function d(m,g){let h=0,_=g.buffer.lines.get(m),x=_==null?void 0:_.isWrapped;for(;x&&m>=0&&m<g.rows;)h++,_=g.buffer.lines.get(--m),x=_==null?void 0:_.isWrapped;return h}function S(m,g){return m>g?"A":"B"}function E(m,g,h,_,x,A){let R=m,D=g,T="";for(;R!==h||D!==_;)R+=x?1:-1,x&&R>A.cols-1?(T+=A.buffer.translateBufferLineToString(D,!1,m,R),R=0,m=0,D++):!x&&R<0&&(T+=A.buffer.translateBufferLineToString(D,!1,0,m+1),R=A.cols-1,m=R,D--);return T+A.buffer.translateBufferLineToString(D,!1,m,R)}function O(m,g){const h=g?"O":"[";return f.C0.ESC+h+m}function C(m,g){m=Math.floor(m);let h="";for(let _=0;_<m;_++)h+=g;return h}l.moveToCellSequence=function(m,g,h,_){const x=h.buffer.x,A=h.buffer.y;if(!h.buffer.hasScrollback)return(function(T,M,$,Z,K,F){return y(M,Z,K,F).length===0?"":C(E(T,M,T,M-d(M,K),!1,K).length,O("D",F))})(x,A,0,g,h,_)+y(A,g,h,_)+(function(T,M,$,Z,K,F){let X;X=y(M,Z,K,F).length>0?Z-d(Z,K):M;const ee=Z,V=(function(Q,ae,j,I,L,H){let q;return q=y(j,I,L,H).length>0?I-d(I,L):ae,Q<j&&q<=I||Q>=j&&q<I?"C":"D"})(T,M,$,Z,K,F);return C(E(T,X,$,ee,V==="C",K).length,O(V,F))})(x,A,m,g,h,_);let R;if(A===g)return R=x>m?"D":"C",C(Math.abs(x-m),O(R,_));R=A>g?"D":"C";const D=Math.abs(A-g);return C((function(T,M){return M.cols-T})(A>g?m:x,h)+(D-1)*h.cols+1+((A>g?x:m)-1),O(R,_))}},1296:function(k,l,u){var f=this&&this.__decorate||function(F,X,ee,V){var Q,ae=arguments.length,j=ae<3?X:V===null?V=Object.getOwnPropertyDescriptor(X,ee):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(F,X,ee,V);else for(var I=F.length-1;I>=0;I--)(Q=F[I])&&(j=(ae<3?Q(j):ae>3?Q(X,ee,j):Q(X,ee))||j);return ae>3&&j&&Object.defineProperty(X,ee,j),j},y=this&&this.__param||function(F,X){return function(ee,V){X(ee,V,F)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const d=u(3787),S=u(2550),E=u(2223),O=u(6171),C=u(6052),m=u(4725),g=u(8055),h=u(8460),_=u(844),x=u(2585),A="xterm-dom-renderer-owner-",R="xterm-rows",D="xterm-fg-",T="xterm-bg-",M="xterm-focus",$="xterm-selection";let Z=1,K=l.DomRenderer=class extends _.Disposable{constructor(F,X,ee,V,Q,ae,j,I,L,H,q,W,le){super(),this._terminal=F,this._document=X,this._element=ee,this._screenElement=V,this._viewportElement=Q,this._helperContainer=ae,this._linkifier2=j,this._charSizeService=L,this._optionsService=H,this._bufferService=q,this._coreBrowserService=W,this._themeService=le,this._terminalClass=Z++,this._rowElements=[],this._selectionRenderModel=(0,C.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new h.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add($),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,O.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((fe=>this._injectCss(fe)))),this._injectCss(this._themeService.colors),this._rowFactory=I.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(A+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((fe=>this._handleLinkHover(fe)))),this.register(this._linkifier2.onHideLinkUnderline((fe=>this._handleLinkLeave(fe)))),this.register((0,_.toDisposable)((()=>{this._element.classList.remove(A+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new S.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const F=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*F,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*F),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/F),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/F),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const ee of this._rowElements)ee.style.width=`${this.dimensions.css.canvas.width}px`,ee.style.height=`${this.dimensions.css.cell.height}px`,ee.style.lineHeight=`${this.dimensions.css.cell.height}px`,ee.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const X=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=X,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(F){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let X=`${this._terminalSelector} .${R} { color: ${F.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;X+=`${this._terminalSelector} .${R} .xterm-dim { color: ${g.color.multiplyOpacity(F.foreground,.5).css};}`,X+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const ee=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,Q=`blink_block_${this._terminalClass}`;X+=`@keyframes ${ee} { 50% { border-bottom-style: hidden; }}`,X+=`@keyframes ${V} { 50% { box-shadow: none; }}`,X+=`@keyframes ${Q} { 0% { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css}; } 50% { background-color: inherit; color: ${F.cursor.css}; }}`,X+=`${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${ee} 1s step-end infinite;}${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${F.cursor.css} !important; color: ${F.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${F.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${F.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${F.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,X+=`${this._terminalSelector} .${$} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${$} div { position: absolute; background-color: ${F.selectionBackgroundOpaque.css};}${this._terminalSelector} .${$} div { position: absolute; background-color: ${F.selectionInactiveBackgroundOpaque.css};}`;for(const[ae,j]of F.ansi.entries())X+=`${this._terminalSelector} .${D}${ae} { color: ${j.css}; }${this._terminalSelector} .${D}${ae}.xterm-dim { color: ${g.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${T}${ae} { background-color: ${j.css}; }`;X+=`${this._terminalSelector} .${D}${E.INVERTED_DEFAULT_COLOR} { color: ${g.color.opaque(F.background).css}; }${this._terminalSelector} .${D}${E.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${g.color.multiplyOpacity(g.color.opaque(F.background),.5).css}; }${this._terminalSelector} .${T}${E.INVERTED_DEFAULT_COLOR} { background-color: ${F.foreground.css}; }`,this._themeStyleElement.textContent=X}_setDefaultSpacing(){const F=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${F}px`,this._rowFactory.defaultSpacing=F}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(F,X){for(let ee=this._rowElements.length;ee<=X;ee++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>X;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(F,X){this._refreshRowElements(F,X),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(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(F,X,ee){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(F,X,ee),this.renderRows(0,this._bufferService.rows-1),!F||!X)return;this._selectionRenderModel.update(this._terminal,F,X,ee);const V=this._selectionRenderModel.viewportStartRow,Q=this._selectionRenderModel.viewportEndRow,ae=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(ae>=this._bufferService.rows||j<0)return;const I=this._document.createDocumentFragment();if(ee){const L=F[0]>X[0];I.appendChild(this._createSelectionElement(ae,L?X[0]:F[0],L?F[0]:X[0],j-ae+1))}else{const L=V===ae?F[0]:0,H=ae===Q?X[0]:this._bufferService.cols;I.appendChild(this._createSelectionElement(ae,L,H));const q=j-ae-1;if(I.appendChild(this._createSelectionElement(ae+1,0,this._bufferService.cols,q)),ae!==j){const W=Q===j?X[0]:this._bufferService.cols;I.appendChild(this._createSelectionElement(j,0,W))}}this._selectionContainer.appendChild(I)}_createSelectionElement(F,X,ee,V=1){const Q=this._document.createElement("div"),ae=X*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(ee-X);return ae+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-ae),Q.style.height=V*this.dimensions.css.cell.height+"px",Q.style.top=F*this.dimensions.css.cell.height+"px",Q.style.left=`${ae}px`,Q.style.width=`${j}px`,Q}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const F of this._rowElements)F.replaceChildren()}renderRows(F,X){const ee=this._bufferService.buffer,V=ee.ybase+ee.y,Q=Math.min(ee.x,this._bufferService.cols-1),ae=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,I=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=F;L<=X;L++){const H=L+ee.ydisp,q=this._rowElements[L],W=ee.lines.get(H);if(!q||!W)break;q.replaceChildren(...this._rowFactory.createRow(W,H,H===V,j,I,Q,ae,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${A}${this._terminalClass}`}_handleLinkHover(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!0)}_handleLinkLeave(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!1)}_setCellUnderline(F,X,ee,V,Q,ae){ee<0&&(F=0),V<0&&(X=0);const j=this._bufferService.rows-1;ee=Math.max(Math.min(ee,j),0),V=Math.max(Math.min(V,j),0),Q=Math.min(Q,this._bufferService.cols);const I=this._bufferService.buffer,L=I.ybase+I.y,H=Math.min(I.x,Q-1),q=this._optionsService.rawOptions.cursorBlink,W=this._optionsService.rawOptions.cursorStyle,le=this._optionsService.rawOptions.cursorInactiveStyle;for(let fe=ee;fe<=V;++fe){const U=fe+I.ydisp,B=this._rowElements[fe],ie=I.lines.get(U);if(!B||!ie)break;B.replaceChildren(...this._rowFactory.createRow(ie,U,U===L,W,le,H,q,this.dimensions.css.cell.width,this._widthCache,ae?fe===ee?F:0:-1,ae?(fe===V?X:Q)-1:-1))}}};l.DomRenderer=K=f([y(7,x.IInstantiationService),y(8,m.ICharSizeService),y(9,x.IOptionsService),y(10,x.IBufferService),y(11,m.ICoreBrowserService),y(12,m.IThemeService)],K)},3787:function(k,l,u){var f=this&&this.__decorate||function(R,D,T,M){var $,Z=arguments.length,K=Z<3?D:M===null?M=Object.getOwnPropertyDescriptor(D,T):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(R,D,T,M);else for(var F=R.length-1;F>=0;F--)($=R[F])&&(K=(Z<3?$(K):Z>3?$(D,T,K):$(D,T))||K);return Z>3&&K&&Object.defineProperty(D,T,K),K},y=this&&this.__param||function(R,D){return function(T,M){D(T,M,R)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const d=u(2223),S=u(643),E=u(511),O=u(2585),C=u(8055),m=u(4725),g=u(4269),h=u(6171),_=u(3734);let x=l.DomRendererRowFactory=class{constructor(R,D,T,M,$,Z,K){this._document=R,this._characterJoinerService=D,this._optionsService=T,this._coreBrowserService=M,this._coreService=$,this._decorationService=Z,this._themeService=K,this._workCell=new E.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,D,T){this._selectionStart=R,this._selectionEnd=D,this._columnSelectMode=T}createRow(R,D,T,M,$,Z,K,F,X,ee,V){const Q=[],ae=this._characterJoinerService.getJoinedCharacters(D),j=this._themeService.colors;let I,L=R.getNoBgTrimmedLength();T&&L<Z+1&&(L=Z+1);let H=0,q="",W=0,le=0,fe=0,U=!1,B=0,ie=!1,ne=0;const me=[],pe=ee!==-1&&V!==-1;for(let Ee=0;Ee<L;Ee++){R.loadCell(Ee,this._workCell);let je=this._workCell.getWidth();if(je===0)continue;let Be=!1,st=Ee,Ce=this._workCell;if(ae.length>0&&Ee===ae[0][0]){Be=!0;const We=ae.shift();Ce=new g.JoinedCellData(this._workCell,R.translateToString(!0,We[0],We[1]),We[1]-We[0]),st=We[1]-1,je=Ce.getWidth()}const _e=this._isCellInSelection(Ee,D),Rt=T&&Ee===Z,mi=pe&&Ee>=ee&&Ee<=V;let xs=!1;this._decorationService.forEachDecorationAtCell(Ee,D,void 0,(We=>{xs=!0}));let Ks=Ce.getChars()||S.WHITESPACE_CELL_CHAR;if(Ks===" "&&(Ce.isUnderline()||Ce.isOverline())&&(Ks=" "),ne=je*F-X.get(Ks,Ce.isBold(),Ce.isItalic()),I){if(H&&(_e&&ie||!_e&&!ie&&Ce.bg===W)&&(_e&&ie&&j.selectionForeground||Ce.fg===le)&&Ce.extended.ext===fe&&mi===U&&ne===B&&!Rt&&!Be&&!xs){Ce.isInvisible()?q+=S.WHITESPACE_CELL_CHAR:q+=Ks,H++;continue}H&&(I.textContent=q),I=this._document.createElement("span"),H=0,q=""}else I=this._document.createElement("span");if(W=Ce.bg,le=Ce.fg,fe=Ce.extended.ext,U=mi,B=ne,ie=_e,Be&&Z>=Ee&&Z<=st&&(Z=Ee),!this._coreService.isCursorHidden&&Rt&&this._coreService.isCursorInitialized){if(me.push("xterm-cursor"),this._coreBrowserService.isFocused)K&&me.push("xterm-cursor-blink"),me.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if($)switch($){case"outline":me.push("xterm-cursor-outline");break;case"block":me.push("xterm-cursor-block");break;case"bar":me.push("xterm-cursor-bar");break;case"underline":me.push("xterm-cursor-underline")}}if(Ce.isBold()&&me.push("xterm-bold"),Ce.isItalic()&&me.push("xterm-italic"),Ce.isDim()&&me.push("xterm-dim"),q=Ce.isInvisible()?S.WHITESPACE_CELL_CHAR:Ce.getChars()||S.WHITESPACE_CELL_CHAR,Ce.isUnderline()&&(me.push(`xterm-underline-${Ce.extended.underlineStyle}`),q===" "&&(q=" "),!Ce.isUnderlineColorDefault()))if(Ce.isUnderlineColorRGB())I.style.textDecorationColor=`rgb(${_.AttributeData.toColorRGB(Ce.getUnderlineColor()).join(",")})`;else{let We=Ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ce.isBold()&&We<8&&(We+=8),I.style.textDecorationColor=j.ansi[We].css}Ce.isOverline()&&(me.push("xterm-overline"),q===" "&&(q=" ")),Ce.isStrikethrough()&&me.push("xterm-strikethrough"),mi&&(I.style.textDecoration="underline");let Dt=Ce.getFgColor(),vt=Ce.getFgColorMode(),Yt=Ce.getBgColor(),Fi=Ce.getBgColorMode();const Vs=!!Ce.isInverse();if(Vs){const We=Dt;Dt=Yt,Yt=We;const ws=vt;vt=Fi,Fi=ws}let Ut,Gs,li,Cs=!1;switch(this._decorationService.forEachDecorationAtCell(Ee,D,void 0,(We=>{We.options.layer!=="top"&&Cs||(We.backgroundColorRGB&&(Fi=50331648,Yt=We.backgroundColorRGB.rgba>>8&16777215,Ut=We.backgroundColorRGB),We.foregroundColorRGB&&(vt=50331648,Dt=We.foregroundColorRGB.rgba>>8&16777215,Gs=We.foregroundColorRGB),Cs=We.options.layer==="top")})),!Cs&&_e&&(Ut=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,Yt=Ut.rgba>>8&16777215,Fi=50331648,Cs=!0,j.selectionForeground&&(vt=50331648,Dt=j.selectionForeground.rgba>>8&16777215,Gs=j.selectionForeground)),Cs&&me.push("xterm-decoration-top"),Fi){case 16777216:case 33554432:li=j.ansi[Yt],me.push(`xterm-bg-${Yt}`);break;case 50331648:li=C.channels.toColor(Yt>>16,Yt>>8&255,255&Yt),this._addStyle(I,`background-color:#${A((Yt>>>0).toString(16),"0",6)}`);break;default:Vs?(li=j.foreground,me.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):li=j.background}switch(Ut||Ce.isDim()&&(Ut=C.color.multiplyOpacity(li,.5)),vt){case 16777216:case 33554432:Ce.isBold()&&Dt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Dt+=8),this._applyMinimumContrast(I,li,j.ansi[Dt],Ce,Ut,void 0)||me.push(`xterm-fg-${Dt}`);break;case 50331648:const We=C.channels.toColor(Dt>>16&255,Dt>>8&255,255&Dt);this._applyMinimumContrast(I,li,We,Ce,Ut,Gs)||this._addStyle(I,`color:#${A(Dt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(I,li,j.foreground,Ce,Ut,Gs)||Vs&&me.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}me.length&&(I.className=me.join(" "),me.length=0),Rt||Be||xs?I.textContent=q:H++,ne!==this.defaultSpacing&&(I.style.letterSpacing=`${ne}px`),Q.push(I),Ee=st}return I&&H&&(I.textContent=q),Q}_applyMinimumContrast(R,D,T,M,$,Z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,h.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const K=this._getContrastCache(M);let F;if($||Z||(F=K.getColor(D.rgba,T.rgba)),F===void 0){const X=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);F=C.color.ensureContrastRatio($||D,Z||T,X),K.setColor(($||D).rgba,(Z||T).rgba,F??null)}return!!F&&(this._addStyle(R,`color:${F.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,D){R.setAttribute("style",`${R.getAttribute("style")||""}${D};`)}_isCellInSelection(R,D){const T=this._selectionStart,M=this._selectionEnd;return!(!T||!M)&&(this._columnSelectMode?T[0]<=M[0]?R>=T[0]&&D>=T[1]&&R<M[0]&&D<=M[1]:R<T[0]&&D>=T[1]&&R>=M[0]&&D<=M[1]:D>T[1]&&D<M[1]||T[1]===M[1]&&D===T[1]&&R>=T[0]&&R<M[0]||T[1]<M[1]&&D===M[1]&&R<M[0]||T[1]<M[1]&&D===T[1]&&R>=T[0])}};function A(R,D,T){for(;R.length<T;)R=D+R;return R}l.DomRendererRowFactory=x=f([y(1,m.ICharacterJoinerService),y(2,O.IOptionsService),y(3,m.ICoreBrowserService),y(4,O.ICoreService),y(5,O.IDecorationService),y(6,m.IThemeService)],x)},2550:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(u,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const y=u.createElement("span");y.classList.add("xterm-char-measure-element");const d=u.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const S=u.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontStyle="italic";const E=u.createElement("span");E.classList.add("xterm-char-measure-element"),E.style.fontWeight="bold",E.style.fontStyle="italic",this._measureElements=[y,d,S,E],this._container.appendChild(y),this._container.appendChild(d),this._container.appendChild(S),this._container.appendChild(E),f.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(u,f,y,d){u===this._font&&f===this._fontSize&&y===this._weight&&d===this._weightBold||(this._font=u,this._fontSize=f,this._weight=y,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(u,f,y){let d=0;if(!f&&!y&&u.length===1&&(d=u.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const O=this._measure(u,0);return O>0&&(this._flat[d]=O),O}let S=u;f&&(S+="B"),y&&(S+="I");let E=this._holey.get(S);if(E===void 0){let O=0;f&&(O|=1),y&&(O|=2),E=this._measure(u,O),E>0&&this._holey.set(S,E)}return E}_measure(u,f){const y=this._measureElements[f];return y.textContent=u.repeat(32),y.offsetWidth/32}}},2223:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const f=u(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(k,l)=>{function u(y){return 57508<=y&&y<=57558}function f(y){return y>=128512&&y<=128591||y>=127744&&y<=128511||y>=128640&&y<=128767||y>=9728&&y<=9983||y>=9984&&y<=10175||y>=65024&&y<=65039||y>=129280&&y<=129535||y>=127462&&y<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(y){if(!y)throw new Error("value must not be falsy");return y},l.isPowerlineGlyph=u,l.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},l.isEmoji=f,l.allowRescaling=function(y,d,S,E){return d===1&&S>Math.ceil(1.5*E)&&y!==void 0&&y>255&&!f(y)&&!u(y)&&!(function(O){return 57344<=O&&O<=63743})(y)},l.treatGlyphAsBackgroundColor=function(y){return u(y)||(function(d){return 9472<=d&&d<=9631})(y)},l.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},l.computeNextVariantOffset=function(y,d,S=0){return(y-(2*Math.round(d)-S))%(2*Math.round(d))}},6052:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class u{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(y,d,S,E=!1){if(this.selectionStart=d,this.selectionEnd=S,!d||!S||d[0]===S[0]&&d[1]===S[1])return void this.clear();const O=y.buffers.active.ydisp,C=d[1]-O,m=S[1]-O,g=Math.max(C,0),h=Math.min(m,y.rows-1);g>=y.rows||h<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=E,this.viewportStartRow=C,this.viewportEndRow=m,this.viewportCappedStartRow=g,this.viewportCappedEndRow=h,this.startCol=d[0],this.endCol=S[0])}isCellSelected(y,d,S){return!!this.hasSelection&&(S-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&S>=this.viewportCappedStartRow&&d<this.endCol&&S<=this.viewportCappedEndRow:d<this.startCol&&S>=this.viewportCappedStartRow&&d>=this.endCol&&S<=this.viewportCappedEndRow:S>this.viewportStartRow&&S<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&S===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportStartRow&&d>=this.startCol)}}l.createSelectionRenderModel=function(){return new u}},456:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,f=this.selectionEnd;return!(!u||!f)&&(u[1]>f[1]||u[1]===f[1]&&u[0]>f[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(k,l,u){var f=this&&this.__decorate||function(h,_,x,A){var R,D=arguments.length,T=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,x):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,_,x,A);else for(var M=h.length-1;M>=0;M--)(R=h[M])&&(T=(D<3?R(T):D>3?R(_,x,T):R(_,x))||T);return D>3&&T&&Object.defineProperty(_,x,T),T},y=this&&this.__param||function(h,_){return function(x,A){_(x,A,h)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const d=u(2585),S=u(8460),E=u(844);let O=l.CharSizeService=class extends E.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(h,_,x){super(),this._optionsService=x,this.width=0,this.height=0,this._onCharSizeChange=this.register(new S.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new g(this._optionsService))}catch{this._measureStrategy=this.register(new m(h,_,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const h=this._measureStrategy.measure();h.width===this.width&&h.height===this.height||(this.width=h.width,this.height=h.height,this._onCharSizeChange.fire())}};l.CharSizeService=O=f([y(2,d.IOptionsService)],O);class C extends E.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(_,x){_!==void 0&&_>0&&x!==void 0&&x>0&&(this._result.width=_,this._result.height=x)}}class m extends C{constructor(_,x,A){super(),this._document=_,this._parentElement=x,this._optionsService=A,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class g extends C{constructor(_){super(),this._optionsService=_,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const x=this._ctx.measureText("W");if(!("width"in x&&"fontBoundingBoxAscent"in x&&"fontBoundingBoxDescent"in x))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const _=this._ctx.measureText("W");return this._validateAndSet(_.width,_.fontBoundingBoxAscent+_.fontBoundingBoxDescent),this._result}}},4269:function(k,l,u){var f=this&&this.__decorate||function(g,h,_,x){var A,R=arguments.length,D=R<3?h:x===null?x=Object.getOwnPropertyDescriptor(h,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,h,_,x);else for(var T=g.length-1;T>=0;T--)(A=g[T])&&(D=(R<3?A(D):R>3?A(h,_,D):A(h,_))||D);return R>3&&D&&Object.defineProperty(h,_,D),D},y=this&&this.__param||function(g,h){return function(_,x){h(_,x,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const d=u(3734),S=u(643),E=u(511),O=u(2585);class C extends d.AttributeData{constructor(h,_,x){super(),this.content=0,this.combinedData="",this.fg=h.fg,this.bg=h.bg,this.combinedData=_,this._width=x}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(h){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=C;let m=l.CharacterJoinerService=class hv{constructor(h){this._bufferService=h,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new E.CellData}register(h){const _={id:this._nextCharacterJoinerId++,handler:h};return this._characterJoiners.push(_),_.id}deregister(h){for(let _=0;_<this._characterJoiners.length;_++)if(this._characterJoiners[_].id===h)return this._characterJoiners.splice(_,1),!0;return!1}getJoinedCharacters(h){if(this._characterJoiners.length===0)return[];const _=this._bufferService.buffer.lines.get(h);if(!_||_.length===0)return[];const x=[],A=_.translateToString(!0);let R=0,D=0,T=0,M=_.getFg(0),$=_.getBg(0);for(let Z=0;Z<_.getTrimmedLength();Z++)if(_.loadCell(Z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==M||this._workCell.bg!==$){if(Z-R>1){const K=this._getJoinedRanges(A,T,D,_,R);for(let F=0;F<K.length;F++)x.push(K[F])}R=Z,T=D,M=this._workCell.fg,$=this._workCell.bg}D+=this._workCell.getChars().length||S.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const Z=this._getJoinedRanges(A,T,D,_,R);for(let K=0;K<Z.length;K++)x.push(Z[K])}return x}_getJoinedRanges(h,_,x,A,R){const D=h.substring(_,x);let T=[];try{T=this._characterJoiners[0].handler(D)}catch(M){console.error(M)}for(let M=1;M<this._characterJoiners.length;M++)try{const $=this._characterJoiners[M].handler(D);for(let Z=0;Z<$.length;Z++)hv._mergeRanges(T,$[Z])}catch($){console.error($)}return this._stringRangesToCellRanges(T,A,R),T}_stringRangesToCellRanges(h,_,x){let A=0,R=!1,D=0,T=h[A];if(T){for(let M=x;M<this._bufferService.cols;M++){const $=_.getWidth(M),Z=_.getString(M).length||S.WHITESPACE_CELL_CHAR.length;if($!==0){if(!R&&T[0]<=D&&(T[0]=M,R=!0),T[1]<=D){if(T[1]=M,T=h[++A],!T)break;T[0]<=D?(T[0]=M,R=!0):R=!1}D+=Z}}T&&(T[1]=this._bufferService.cols)}}static _mergeRanges(h,_){let x=!1;for(let A=0;A<h.length;A++){const R=h[A];if(x){if(_[1]<=R[0])return h[A-1][1]=_[1],h;if(_[1]<=R[1])return h[A-1][1]=Math.max(_[1],R[1]),h.splice(A,1),h;h.splice(A,1),A--}else{if(_[1]<=R[0])return h.splice(A,0,_),h;if(_[1]<=R[1])return R[0]=Math.min(_[0],R[0]),h;_[0]<R[1]&&(R[0]=Math.min(_[0],R[0]),x=!0)}}return x?h[h.length-1][1]=_[1]:h.push(_),h}};l.CharacterJoinerService=m=f([y(0,O.IBufferService)],m)},5114:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const f=u(844),y=u(8460),d=u(3656);class S extends f.Disposable{constructor(C,m,g){super(),this._textarea=C,this._window=m,this.mainDocument=g,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new E(this._window),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new y.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((h=>this._screenDprMonitor.setWindow(h)))),this.register((0,y.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(C){this._window!==C&&(this._window=C,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}}l.CoreBrowserService=S;class E extends f.Disposable{constructor(C){super(),this._parentWindow=C,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)((()=>this.clearListener())))}setWindow(C){this._parentWindow=C,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var C;this._outerListener&&((C=this._resolutionMediaMatchList)==null||C.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const f=u(844);class y extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(S){return this.linkProviders.push(S),{dispose:()=>{const E=this.linkProviders.indexOf(S);E!==-1&&this.linkProviders.splice(E,1)}}}}l.LinkProviderService=y},8934:function(k,l,u){var f=this&&this.__decorate||function(O,C,m,g){var h,_=arguments.length,x=_<3?C:g===null?g=Object.getOwnPropertyDescriptor(C,m):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(O,C,m,g);else for(var A=O.length-1;A>=0;A--)(h=O[A])&&(x=(_<3?h(x):_>3?h(C,m,x):h(C,m))||x);return _>3&&x&&Object.defineProperty(C,m,x),x},y=this&&this.__param||function(O,C){return function(m,g){C(m,g,O)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const d=u(4725),S=u(9806);let E=l.MouseService=class{constructor(O,C){this._renderService=O,this._charSizeService=C}getCoords(O,C,m,g,h){return(0,S.getCoords)(window,O,C,m,g,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,h)}getMouseReportCoords(O,C){const m=(0,S.getCoordsRelativeToElement)(window,O,C);if(this._charSizeService.hasValidSize)return m[0]=Math.min(Math.max(m[0],0),this._renderService.dimensions.css.canvas.width-1),m[1]=Math.min(Math.max(m[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(m[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(m[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(m[0]),y:Math.floor(m[1])}}};l.MouseService=E=f([y(0,d.IRenderService),y(1,d.ICharSizeService)],E)},3230:function(k,l,u){var f=this&&this.__decorate||function(h,_,x,A){var R,D=arguments.length,T=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,x):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,_,x,A);else for(var M=h.length-1;M>=0;M--)(R=h[M])&&(T=(D<3?R(T):D>3?R(_,x,T):R(_,x))||T);return D>3&&T&&Object.defineProperty(_,x,T),T},y=this&&this.__param||function(h,_){return function(x,A){_(x,A,h)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const d=u(6193),S=u(4725),E=u(8460),O=u(844),C=u(7226),m=u(2585);let g=l.RenderService=class extends O.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(h,_,x,A,R,D,T,M){super(),this._rowCount=h,this._charSizeService=A,this._renderer=this.register(new O.MutableDisposable),this._pausedResizeTask=new C.DebouncedIdleTask,this._observerDisposable=this.register(new O.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new E.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new E.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new E.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new E.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer((($,Z)=>this._renderRows($,Z)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var $;return($=this._renderer.value)==null?void 0:$.clear()}))),this.register(x.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(x.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(x.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,_),this.register(T.onWindowChange(($=>this._registerIntersectionObserver($,_))))}_registerIntersectionObserver(h,_){if("IntersectionObserver"in h){const x=new h.IntersectionObserver((A=>this._handleIntersectionChange(A[A.length-1])),{threshold:0});x.observe(_),this._observerDisposable.value=(0,O.toDisposable)((()=>x.disconnect()))}}_handleIntersectionChange(h){this._isPaused=h.isIntersecting===void 0?h.intersectionRatio===0:!h.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(h,_,x=!1){this._isPaused?this._needsFullRefresh=!0:(x||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(h,_,this._rowCount))}_renderRows(h,_){this._renderer.value&&(h=Math.min(h,this._rowCount-1),_=Math.min(_,this._rowCount-1),this._renderer.value.renderRows(h,_),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:h,end:_}),this._onRender.fire({start:h,end:_}),this._isNextRenderRedrawOnly=!0)}resize(h,_){this._rowCount=_,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(h){this._renderer.value=h,this._renderer.value&&(this._renderer.value.onRequestRedraw((_=>this.refreshRows(_.start,_.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(h){return this._renderDebouncer.addRefreshCallback(h)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var h,_;this._renderer.value&&((_=(h=this._renderer.value).clearTextureAtlas)==null||_.call(h),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(h,_){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var x;return(x=this._renderer.value)==null?void 0:x.handleResize(h,_)})):this._renderer.value.handleResize(h,_),this._fullRefresh())}handleCharSizeChanged(){var h;(h=this._renderer.value)==null||h.handleCharSizeChanged()}handleBlur(){var h;(h=this._renderer.value)==null||h.handleBlur()}handleFocus(){var h;(h=this._renderer.value)==null||h.handleFocus()}handleSelectionChanged(h,_,x){var A;this._selectionState.start=h,this._selectionState.end=_,this._selectionState.columnSelectMode=x,(A=this._renderer.value)==null||A.handleSelectionChanged(h,_,x)}handleCursorMove(){var h;(h=this._renderer.value)==null||h.handleCursorMove()}clear(){var h;(h=this._renderer.value)==null||h.clear()}};l.RenderService=g=f([y(2,m.IOptionsService),y(3,S.ICharSizeService),y(4,m.IDecorationService),y(5,m.IBufferService),y(6,S.ICoreBrowserService),y(7,S.IThemeService)],g)},9312:function(k,l,u){var f=this&&this.__decorate||function(T,M,$,Z){var K,F=arguments.length,X=F<3?M:Z===null?Z=Object.getOwnPropertyDescriptor(M,$):Z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(T,M,$,Z);else for(var ee=T.length-1;ee>=0;ee--)(K=T[ee])&&(X=(F<3?K(X):F>3?K(M,$,X):K(M,$))||X);return F>3&&X&&Object.defineProperty(M,$,X),X},y=this&&this.__param||function(T,M){return function($,Z){M($,Z,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const d=u(9806),S=u(9504),E=u(456),O=u(4725),C=u(8460),m=u(844),g=u(6114),h=u(4841),_=u(511),x=u(2585),A=" ",R=new RegExp(A,"g");let D=l.SelectionService=class extends m.Disposable{constructor(T,M,$,Z,K,F,X,ee,V){super(),this._element=T,this._screenElement=M,this._linkifier=$,this._bufferService=Z,this._coreService=K,this._mouseService=F,this._optionsService=X,this._renderService=ee,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new _.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new C.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new C.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Q=>this._handleMouseMove(Q),this._mouseUpListener=Q=>this._handleMouseUp(Q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Q=>this._handleTrim(Q))),this.register(this._bufferService.buffers.onBufferActivate((Q=>this._handleBufferActivate(Q)))),this.enable(),this._model=new E.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,m.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const T=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!T||!M||T[0]===M[0]&&T[1]===M[1])}get selectionText(){const T=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!T||!M)return"";const $=this._bufferService.buffer,Z=[];if(this._activeSelectionMode===3){if(T[0]===M[0])return"";const K=T[0]<M[0]?T[0]:M[0],F=T[0]<M[0]?M[0]:T[0];for(let X=T[1];X<=M[1];X++){const ee=$.translateBufferLineToString(X,!0,K,F);Z.push(ee)}}else{const K=T[1]===M[1]?M[0]:void 0;Z.push($.translateBufferLineToString(T[1],!0,T[0],K));for(let F=T[1]+1;F<=M[1]-1;F++){const X=$.lines.get(F),ee=$.translateBufferLineToString(F,!0);X!=null&&X.isWrapped?Z[Z.length-1]+=ee:Z.push(ee)}if(T[1]!==M[1]){const F=$.lines.get(M[1]),X=$.translateBufferLineToString(M[1],!0,0,M[0]);F&&F.isWrapped?Z[Z.length-1]+=X:Z.push(X)}}return Z.map((K=>K.replace(R," "))).join(g.isWindows?`\r
|
|
308
308
|
`:`
|
|
309
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),g.isLinux&&T&&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(T){const M=this._getMouseBufferCoords(T),$=this._model.finalSelectionStart,Z=this._model.finalSelectionEnd;return!!($&&Z&&M)&&this._areCoordsInSelection(M,$,Z)}isCellInSelection(T,M){const $=this._model.finalSelectionStart,Z=this._model.finalSelectionEnd;return!(!$||!Z)&&this._areCoordsInSelection([T,M],$,Z)}_areCoordsInSelection(T,M,$){return T[1]>M[1]&&T[1]<$[1]||M[1]===$[1]&&T[1]===M[1]&&T[0]>=M[0]&&T[0]<$[0]||M[1]<$[1]&&T[1]===$[1]&&T[0]<$[0]||M[1]<$[1]&&T[1]===M[1]&&T[0]>=M[0]}_selectWordAtCursor(T,M){var K,F;const $=(F=(K=this._linkifier.currentLink)==null?void 0:K.link)==null?void 0:F.range;if($)return this._model.selectionStart=[$.start.x-1,$.start.y-1],this._model.selectionStartLength=(0,h.getRangeLength)($,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const Z=this._getMouseBufferCoords(T);return!!Z&&(this._selectWordAt(Z,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,M){this._model.clearSelection(),T=Math.max(T,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const M=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(T){let M=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const $=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=$?0:(M>$&&(M-=$),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(T){return g.isMac?T.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:T.shiftKey}handleMouseDown(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._handleIncrementalClick(T):T.detail===1?this._handleSingleClick(T):T.detail===2?this._handleDoubleClick(T):T.detail===3&&this._handleTripleClick(T),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))}_handleSingleClick(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const M=this._getMouseBufferCoords(T);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(T){return T.altKey&&!(g.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(T),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(T),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const $=this._bufferService.buffer;if(this._model.selectionEnd[1]<$.lines.length){const Z=$.lines.get(this._model.selectionEnd[1]);Z&&Z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}M&&M[0]===this._model.selectionEnd[0]&&M[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const T=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(T.ydisp+this._bufferService.rows,T.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=T.ydisp),this.refresh()}}_handleMouseUp(T){const M=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const $=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if($&&$[0]!==void 0&&$[1]!==void 0){const Z=(0,S.moveToCellSequence)($[0]-1,$[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(Z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,$=!(!T||!M||T[0]===M[0]&&T[1]===M[1]);$?T&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,M,$)):this._oldHasSelection&&this._fireOnSelectionChange(T,M,$)}_fireOnSelectionChange(T,M,$){this._oldSelectionStart=T,this._oldSelectionEnd=M,this._oldHasSelection=$,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(T,M){let $=M;for(let Z=0;M>=Z;Z++){const K=T.loadCell(Z,this._workCell).getChars().length;this._workCell.getWidth()===0?$--:K>1&&M!==Z&&($+=K-1)}return $}setSelection(T,M,$){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,M],this._model.selectionStartLength=$,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,M,$=!0,Z=!0){if(T[0]>=this._bufferService.cols)return;const K=this._bufferService.buffer,F=K.lines.get(T[1]);if(!F)return;const X=K.translateBufferLineToString(T[1],!1);let ee=this._convertViewportColToCharacterIndex(F,T[0]),V=ee;const Q=T[0]-ee;let ae=0,j=0,U=0,L=0;if(X.charAt(ee)===" "){for(;ee>0&&X.charAt(ee-1)===" ";)ee--;for(;V<X.length&&X.charAt(V+1)===" ";)V++}else{let W=T[0],le=T[0];F.getWidth(W)===0&&(ae++,W--),F.getWidth(le)===2&&(j++,le++);const fe=F.getString(le).length;for(fe>1&&(L+=fe-1,V+=fe-1);W>0&&ee>0&&!this._isCharWordSeparator(F.loadCell(W-1,this._workCell));){F.loadCell(W-1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===0?(ae++,W--):I>1&&(U+=I-1,ee-=I-1),ee--,W--}for(;le<F.length&&V+1<X.length&&!this._isCharWordSeparator(F.loadCell(le+1,this._workCell));){F.loadCell(le+1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,le++):I>1&&(L+=I-1,V+=I-1),V++,le++}}V++;let H=ee+Q-ae+U,q=Math.min(this._bufferService.cols,V-ee+ae+j-U-L);if(M||X.slice(ee,V).trim()!==""){if($&&H===0&&F.getCodePoint(0)!==32){const W=K.lines.get(T[1]-1);if(W&&F.isWrapped&&W.getCodePoint(this._bufferService.cols-1)!==32){const le=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(le){const fe=this._bufferService.cols-le.start;H-=fe,q+=fe}}}if(Z&&H+q===this._bufferService.cols&&F.getCodePoint(this._bufferService.cols-1)!==32){const W=K.lines.get(T[1]+1);if(W!=null&&W.isWrapped&&W.getCodePoint(0)!==32){const le=this._getWordAt([0,T[1]+1],!1,!1,!0);le&&(q+=le.length)}}return{start:H,length:q}}}_selectWordAt(T,M){const $=this._getWordAt(T,M);if($){for(;$.start<0;)$.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[$.start,T[1]],this._model.selectionStartLength=$.length}}_selectToWordAt(T){const M=this._getWordAt(T,!0);if(M){let $=T[1];for(;M.start<0;)M.start+=this._bufferService.cols,$--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,$++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,$]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const M=this._bufferService.buffer.getWrappedRangeForLine(T),$={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,h.getRangeLength)($,this._bufferService.cols)}};l.SelectionService=D=f([y(3,x.IBufferService),y(4,x.ICoreService),y(5,O.IMouseService),y(6,x.IOptionsService),y(7,O.IRenderService),y(8,O.ICoreBrowserService)],D)},4725:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const f=u(8343);l.ICharSizeService=(0,f.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),l.IMouseService=(0,f.createDecorator)("MouseService"),l.IRenderService=(0,f.createDecorator)("RenderService"),l.ISelectionService=(0,f.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,f.createDecorator)("ThemeService"),l.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(k,l,u){var f=this&&this.__decorate||function(D,T,M,$){var Z,K=arguments.length,F=K<3?T:$===null?$=Object.getOwnPropertyDescriptor(T,M):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(D,T,M,$);else for(var X=D.length-1;X>=0;X--)(Z=D[X])&&(F=(K<3?Z(F):K>3?Z(T,M,F):Z(T,M))||F);return K>3&&F&&Object.defineProperty(T,M,F),F},y=this&&this.__param||function(D,T){return function(M,$){T(M,$,D)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const d=u(7239),S=u(8055),E=u(8460),O=u(844),C=u(2585),m=S.css.toColor("#ffffff"),g=S.css.toColor("#000000"),h=S.css.toColor("#ffffff"),_=S.css.toColor("#000000"),x={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[S.css.toColor("#2e3436"),S.css.toColor("#cc0000"),S.css.toColor("#4e9a06"),S.css.toColor("#c4a000"),S.css.toColor("#3465a4"),S.css.toColor("#75507b"),S.css.toColor("#06989a"),S.css.toColor("#d3d7cf"),S.css.toColor("#555753"),S.css.toColor("#ef2929"),S.css.toColor("#8ae234"),S.css.toColor("#fce94f"),S.css.toColor("#729fcf"),S.css.toColor("#ad7fa8"),S.css.toColor("#34e2e2"),S.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let M=0;M<216;M++){const $=T[M/36%6|0],Z=T[M/6%6|0],K=T[M%6];D.push({css:S.channels.toCss($,Z,K),rgba:S.channels.toRgba($,Z,K)})}for(let M=0;M<24;M++){const $=8+10*M;D.push({css:S.channels.toCss($,$,$),rgba:S.channels.toRgba($,$,$)})}return D})());let A=l.ThemeService=class extends O.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new E.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:m,background:g,cursor:h,cursorAccent:_,selectionForeground:void 0,selectionBackgroundTransparent:x,selectionBackgroundOpaque:S.color.blend(g,x),selectionInactiveBackgroundTransparent:x,selectionInactiveBackgroundOpaque:S.color.blend(g,x),ansi:l.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const T=this._colors;if(T.foreground=R(D.foreground,m),T.background=R(D.background,g),T.cursor=R(D.cursor,h),T.cursorAccent=R(D.cursorAccent,_),T.selectionBackgroundTransparent=R(D.selectionBackground,x),T.selectionBackgroundOpaque=S.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=R(D.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=S.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=D.selectionForeground?R(D.selectionForeground,S.NULL_COLOR):void 0,T.selectionForeground===S.NULL_COLOR&&(T.selectionForeground=void 0),S.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=S.color.opacity(T.selectionBackgroundTransparent,.3)),S.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=S.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=l.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=R(D.black,l.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=R(D.red,l.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=R(D.green,l.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=R(D.yellow,l.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=R(D.blue,l.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=R(D.magenta,l.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=R(D.cyan,l.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=R(D.white,l.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=R(D.brightBlack,l.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=R(D.brightRed,l.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=R(D.brightGreen,l.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=R(D.brightYellow,l.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=R(D.brightBlue,l.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=R(D.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=R(D.brightCyan,l.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=R(D.brightWhite,l.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const M=Math.min(T.ansi.length-16,D.extendedAnsi.length);for(let $=0;$<M;$++)T.ansi[$+16]=R(D.extendedAnsi[$],l.DEFAULT_ANSI_COLORS[$+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[D]=this._restoreColors.ansi[D]}else for(let T=0;T<this._restoreColors.ansi.length;++T)this._colors.ansi[T]=this._restoreColors.ansi[T]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(D,T){if(D!==void 0)try{return S.css.toColor(D)}catch{}return T}l.ThemeService=A=f([y(0,C.IOptionsService)],A)},6349:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const f=u(8460),y=u(844);class d extends y.Disposable{constructor(E){super(),this._maxLength=E,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(E){if(this._maxLength===E)return;const O=new Array(E);for(let C=0;C<Math.min(E,this.length);C++)O[C]=this._array[this._getCyclicIndex(C)];this._array=O,this._maxLength=E,this._startIndex=0}get length(){return this._length}set length(E){if(E>this._length)for(let O=this._length;O<E;O++)this._array[O]=void 0;this._length=E}get(E){return this._array[this._getCyclicIndex(E)]}set(E,O){this._array[this._getCyclicIndex(E)]=O}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,O,...C){if(O){for(let m=E;m<this._length-O;m++)this._array[this._getCyclicIndex(m)]=this._array[this._getCyclicIndex(m+O)];this._length-=O,this.onDeleteEmitter.fire({index:E,amount:O})}for(let m=this._length-1;m>=E;m--)this._array[this._getCyclicIndex(m+C.length)]=this._array[this._getCyclicIndex(m)];for(let m=0;m<C.length;m++)this._array[this._getCyclicIndex(E+m)]=C[m];if(C.length&&this.onInsertEmitter.fire({index:E,amount:C.length}),this._length+C.length>this._maxLength){const m=this._length+C.length-this._maxLength;this._startIndex+=m,this._length=this._maxLength,this.onTrimEmitter.fire(m)}else this._length+=C.length}trimStart(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)}shiftElements(E,O,C){if(!(O<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+C<0)throw new Error("Cannot shift elements in list beyond index 0");if(C>0){for(let g=O-1;g>=0;g--)this.set(E+g+C,this.get(E+g));const m=E+O+C-this._length;if(m>0)for(this._length+=m;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let m=0;m<O;m++)this.set(E+m+C,this.get(E+m))}}_getCyclicIndex(E){return(this._startIndex+E)%this._maxLength}}l.CircularList=d},1439:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function u(f,y=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const S in f)d[S]=y<=1?f[S]:f[S]&&u(f[S],y-1);return d}},8055:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let u=0,f=0,y=0,d=0;var S,E,O,C,m;function g(_){const x=_.toString(16);return x.length<2?"0"+x:x}function h(_,x){return _<x?(x+.05)/(_+.05):(_+.05)/(x+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(_){_.toCss=function(x,A,R,D){return D!==void 0?`#${g(x)}${g(A)}${g(R)}${g(D)}`:`#${g(x)}${g(A)}${g(R)}`},_.toRgba=function(x,A,R,D=255){return(x<<24|A<<16|R<<8|D)>>>0},_.toColor=function(x,A,R,D){return{css:_.toCss(x,A,R,D),rgba:_.toRgba(x,A,R,D)}}})(S||(l.channels=S={})),(function(_){function x(A,R){return d=Math.round(255*R),[u,f,y]=m.toChannels(A.rgba),{css:S.toCss(u,f,y,d),rgba:S.toRgba(u,f,y,d)}}_.blend=function(A,R){if(d=(255&R.rgba)/255,d===1)return{css:R.css,rgba:R.rgba};const D=R.rgba>>24&255,T=R.rgba>>16&255,M=R.rgba>>8&255,$=A.rgba>>24&255,Z=A.rgba>>16&255,K=A.rgba>>8&255;return u=$+Math.round((D-$)*d),f=Z+Math.round((T-Z)*d),y=K+Math.round((M-K)*d),{css:S.toCss(u,f,y),rgba:S.toRgba(u,f,y)}},_.isOpaque=function(A){return(255&A.rgba)==255},_.ensureContrastRatio=function(A,R,D){const T=m.ensureContrastRatio(A.rgba,R.rgba,D);if(T)return S.toColor(T>>24&255,T>>16&255,T>>8&255)},_.opaque=function(A){const R=(255|A.rgba)>>>0;return[u,f,y]=m.toChannels(R),{css:S.toCss(u,f,y),rgba:R}},_.opacity=x,_.multiplyOpacity=function(A,R){return d=255&A.rgba,x(A,d*R/255)},_.toColorRGB=function(A){return[A.rgba>>24&255,A.rgba>>16&255,A.rgba>>8&255]}})(E||(l.color=E={})),(function(_){let x,A;try{const R=document.createElement("canvas");R.width=1,R.height=1;const D=R.getContext("2d",{willReadFrequently:!0});D&&(x=D,x.globalCompositeOperation="copy",A=x.createLinearGradient(0,0,1,1))}catch{}_.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return u=parseInt(R.slice(1,2).repeat(2),16),f=parseInt(R.slice(2,3).repeat(2),16),y=parseInt(R.slice(3,4).repeat(2),16),S.toColor(u,f,y);case 5:return u=parseInt(R.slice(1,2).repeat(2),16),f=parseInt(R.slice(2,3).repeat(2),16),y=parseInt(R.slice(3,4).repeat(2),16),d=parseInt(R.slice(4,5).repeat(2),16),S.toColor(u,f,y,d);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const D=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return u=parseInt(D[1]),f=parseInt(D[2]),y=parseInt(D[3]),d=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),S.toColor(u,f,y,d);if(!x||!A)throw new Error("css.toColor: Unsupported css format");if(x.fillStyle=A,x.fillStyle=R,typeof x.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(x.fillRect(0,0,1,1),[u,f,y,d]=x.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(u,f,y,d),css:R}}})(O||(l.css=O={})),(function(_){function x(A,R,D){const T=A/255,M=R/255,$=D/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*($<=.03928?$/12.92:Math.pow(($+.055)/1.055,2.4))}_.relativeLuminance=function(A){return x(A>>16&255,A>>8&255,255&A)},_.relativeLuminance2=x})(C||(l.rgb=C={})),(function(_){function x(R,D,T){const M=R>>24&255,$=R>>16&255,Z=R>>8&255;let K=D>>24&255,F=D>>16&255,X=D>>8&255,ee=h(C.relativeLuminance2(K,F,X),C.relativeLuminance2(M,$,Z));for(;ee<T&&(K>0||F>0||X>0);)K-=Math.max(0,Math.ceil(.1*K)),F-=Math.max(0,Math.ceil(.1*F)),X-=Math.max(0,Math.ceil(.1*X)),ee=h(C.relativeLuminance2(K,F,X),C.relativeLuminance2(M,$,Z));return(K<<24|F<<16|X<<8|255)>>>0}function A(R,D,T){const M=R>>24&255,$=R>>16&255,Z=R>>8&255;let K=D>>24&255,F=D>>16&255,X=D>>8&255,ee=h(C.relativeLuminance2(K,F,X),C.relativeLuminance2(M,$,Z));for(;ee<T&&(K<255||F<255||X<255);)K=Math.min(255,K+Math.ceil(.1*(255-K))),F=Math.min(255,F+Math.ceil(.1*(255-F))),X=Math.min(255,X+Math.ceil(.1*(255-X))),ee=h(C.relativeLuminance2(K,F,X),C.relativeLuminance2(M,$,Z));return(K<<24|F<<16|X<<8|255)>>>0}_.blend=function(R,D){if(d=(255&D)/255,d===1)return D;const T=D>>24&255,M=D>>16&255,$=D>>8&255,Z=R>>24&255,K=R>>16&255,F=R>>8&255;return u=Z+Math.round((T-Z)*d),f=K+Math.round((M-K)*d),y=F+Math.round(($-F)*d),S.toRgba(u,f,y)},_.ensureContrastRatio=function(R,D,T){const M=C.relativeLuminance(R>>8),$=C.relativeLuminance(D>>8);if(h(M,$)<T){if($<M){const F=x(R,D,T),X=h(M,C.relativeLuminance(F>>8));if(X<T){const ee=A(R,D,T);return X>h(M,C.relativeLuminance(ee>>8))?F:ee}return F}const Z=A(R,D,T),K=h(M,C.relativeLuminance(Z>>8));if(K<T){const F=x(R,D,T);return K>h(M,C.relativeLuminance(F>>8))?Z:F}return Z}},_.reduceLuminance=x,_.increaseLuminance=A,_.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(m||(l.rgba=m={})),l.toPaddedHex=g,l.contrastRatio=h},8969:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const f=u(844),y=u(2585),d=u(4348),S=u(7866),E=u(744),O=u(7302),C=u(6975),m=u(8460),g=u(1753),h=u(1480),_=u(7994),x=u(9282),A=u(5435),R=u(5981),D=u(2660);let T=!1;class M extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new m.EventEmitter),this._onScroll.event((Z=>{var K;(K=this._onScrollApi)==null||K.fire(Z.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(Z){for(const K in Z)this.optionsService.options[K]=Z[K]}constructor(Z){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new m.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new m.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new O.OptionsService(Z)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(E.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(S.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(C.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(g.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(h.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(_.CharsetService),this._instantiationService.setService(y.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(y.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new A.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,m.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,m.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,m.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,m.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((K=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((K=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((K,F)=>this._inputHandler.parse(K,F)))),this.register((0,m.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(Z,K){this._writeBuffer.write(Z,K)}writeSync(Z,K){this._logService.logLevel<=y.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(Z,K)}input(Z,K=!0){this.coreService.triggerDataEvent(Z,K)}resize(Z,K){isNaN(Z)||isNaN(K)||(Z=Math.max(Z,E.MINIMUM_COLS),K=Math.max(K,E.MINIMUM_ROWS),this._bufferService.resize(Z,K))}scroll(Z,K=!1){this._bufferService.scroll(Z,K)}scrollLines(Z,K,F){this._bufferService.scrollLines(Z,K,F)}scrollPages(Z){this.scrollLines(Z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(Z){const K=Z-this._bufferService.buffer.ydisp;K!==0&&this.scrollLines(K)}registerEscHandler(Z,K){return this._inputHandler.registerEscHandler(Z,K)}registerDcsHandler(Z,K){return this._inputHandler.registerDcsHandler(Z,K)}registerCsiHandler(Z,K){return this._inputHandler.registerCsiHandler(Z,K)}registerOscHandler(Z,K){return this._inputHandler.registerOscHandler(Z,K)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let Z=!1;const K=this.optionsService.rawOptions.windowsPty;K&&K.buildNumber!==void 0&&K.buildNumber!==void 0?Z=K.backend==="conpty"&&K.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(Z=!0),Z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const Z=[];Z.push(this.onLineFeed(x.updateWindowsModeWrappedState.bind(null,this._bufferService))),Z.push(this.registerCsiHandler({final:"H"},(()=>((0,x.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const K of Z)K.dispose()}))}}}l.CoreTerminal=M},8460:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===u)return void this._listeners.splice(f,1)}}})),this._event}fire(u,f){const y=[];for(let d=0;d<this._listeners.length;d++)y.push(this._listeners[d]);for(let d=0;d<y.length;d++)y[d].call(void 0,u,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(u,f){return u((y=>f.fire(y)))},l.runAndSubscribe=function(u,f){return f(void 0),u((y=>f(y)))}},5435:function(k,l,u){var f=this&&this.__decorate||function(ae,j,U,L){var H,q=arguments.length,W=q<3?j:L===null?L=Object.getOwnPropertyDescriptor(j,U):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(ae,j,U,L);else for(var le=ae.length-1;le>=0;le--)(H=ae[le])&&(W=(q<3?H(W):q>3?H(j,U,W):H(j,U))||W);return q>3&&W&&Object.defineProperty(j,U,W),W},y=this&&this.__param||function(ae,j){return function(U,L){j(U,L,ae)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const d=u(2584),S=u(7116),E=u(2015),O=u(844),C=u(482),m=u(8437),g=u(8460),h=u(643),_=u(511),x=u(3734),A=u(2585),R=u(1480),D=u(6242),T=u(6351),M=u(5941),$={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Z=131072;function K(ae,j){if(ae>24)return j.setWinLines||!1;switch(ae){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var F;(function(ae){ae[ae.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ae[ae.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(F||(l.WindowsOptionsReportType=F={}));let X=0;class ee extends O.Disposable{getAttrData(){return this._curAttrData}constructor(j,U,L,H,q,W,le,fe,I=new E.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=U,this._coreService=L,this._logService=H,this._optionsService=q,this._oscLinkService=W,this._coreMouseService=le,this._unicodeService=fe,this._parser=I,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new C.StringToUtf32,this._utf8Decoder=new C.Utf8ToUtf32,this._workCell=new _.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new g.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new g.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new g.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new g.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new g.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new g.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new g.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new g.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new g.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new g.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new g.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new g.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new g.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._parser.setCsiHandlerFallback(((B,ie)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(B),params:ie.toArray()})})),this._parser.setEscHandlerFallback((B=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(B)})})),this._parser.setExecuteHandlerFallback((B=>{this._logService.debug("Unknown EXECUTE code: ",{code:B})})),this._parser.setOscHandlerFallback(((B,ie,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:B,action:ie,data:ne})})),this._parser.setDcsHandlerFallback(((B,ie,ne)=>{ie==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(B),action:ie,payload:ne})})),this._parser.setPrintHandler(((B,ie,ne)=>this.print(B,ie,ne))),this._parser.registerCsiHandler({final:"@"},(B=>this.insertChars(B))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(B=>this.scrollLeft(B))),this._parser.registerCsiHandler({final:"A"},(B=>this.cursorUp(B))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(B=>this.scrollRight(B))),this._parser.registerCsiHandler({final:"B"},(B=>this.cursorDown(B))),this._parser.registerCsiHandler({final:"C"},(B=>this.cursorForward(B))),this._parser.registerCsiHandler({final:"D"},(B=>this.cursorBackward(B))),this._parser.registerCsiHandler({final:"E"},(B=>this.cursorNextLine(B))),this._parser.registerCsiHandler({final:"F"},(B=>this.cursorPrecedingLine(B))),this._parser.registerCsiHandler({final:"G"},(B=>this.cursorCharAbsolute(B))),this._parser.registerCsiHandler({final:"H"},(B=>this.cursorPosition(B))),this._parser.registerCsiHandler({final:"I"},(B=>this.cursorForwardTab(B))),this._parser.registerCsiHandler({final:"J"},(B=>this.eraseInDisplay(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(B=>this.eraseInDisplay(B,!0))),this._parser.registerCsiHandler({final:"K"},(B=>this.eraseInLine(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(B=>this.eraseInLine(B,!0))),this._parser.registerCsiHandler({final:"L"},(B=>this.insertLines(B))),this._parser.registerCsiHandler({final:"M"},(B=>this.deleteLines(B))),this._parser.registerCsiHandler({final:"P"},(B=>this.deleteChars(B))),this._parser.registerCsiHandler({final:"S"},(B=>this.scrollUp(B))),this._parser.registerCsiHandler({final:"T"},(B=>this.scrollDown(B))),this._parser.registerCsiHandler({final:"X"},(B=>this.eraseChars(B))),this._parser.registerCsiHandler({final:"Z"},(B=>this.cursorBackwardTab(B))),this._parser.registerCsiHandler({final:"`"},(B=>this.charPosAbsolute(B))),this._parser.registerCsiHandler({final:"a"},(B=>this.hPositionRelative(B))),this._parser.registerCsiHandler({final:"b"},(B=>this.repeatPrecedingCharacter(B))),this._parser.registerCsiHandler({final:"c"},(B=>this.sendDeviceAttributesPrimary(B))),this._parser.registerCsiHandler({prefix:">",final:"c"},(B=>this.sendDeviceAttributesSecondary(B))),this._parser.registerCsiHandler({final:"d"},(B=>this.linePosAbsolute(B))),this._parser.registerCsiHandler({final:"e"},(B=>this.vPositionRelative(B))),this._parser.registerCsiHandler({final:"f"},(B=>this.hVPosition(B))),this._parser.registerCsiHandler({final:"g"},(B=>this.tabClear(B))),this._parser.registerCsiHandler({final:"h"},(B=>this.setMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(B=>this.setModePrivate(B))),this._parser.registerCsiHandler({final:"l"},(B=>this.resetMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(B=>this.resetModePrivate(B))),this._parser.registerCsiHandler({final:"m"},(B=>this.charAttributes(B))),this._parser.registerCsiHandler({final:"n"},(B=>this.deviceStatus(B))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(B=>this.deviceStatusPrivate(B))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(B=>this.softReset(B))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(B=>this.setCursorStyle(B))),this._parser.registerCsiHandler({final:"r"},(B=>this.setScrollRegion(B))),this._parser.registerCsiHandler({final:"s"},(B=>this.saveCursor(B))),this._parser.registerCsiHandler({final:"t"},(B=>this.windowOptions(B))),this._parser.registerCsiHandler({final:"u"},(B=>this.restoreCursor(B))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(B=>this.insertColumns(B))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(B=>this.deleteColumns(B))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(B=>this.selectProtected(B))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(B=>this.requestMode(B,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(B=>this.requestMode(B,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((B=>(this.setTitle(B),this.setIconName(B),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((B=>this.setIconName(B)))),this._parser.registerOscHandler(2,new D.OscHandler((B=>this.setTitle(B)))),this._parser.registerOscHandler(4,new D.OscHandler((B=>this.setOrReportIndexedColor(B)))),this._parser.registerOscHandler(8,new D.OscHandler((B=>this.setHyperlink(B)))),this._parser.registerOscHandler(10,new D.OscHandler((B=>this.setOrReportFgColor(B)))),this._parser.registerOscHandler(11,new D.OscHandler((B=>this.setOrReportBgColor(B)))),this._parser.registerOscHandler(12,new D.OscHandler((B=>this.setOrReportCursorColor(B)))),this._parser.registerOscHandler(104,new D.OscHandler((B=>this.restoreIndexedColor(B)))),this._parser.registerOscHandler(110,new D.OscHandler((B=>this.restoreFgColor(B)))),this._parser.registerOscHandler(111,new D.OscHandler((B=>this.restoreBgColor(B)))),this._parser.registerOscHandler(112,new D.OscHandler((B=>this.restoreCursorColor(B)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const B in S.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:B},(()=>this.selectCharset("("+B))),this._parser.registerEscHandler({intermediates:")",final:B},(()=>this.selectCharset(")"+B))),this._parser.registerEscHandler({intermediates:"*",final:B},(()=>this.selectCharset("*"+B))),this._parser.registerEscHandler({intermediates:"+",final:B},(()=>this.selectCharset("+"+B))),this._parser.registerEscHandler({intermediates:"-",final:B},(()=>this.selectCharset("-"+B))),this._parser.registerEscHandler({intermediates:".",final:B},(()=>this.selectCharset("."+B))),this._parser.registerEscHandler({intermediates:"/",final:B},(()=>this.selectCharset("/"+B)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((B=>(this._logService.error("Parsing error: ",B),B))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler(((B,ie)=>this.requestStatusString(B,ie))))}_preserveStack(j,U,L,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=U,this._parseStack.decodedLength=L,this._parseStack.position=H}_logSlowResolvingAsync(j){this._logService.logLevel<=A.LogLevelEnum.WARN&&Promise.race([j,new Promise(((U,L)=>setTimeout((()=>L("#SLOW_TIMEOUT")),5e3)))]).catch((U=>{if(U!=="#SLOW_TIMEOUT")throw U;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,U){let L,H=this._activeBuffer.x,q=this._activeBuffer.y,W=0;const le=this._parseStack.paused;if(le){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,U))return this._logSlowResolvingAsync(L),L;H=this._parseStack.cursorStartX,q=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>Z&&(W=this._parseStack.position+Z)}if(this._logService.logLevel<=A.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,(B=>String.fromCharCode(B))).join("")}"`),typeof j=="string"?j.split("").map((B=>B.charCodeAt(0))):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<Z&&(this._parseBuffer=new Uint32Array(Math.min(j.length,Z))),le||this._dirtyRowTracker.clearRange(),j.length>Z)for(let B=W;B<j.length;B+=Z){const ie=B+Z<j.length?B+Z:j.length,ne=typeof j=="string"?this._stringDecoder.decode(j.substring(B,ie),this._parseBuffer):this._utf8Decoder.decode(j.subarray(B,ie),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,ne))return this._preserveStack(H,q,ne,B),this._logSlowResolvingAsync(L),L}else if(!le){const B=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,B))return this._preserveStack(H,q,B,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===H&&this._activeBuffer.y===q||this._onCursorMove.fire();const fe=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),I=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);I<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(I,this._bufferService.rows-1),Math.min(fe,this._bufferService.rows-1))}print(j,U,L){let H,q;const W=this._charsetService.charset,le=this._optionsService.rawOptions.screenReaderMode,fe=this._bufferService.cols,I=this._coreService.decPrivateModes.wraparound,B=this._coreService.modes.insertMode,ie=this._curAttrData;let ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-U>0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ie);let me=this._parser.precedingJoinState;for(let pe=U;pe<L;++pe){if(H=j[pe],H<127&&W){const st=W[String.fromCharCode(H)];st&&(H=st.charCodeAt(0))}const Ee=this._unicodeService.charProperties(H,me);q=R.UnicodeService.extractWidth(Ee);const je=R.UnicodeService.extractShouldJoin(Ee),Be=je?R.UnicodeService.extractWidth(me):0;if(me=Ee,le&&this._onA11yChar.fire((0,C.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+q-Be>fe){if(I){const st=ne;let Ce=this._activeBuffer.x-Be;for(this._activeBuffer.x=Be,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),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Be>0&&ne instanceof m.BufferLine&&ne.copyCellsFrom(st,Ce,0,Be,!1);Ce<fe;)st.setCellFromCodepoint(Ce++,0,1,ie)}else if(this._activeBuffer.x=fe-1,q===2)continue}if(je&&this._activeBuffer.x){const st=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-st,H,q);for(let Ce=q-Be;--Ce>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}else if(B&&(ne.insertCells(this._activeBuffer.x,q-Be,this._activeBuffer.getNullCell(ie)),ne.getWidth(fe-1)===2&&ne.setCellFromCodepoint(fe-1,h.NULL_CELL_CODE,h.NULL_CELL_WIDTH,ie)),ne.setCellFromCodepoint(this._activeBuffer.x++,H,q,ie),q>0)for(;--q;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}this._parser.precedingJoinState=me,this._activeBuffer.x<fe&&L-U>0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,ie),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,U){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,U):this._parser.registerCsiHandler(j,(L=>!K(L.params[0],this._optionsService.rawOptions.windowOptions)||U(L)))}registerDcsHandler(j,U){return this._parser.registerDcsHandler(j,new T.DcsHandler(U))}registerEscHandler(j,U){return this._parser.registerEscHandler(j,U)}registerOscHandler(j,U){return this._parser.registerOscHandler(j,new D.OscHandler(U))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var j;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&&((j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&j.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);U.hasWidth(this._activeBuffer.x)&&!U.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,U){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+U):(this._activeBuffer.x=j,this._activeBuffer.y=U),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,U){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+U)}cursorUp(j){const U=this._activeBuffer.y-this._activeBuffer.scrollTop;return U>=0?this._moveCursor(0,-Math.min(U,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const U=this._activeBuffer.scrollBottom-this._activeBuffer.y;return U>=0?this._moveCursor(0,Math.min(U,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const U=j.params[0];return U===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:U===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=j.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=j.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const U=j.params[0];return U===1&&(this._curAttrData.bg|=536870912),U!==2&&U!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,U,L,H=!1,q=!1){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);W.replaceCells(U,L,this._activeBuffer.getNullCell(this._eraseAttrData()),q),H&&(W.isWrapped=!1)}_resetBufferLine(j,U=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),U),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),L.isWrapped=!1)}eraseInDisplay(j,U=!1){let L;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);L<this._bufferService.rows;L++)this._resetBufferLine(L,U);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,U),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,U);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,U);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(j,U=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,U);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,U)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let U=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,q=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;U--;)this._activeBuffer.lines.splice(q-1,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}deleteLines(j){this._restrictCursor();let U=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;U--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let U=j.params[0]||1;for(;U--;)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(j){let U=j.params[0]||1;for(;U--;)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(m.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.deleteCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.insertCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.insertCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.deleteCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const U=this._parser.precedingJoinState;if(!U)return!0;const L=j.params[0]||1,H=R.UnicodeService.extractWidth(U),q=this._activeBuffer.x-H,W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(q),le=new Uint32Array(W.length*L);let fe=0;for(let B=0;B<W.length;){const ie=W.codePointAt(B)||0;le[fe++]=ie,B+=ie>65535?2:1}let I=fe;for(let B=1;B<L;++B)le.copyWithin(I,0,fe),I+=fe;return this.print(le,0,I),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let U=0;U<j.length;U++)switch(j.params[U]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let U=0;U<j.length;U++)switch(j.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,S.DEFAULT_CHARSET),this._charsetService.setgCharset(1,S.DEFAULT_CHARSET),this._charsetService.setgCharset(2,S.DEFAULT_CHARSET),this._charsetService.setgCharset(3,S.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(j){for(let U=0;U<j.length;U++)switch(j.params[U]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let U=0;U<j.length;U++)switch(j.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),j.params[U]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(j,U){const L=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:q}=this._coreMouseService,W=this._coreService,{buffers:le,cols:fe}=this._bufferService,{active:I,alt:B}=le,ie=this._optionsService.rawOptions,ne=je=>je?1:2,me=j.params[0];return pe=me,Ee=U?me===2?4:me===4?ne(W.modes.insertMode):me===12?3:me===20?ne(ie.convertEol):0:me===1?ne(L.applicationCursorKeys):me===3?ie.windowOptions.setWinLines?fe===80?2:fe===132?1:0:0:me===6?ne(L.origin):me===7?ne(L.wraparound):me===8?3:me===9?ne(H==="X10"):me===12?ne(ie.cursorBlink):me===25?ne(!W.isCursorHidden):me===45?ne(L.reverseWraparound):me===66?ne(L.applicationKeypad):me===67?4:me===1e3?ne(H==="VT200"):me===1002?ne(H==="DRAG"):me===1003?ne(H==="ANY"):me===1004?ne(L.sendFocus):me===1005?4:me===1006?ne(q==="SGR"):me===1015?4:me===1016?ne(q==="SGR_PIXELS"):me===1048?1:me===47||me===1047||me===1049?ne(I===B):me===2004?ne(L.bracketedPasteMode):0,W.triggerDataEvent(`${d.C0.ESC}[${U?"":"?"}${pe};${Ee}$y`),!0;var pe,Ee}_updateAttrColor(j,U,L,H,q){return U===2?(j|=50331648,j&=-16777216,j|=x.AttributeData.fromColorRGB([L,H,q])):U===5&&(j&=-50331904,j|=33554432|255&L),j}_extractColor(j,U,L){const H=[0,0,-1,0,0,0];let q=0,W=0;do{if(H[W+q]=j.params[U+W],j.hasSubParams(U+W)){const le=j.getSubParams(U+W);let fe=0;do H[1]===5&&(q=1),H[W+fe+1+q]=le[fe];while(++fe<le.length&&fe+W+1+q<H.length);break}if(H[1]===5&&W+q>=2||H[1]===2&&W+q>=5)break;H[1]&&(q=1)}while(++W+U<j.length&&W+q<H.length);for(let le=2;le<H.length;++le)H[le]===-1&&(H[le]=0);switch(H[0]){case 38:L.fg=this._updateAttrColor(L.fg,H[1],H[3],H[4],H[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,H[1],H[3],H[4],H[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,H[1],H[3],H[4],H[5])}return W}_processUnderline(j,U){U.extended=U.extended.clone(),(!~j||j>5)&&(j=1),U.extended.underlineStyle=j,U.fg|=268435456,j===0&&(U.fg&=-268435457),U.updateExtended()}_processSGR0(j){j.fg=m.DEFAULT_ATTR_DATA.fg,j.bg=m.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const U=j.length;let L;const H=this._curAttrData;for(let q=0;q<U;q++)L=j.params[q],L>=30&&L<=37?(H.fg&=-50331904,H.fg|=16777216|L-30):L>=40&&L<=47?(H.bg&=-50331904,H.bg|=16777216|L-40):L>=90&&L<=97?(H.fg&=-50331904,H.fg|=16777224|L-90):L>=100&&L<=107?(H.bg&=-50331904,H.bg|=16777224|L-100):L===0?this._processSGR0(H):L===1?H.fg|=134217728:L===3?H.bg|=67108864:L===4?(H.fg|=268435456,this._processUnderline(j.hasSubParams(q)?j.getSubParams(q)[0]:1,H)):L===5?H.fg|=536870912:L===7?H.fg|=67108864:L===8?H.fg|=1073741824:L===9?H.fg|=2147483648:L===2?H.bg|=134217728:L===21?this._processUnderline(2,H):L===22?(H.fg&=-134217729,H.bg&=-134217729):L===23?H.bg&=-67108865:L===24?(H.fg&=-268435457,this._processUnderline(0,H)):L===25?H.fg&=-536870913:L===27?H.fg&=-67108865:L===28?H.fg&=-1073741825:L===29?H.fg&=2147483647:L===39?(H.fg&=-67108864,H.fg|=16777215&m.DEFAULT_ATTR_DATA.fg):L===49?(H.bg&=-67108864,H.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?q+=this._extractColor(j,q,H):L===53?H.bg|=1073741824:L===55?H.bg&=-1073741825:L===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):L===100?(H.fg&=-67108864,H.fg|=16777215&m.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const U=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${U};${L}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const U=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${U};${L}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(j){const U=j.params[0]||1;switch(U){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const L=U%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(j){const U=j.params[0]||1;let L;return(j.length<2||(L=j.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>U&&(this._activeBuffer.scrollTop=U-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(j){if(!K(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const U=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:U!==2&&this._onRequestWindowsOptionsReport.fire(F.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(F.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:U!==0&&U!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),U!==0&&U!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:U!==0&&U!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),U!==0&&U!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const U=[],L=j.split(";");for(;L.length>1;){const H=L.shift(),q=L.shift();if(/^\d+$/.exec(H)){const W=parseInt(H);if(Q(W))if(q==="?")U.push({type:0,index:W});else{const le=(0,M.parseColor)(q);le&&U.push({type:1,index:W,color:le})}}}return U.length&&this._onColor.fire(U),!0}setHyperlink(j){const U=j.split(";");return!(U.length<2)&&(U[1]?this._createHyperlink(U[0],U[1]):!U[0]&&this._finishHyperlink())}_createHyperlink(j,U){this._getCurrentLinkId()&&this._finishHyperlink();const L=j.split(":");let H;const q=L.findIndex((W=>W.startsWith("id=")));return q!==-1&&(H=L[q].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:U}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,U){const L=j.split(";");for(let H=0;H<L.length&&!(U>=this._specialColors.length);++H,++U)if(L[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[U]}]);else{const q=(0,M.parseColor)(L[H]);q&&this._onColor.fire([{type:1,index:this._specialColors[U],color:q}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const U=[],L=j.split(";");for(let H=0;H<L.length;++H)if(/^\d+$/.exec(L[H])){const q=parseInt(L[H]);Q(q)&&U.push({type:2,index:q})}return U.length&&this._onColor.fire(U),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){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,S.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset($[j[0]],S.CHARSETS[j[1]]||S.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new _.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let U=0;U<this._bufferService.rows;++U){const L=this._activeBuffer.ybase+this._activeBuffer.y+U,H=this._activeBuffer.lines.get(L);H&&(H.fill(j),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,U){const L=this._bufferService.buffer,H=this._optionsService.rawOptions;return(q=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${q}${d.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,U){this._dirtyRowTracker.markRangeDirty(j,U)}}l.InputHandler=ee;let V=class{constructor(ae){this._bufferService=ae,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ae){ae<this.start?this.start=ae:ae>this.end&&(this.end=ae)}markRangeDirty(ae,j){ae>j&&(X=ae,ae=j,j=X),ae<this.start&&(this.start=ae),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Q(ae){return 0<=ae&&ae<256}V=f([y(0,A.IBufferService)],V)},844:(k,l)=>{function u(f){for(const y of f)y.dispose();f.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const y=this._disposables.indexOf(f);y!==-1&&this._disposables.splice(y,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var y;this._isDisposed||f===this._value||((y=this._value)==null||y.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},l.toDisposable=function(f){return{dispose:f}},l.disposeArray=u,l.getDisposeArrayDisposable=function(f){return{dispose:()=>u(f)}}},1505:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(y,d,S){this._data[y]||(this._data[y]={}),this._data[y][d]=S}get(y,d){return this._data[y]?this._data[y][d]:void 0}clear(){this._data={}}}l.TwoKeyMap=u,l.FourKeyMap=class{constructor(){this._data=new u}set(f,y,d,S,E){this._data.get(f,y)||this._data.set(f,y,new u),this._data.get(f,y).set(d,S,E)}get(f,y,d,S){var E;return(E=this._data.get(f,y))==null?void 0:E.get(d,S)}clear(){this._data.clear()}}},6114:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const u=l.isNode?"node":navigator.userAgent,f=l.isNode?"node":navigator.platform;l.isFirefox=u.includes("Firefox"),l.isLegacyEdge=u.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(u),l.getSafariVersion=function(){if(!l.isSafari)return 0;const y=u.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),l.isIpad=f==="iPad",l.isIphone=f==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),l.isLinux=f.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(u)},6106:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let u=0;l.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(u=this._search(this._getKey(f)),this._array.splice(u,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const y=this._getKey(f);if(y===void 0||(u=this._search(y),u===-1)||this._getKey(this._array[u])!==y)return!1;do if(this._array[u]===f)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===y);return!1}*getKeyIterator(f){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===f)}forEachByKey(f,y){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do y(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===f)}values(){return[...this._array].values()}_search(f){let y=0,d=this._array.length-1;for(;d>=y;){let S=y+d>>1;const E=this._getKey(this._array[S]);if(E>f)d=S-1;else{if(!(E<f)){for(;S>0&&this._getKey(this._array[S-1])===f;)S--;return S}y=S+1}}return y}}},7226:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const f=u(6114);class y{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 O=0,C=0,m=E.timeRemaining(),g=0;for(;this._i<this._tasks.length;){if(O=Date.now(),this._tasks[this._i]()||this._i++,O=Math.max(1,Date.now()-O),C=Math.max(O,C),g=E.timeRemaining(),1.5*C>g)return m-O<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(m-O))}ms`),void this._start();m=g}this.clear()}}class d extends y{_requestCallback(E){return setTimeout((()=>E(this._createDeadline(16))))}_cancelCallback(E){clearTimeout(E)}_createDeadline(E){const O=Date.now()+E;return{timeRemaining:()=>Math.max(0,O-Date.now())}}}l.PriorityTaskQueue=d,l.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(S){return requestIdleCallback(S)}_cancelCallback(S){cancelIdleCallback(S)}}:d,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(S){this._queue.clear(),this._queue.enqueue(S)}flush(){this._queue.flush()}}},9282:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const f=u(643);l.updateWindowsModeWrappedState=function(y){const d=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),S=d==null?void 0:d.get(y.cols-1),E=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);E&&S&&(E.isWrapped=S[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&S[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new u;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}l.AttributeData=u;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,S=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=S}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=f},9092:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const f=u(6349),y=u(7226),d=u(3734),S=u(8437),E=u(4634),O=u(511),C=u(643),m=u(4863),g=u(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(h,_,x){this._hasScrollback=h,this._optionsService=_,this._bufferService=x,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=S.DEFAULT_ATTR_DATA.clone(),this.savedCharset=g.DEFAULT_CHARSET,this.markers=[],this._nullCell=O.CellData.fromCharData([0,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]),this._whitespaceCell=O.CellData.fromCharData([0,C.WHITESPACE_CELL_CHAR,C.WHITESPACE_CELL_WIDTH,C.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new y.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(h){return h?(this._nullCell.fg=h.fg,this._nullCell.bg=h.bg,this._nullCell.extended=h.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(h){return h?(this._whitespaceCell.fg=h.fg,this._whitespaceCell.bg=h.bg,this._whitespaceCell.extended=h.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(h,_){return new S.BufferLine(this._bufferService.cols,this.getNullCell(h),_)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const h=this.ybase+this.y-this.ydisp;return h>=0&&h<this._rows}_getCorrectBufferLength(h){if(!this._hasScrollback)return h;const _=h+this._optionsService.rawOptions.scrollback;return _>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:_}fillViewportRows(h){if(this.lines.length===0){h===void 0&&(h=S.DEFAULT_ATTR_DATA);let _=this._rows;for(;_--;)this.lines.push(this.getBlankLine(h))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(h,_){const x=this.getNullCell(S.DEFAULT_ATTR_DATA);let A=0;const R=this._getCorrectBufferLength(_);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<h)for(let T=0;T<this.lines.length;T++)A+=+this.lines.get(T).resize(h,x);let D=0;if(this._rows<_)for(let T=this._rows;T<_;T++)this.lines.length<_+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new S.BufferLine(h,x)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new S.BufferLine(h,x)));else for(let T=this._rows;T>_;T--)this.lines.length>_+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const T=this.lines.length-R;T>0&&(this.lines.trimStart(T),this.ybase=Math.max(this.ybase-T,0),this.ydisp=Math.max(this.ydisp-T,0),this.savedY=Math.max(this.savedY-T,0)),this.lines.maxLength=R}this.x=Math.min(this.x,h-1),this.y=Math.min(this.y,_-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,h-1),this.scrollTop=0}if(this.scrollBottom=_-1,this._isReflowEnabled&&(this._reflow(h,_),this._cols>h))for(let D=0;D<this.lines.length;D++)A+=+this.lines.get(D).resize(h,x);this._cols=h,this._rows=_,this._memoryCleanupQueue.clear(),A>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let h=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,h=!1);let _=0;for(;this._memoryCleanupPosition<this.lines.length;)if(_+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),_>100)return!0;return h}get _isReflowEnabled(){const h=this._optionsService.rawOptions.windowsPty;return h&&h.buildNumber?this._hasScrollback&&h.backend==="conpty"&&h.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(h,_){this._cols!==h&&(h>this._cols?this._reflowLarger(h,_):this._reflowSmaller(h,_))}_reflowLarger(h,_){const x=(0,E.reflowLargerGetLinesToRemove)(this.lines,this._cols,h,this.ybase+this.y,this.getNullCell(S.DEFAULT_ATTR_DATA));if(x.length>0){const A=(0,E.reflowLargerCreateNewLayout)(this.lines,x);(0,E.reflowLargerApplyNewLayout)(this.lines,A.layout),this._reflowLargerAdjustViewport(h,_,A.countRemoved)}}_reflowLargerAdjustViewport(h,_,x){const A=this.getNullCell(S.DEFAULT_ATTR_DATA);let R=x;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<_&&this.lines.push(new S.BufferLine(h,A))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-x,0)}_reflowSmaller(h,_){const x=this.getNullCell(S.DEFAULT_ATTR_DATA),A=[];let R=0;for(let D=this.lines.length-1;D>=0;D--){let T=this.lines.get(D);if(!T||!T.isWrapped&&T.getTrimmedLength()<=h)continue;const M=[T];for(;T.isWrapped&&D>0;)T=this.lines.get(--D),M.unshift(T);const $=this.ybase+this.y;if($>=D&&$<D+M.length)continue;const Z=M[M.length-1].getTrimmedLength(),K=(0,E.reflowSmallerGetNewLineLengths)(M,this._cols,h),F=K.length-M.length;let X;X=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+F):Math.max(0,this.lines.length-this.lines.maxLength+F);const ee=[];for(let L=0;L<F;L++){const H=this.getBlankLine(S.DEFAULT_ATTR_DATA,!0);ee.push(H)}ee.length>0&&(A.push({start:D+M.length+R,newLines:ee}),R+=ee.length),M.push(...ee);let V=K.length-1,Q=K[V];Q===0&&(V--,Q=K[V]);let ae=M.length-F-1,j=Z;for(;ae>=0;){const L=Math.min(j,Q);if(M[V]===void 0)break;if(M[V].copyCellsFrom(M[ae],j-L,Q-L,L,!0),Q-=L,Q===0&&(V--,Q=K[V]),j-=L,j===0){ae--;const H=Math.max(ae,0);j=(0,E.getWrappedLineTrimmedLength)(M,H,this._cols)}}for(let L=0;L<M.length;L++)K[L]<h&&M[L].setCell(K[L],x);let U=F-X;for(;U-- >0;)this.ybase===0?this.y<_-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-_&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+F,this.ybase+_-1)}if(A.length>0){const D=[],T=[];for(let V=0;V<this.lines.length;V++)T.push(this.lines.get(V));const M=this.lines.length;let $=M-1,Z=0,K=A[Z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let F=0;for(let V=Math.min(this.lines.maxLength-1,M+R-1);V>=0;V--)if(K&&K.start>$+F){for(let Q=K.newLines.length-1;Q>=0;Q--)this.lines.set(V--,K.newLines[Q]);V++,D.push({index:$+1,amount:K.newLines.length}),F+=K.newLines.length,K=A[++Z]}else this.lines.set(V,T[$--]);let X=0;for(let V=D.length-1;V>=0;V--)D[V].index+=X,this.lines.onInsertEmitter.fire(D[V]),X+=D[V].amount;const ee=Math.max(0,M+R-this.lines.maxLength);ee>0&&this.lines.onTrimEmitter.fire(ee)}}translateBufferLineToString(h,_,x=0,A){const R=this.lines.get(h);return R?R.translateToString(_,x,A):""}getWrappedRangeForLine(h){let _=h,x=h;for(;_>0&&this.lines.get(_).isWrapped;)_--;for(;x+1<this.lines.length&&this.lines.get(x+1).isWrapped;)x++;return{first:_,last:x}}setupTabStops(h){for(h!=null?this.tabs[h]||(h=this.prevStop(h)):(this.tabs={},h=0);h<this._cols;h+=this._optionsService.rawOptions.tabStopWidth)this.tabs[h]=!0}prevStop(h){for(h==null&&(h=this.x);!this.tabs[--h]&&h>0;);return h>=this._cols?this._cols-1:h<0?0:h}nextStop(h){for(h==null&&(h=this.x);!this.tabs[++h]&&h<this._cols;);return h>=this._cols?this._cols-1:h<0?0:h}clearMarkers(h){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].line===h&&(this.markers[_].dispose(),this.markers.splice(_--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].dispose(),this.markers.splice(h--,1);this._isClearing=!1}addMarker(h){const _=new m.Marker(h);return this.markers.push(_),_.register(this.lines.onTrim((x=>{_.line-=x,_.line<0&&_.dispose()}))),_.register(this.lines.onInsert((x=>{_.line>=x.index&&(_.line+=x.amount)}))),_.register(this.lines.onDelete((x=>{_.line>=x.index&&_.line<x.index+x.amount&&_.dispose(),_.line>x.index&&(_.line-=x.amount)}))),_.register(_.onDispose((()=>this._removeMarker(_)))),_}_removeMarker(h){this._isClearing||this.markers.splice(this.markers.indexOf(h),1)}}},8437:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const f=u(3734),y=u(511),d=u(643),S=u(482);l.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let E=0;class O{constructor(m,g,h=!1){this.isWrapped=h,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*m);const _=g||y.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let x=0;x<m;++x)this.setCell(x,_);this.length=m}get(m){const g=this._data[3*m+0],h=2097151&g;return[this._data[3*m+1],2097152&g?this._combined[m]:h?(0,S.stringFromCodePoint)(h):"",g>>22,2097152&g?this._combined[m].charCodeAt(this._combined[m].length-1):h]}set(m,g){this._data[3*m+1]=g[d.CHAR_DATA_ATTR_INDEX],g[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[m]=g[1],this._data[3*m+0]=2097152|m|g[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*m+0]=g[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(m){return this._data[3*m+0]>>22}hasWidth(m){return 12582912&this._data[3*m+0]}getFg(m){return this._data[3*m+1]}getBg(m){return this._data[3*m+2]}hasContent(m){return 4194303&this._data[3*m+0]}getCodePoint(m){const g=this._data[3*m+0];return 2097152&g?this._combined[m].charCodeAt(this._combined[m].length-1):2097151&g}isCombined(m){return 2097152&this._data[3*m+0]}getString(m){const g=this._data[3*m+0];return 2097152&g?this._combined[m]:2097151&g?(0,S.stringFromCodePoint)(2097151&g):""}isProtected(m){return 536870912&this._data[3*m+2]}loadCell(m,g){return E=3*m,g.content=this._data[E+0],g.fg=this._data[E+1],g.bg=this._data[E+2],2097152&g.content&&(g.combinedData=this._combined[m]),268435456&g.bg&&(g.extended=this._extendedAttrs[m]),g}setCell(m,g){2097152&g.content&&(this._combined[m]=g.combinedData),268435456&g.bg&&(this._extendedAttrs[m]=g.extended),this._data[3*m+0]=g.content,this._data[3*m+1]=g.fg,this._data[3*m+2]=g.bg}setCellFromCodepoint(m,g,h,_){268435456&_.bg&&(this._extendedAttrs[m]=_.extended),this._data[3*m+0]=g|h<<22,this._data[3*m+1]=_.fg,this._data[3*m+2]=_.bg}addCodepointToCell(m,g,h){let _=this._data[3*m+0];2097152&_?this._combined[m]+=(0,S.stringFromCodePoint)(g):2097151&_?(this._combined[m]=(0,S.stringFromCodePoint)(2097151&_)+(0,S.stringFromCodePoint)(g),_&=-2097152,_|=2097152):_=g|4194304,h&&(_&=-12582913,_|=h<<22),this._data[3*m+0]=_}insertCells(m,g,h){if((m%=this.length)&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,h),g<this.length-m){const _=new y.CellData;for(let x=this.length-m-g-1;x>=0;--x)this.setCell(m+g+x,this.loadCell(m+x,_));for(let x=0;x<g;++x)this.setCell(m+x,h)}else for(let _=m;_<this.length;++_)this.setCell(_,h);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,h)}deleteCells(m,g,h){if(m%=this.length,g<this.length-m){const _=new y.CellData;for(let x=0;x<this.length-m-g;++x)this.setCell(m+x,this.loadCell(m+g+x,_));for(let x=this.length-g;x<this.length;++x)this.setCell(x,h)}else for(let _=m;_<this.length;++_)this.setCell(_,h);m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,h),this.getWidth(m)!==0||this.hasContent(m)||this.setCellFromCodepoint(m,0,1,h)}replaceCells(m,g,h,_=!1){if(_)for(m&&this.getWidth(m-1)===2&&!this.isProtected(m-1)&&this.setCellFromCodepoint(m-1,0,1,h),g<this.length&&this.getWidth(g-1)===2&&!this.isProtected(g)&&this.setCellFromCodepoint(g,0,1,h);m<g&&m<this.length;)this.isProtected(m)||this.setCell(m,h),m++;else for(m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,h),g<this.length&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g,0,1,h);m<g&&m<this.length;)this.setCell(m++,h)}resize(m,g){if(m===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const h=3*m;if(m>this.length){if(this._data.buffer.byteLength>=4*h)this._data=new Uint32Array(this._data.buffer,0,h);else{const _=new Uint32Array(h);_.set(this._data),this._data=_}for(let _=this.length;_<m;++_)this.setCell(_,g)}else{this._data=this._data.subarray(0,h);const _=Object.keys(this._combined);for(let A=0;A<_.length;A++){const R=parseInt(_[A],10);R>=m&&delete this._combined[R]}const x=Object.keys(this._extendedAttrs);for(let A=0;A<x.length;A++){const R=parseInt(x[A],10);R>=m&&delete this._extendedAttrs[R]}}return this.length=m,4*h*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const m=new Uint32Array(this._data.length);return m.set(this._data),this._data=m,1}return 0}fill(m,g=!1){if(g)for(let h=0;h<this.length;++h)this.isProtected(h)||this.setCell(h,m);else{this._combined={},this._extendedAttrs={};for(let h=0;h<this.length;++h)this.setCell(h,m)}}copyFrom(m){this.length!==m.length?this._data=new Uint32Array(m._data):this._data.set(m._data),this.length=m.length,this._combined={};for(const g in m._combined)this._combined[g]=m._combined[g];this._extendedAttrs={};for(const g in m._extendedAttrs)this._extendedAttrs[g]=m._extendedAttrs[g];this.isWrapped=m.isWrapped}clone(){const m=new O(0);m._data=new Uint32Array(this._data),m.length=this.length;for(const g in this._combined)m._combined[g]=this._combined[g];for(const g in this._extendedAttrs)m._extendedAttrs[g]=this._extendedAttrs[g];return m.isWrapped=this.isWrapped,m}getTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0])return m+(this._data[3*m+0]>>22);return 0}getNoBgTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0]||50331648&this._data[3*m+2])return m+(this._data[3*m+0]>>22);return 0}copyCellsFrom(m,g,h,_,x){const A=m._data;if(x)for(let D=_-1;D>=0;D--){for(let T=0;T<3;T++)this._data[3*(h+D)+T]=A[3*(g+D)+T];268435456&A[3*(g+D)+2]&&(this._extendedAttrs[h+D]=m._extendedAttrs[g+D])}else for(let D=0;D<_;D++){for(let T=0;T<3;T++)this._data[3*(h+D)+T]=A[3*(g+D)+T];268435456&A[3*(g+D)+2]&&(this._extendedAttrs[h+D]=m._extendedAttrs[g+D])}const R=Object.keys(m._combined);for(let D=0;D<R.length;D++){const T=parseInt(R[D],10);T>=g&&(this._combined[T-g+h]=m._combined[T])}}translateToString(m,g,h,_){g=g??0,h=h??this.length,m&&(h=Math.min(h,this.getTrimmedLength())),_&&(_.length=0);let x="";for(;g<h;){const A=this._data[3*g+0],R=2097151&A,D=2097152&A?this._combined[g]:R?(0,S.stringFromCodePoint)(R):d.WHITESPACE_CELL_CHAR;if(x+=D,_)for(let T=0;T<D.length;++T)_.push(g);g+=A>>22||1}return _&&_.push(g),x}}l.BufferLine=O},4841:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(u,f){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return f*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(k,l)=>{function u(f,y,d){if(y===f.length-1)return f[y].getTrimmedLength();const S=!f[y].hasContent(d-1)&&f[y].getWidth(d-1)===1,E=f[y+1].getWidth(0)===2;return S&&E?d-1:d}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(f,y,d,S,E){const O=[];for(let C=0;C<f.length-1;C++){let m=C,g=f.get(++m);if(!g.isWrapped)continue;const h=[f.get(C)];for(;m<f.length&&g.isWrapped;)h.push(g),g=f.get(++m);if(S>=C&&S<m){C+=h.length-1;continue}let _=0,x=u(h,_,y),A=1,R=0;for(;A<h.length;){const T=u(h,A,y),M=T-R,$=d-x,Z=Math.min(M,$);h[_].copyCellsFrom(h[A],R,x,Z,!1),x+=Z,x===d&&(_++,x=0),R+=Z,R===T&&(A++,R=0),x===0&&_!==0&&h[_-1].getWidth(d-1)===2&&(h[_].copyCellsFrom(h[_-1],d-1,x++,1,!1),h[_-1].setCell(d-1,E))}h[_].replaceCells(x,d,E);let D=0;for(let T=h.length-1;T>0&&(T>_||h[T].getTrimmedLength()===0);T--)D++;D>0&&(O.push(C+h.length-D),O.push(D)),C+=h.length-1}return O},l.reflowLargerCreateNewLayout=function(f,y){const d=[];let S=0,E=y[S],O=0;for(let C=0;C<f.length;C++)if(E===C){const m=y[++S];f.onDeleteEmitter.fire({index:C-O,amount:m}),C+=m-1,O+=m,E=y[++S]}else d.push(C);return{layout:d,countRemoved:O}},l.reflowLargerApplyNewLayout=function(f,y){const d=[];for(let S=0;S<y.length;S++)d.push(f.get(y[S]));for(let S=0;S<d.length;S++)f.set(S,d[S]);f.length=y.length},l.reflowSmallerGetNewLineLengths=function(f,y,d){const S=[],E=f.map(((g,h)=>u(f,h,y))).reduce(((g,h)=>g+h));let O=0,C=0,m=0;for(;m<E;){if(E-m<d){S.push(E-m);break}O+=d;const g=u(f,C,y);O>g&&(O-=g,C++);const h=f[C].getWidth(O-1)===2;h&&O--;const _=h?d-1:d;S.push(_),m+=_}return S},l.getWrappedLineTrimmedLength=u},5295:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const f=u(8460),y=u(844),d=u(9092);class S extends y.Disposable{constructor(O,C){super(),this._optionsService=O,this._bufferService=C,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(O){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(O),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(O,C){this._normal.resize(O,C),this._alt.resize(O,C),this.setupTabStops(O)}setupTabStops(O){this._normal.setupTabStops(O),this._alt.setupTabStops(O)}}l.BufferSet=S},511:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const f=u(482),y=u(643),d=u(3734);class S extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(O){const C=new S;return C.setFromCharData(O),C}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(O){this.fg=O[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let C=!1;if(O[y.CHAR_DATA_CHAR_INDEX].length>2)C=!0;else if(O[y.CHAR_DATA_CHAR_INDEX].length===2){const m=O[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=m&&m<=56319){const g=O[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=g&&g<=57343?this.content=1024*(m-55296)+g-56320+65536|O[y.CHAR_DATA_WIDTH_INDEX]<<22:C=!0}else C=!0}else this.content=O[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|O[y.CHAR_DATA_WIDTH_INDEX]<<22;C&&(this.combinedData=O[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|O[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=S},643:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const f=u(8460),y=u(844);class d{get id(){return this._id}constructor(E){this.line=E,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,y.disposeArray)(this._disposables),this._disposables.length=0)}register(E){return this._disposables.push(E),E}}l.Marker=d,d._nextId=1},7116:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(k,l)=>{var u,f,y;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
|
|
309
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),g.isLinux&&T&&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(T){const M=this._getMouseBufferCoords(T),$=this._model.finalSelectionStart,Z=this._model.finalSelectionEnd;return!!($&&Z&&M)&&this._areCoordsInSelection(M,$,Z)}isCellInSelection(T,M){const $=this._model.finalSelectionStart,Z=this._model.finalSelectionEnd;return!(!$||!Z)&&this._areCoordsInSelection([T,M],$,Z)}_areCoordsInSelection(T,M,$){return T[1]>M[1]&&T[1]<$[1]||M[1]===$[1]&&T[1]===M[1]&&T[0]>=M[0]&&T[0]<$[0]||M[1]<$[1]&&T[1]===$[1]&&T[0]<$[0]||M[1]<$[1]&&T[1]===M[1]&&T[0]>=M[0]}_selectWordAtCursor(T,M){var K,F;const $=(F=(K=this._linkifier.currentLink)==null?void 0:K.link)==null?void 0:F.range;if($)return this._model.selectionStart=[$.start.x-1,$.start.y-1],this._model.selectionStartLength=(0,h.getRangeLength)($,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const Z=this._getMouseBufferCoords(T);return!!Z&&(this._selectWordAt(Z,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,M){this._model.clearSelection(),T=Math.max(T,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const M=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(T){let M=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const $=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=$?0:(M>$&&(M-=$),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(T){return g.isMac?T.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:T.shiftKey}handleMouseDown(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._handleIncrementalClick(T):T.detail===1?this._handleSingleClick(T):T.detail===2?this._handleDoubleClick(T):T.detail===3&&this._handleTripleClick(T),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))}_handleSingleClick(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const M=this._getMouseBufferCoords(T);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(T){return T.altKey&&!(g.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(T),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(T),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const $=this._bufferService.buffer;if(this._model.selectionEnd[1]<$.lines.length){const Z=$.lines.get(this._model.selectionEnd[1]);Z&&Z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}M&&M[0]===this._model.selectionEnd[0]&&M[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const T=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(T.ydisp+this._bufferService.rows,T.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=T.ydisp),this.refresh()}}_handleMouseUp(T){const M=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const $=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if($&&$[0]!==void 0&&$[1]!==void 0){const Z=(0,S.moveToCellSequence)($[0]-1,$[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(Z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,$=!(!T||!M||T[0]===M[0]&&T[1]===M[1]);$?T&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,M,$)):this._oldHasSelection&&this._fireOnSelectionChange(T,M,$)}_fireOnSelectionChange(T,M,$){this._oldSelectionStart=T,this._oldSelectionEnd=M,this._oldHasSelection=$,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(T,M){let $=M;for(let Z=0;M>=Z;Z++){const K=T.loadCell(Z,this._workCell).getChars().length;this._workCell.getWidth()===0?$--:K>1&&M!==Z&&($+=K-1)}return $}setSelection(T,M,$){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,M],this._model.selectionStartLength=$,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,M,$=!0,Z=!0){if(T[0]>=this._bufferService.cols)return;const K=this._bufferService.buffer,F=K.lines.get(T[1]);if(!F)return;const X=K.translateBufferLineToString(T[1],!1);let ee=this._convertViewportColToCharacterIndex(F,T[0]),V=ee;const Q=T[0]-ee;let ae=0,j=0,I=0,L=0;if(X.charAt(ee)===" "){for(;ee>0&&X.charAt(ee-1)===" ";)ee--;for(;V<X.length&&X.charAt(V+1)===" ";)V++}else{let W=T[0],le=T[0];F.getWidth(W)===0&&(ae++,W--),F.getWidth(le)===2&&(j++,le++);const fe=F.getString(le).length;for(fe>1&&(L+=fe-1,V+=fe-1);W>0&&ee>0&&!this._isCharWordSeparator(F.loadCell(W-1,this._workCell));){F.loadCell(W-1,this._workCell);const U=this._workCell.getChars().length;this._workCell.getWidth()===0?(ae++,W--):U>1&&(I+=U-1,ee-=U-1),ee--,W--}for(;le<F.length&&V+1<X.length&&!this._isCharWordSeparator(F.loadCell(le+1,this._workCell));){F.loadCell(le+1,this._workCell);const U=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,le++):U>1&&(L+=U-1,V+=U-1),V++,le++}}V++;let H=ee+Q-ae+I,q=Math.min(this._bufferService.cols,V-ee+ae+j-I-L);if(M||X.slice(ee,V).trim()!==""){if($&&H===0&&F.getCodePoint(0)!==32){const W=K.lines.get(T[1]-1);if(W&&F.isWrapped&&W.getCodePoint(this._bufferService.cols-1)!==32){const le=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(le){const fe=this._bufferService.cols-le.start;H-=fe,q+=fe}}}if(Z&&H+q===this._bufferService.cols&&F.getCodePoint(this._bufferService.cols-1)!==32){const W=K.lines.get(T[1]+1);if(W!=null&&W.isWrapped&&W.getCodePoint(0)!==32){const le=this._getWordAt([0,T[1]+1],!1,!1,!0);le&&(q+=le.length)}}return{start:H,length:q}}}_selectWordAt(T,M){const $=this._getWordAt(T,M);if($){for(;$.start<0;)$.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[$.start,T[1]],this._model.selectionStartLength=$.length}}_selectToWordAt(T){const M=this._getWordAt(T,!0);if(M){let $=T[1];for(;M.start<0;)M.start+=this._bufferService.cols,$--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,$++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,$]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const M=this._bufferService.buffer.getWrappedRangeForLine(T),$={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,h.getRangeLength)($,this._bufferService.cols)}};l.SelectionService=D=f([y(3,x.IBufferService),y(4,x.ICoreService),y(5,O.IMouseService),y(6,x.IOptionsService),y(7,O.IRenderService),y(8,O.ICoreBrowserService)],D)},4725:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const f=u(8343);l.ICharSizeService=(0,f.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),l.IMouseService=(0,f.createDecorator)("MouseService"),l.IRenderService=(0,f.createDecorator)("RenderService"),l.ISelectionService=(0,f.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,f.createDecorator)("ThemeService"),l.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(k,l,u){var f=this&&this.__decorate||function(D,T,M,$){var Z,K=arguments.length,F=K<3?T:$===null?$=Object.getOwnPropertyDescriptor(T,M):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(D,T,M,$);else for(var X=D.length-1;X>=0;X--)(Z=D[X])&&(F=(K<3?Z(F):K>3?Z(T,M,F):Z(T,M))||F);return K>3&&F&&Object.defineProperty(T,M,F),F},y=this&&this.__param||function(D,T){return function(M,$){T(M,$,D)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const d=u(7239),S=u(8055),E=u(8460),O=u(844),C=u(2585),m=S.css.toColor("#ffffff"),g=S.css.toColor("#000000"),h=S.css.toColor("#ffffff"),_=S.css.toColor("#000000"),x={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[S.css.toColor("#2e3436"),S.css.toColor("#cc0000"),S.css.toColor("#4e9a06"),S.css.toColor("#c4a000"),S.css.toColor("#3465a4"),S.css.toColor("#75507b"),S.css.toColor("#06989a"),S.css.toColor("#d3d7cf"),S.css.toColor("#555753"),S.css.toColor("#ef2929"),S.css.toColor("#8ae234"),S.css.toColor("#fce94f"),S.css.toColor("#729fcf"),S.css.toColor("#ad7fa8"),S.css.toColor("#34e2e2"),S.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let M=0;M<216;M++){const $=T[M/36%6|0],Z=T[M/6%6|0],K=T[M%6];D.push({css:S.channels.toCss($,Z,K),rgba:S.channels.toRgba($,Z,K)})}for(let M=0;M<24;M++){const $=8+10*M;D.push({css:S.channels.toCss($,$,$),rgba:S.channels.toRgba($,$,$)})}return D})());let A=l.ThemeService=class extends O.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new E.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:m,background:g,cursor:h,cursorAccent:_,selectionForeground:void 0,selectionBackgroundTransparent:x,selectionBackgroundOpaque:S.color.blend(g,x),selectionInactiveBackgroundTransparent:x,selectionInactiveBackgroundOpaque:S.color.blend(g,x),ansi:l.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const T=this._colors;if(T.foreground=R(D.foreground,m),T.background=R(D.background,g),T.cursor=R(D.cursor,h),T.cursorAccent=R(D.cursorAccent,_),T.selectionBackgroundTransparent=R(D.selectionBackground,x),T.selectionBackgroundOpaque=S.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=R(D.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=S.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=D.selectionForeground?R(D.selectionForeground,S.NULL_COLOR):void 0,T.selectionForeground===S.NULL_COLOR&&(T.selectionForeground=void 0),S.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=S.color.opacity(T.selectionBackgroundTransparent,.3)),S.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=S.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=l.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=R(D.black,l.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=R(D.red,l.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=R(D.green,l.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=R(D.yellow,l.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=R(D.blue,l.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=R(D.magenta,l.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=R(D.cyan,l.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=R(D.white,l.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=R(D.brightBlack,l.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=R(D.brightRed,l.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=R(D.brightGreen,l.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=R(D.brightYellow,l.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=R(D.brightBlue,l.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=R(D.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=R(D.brightCyan,l.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=R(D.brightWhite,l.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const M=Math.min(T.ansi.length-16,D.extendedAnsi.length);for(let $=0;$<M;$++)T.ansi[$+16]=R(D.extendedAnsi[$],l.DEFAULT_ANSI_COLORS[$+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[D]=this._restoreColors.ansi[D]}else for(let T=0;T<this._restoreColors.ansi.length;++T)this._colors.ansi[T]=this._restoreColors.ansi[T]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(D,T){if(D!==void 0)try{return S.css.toColor(D)}catch{}return T}l.ThemeService=A=f([y(0,C.IOptionsService)],A)},6349:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const f=u(8460),y=u(844);class d extends y.Disposable{constructor(E){super(),this._maxLength=E,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(E){if(this._maxLength===E)return;const O=new Array(E);for(let C=0;C<Math.min(E,this.length);C++)O[C]=this._array[this._getCyclicIndex(C)];this._array=O,this._maxLength=E,this._startIndex=0}get length(){return this._length}set length(E){if(E>this._length)for(let O=this._length;O<E;O++)this._array[O]=void 0;this._length=E}get(E){return this._array[this._getCyclicIndex(E)]}set(E,O){this._array[this._getCyclicIndex(E)]=O}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,O,...C){if(O){for(let m=E;m<this._length-O;m++)this._array[this._getCyclicIndex(m)]=this._array[this._getCyclicIndex(m+O)];this._length-=O,this.onDeleteEmitter.fire({index:E,amount:O})}for(let m=this._length-1;m>=E;m--)this._array[this._getCyclicIndex(m+C.length)]=this._array[this._getCyclicIndex(m)];for(let m=0;m<C.length;m++)this._array[this._getCyclicIndex(E+m)]=C[m];if(C.length&&this.onInsertEmitter.fire({index:E,amount:C.length}),this._length+C.length>this._maxLength){const m=this._length+C.length-this._maxLength;this._startIndex+=m,this._length=this._maxLength,this.onTrimEmitter.fire(m)}else this._length+=C.length}trimStart(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)}shiftElements(E,O,C){if(!(O<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+C<0)throw new Error("Cannot shift elements in list beyond index 0");if(C>0){for(let g=O-1;g>=0;g--)this.set(E+g+C,this.get(E+g));const m=E+O+C-this._length;if(m>0)for(this._length+=m;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let m=0;m<O;m++)this.set(E+m+C,this.get(E+m))}}_getCyclicIndex(E){return(this._startIndex+E)%this._maxLength}}l.CircularList=d},1439:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function u(f,y=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const S in f)d[S]=y<=1?f[S]:f[S]&&u(f[S],y-1);return d}},8055:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let u=0,f=0,y=0,d=0;var S,E,O,C,m;function g(_){const x=_.toString(16);return x.length<2?"0"+x:x}function h(_,x){return _<x?(x+.05)/(_+.05):(_+.05)/(x+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(_){_.toCss=function(x,A,R,D){return D!==void 0?`#${g(x)}${g(A)}${g(R)}${g(D)}`:`#${g(x)}${g(A)}${g(R)}`},_.toRgba=function(x,A,R,D=255){return(x<<24|A<<16|R<<8|D)>>>0},_.toColor=function(x,A,R,D){return{css:_.toCss(x,A,R,D),rgba:_.toRgba(x,A,R,D)}}})(S||(l.channels=S={})),(function(_){function x(A,R){return d=Math.round(255*R),[u,f,y]=m.toChannels(A.rgba),{css:S.toCss(u,f,y,d),rgba:S.toRgba(u,f,y,d)}}_.blend=function(A,R){if(d=(255&R.rgba)/255,d===1)return{css:R.css,rgba:R.rgba};const D=R.rgba>>24&255,T=R.rgba>>16&255,M=R.rgba>>8&255,$=A.rgba>>24&255,Z=A.rgba>>16&255,K=A.rgba>>8&255;return u=$+Math.round((D-$)*d),f=Z+Math.round((T-Z)*d),y=K+Math.round((M-K)*d),{css:S.toCss(u,f,y),rgba:S.toRgba(u,f,y)}},_.isOpaque=function(A){return(255&A.rgba)==255},_.ensureContrastRatio=function(A,R,D){const T=m.ensureContrastRatio(A.rgba,R.rgba,D);if(T)return S.toColor(T>>24&255,T>>16&255,T>>8&255)},_.opaque=function(A){const R=(255|A.rgba)>>>0;return[u,f,y]=m.toChannels(R),{css:S.toCss(u,f,y),rgba:R}},_.opacity=x,_.multiplyOpacity=function(A,R){return d=255&A.rgba,x(A,d*R/255)},_.toColorRGB=function(A){return[A.rgba>>24&255,A.rgba>>16&255,A.rgba>>8&255]}})(E||(l.color=E={})),(function(_){let x,A;try{const R=document.createElement("canvas");R.width=1,R.height=1;const D=R.getContext("2d",{willReadFrequently:!0});D&&(x=D,x.globalCompositeOperation="copy",A=x.createLinearGradient(0,0,1,1))}catch{}_.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return u=parseInt(R.slice(1,2).repeat(2),16),f=parseInt(R.slice(2,3).repeat(2),16),y=parseInt(R.slice(3,4).repeat(2),16),S.toColor(u,f,y);case 5:return u=parseInt(R.slice(1,2).repeat(2),16),f=parseInt(R.slice(2,3).repeat(2),16),y=parseInt(R.slice(3,4).repeat(2),16),d=parseInt(R.slice(4,5).repeat(2),16),S.toColor(u,f,y,d);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const D=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return u=parseInt(D[1]),f=parseInt(D[2]),y=parseInt(D[3]),d=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),S.toColor(u,f,y,d);if(!x||!A)throw new Error("css.toColor: Unsupported css format");if(x.fillStyle=A,x.fillStyle=R,typeof x.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(x.fillRect(0,0,1,1),[u,f,y,d]=x.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(u,f,y,d),css:R}}})(O||(l.css=O={})),(function(_){function x(A,R,D){const T=A/255,M=R/255,$=D/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*($<=.03928?$/12.92:Math.pow(($+.055)/1.055,2.4))}_.relativeLuminance=function(A){return x(A>>16&255,A>>8&255,255&A)},_.relativeLuminance2=x})(C||(l.rgb=C={})),(function(_){function x(R,D,T){const M=R>>24&255,$=R>>16&255,Z=R>>8&255;let K=D>>24&255,F=D>>16&255,X=D>>8&255,ee=h(C.relativeLuminance2(K,F,X),C.relativeLuminance2(M,$,Z));for(;ee<T&&(K>0||F>0||X>0);)K-=Math.max(0,Math.ceil(.1*K)),F-=Math.max(0,Math.ceil(.1*F)),X-=Math.max(0,Math.ceil(.1*X)),ee=h(C.relativeLuminance2(K,F,X),C.relativeLuminance2(M,$,Z));return(K<<24|F<<16|X<<8|255)>>>0}function A(R,D,T){const M=R>>24&255,$=R>>16&255,Z=R>>8&255;let K=D>>24&255,F=D>>16&255,X=D>>8&255,ee=h(C.relativeLuminance2(K,F,X),C.relativeLuminance2(M,$,Z));for(;ee<T&&(K<255||F<255||X<255);)K=Math.min(255,K+Math.ceil(.1*(255-K))),F=Math.min(255,F+Math.ceil(.1*(255-F))),X=Math.min(255,X+Math.ceil(.1*(255-X))),ee=h(C.relativeLuminance2(K,F,X),C.relativeLuminance2(M,$,Z));return(K<<24|F<<16|X<<8|255)>>>0}_.blend=function(R,D){if(d=(255&D)/255,d===1)return D;const T=D>>24&255,M=D>>16&255,$=D>>8&255,Z=R>>24&255,K=R>>16&255,F=R>>8&255;return u=Z+Math.round((T-Z)*d),f=K+Math.round((M-K)*d),y=F+Math.round(($-F)*d),S.toRgba(u,f,y)},_.ensureContrastRatio=function(R,D,T){const M=C.relativeLuminance(R>>8),$=C.relativeLuminance(D>>8);if(h(M,$)<T){if($<M){const F=x(R,D,T),X=h(M,C.relativeLuminance(F>>8));if(X<T){const ee=A(R,D,T);return X>h(M,C.relativeLuminance(ee>>8))?F:ee}return F}const Z=A(R,D,T),K=h(M,C.relativeLuminance(Z>>8));if(K<T){const F=x(R,D,T);return K>h(M,C.relativeLuminance(F>>8))?Z:F}return Z}},_.reduceLuminance=x,_.increaseLuminance=A,_.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(m||(l.rgba=m={})),l.toPaddedHex=g,l.contrastRatio=h},8969:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const f=u(844),y=u(2585),d=u(4348),S=u(7866),E=u(744),O=u(7302),C=u(6975),m=u(8460),g=u(1753),h=u(1480),_=u(7994),x=u(9282),A=u(5435),R=u(5981),D=u(2660);let T=!1;class M extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new m.EventEmitter),this._onScroll.event((Z=>{var K;(K=this._onScrollApi)==null||K.fire(Z.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(Z){for(const K in Z)this.optionsService.options[K]=Z[K]}constructor(Z){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new m.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new m.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new O.OptionsService(Z)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(E.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(S.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(C.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(g.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(h.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(_.CharsetService),this._instantiationService.setService(y.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(y.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new A.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,m.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,m.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,m.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,m.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((K=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((K=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((K,F)=>this._inputHandler.parse(K,F)))),this.register((0,m.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(Z,K){this._writeBuffer.write(Z,K)}writeSync(Z,K){this._logService.logLevel<=y.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(Z,K)}input(Z,K=!0){this.coreService.triggerDataEvent(Z,K)}resize(Z,K){isNaN(Z)||isNaN(K)||(Z=Math.max(Z,E.MINIMUM_COLS),K=Math.max(K,E.MINIMUM_ROWS),this._bufferService.resize(Z,K))}scroll(Z,K=!1){this._bufferService.scroll(Z,K)}scrollLines(Z,K,F){this._bufferService.scrollLines(Z,K,F)}scrollPages(Z){this.scrollLines(Z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(Z){const K=Z-this._bufferService.buffer.ydisp;K!==0&&this.scrollLines(K)}registerEscHandler(Z,K){return this._inputHandler.registerEscHandler(Z,K)}registerDcsHandler(Z,K){return this._inputHandler.registerDcsHandler(Z,K)}registerCsiHandler(Z,K){return this._inputHandler.registerCsiHandler(Z,K)}registerOscHandler(Z,K){return this._inputHandler.registerOscHandler(Z,K)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let Z=!1;const K=this.optionsService.rawOptions.windowsPty;K&&K.buildNumber!==void 0&&K.buildNumber!==void 0?Z=K.backend==="conpty"&&K.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(Z=!0),Z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const Z=[];Z.push(this.onLineFeed(x.updateWindowsModeWrappedState.bind(null,this._bufferService))),Z.push(this.registerCsiHandler({final:"H"},(()=>((0,x.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const K of Z)K.dispose()}))}}}l.CoreTerminal=M},8460:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===u)return void this._listeners.splice(f,1)}}})),this._event}fire(u,f){const y=[];for(let d=0;d<this._listeners.length;d++)y.push(this._listeners[d]);for(let d=0;d<y.length;d++)y[d].call(void 0,u,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(u,f){return u((y=>f.fire(y)))},l.runAndSubscribe=function(u,f){return f(void 0),u((y=>f(y)))}},5435:function(k,l,u){var f=this&&this.__decorate||function(ae,j,I,L){var H,q=arguments.length,W=q<3?j:L===null?L=Object.getOwnPropertyDescriptor(j,I):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(ae,j,I,L);else for(var le=ae.length-1;le>=0;le--)(H=ae[le])&&(W=(q<3?H(W):q>3?H(j,I,W):H(j,I))||W);return q>3&&W&&Object.defineProperty(j,I,W),W},y=this&&this.__param||function(ae,j){return function(I,L){j(I,L,ae)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const d=u(2584),S=u(7116),E=u(2015),O=u(844),C=u(482),m=u(8437),g=u(8460),h=u(643),_=u(511),x=u(3734),A=u(2585),R=u(1480),D=u(6242),T=u(6351),M=u(5941),$={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Z=131072;function K(ae,j){if(ae>24)return j.setWinLines||!1;switch(ae){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var F;(function(ae){ae[ae.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ae[ae.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(F||(l.WindowsOptionsReportType=F={}));let X=0;class ee extends O.Disposable{getAttrData(){return this._curAttrData}constructor(j,I,L,H,q,W,le,fe,U=new E.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=I,this._coreService=L,this._logService=H,this._optionsService=q,this._oscLinkService=W,this._coreMouseService=le,this._unicodeService=fe,this._parser=U,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new C.StringToUtf32,this._utf8Decoder=new C.Utf8ToUtf32,this._workCell=new _.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new g.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new g.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new g.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new g.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new g.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new g.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new g.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new g.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new g.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new g.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new g.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new g.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new g.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._parser.setCsiHandlerFallback(((B,ie)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(B),params:ie.toArray()})})),this._parser.setEscHandlerFallback((B=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(B)})})),this._parser.setExecuteHandlerFallback((B=>{this._logService.debug("Unknown EXECUTE code: ",{code:B})})),this._parser.setOscHandlerFallback(((B,ie,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:B,action:ie,data:ne})})),this._parser.setDcsHandlerFallback(((B,ie,ne)=>{ie==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(B),action:ie,payload:ne})})),this._parser.setPrintHandler(((B,ie,ne)=>this.print(B,ie,ne))),this._parser.registerCsiHandler({final:"@"},(B=>this.insertChars(B))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(B=>this.scrollLeft(B))),this._parser.registerCsiHandler({final:"A"},(B=>this.cursorUp(B))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(B=>this.scrollRight(B))),this._parser.registerCsiHandler({final:"B"},(B=>this.cursorDown(B))),this._parser.registerCsiHandler({final:"C"},(B=>this.cursorForward(B))),this._parser.registerCsiHandler({final:"D"},(B=>this.cursorBackward(B))),this._parser.registerCsiHandler({final:"E"},(B=>this.cursorNextLine(B))),this._parser.registerCsiHandler({final:"F"},(B=>this.cursorPrecedingLine(B))),this._parser.registerCsiHandler({final:"G"},(B=>this.cursorCharAbsolute(B))),this._parser.registerCsiHandler({final:"H"},(B=>this.cursorPosition(B))),this._parser.registerCsiHandler({final:"I"},(B=>this.cursorForwardTab(B))),this._parser.registerCsiHandler({final:"J"},(B=>this.eraseInDisplay(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(B=>this.eraseInDisplay(B,!0))),this._parser.registerCsiHandler({final:"K"},(B=>this.eraseInLine(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(B=>this.eraseInLine(B,!0))),this._parser.registerCsiHandler({final:"L"},(B=>this.insertLines(B))),this._parser.registerCsiHandler({final:"M"},(B=>this.deleteLines(B))),this._parser.registerCsiHandler({final:"P"},(B=>this.deleteChars(B))),this._parser.registerCsiHandler({final:"S"},(B=>this.scrollUp(B))),this._parser.registerCsiHandler({final:"T"},(B=>this.scrollDown(B))),this._parser.registerCsiHandler({final:"X"},(B=>this.eraseChars(B))),this._parser.registerCsiHandler({final:"Z"},(B=>this.cursorBackwardTab(B))),this._parser.registerCsiHandler({final:"`"},(B=>this.charPosAbsolute(B))),this._parser.registerCsiHandler({final:"a"},(B=>this.hPositionRelative(B))),this._parser.registerCsiHandler({final:"b"},(B=>this.repeatPrecedingCharacter(B))),this._parser.registerCsiHandler({final:"c"},(B=>this.sendDeviceAttributesPrimary(B))),this._parser.registerCsiHandler({prefix:">",final:"c"},(B=>this.sendDeviceAttributesSecondary(B))),this._parser.registerCsiHandler({final:"d"},(B=>this.linePosAbsolute(B))),this._parser.registerCsiHandler({final:"e"},(B=>this.vPositionRelative(B))),this._parser.registerCsiHandler({final:"f"},(B=>this.hVPosition(B))),this._parser.registerCsiHandler({final:"g"},(B=>this.tabClear(B))),this._parser.registerCsiHandler({final:"h"},(B=>this.setMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(B=>this.setModePrivate(B))),this._parser.registerCsiHandler({final:"l"},(B=>this.resetMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(B=>this.resetModePrivate(B))),this._parser.registerCsiHandler({final:"m"},(B=>this.charAttributes(B))),this._parser.registerCsiHandler({final:"n"},(B=>this.deviceStatus(B))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(B=>this.deviceStatusPrivate(B))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(B=>this.softReset(B))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(B=>this.setCursorStyle(B))),this._parser.registerCsiHandler({final:"r"},(B=>this.setScrollRegion(B))),this._parser.registerCsiHandler({final:"s"},(B=>this.saveCursor(B))),this._parser.registerCsiHandler({final:"t"},(B=>this.windowOptions(B))),this._parser.registerCsiHandler({final:"u"},(B=>this.restoreCursor(B))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(B=>this.insertColumns(B))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(B=>this.deleteColumns(B))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(B=>this.selectProtected(B))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(B=>this.requestMode(B,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(B=>this.requestMode(B,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((B=>(this.setTitle(B),this.setIconName(B),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((B=>this.setIconName(B)))),this._parser.registerOscHandler(2,new D.OscHandler((B=>this.setTitle(B)))),this._parser.registerOscHandler(4,new D.OscHandler((B=>this.setOrReportIndexedColor(B)))),this._parser.registerOscHandler(8,new D.OscHandler((B=>this.setHyperlink(B)))),this._parser.registerOscHandler(10,new D.OscHandler((B=>this.setOrReportFgColor(B)))),this._parser.registerOscHandler(11,new D.OscHandler((B=>this.setOrReportBgColor(B)))),this._parser.registerOscHandler(12,new D.OscHandler((B=>this.setOrReportCursorColor(B)))),this._parser.registerOscHandler(104,new D.OscHandler((B=>this.restoreIndexedColor(B)))),this._parser.registerOscHandler(110,new D.OscHandler((B=>this.restoreFgColor(B)))),this._parser.registerOscHandler(111,new D.OscHandler((B=>this.restoreBgColor(B)))),this._parser.registerOscHandler(112,new D.OscHandler((B=>this.restoreCursorColor(B)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const B in S.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:B},(()=>this.selectCharset("("+B))),this._parser.registerEscHandler({intermediates:")",final:B},(()=>this.selectCharset(")"+B))),this._parser.registerEscHandler({intermediates:"*",final:B},(()=>this.selectCharset("*"+B))),this._parser.registerEscHandler({intermediates:"+",final:B},(()=>this.selectCharset("+"+B))),this._parser.registerEscHandler({intermediates:"-",final:B},(()=>this.selectCharset("-"+B))),this._parser.registerEscHandler({intermediates:".",final:B},(()=>this.selectCharset("."+B))),this._parser.registerEscHandler({intermediates:"/",final:B},(()=>this.selectCharset("/"+B)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((B=>(this._logService.error("Parsing error: ",B),B))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler(((B,ie)=>this.requestStatusString(B,ie))))}_preserveStack(j,I,L,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=I,this._parseStack.decodedLength=L,this._parseStack.position=H}_logSlowResolvingAsync(j){this._logService.logLevel<=A.LogLevelEnum.WARN&&Promise.race([j,new Promise(((I,L)=>setTimeout((()=>L("#SLOW_TIMEOUT")),5e3)))]).catch((I=>{if(I!=="#SLOW_TIMEOUT")throw I;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,I){let L,H=this._activeBuffer.x,q=this._activeBuffer.y,W=0;const le=this._parseStack.paused;if(le){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,I))return this._logSlowResolvingAsync(L),L;H=this._parseStack.cursorStartX,q=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>Z&&(W=this._parseStack.position+Z)}if(this._logService.logLevel<=A.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,(B=>String.fromCharCode(B))).join("")}"`),typeof j=="string"?j.split("").map((B=>B.charCodeAt(0))):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<Z&&(this._parseBuffer=new Uint32Array(Math.min(j.length,Z))),le||this._dirtyRowTracker.clearRange(),j.length>Z)for(let B=W;B<j.length;B+=Z){const ie=B+Z<j.length?B+Z:j.length,ne=typeof j=="string"?this._stringDecoder.decode(j.substring(B,ie),this._parseBuffer):this._utf8Decoder.decode(j.subarray(B,ie),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,ne))return this._preserveStack(H,q,ne,B),this._logSlowResolvingAsync(L),L}else if(!le){const B=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,B))return this._preserveStack(H,q,B,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===H&&this._activeBuffer.y===q||this._onCursorMove.fire();const fe=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),U=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);U<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(U,this._bufferService.rows-1),Math.min(fe,this._bufferService.rows-1))}print(j,I,L){let H,q;const W=this._charsetService.charset,le=this._optionsService.rawOptions.screenReaderMode,fe=this._bufferService.cols,U=this._coreService.decPrivateModes.wraparound,B=this._coreService.modes.insertMode,ie=this._curAttrData;let ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-I>0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ie);let me=this._parser.precedingJoinState;for(let pe=I;pe<L;++pe){if(H=j[pe],H<127&&W){const st=W[String.fromCharCode(H)];st&&(H=st.charCodeAt(0))}const Ee=this._unicodeService.charProperties(H,me);q=R.UnicodeService.extractWidth(Ee);const je=R.UnicodeService.extractShouldJoin(Ee),Be=je?R.UnicodeService.extractWidth(me):0;if(me=Ee,le&&this._onA11yChar.fire((0,C.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+q-Be>fe){if(U){const st=ne;let Ce=this._activeBuffer.x-Be;for(this._activeBuffer.x=Be,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),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Be>0&&ne instanceof m.BufferLine&&ne.copyCellsFrom(st,Ce,0,Be,!1);Ce<fe;)st.setCellFromCodepoint(Ce++,0,1,ie)}else if(this._activeBuffer.x=fe-1,q===2)continue}if(je&&this._activeBuffer.x){const st=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-st,H,q);for(let Ce=q-Be;--Ce>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}else if(B&&(ne.insertCells(this._activeBuffer.x,q-Be,this._activeBuffer.getNullCell(ie)),ne.getWidth(fe-1)===2&&ne.setCellFromCodepoint(fe-1,h.NULL_CELL_CODE,h.NULL_CELL_WIDTH,ie)),ne.setCellFromCodepoint(this._activeBuffer.x++,H,q,ie),q>0)for(;--q;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}this._parser.precedingJoinState=me,this._activeBuffer.x<fe&&L-I>0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,ie),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,I){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,I):this._parser.registerCsiHandler(j,(L=>!K(L.params[0],this._optionsService.rawOptions.windowOptions)||I(L)))}registerDcsHandler(j,I){return this._parser.registerDcsHandler(j,new T.DcsHandler(I))}registerEscHandler(j,I){return this._parser.registerEscHandler(j,I)}registerOscHandler(j,I){return this._parser.registerOscHandler(j,new D.OscHandler(I))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var j;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&&((j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&j.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);I.hasWidth(this._activeBuffer.x)&&!I.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,I){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+I):(this._activeBuffer.x=j,this._activeBuffer.y=I),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,I){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+I)}cursorUp(j){const I=this._activeBuffer.y-this._activeBuffer.scrollTop;return I>=0?this._moveCursor(0,-Math.min(I,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const I=this._activeBuffer.scrollBottom-this._activeBuffer.y;return I>=0?this._moveCursor(0,Math.min(I,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const I=j.params[0];return I===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:I===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let I=j.params[0]||1;for(;I--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let I=j.params[0]||1;for(;I--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const I=j.params[0];return I===1&&(this._curAttrData.bg|=536870912),I!==2&&I!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,I,L,H=!1,q=!1){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);W.replaceCells(I,L,this._activeBuffer.getNullCell(this._eraseAttrData()),q),H&&(W.isWrapped=!1)}_resetBufferLine(j,I=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),I),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),L.isWrapped=!1)}eraseInDisplay(j,I=!1){let L;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,I);L<this._bufferService.rows;L++)this._resetBufferLine(L,I);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,I),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,I);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,I);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(j,I=!1){switch(this._restrictCursor(this._bufferService.cols),j.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)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let I=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,q=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;I--;)this._activeBuffer.lines.splice(q-1,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}deleteLines(j){this._restrictCursor();let I=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;I--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let I=j.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(j){let I=j.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(m.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=j.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.deleteCells(0,I,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=j.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.insertCells(0,I,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=j.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.insertCells(this._activeBuffer.x,I,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=j.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.deleteCells(this._activeBuffer.x,I,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const I=this._parser.precedingJoinState;if(!I)return!0;const L=j.params[0]||1,H=R.UnicodeService.extractWidth(I),q=this._activeBuffer.x-H,W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(q),le=new Uint32Array(W.length*L);let fe=0;for(let B=0;B<W.length;){const ie=W.codePointAt(B)||0;le[fe++]=ie,B+=ie>65535?2:1}let U=fe;for(let B=1;B<L;++B)le.copyWithin(U,0,fe),U+=fe;return this.print(le,0,U),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let I=0;I<j.length;I++)switch(j.params[I]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let I=0;I<j.length;I++)switch(j.params[I]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,S.DEFAULT_CHARSET),this._charsetService.setgCharset(1,S.DEFAULT_CHARSET),this._charsetService.setgCharset(2,S.DEFAULT_CHARSET),this._charsetService.setgCharset(3,S.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(j){for(let I=0;I<j.length;I++)switch(j.params[I]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let I=0;I<j.length;I++)switch(j.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:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),j.params[I]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(j,I){const L=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:q}=this._coreMouseService,W=this._coreService,{buffers:le,cols:fe}=this._bufferService,{active:U,alt:B}=le,ie=this._optionsService.rawOptions,ne=je=>je?1:2,me=j.params[0];return pe=me,Ee=I?me===2?4:me===4?ne(W.modes.insertMode):me===12?3:me===20?ne(ie.convertEol):0:me===1?ne(L.applicationCursorKeys):me===3?ie.windowOptions.setWinLines?fe===80?2:fe===132?1:0:0:me===6?ne(L.origin):me===7?ne(L.wraparound):me===8?3:me===9?ne(H==="X10"):me===12?ne(ie.cursorBlink):me===25?ne(!W.isCursorHidden):me===45?ne(L.reverseWraparound):me===66?ne(L.applicationKeypad):me===67?4:me===1e3?ne(H==="VT200"):me===1002?ne(H==="DRAG"):me===1003?ne(H==="ANY"):me===1004?ne(L.sendFocus):me===1005?4:me===1006?ne(q==="SGR"):me===1015?4:me===1016?ne(q==="SGR_PIXELS"):me===1048?1:me===47||me===1047||me===1049?ne(U===B):me===2004?ne(L.bracketedPasteMode):0,W.triggerDataEvent(`${d.C0.ESC}[${I?"":"?"}${pe};${Ee}$y`),!0;var pe,Ee}_updateAttrColor(j,I,L,H,q){return I===2?(j|=50331648,j&=-16777216,j|=x.AttributeData.fromColorRGB([L,H,q])):I===5&&(j&=-50331904,j|=33554432|255&L),j}_extractColor(j,I,L){const H=[0,0,-1,0,0,0];let q=0,W=0;do{if(H[W+q]=j.params[I+W],j.hasSubParams(I+W)){const le=j.getSubParams(I+W);let fe=0;do H[1]===5&&(q=1),H[W+fe+1+q]=le[fe];while(++fe<le.length&&fe+W+1+q<H.length);break}if(H[1]===5&&W+q>=2||H[1]===2&&W+q>=5)break;H[1]&&(q=1)}while(++W+I<j.length&&W+q<H.length);for(let le=2;le<H.length;++le)H[le]===-1&&(H[le]=0);switch(H[0]){case 38:L.fg=this._updateAttrColor(L.fg,H[1],H[3],H[4],H[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,H[1],H[3],H[4],H[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,H[1],H[3],H[4],H[5])}return W}_processUnderline(j,I){I.extended=I.extended.clone(),(!~j||j>5)&&(j=1),I.extended.underlineStyle=j,I.fg|=268435456,j===0&&(I.fg&=-268435457),I.updateExtended()}_processSGR0(j){j.fg=m.DEFAULT_ATTR_DATA.fg,j.bg=m.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const I=j.length;let L;const H=this._curAttrData;for(let q=0;q<I;q++)L=j.params[q],L>=30&&L<=37?(H.fg&=-50331904,H.fg|=16777216|L-30):L>=40&&L<=47?(H.bg&=-50331904,H.bg|=16777216|L-40):L>=90&&L<=97?(H.fg&=-50331904,H.fg|=16777224|L-90):L>=100&&L<=107?(H.bg&=-50331904,H.bg|=16777224|L-100):L===0?this._processSGR0(H):L===1?H.fg|=134217728:L===3?H.bg|=67108864:L===4?(H.fg|=268435456,this._processUnderline(j.hasSubParams(q)?j.getSubParams(q)[0]:1,H)):L===5?H.fg|=536870912:L===7?H.fg|=67108864:L===8?H.fg|=1073741824:L===9?H.fg|=2147483648:L===2?H.bg|=134217728:L===21?this._processUnderline(2,H):L===22?(H.fg&=-134217729,H.bg&=-134217729):L===23?H.bg&=-67108865:L===24?(H.fg&=-268435457,this._processUnderline(0,H)):L===25?H.fg&=-536870913:L===27?H.fg&=-67108865:L===28?H.fg&=-1073741825:L===29?H.fg&=2147483647:L===39?(H.fg&=-67108864,H.fg|=16777215&m.DEFAULT_ATTR_DATA.fg):L===49?(H.bg&=-67108864,H.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?q+=this._extractColor(j,q,H):L===53?H.bg|=1073741824:L===55?H.bg&=-1073741825:L===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):L===100?(H.fg&=-67108864,H.fg|=16777215&m.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const I=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${I};${L}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const I=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${I};${L}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(j){const I=j.params[0]||1;switch(I){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const L=I%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(j){const I=j.params[0]||1;let L;return(j.length<2||(L=j.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>I&&(this._activeBuffer.scrollTop=I-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(j){if(!K(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const I=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:I!==2&&this._onRequestWindowsOptionsReport.fire(F.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(F.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:I!==0&&I!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),I!==0&&I!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&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())}return!0}saveCursor(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const I=[],L=j.split(";");for(;L.length>1;){const H=L.shift(),q=L.shift();if(/^\d+$/.exec(H)){const W=parseInt(H);if(Q(W))if(q==="?")I.push({type:0,index:W});else{const le=(0,M.parseColor)(q);le&&I.push({type:1,index:W,color:le})}}}return I.length&&this._onColor.fire(I),!0}setHyperlink(j){const I=j.split(";");return!(I.length<2)&&(I[1]?this._createHyperlink(I[0],I[1]):!I[0]&&this._finishHyperlink())}_createHyperlink(j,I){this._getCurrentLinkId()&&this._finishHyperlink();const L=j.split(":");let H;const q=L.findIndex((W=>W.startsWith("id=")));return q!==-1&&(H=L[q].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,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(j,I){const L=j.split(";");for(let H=0;H<L.length&&!(I>=this._specialColors.length);++H,++I)if(L[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[I]}]);else{const q=(0,M.parseColor)(L[H]);q&&this._onColor.fire([{type:1,index:this._specialColors[I],color:q}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const I=[],L=j.split(";");for(let H=0;H<L.length;++H)if(/^\d+$/.exec(L[H])){const q=parseInt(L[H]);Q(q)&&I.push({type:2,index:q})}return I.length&&this._onColor.fire(I),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){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,S.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset($[j[0]],S.CHARSETS[j[1]]||S.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new _.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let I=0;I<this._bufferService.rows;++I){const L=this._activeBuffer.ybase+this._activeBuffer.y+I,H=this._activeBuffer.lines.get(L);H&&(H.fill(j),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,I){const L=this._bufferService.buffer,H=this._optionsService.rawOptions;return(q=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${q}${d.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,I){this._dirtyRowTracker.markRangeDirty(j,I)}}l.InputHandler=ee;let V=class{constructor(ae){this._bufferService=ae,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ae){ae<this.start?this.start=ae:ae>this.end&&(this.end=ae)}markRangeDirty(ae,j){ae>j&&(X=ae,ae=j,j=X),ae<this.start&&(this.start=ae),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Q(ae){return 0<=ae&&ae<256}V=f([y(0,A.IBufferService)],V)},844:(k,l)=>{function u(f){for(const y of f)y.dispose();f.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const y=this._disposables.indexOf(f);y!==-1&&this._disposables.splice(y,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var y;this._isDisposed||f===this._value||((y=this._value)==null||y.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},l.toDisposable=function(f){return{dispose:f}},l.disposeArray=u,l.getDisposeArrayDisposable=function(f){return{dispose:()=>u(f)}}},1505:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(y,d,S){this._data[y]||(this._data[y]={}),this._data[y][d]=S}get(y,d){return this._data[y]?this._data[y][d]:void 0}clear(){this._data={}}}l.TwoKeyMap=u,l.FourKeyMap=class{constructor(){this._data=new u}set(f,y,d,S,E){this._data.get(f,y)||this._data.set(f,y,new u),this._data.get(f,y).set(d,S,E)}get(f,y,d,S){var E;return(E=this._data.get(f,y))==null?void 0:E.get(d,S)}clear(){this._data.clear()}}},6114:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const u=l.isNode?"node":navigator.userAgent,f=l.isNode?"node":navigator.platform;l.isFirefox=u.includes("Firefox"),l.isLegacyEdge=u.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(u),l.getSafariVersion=function(){if(!l.isSafari)return 0;const y=u.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),l.isIpad=f==="iPad",l.isIphone=f==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),l.isLinux=f.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(u)},6106:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let u=0;l.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(u=this._search(this._getKey(f)),this._array.splice(u,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const y=this._getKey(f);if(y===void 0||(u=this._search(y),u===-1)||this._getKey(this._array[u])!==y)return!1;do if(this._array[u]===f)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===y);return!1}*getKeyIterator(f){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===f)}forEachByKey(f,y){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do y(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===f)}values(){return[...this._array].values()}_search(f){let y=0,d=this._array.length-1;for(;d>=y;){let S=y+d>>1;const E=this._getKey(this._array[S]);if(E>f)d=S-1;else{if(!(E<f)){for(;S>0&&this._getKey(this._array[S-1])===f;)S--;return S}y=S+1}}return y}}},7226:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const f=u(6114);class y{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 O=0,C=0,m=E.timeRemaining(),g=0;for(;this._i<this._tasks.length;){if(O=Date.now(),this._tasks[this._i]()||this._i++,O=Math.max(1,Date.now()-O),C=Math.max(O,C),g=E.timeRemaining(),1.5*C>g)return m-O<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(m-O))}ms`),void this._start();m=g}this.clear()}}class d extends y{_requestCallback(E){return setTimeout((()=>E(this._createDeadline(16))))}_cancelCallback(E){clearTimeout(E)}_createDeadline(E){const O=Date.now()+E;return{timeRemaining:()=>Math.max(0,O-Date.now())}}}l.PriorityTaskQueue=d,l.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(S){return requestIdleCallback(S)}_cancelCallback(S){cancelIdleCallback(S)}}:d,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(S){this._queue.clear(),this._queue.enqueue(S)}flush(){this._queue.flush()}}},9282:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const f=u(643);l.updateWindowsModeWrappedState=function(y){const d=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),S=d==null?void 0:d.get(y.cols-1),E=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);E&&S&&(E.isWrapped=S[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&S[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new u;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}l.AttributeData=u;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,S=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=S}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=f},9092:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const f=u(6349),y=u(7226),d=u(3734),S=u(8437),E=u(4634),O=u(511),C=u(643),m=u(4863),g=u(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(h,_,x){this._hasScrollback=h,this._optionsService=_,this._bufferService=x,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=S.DEFAULT_ATTR_DATA.clone(),this.savedCharset=g.DEFAULT_CHARSET,this.markers=[],this._nullCell=O.CellData.fromCharData([0,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]),this._whitespaceCell=O.CellData.fromCharData([0,C.WHITESPACE_CELL_CHAR,C.WHITESPACE_CELL_WIDTH,C.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new y.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(h){return h?(this._nullCell.fg=h.fg,this._nullCell.bg=h.bg,this._nullCell.extended=h.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(h){return h?(this._whitespaceCell.fg=h.fg,this._whitespaceCell.bg=h.bg,this._whitespaceCell.extended=h.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(h,_){return new S.BufferLine(this._bufferService.cols,this.getNullCell(h),_)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const h=this.ybase+this.y-this.ydisp;return h>=0&&h<this._rows}_getCorrectBufferLength(h){if(!this._hasScrollback)return h;const _=h+this._optionsService.rawOptions.scrollback;return _>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:_}fillViewportRows(h){if(this.lines.length===0){h===void 0&&(h=S.DEFAULT_ATTR_DATA);let _=this._rows;for(;_--;)this.lines.push(this.getBlankLine(h))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(h,_){const x=this.getNullCell(S.DEFAULT_ATTR_DATA);let A=0;const R=this._getCorrectBufferLength(_);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<h)for(let T=0;T<this.lines.length;T++)A+=+this.lines.get(T).resize(h,x);let D=0;if(this._rows<_)for(let T=this._rows;T<_;T++)this.lines.length<_+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new S.BufferLine(h,x)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new S.BufferLine(h,x)));else for(let T=this._rows;T>_;T--)this.lines.length>_+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const T=this.lines.length-R;T>0&&(this.lines.trimStart(T),this.ybase=Math.max(this.ybase-T,0),this.ydisp=Math.max(this.ydisp-T,0),this.savedY=Math.max(this.savedY-T,0)),this.lines.maxLength=R}this.x=Math.min(this.x,h-1),this.y=Math.min(this.y,_-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,h-1),this.scrollTop=0}if(this.scrollBottom=_-1,this._isReflowEnabled&&(this._reflow(h,_),this._cols>h))for(let D=0;D<this.lines.length;D++)A+=+this.lines.get(D).resize(h,x);this._cols=h,this._rows=_,this._memoryCleanupQueue.clear(),A>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let h=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,h=!1);let _=0;for(;this._memoryCleanupPosition<this.lines.length;)if(_+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),_>100)return!0;return h}get _isReflowEnabled(){const h=this._optionsService.rawOptions.windowsPty;return h&&h.buildNumber?this._hasScrollback&&h.backend==="conpty"&&h.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(h,_){this._cols!==h&&(h>this._cols?this._reflowLarger(h,_):this._reflowSmaller(h,_))}_reflowLarger(h,_){const x=(0,E.reflowLargerGetLinesToRemove)(this.lines,this._cols,h,this.ybase+this.y,this.getNullCell(S.DEFAULT_ATTR_DATA));if(x.length>0){const A=(0,E.reflowLargerCreateNewLayout)(this.lines,x);(0,E.reflowLargerApplyNewLayout)(this.lines,A.layout),this._reflowLargerAdjustViewport(h,_,A.countRemoved)}}_reflowLargerAdjustViewport(h,_,x){const A=this.getNullCell(S.DEFAULT_ATTR_DATA);let R=x;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<_&&this.lines.push(new S.BufferLine(h,A))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-x,0)}_reflowSmaller(h,_){const x=this.getNullCell(S.DEFAULT_ATTR_DATA),A=[];let R=0;for(let D=this.lines.length-1;D>=0;D--){let T=this.lines.get(D);if(!T||!T.isWrapped&&T.getTrimmedLength()<=h)continue;const M=[T];for(;T.isWrapped&&D>0;)T=this.lines.get(--D),M.unshift(T);const $=this.ybase+this.y;if($>=D&&$<D+M.length)continue;const Z=M[M.length-1].getTrimmedLength(),K=(0,E.reflowSmallerGetNewLineLengths)(M,this._cols,h),F=K.length-M.length;let X;X=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+F):Math.max(0,this.lines.length-this.lines.maxLength+F);const ee=[];for(let L=0;L<F;L++){const H=this.getBlankLine(S.DEFAULT_ATTR_DATA,!0);ee.push(H)}ee.length>0&&(A.push({start:D+M.length+R,newLines:ee}),R+=ee.length),M.push(...ee);let V=K.length-1,Q=K[V];Q===0&&(V--,Q=K[V]);let ae=M.length-F-1,j=Z;for(;ae>=0;){const L=Math.min(j,Q);if(M[V]===void 0)break;if(M[V].copyCellsFrom(M[ae],j-L,Q-L,L,!0),Q-=L,Q===0&&(V--,Q=K[V]),j-=L,j===0){ae--;const H=Math.max(ae,0);j=(0,E.getWrappedLineTrimmedLength)(M,H,this._cols)}}for(let L=0;L<M.length;L++)K[L]<h&&M[L].setCell(K[L],x);let I=F-X;for(;I-- >0;)this.ybase===0?this.y<_-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-_&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+F,this.ybase+_-1)}if(A.length>0){const D=[],T=[];for(let V=0;V<this.lines.length;V++)T.push(this.lines.get(V));const M=this.lines.length;let $=M-1,Z=0,K=A[Z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let F=0;for(let V=Math.min(this.lines.maxLength-1,M+R-1);V>=0;V--)if(K&&K.start>$+F){for(let Q=K.newLines.length-1;Q>=0;Q--)this.lines.set(V--,K.newLines[Q]);V++,D.push({index:$+1,amount:K.newLines.length}),F+=K.newLines.length,K=A[++Z]}else this.lines.set(V,T[$--]);let X=0;for(let V=D.length-1;V>=0;V--)D[V].index+=X,this.lines.onInsertEmitter.fire(D[V]),X+=D[V].amount;const ee=Math.max(0,M+R-this.lines.maxLength);ee>0&&this.lines.onTrimEmitter.fire(ee)}}translateBufferLineToString(h,_,x=0,A){const R=this.lines.get(h);return R?R.translateToString(_,x,A):""}getWrappedRangeForLine(h){let _=h,x=h;for(;_>0&&this.lines.get(_).isWrapped;)_--;for(;x+1<this.lines.length&&this.lines.get(x+1).isWrapped;)x++;return{first:_,last:x}}setupTabStops(h){for(h!=null?this.tabs[h]||(h=this.prevStop(h)):(this.tabs={},h=0);h<this._cols;h+=this._optionsService.rawOptions.tabStopWidth)this.tabs[h]=!0}prevStop(h){for(h==null&&(h=this.x);!this.tabs[--h]&&h>0;);return h>=this._cols?this._cols-1:h<0?0:h}nextStop(h){for(h==null&&(h=this.x);!this.tabs[++h]&&h<this._cols;);return h>=this._cols?this._cols-1:h<0?0:h}clearMarkers(h){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].line===h&&(this.markers[_].dispose(),this.markers.splice(_--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].dispose(),this.markers.splice(h--,1);this._isClearing=!1}addMarker(h){const _=new m.Marker(h);return this.markers.push(_),_.register(this.lines.onTrim((x=>{_.line-=x,_.line<0&&_.dispose()}))),_.register(this.lines.onInsert((x=>{_.line>=x.index&&(_.line+=x.amount)}))),_.register(this.lines.onDelete((x=>{_.line>=x.index&&_.line<x.index+x.amount&&_.dispose(),_.line>x.index&&(_.line-=x.amount)}))),_.register(_.onDispose((()=>this._removeMarker(_)))),_}_removeMarker(h){this._isClearing||this.markers.splice(this.markers.indexOf(h),1)}}},8437:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const f=u(3734),y=u(511),d=u(643),S=u(482);l.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let E=0;class O{constructor(m,g,h=!1){this.isWrapped=h,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*m);const _=g||y.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let x=0;x<m;++x)this.setCell(x,_);this.length=m}get(m){const g=this._data[3*m+0],h=2097151&g;return[this._data[3*m+1],2097152&g?this._combined[m]:h?(0,S.stringFromCodePoint)(h):"",g>>22,2097152&g?this._combined[m].charCodeAt(this._combined[m].length-1):h]}set(m,g){this._data[3*m+1]=g[d.CHAR_DATA_ATTR_INDEX],g[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[m]=g[1],this._data[3*m+0]=2097152|m|g[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*m+0]=g[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(m){return this._data[3*m+0]>>22}hasWidth(m){return 12582912&this._data[3*m+0]}getFg(m){return this._data[3*m+1]}getBg(m){return this._data[3*m+2]}hasContent(m){return 4194303&this._data[3*m+0]}getCodePoint(m){const g=this._data[3*m+0];return 2097152&g?this._combined[m].charCodeAt(this._combined[m].length-1):2097151&g}isCombined(m){return 2097152&this._data[3*m+0]}getString(m){const g=this._data[3*m+0];return 2097152&g?this._combined[m]:2097151&g?(0,S.stringFromCodePoint)(2097151&g):""}isProtected(m){return 536870912&this._data[3*m+2]}loadCell(m,g){return E=3*m,g.content=this._data[E+0],g.fg=this._data[E+1],g.bg=this._data[E+2],2097152&g.content&&(g.combinedData=this._combined[m]),268435456&g.bg&&(g.extended=this._extendedAttrs[m]),g}setCell(m,g){2097152&g.content&&(this._combined[m]=g.combinedData),268435456&g.bg&&(this._extendedAttrs[m]=g.extended),this._data[3*m+0]=g.content,this._data[3*m+1]=g.fg,this._data[3*m+2]=g.bg}setCellFromCodepoint(m,g,h,_){268435456&_.bg&&(this._extendedAttrs[m]=_.extended),this._data[3*m+0]=g|h<<22,this._data[3*m+1]=_.fg,this._data[3*m+2]=_.bg}addCodepointToCell(m,g,h){let _=this._data[3*m+0];2097152&_?this._combined[m]+=(0,S.stringFromCodePoint)(g):2097151&_?(this._combined[m]=(0,S.stringFromCodePoint)(2097151&_)+(0,S.stringFromCodePoint)(g),_&=-2097152,_|=2097152):_=g|4194304,h&&(_&=-12582913,_|=h<<22),this._data[3*m+0]=_}insertCells(m,g,h){if((m%=this.length)&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,h),g<this.length-m){const _=new y.CellData;for(let x=this.length-m-g-1;x>=0;--x)this.setCell(m+g+x,this.loadCell(m+x,_));for(let x=0;x<g;++x)this.setCell(m+x,h)}else for(let _=m;_<this.length;++_)this.setCell(_,h);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,h)}deleteCells(m,g,h){if(m%=this.length,g<this.length-m){const _=new y.CellData;for(let x=0;x<this.length-m-g;++x)this.setCell(m+x,this.loadCell(m+g+x,_));for(let x=this.length-g;x<this.length;++x)this.setCell(x,h)}else for(let _=m;_<this.length;++_)this.setCell(_,h);m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,h),this.getWidth(m)!==0||this.hasContent(m)||this.setCellFromCodepoint(m,0,1,h)}replaceCells(m,g,h,_=!1){if(_)for(m&&this.getWidth(m-1)===2&&!this.isProtected(m-1)&&this.setCellFromCodepoint(m-1,0,1,h),g<this.length&&this.getWidth(g-1)===2&&!this.isProtected(g)&&this.setCellFromCodepoint(g,0,1,h);m<g&&m<this.length;)this.isProtected(m)||this.setCell(m,h),m++;else for(m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,h),g<this.length&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g,0,1,h);m<g&&m<this.length;)this.setCell(m++,h)}resize(m,g){if(m===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const h=3*m;if(m>this.length){if(this._data.buffer.byteLength>=4*h)this._data=new Uint32Array(this._data.buffer,0,h);else{const _=new Uint32Array(h);_.set(this._data),this._data=_}for(let _=this.length;_<m;++_)this.setCell(_,g)}else{this._data=this._data.subarray(0,h);const _=Object.keys(this._combined);for(let A=0;A<_.length;A++){const R=parseInt(_[A],10);R>=m&&delete this._combined[R]}const x=Object.keys(this._extendedAttrs);for(let A=0;A<x.length;A++){const R=parseInt(x[A],10);R>=m&&delete this._extendedAttrs[R]}}return this.length=m,4*h*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const m=new Uint32Array(this._data.length);return m.set(this._data),this._data=m,1}return 0}fill(m,g=!1){if(g)for(let h=0;h<this.length;++h)this.isProtected(h)||this.setCell(h,m);else{this._combined={},this._extendedAttrs={};for(let h=0;h<this.length;++h)this.setCell(h,m)}}copyFrom(m){this.length!==m.length?this._data=new Uint32Array(m._data):this._data.set(m._data),this.length=m.length,this._combined={};for(const g in m._combined)this._combined[g]=m._combined[g];this._extendedAttrs={};for(const g in m._extendedAttrs)this._extendedAttrs[g]=m._extendedAttrs[g];this.isWrapped=m.isWrapped}clone(){const m=new O(0);m._data=new Uint32Array(this._data),m.length=this.length;for(const g in this._combined)m._combined[g]=this._combined[g];for(const g in this._extendedAttrs)m._extendedAttrs[g]=this._extendedAttrs[g];return m.isWrapped=this.isWrapped,m}getTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0])return m+(this._data[3*m+0]>>22);return 0}getNoBgTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0]||50331648&this._data[3*m+2])return m+(this._data[3*m+0]>>22);return 0}copyCellsFrom(m,g,h,_,x){const A=m._data;if(x)for(let D=_-1;D>=0;D--){for(let T=0;T<3;T++)this._data[3*(h+D)+T]=A[3*(g+D)+T];268435456&A[3*(g+D)+2]&&(this._extendedAttrs[h+D]=m._extendedAttrs[g+D])}else for(let D=0;D<_;D++){for(let T=0;T<3;T++)this._data[3*(h+D)+T]=A[3*(g+D)+T];268435456&A[3*(g+D)+2]&&(this._extendedAttrs[h+D]=m._extendedAttrs[g+D])}const R=Object.keys(m._combined);for(let D=0;D<R.length;D++){const T=parseInt(R[D],10);T>=g&&(this._combined[T-g+h]=m._combined[T])}}translateToString(m,g,h,_){g=g??0,h=h??this.length,m&&(h=Math.min(h,this.getTrimmedLength())),_&&(_.length=0);let x="";for(;g<h;){const A=this._data[3*g+0],R=2097151&A,D=2097152&A?this._combined[g]:R?(0,S.stringFromCodePoint)(R):d.WHITESPACE_CELL_CHAR;if(x+=D,_)for(let T=0;T<D.length;++T)_.push(g);g+=A>>22||1}return _&&_.push(g),x}}l.BufferLine=O},4841:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(u,f){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return f*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(k,l)=>{function u(f,y,d){if(y===f.length-1)return f[y].getTrimmedLength();const S=!f[y].hasContent(d-1)&&f[y].getWidth(d-1)===1,E=f[y+1].getWidth(0)===2;return S&&E?d-1:d}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(f,y,d,S,E){const O=[];for(let C=0;C<f.length-1;C++){let m=C,g=f.get(++m);if(!g.isWrapped)continue;const h=[f.get(C)];for(;m<f.length&&g.isWrapped;)h.push(g),g=f.get(++m);if(S>=C&&S<m){C+=h.length-1;continue}let _=0,x=u(h,_,y),A=1,R=0;for(;A<h.length;){const T=u(h,A,y),M=T-R,$=d-x,Z=Math.min(M,$);h[_].copyCellsFrom(h[A],R,x,Z,!1),x+=Z,x===d&&(_++,x=0),R+=Z,R===T&&(A++,R=0),x===0&&_!==0&&h[_-1].getWidth(d-1)===2&&(h[_].copyCellsFrom(h[_-1],d-1,x++,1,!1),h[_-1].setCell(d-1,E))}h[_].replaceCells(x,d,E);let D=0;for(let T=h.length-1;T>0&&(T>_||h[T].getTrimmedLength()===0);T--)D++;D>0&&(O.push(C+h.length-D),O.push(D)),C+=h.length-1}return O},l.reflowLargerCreateNewLayout=function(f,y){const d=[];let S=0,E=y[S],O=0;for(let C=0;C<f.length;C++)if(E===C){const m=y[++S];f.onDeleteEmitter.fire({index:C-O,amount:m}),C+=m-1,O+=m,E=y[++S]}else d.push(C);return{layout:d,countRemoved:O}},l.reflowLargerApplyNewLayout=function(f,y){const d=[];for(let S=0;S<y.length;S++)d.push(f.get(y[S]));for(let S=0;S<d.length;S++)f.set(S,d[S]);f.length=y.length},l.reflowSmallerGetNewLineLengths=function(f,y,d){const S=[],E=f.map(((g,h)=>u(f,h,y))).reduce(((g,h)=>g+h));let O=0,C=0,m=0;for(;m<E;){if(E-m<d){S.push(E-m);break}O+=d;const g=u(f,C,y);O>g&&(O-=g,C++);const h=f[C].getWidth(O-1)===2;h&&O--;const _=h?d-1:d;S.push(_),m+=_}return S},l.getWrappedLineTrimmedLength=u},5295:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const f=u(8460),y=u(844),d=u(9092);class S extends y.Disposable{constructor(O,C){super(),this._optionsService=O,this._bufferService=C,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(O){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(O),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(O,C){this._normal.resize(O,C),this._alt.resize(O,C),this.setupTabStops(O)}setupTabStops(O){this._normal.setupTabStops(O),this._alt.setupTabStops(O)}}l.BufferSet=S},511:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const f=u(482),y=u(643),d=u(3734);class S extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(O){const C=new S;return C.setFromCharData(O),C}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(O){this.fg=O[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let C=!1;if(O[y.CHAR_DATA_CHAR_INDEX].length>2)C=!0;else if(O[y.CHAR_DATA_CHAR_INDEX].length===2){const m=O[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=m&&m<=56319){const g=O[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=g&&g<=57343?this.content=1024*(m-55296)+g-56320+65536|O[y.CHAR_DATA_WIDTH_INDEX]<<22:C=!0}else C=!0}else this.content=O[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|O[y.CHAR_DATA_WIDTH_INDEX]<<22;C&&(this.combinedData=O[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|O[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=S},643:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const f=u(8460),y=u(844);class d{get id(){return this._id}constructor(E){this.line=E,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,y.disposeArray)(this._disposables),this._disposables.length=0)}register(E){return this._disposables.push(E),E}}l.Marker=d,d._nextId=1},7116:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(k,l)=>{var u,f,y;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
|
|
310
310
|
`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(u||(l.C0=u={})),(function(d){d.PAD="",d.HOP="",d.BPH="",d.NBH="",d.IND="",d.NEL="
",d.SSA="",d.ESA="",d.HTS="",d.HTJ="",d.VTS="",d.PLD="",d.PLU="",d.RI="",d.SS2="",d.SS3="",d.DCS="",d.PU1="",d.PU2="",d.STS="",d.CCH="",d.MW="",d.SPA="",d.EPA="",d.SOS="",d.SGCI="",d.SCI="",d.CSI="",d.ST="",d.OSC="",d.PM="",d.APC=""})(f||(l.C1=f={})),(function(d){d.ST=`${u.ESC}\\`})(y||(l.C1_ESCAPED=y={}))},7399:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const f=u(2584),y={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:["'",'"']};l.evaluateKeyboardEvent=function(d,S,E,O){const C={type:0,cancel:!1,key:void 0},m=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?C.key=S?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?C.key=S?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?C.key=S?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(C.key=S?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:C.key=d.ctrlKey?"\b":f.C0.DEL,d.altKey&&(C.key=f.C0.ESC+C.key);break;case 9:if(d.shiftKey){C.key=f.C0.ESC+"[Z";break}C.key=f.C0.HT,C.cancel=!0;break;case 13:C.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,C.cancel=!0;break;case 27:C.key=f.C0.ESC,d.altKey&&(C.key=f.C0.ESC+f.C0.ESC),C.cancel=!0;break;case 37:if(d.metaKey)break;m?(C.key=f.C0.ESC+"[1;"+(m+1)+"D",C.key===f.C0.ESC+"[1;3D"&&(C.key=f.C0.ESC+(E?"b":"[1;5D"))):C.key=S?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;m?(C.key=f.C0.ESC+"[1;"+(m+1)+"C",C.key===f.C0.ESC+"[1;3C"&&(C.key=f.C0.ESC+(E?"f":"[1;5C"))):C.key=S?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;m?(C.key=f.C0.ESC+"[1;"+(m+1)+"A",E||C.key!==f.C0.ESC+"[1;3A"||(C.key=f.C0.ESC+"[1;5A")):C.key=S?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;m?(C.key=f.C0.ESC+"[1;"+(m+1)+"B",E||C.key!==f.C0.ESC+"[1;3B"||(C.key=f.C0.ESC+"[1;5B")):C.key=S?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(C.key=f.C0.ESC+"[2~");break;case 46:C.key=m?f.C0.ESC+"[3;"+(m+1)+"~":f.C0.ESC+"[3~";break;case 36:C.key=m?f.C0.ESC+"[1;"+(m+1)+"H":S?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:C.key=m?f.C0.ESC+"[1;"+(m+1)+"F":S?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?C.type=2:d.ctrlKey?C.key=f.C0.ESC+"[5;"+(m+1)+"~":C.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?C.type=3:d.ctrlKey?C.key=f.C0.ESC+"[6;"+(m+1)+"~":C.key=f.C0.ESC+"[6~";break;case 112:C.key=m?f.C0.ESC+"[1;"+(m+1)+"P":f.C0.ESC+"OP";break;case 113:C.key=m?f.C0.ESC+"[1;"+(m+1)+"Q":f.C0.ESC+"OQ";break;case 114:C.key=m?f.C0.ESC+"[1;"+(m+1)+"R":f.C0.ESC+"OR";break;case 115:C.key=m?f.C0.ESC+"[1;"+(m+1)+"S":f.C0.ESC+"OS";break;case 116:C.key=m?f.C0.ESC+"[15;"+(m+1)+"~":f.C0.ESC+"[15~";break;case 117:C.key=m?f.C0.ESC+"[17;"+(m+1)+"~":f.C0.ESC+"[17~";break;case 118:C.key=m?f.C0.ESC+"[18;"+(m+1)+"~":f.C0.ESC+"[18~";break;case 119:C.key=m?f.C0.ESC+"[19;"+(m+1)+"~":f.C0.ESC+"[19~";break;case 120:C.key=m?f.C0.ESC+"[20;"+(m+1)+"~":f.C0.ESC+"[20~";break;case 121:C.key=m?f.C0.ESC+"[21;"+(m+1)+"~":f.C0.ESC+"[21~";break;case 122:C.key=m?f.C0.ESC+"[23;"+(m+1)+"~":f.C0.ESC+"[23~";break;case 123:C.key=m?f.C0.ESC+"[24;"+(m+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(E&&!O||!d.altKey||d.metaKey)!E||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?C.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(C.key=f.C0.US),d.key==="@"&&(C.key=f.C0.NUL)):d.keyCode===65&&(C.type=1);else{const g=y[d.keyCode],h=g==null?void 0:g[d.shiftKey?1:0];if(h)C.key=f.C0.ESC+h;else if(d.keyCode>=65&&d.keyCode<=90){const _=d.ctrlKey?d.keyCode-64:d.keyCode+32;let x=String.fromCharCode(_);d.shiftKey&&(x=x.toUpperCase()),C.key=f.C0.ESC+x}else if(d.keyCode===32)C.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let _=d.code.slice(3,4);d.shiftKey||(_=_.toLowerCase()),C.key=f.C0.ESC+_,C.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?C.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?C.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?C.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?C.key=f.C0.DEL:d.keyCode===219?C.key=f.C0.ESC:d.keyCode===220?C.key=f.C0.FS:d.keyCode===221&&(C.key=f.C0.GS)}return C}},482:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},l.utf32ToString=function(u,f=0,y=u.length){let d="";for(let S=f;S<y;++S){let E=u[S];E>65535?(E-=65536,d+=String.fromCharCode(55296+(E>>10))+String.fromCharCode(E%1024+56320)):d+=String.fromCharCode(E)}return d},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,f){const y=u.length;if(!y)return 0;let d=0,S=0;if(this._interim){const E=u.charCodeAt(S++);56320<=E&&E<=57343?f[d++]=1024*(this._interim-55296)+E-56320+65536:(f[d++]=this._interim,f[d++]=E),this._interim=0}for(let E=S;E<y;++E){const O=u.charCodeAt(E);if(55296<=O&&O<=56319){if(++E>=y)return this._interim=O,d;const C=u.charCodeAt(E);56320<=C&&C<=57343?f[d++]=1024*(O-55296)+C-56320+65536:(f[d++]=O,f[d++]=C)}else O!==65279&&(f[d++]=O)}return d}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,f){const y=u.length;if(!y)return 0;let d,S,E,O,C=0,m=0,g=0;if(this.interim[0]){let x=!1,A=this.interim[0];A&=(224&A)==192?31:(240&A)==224?15:7;let R,D=0;for(;(R=63&this.interim[++D])&&D<4;)A<<=6,A|=R;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=T-D;for(;g<M;){if(g>=y)return 0;if(R=u[g++],(192&R)!=128){g--,x=!0;break}this.interim[D++]=R,A<<=6,A|=63&R}x||(T===2?A<128?g--:f[C++]=A:T===3?A<2048||A>=55296&&A<=57343||A===65279||(f[C++]=A):A<65536||A>1114111||(f[C++]=A)),this.interim.fill(0)}const h=y-4;let _=g;for(;_<y;){for(;!(!(_<h)||128&(d=u[_])||128&(S=u[_+1])||128&(E=u[_+2])||128&(O=u[_+3]));)f[C++]=d,f[C++]=S,f[C++]=E,f[C++]=O,_+=4;if(d=u[_++],d<128)f[C++]=d;else if((224&d)==192){if(_>=y)return this.interim[0]=d,C;if(S=u[_++],(192&S)!=128){_--;continue}if(m=(31&d)<<6|63&S,m<128){_--;continue}f[C++]=m}else if((240&d)==224){if(_>=y)return this.interim[0]=d,C;if(S=u[_++],(192&S)!=128){_--;continue}if(_>=y)return this.interim[0]=d,this.interim[1]=S,C;if(E=u[_++],(192&E)!=128){_--;continue}if(m=(15&d)<<12|(63&S)<<6|63&E,m<2048||m>=55296&&m<=57343||m===65279)continue;f[C++]=m}else if((248&d)==240){if(_>=y)return this.interim[0]=d,C;if(S=u[_++],(192&S)!=128){_--;continue}if(_>=y)return this.interim[0]=d,this.interim[1]=S,C;if(E=u[_++],(192&E)!=128){_--;continue}if(_>=y)return this.interim[0]=d,this.interim[1]=S,this.interim[2]=E,C;if(O=u[_++],(192&O)!=128){_--;continue}if(m=(7&d)<<18|(63&S)<<12|(63&E)<<6|63&O,m<65536||m>1114111)continue;f[C++]=m}}return C}}},225:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const f=u(1480),y=[[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]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let S;l.UnicodeV6=class{constructor(){if(this.version="6",!S){S=new Uint8Array(65536),S.fill(1),S[0]=0,S.fill(0,1,32),S.fill(0,127,160),S.fill(2,4352,4448),S[9001]=2,S[9002]=2,S.fill(2,11904,42192),S[12351]=1,S.fill(2,44032,55204),S.fill(2,63744,64256),S.fill(2,65040,65050),S.fill(2,65072,65136),S.fill(2,65280,65377),S.fill(2,65504,65511);for(let E=0;E<y.length;++E)S.fill(0,y[E][0],y[E][1]+1)}}wcwidth(E){return E<32?0:E<127?1:E<65536?S[E]:(function(O,C){let m,g=0,h=C.length-1;if(O<C[0][0]||O>C[h][1])return!1;for(;h>=g;)if(m=g+h>>1,O>C[m][1])g=m+1;else{if(!(O<C[m][0]))return!0;h=m-1}return!1})(E,d)?0:E>=131072&&E<=196605||E>=196608&&E<=262141?2:1}charProperties(E,O){let C=this.wcwidth(E),m=C===0&&O!==0;if(m){const g=f.UnicodeService.extractWidth(O);g===0?m=!1:g>C&&(C=g)}return f.UnicodeService.createPropertyValue(0,C,m)}}},5981:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const f=u(8460),y=u(844);class d extends y.Disposable{constructor(E){super(),this._action=E,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(E,O){if(O!==void 0&&this._syncCalls>O)return void(this._syncCalls=0);if(this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let C;for(this._isSyncWriting=!0;C=this._writeBuffer.shift();){this._action(C);const m=this._callbacks.shift();m&&m()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(E,O){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(O),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(O)}_innerWrite(E=0,O=!0){const C=E||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const m=this._writeBuffer[this._bufferOffset],g=this._action(m,O);if(g){const _=x=>Date.now()-C>=12?setTimeout((()=>this._innerWrite(0,x))):this._innerWrite(C,x);return void g.catch((x=>(queueMicrotask((()=>{throw x})),Promise.resolve(!1)))).then(_)}const h=this._callbacks[this._bufferOffset];if(h&&h(),this._bufferOffset++,this._pendingData-=m.length,Date.now()-C>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}l.WriteBuffer=d},5941:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const u=/^([\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})$/,f=/^[\da-f]+$/;function y(d,S){const E=d.toString(16),O=E.length<2?"0"+E:E;switch(S){case 4:return E[0];case 8:return O;case 12:return(O+O).slice(0,3);default:return O+O}}l.parseColor=function(d){if(!d)return;let S=d.toLowerCase();if(S.indexOf("rgb:")===0){S=S.slice(4);const E=u.exec(S);if(E){const O=E[1]?15:E[4]?255:E[7]?4095:65535;return[Math.round(parseInt(E[1]||E[4]||E[7]||E[10],16)/O*255),Math.round(parseInt(E[2]||E[5]||E[8]||E[11],16)/O*255),Math.round(parseInt(E[3]||E[6]||E[9]||E[12],16)/O*255)]}}else if(S.indexOf("#")===0&&(S=S.slice(1),f.exec(S)&&[3,6,9,12].includes(S.length))){const E=S.length/3,O=[0,0,0];for(let C=0;C<3;++C){const m=parseInt(S.slice(E*C,E*C+E),16);O[C]=E===1?m<<4:E===2?m:E===3?m>>4:m>>8}return O}},l.toRgbString=function(d,S=16){const[E,O,C]=d;return`rgb:${y(E,S)}/${y(O,S)}/${y(C,S)}`}},5770:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const f=u(482),y=u(8742),d=u(5770),S=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=S,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=S}registerHandler(O,C){this._handlers[O]===void 0&&(this._handlers[O]=[]);const m=this._handlers[O];return m.push(C),{dispose:()=>{const g=m.indexOf(C);g!==-1&&m.splice(g,1)}}}clearHandler(O){this._handlers[O]&&delete this._handlers[O]}setHandlerFallback(O){this._handlerFb=O}reset(){if(this._active.length)for(let O=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;O>=0;--O)this._active[O].unhook(!1);this._stack.paused=!1,this._active=S,this._ident=0}hook(O,C){if(this.reset(),this._ident=O,this._active=this._handlers[O]||S,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].hook(C);else this._handlerFb(this._ident,"HOOK",C)}put(O,C,m){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(O,C,m);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(O,C,m))}unhook(O,C=!0){if(this._active.length){let m=!1,g=this._active.length-1,h=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,m=C,h=this._stack.fallThrough,this._stack.paused=!1),!h&&m===!1){for(;g>=0&&(m=this._active[g].unhook(O),m!==!0);g--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,m;g--}for(;g>=0;g--)if(m=this._active[g].unhook(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,m}else this._handlerFb(this._ident,"UNHOOK",O);this._active=S,this._ident=0}};const E=new y.Params;E.addParam(0),l.DcsHandler=class{constructor(O){this._handler=O,this._data="",this._params=E,this._hitLimit=!1}hook(O){this._params=O.length>1||O.params[0]?O.clone():E,this._data="",this._hitLimit=!1}put(O,C,m){this._hitLimit||(this._data+=(0,f.utf32ToString)(O,C,m),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(O){let C=!1;if(this._hitLimit)C=!1;else if(O&&(C=this._handler(this._data,this._params),C instanceof Promise))return C.then((m=>(this._params=E,this._data="",this._hitLimit=!1,m)));return this._params=E,this._data="",this._hitLimit=!1,C}}},2015:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const f=u(844),y=u(8742),d=u(6242),S=u(6351);class E{constructor(g){this.table=new Uint8Array(g)}setDefault(g,h){this.table.fill(g<<4|h)}add(g,h,_,x){this.table[h<<8|g]=_<<4|x}addMany(g,h,_,x){for(let A=0;A<g.length;A++)this.table[h<<8|g[A]]=_<<4|x}}l.TransitionTable=E;const O=160;l.VT500_TRANSITION_TABLE=(function(){const m=new E(4095),g=Array.apply(null,Array(256)).map(((D,T)=>T)),h=(D,T)=>g.slice(D,T),_=h(32,127),x=h(0,24);x.push(25),x.push.apply(x,h(28,32));const A=h(0,14);let R;for(R in m.setDefault(1,0),m.addMany(_,0,2,0),A)m.addMany([24,26,153,154],R,3,0),m.addMany(h(128,144),R,3,0),m.addMany(h(144,152),R,3,0),m.add(156,R,0,0),m.add(27,R,11,1),m.add(157,R,4,8),m.addMany([152,158,159],R,0,7),m.add(155,R,11,3),m.add(144,R,11,9);return m.addMany(x,0,3,0),m.addMany(x,1,3,1),m.add(127,1,0,1),m.addMany(x,8,0,8),m.addMany(x,3,3,3),m.add(127,3,0,3),m.addMany(x,4,3,4),m.add(127,4,0,4),m.addMany(x,6,3,6),m.addMany(x,5,3,5),m.add(127,5,0,5),m.addMany(x,2,3,2),m.add(127,2,0,2),m.add(93,1,4,8),m.addMany(_,8,5,8),m.add(127,8,5,8),m.addMany([156,27,24,26,7],8,6,0),m.addMany(h(28,32),8,0,8),m.addMany([88,94,95],1,0,7),m.addMany(_,7,0,7),m.addMany(x,7,0,7),m.add(156,7,0,0),m.add(127,7,0,7),m.add(91,1,11,3),m.addMany(h(64,127),3,7,0),m.addMany(h(48,60),3,8,4),m.addMany([60,61,62,63],3,9,4),m.addMany(h(48,60),4,8,4),m.addMany(h(64,127),4,7,0),m.addMany([60,61,62,63],4,0,6),m.addMany(h(32,64),6,0,6),m.add(127,6,0,6),m.addMany(h(64,127),6,0,0),m.addMany(h(32,48),3,9,5),m.addMany(h(32,48),5,9,5),m.addMany(h(48,64),5,0,6),m.addMany(h(64,127),5,7,0),m.addMany(h(32,48),4,9,5),m.addMany(h(32,48),1,9,2),m.addMany(h(32,48),2,9,2),m.addMany(h(48,127),2,10,0),m.addMany(h(48,80),1,10,0),m.addMany(h(81,88),1,10,0),m.addMany([89,90,92],1,10,0),m.addMany(h(96,127),1,10,0),m.add(80,1,11,9),m.addMany(x,9,0,9),m.add(127,9,0,9),m.addMany(h(28,32),9,0,9),m.addMany(h(32,48),9,9,12),m.addMany(h(48,60),9,8,10),m.addMany([60,61,62,63],9,9,10),m.addMany(x,11,0,11),m.addMany(h(32,128),11,0,11),m.addMany(h(28,32),11,0,11),m.addMany(x,10,0,10),m.add(127,10,0,10),m.addMany(h(28,32),10,0,10),m.addMany(h(48,60),10,8,10),m.addMany([60,61,62,63],10,0,11),m.addMany(h(32,48),10,9,12),m.addMany(x,12,0,12),m.add(127,12,0,12),m.addMany(h(28,32),12,0,12),m.addMany(h(32,48),12,9,12),m.addMany(h(48,64),12,0,11),m.addMany(h(64,127),12,12,13),m.addMany(h(64,127),10,12,13),m.addMany(h(64,127),9,12,13),m.addMany(x,13,13,13),m.addMany(_,13,13,13),m.add(127,13,0,13),m.addMany([27,156,24,26],13,14,0),m.add(O,0,2,0),m.add(O,8,5,8),m.add(O,6,0,6),m.add(O,11,0,11),m.add(O,13,13,13),m})();class C extends f.Disposable{constructor(g=l.VT500_TRANSITION_TABLE){super(),this._transitions=g,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new y.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(h,_,x)=>{},this._executeHandlerFb=h=>{},this._csiHandlerFb=(h,_)=>{},this._escHandlerFb=h=>{},this._errorHandlerFb=h=>h,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new S.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(g,h=[64,126]){let _=0;if(g.prefix){if(g.prefix.length>1)throw new Error("only one byte as prefix supported");if(_=g.prefix.charCodeAt(0),_&&60>_||_>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(g.intermediates){if(g.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let A=0;A<g.intermediates.length;++A){const R=g.intermediates.charCodeAt(A);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");_<<=8,_|=R}}if(g.final.length!==1)throw new Error("final must be a single byte");const x=g.final.charCodeAt(0);if(h[0]>x||x>h[1])throw new Error(`final must be in range ${h[0]} .. ${h[1]}`);return _<<=8,_|=x,_}identToString(g){const h=[];for(;g;)h.push(String.fromCharCode(255&g)),g>>=8;return h.reverse().join("")}setPrintHandler(g){this._printHandler=g}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(g,h){const _=this._identifier(g,[48,126]);this._escHandlers[_]===void 0&&(this._escHandlers[_]=[]);const x=this._escHandlers[_];return x.push(h),{dispose:()=>{const A=x.indexOf(h);A!==-1&&x.splice(A,1)}}}clearEscHandler(g){this._escHandlers[this._identifier(g,[48,126])]&&delete this._escHandlers[this._identifier(g,[48,126])]}setEscHandlerFallback(g){this._escHandlerFb=g}setExecuteHandler(g,h){this._executeHandlers[g.charCodeAt(0)]=h}clearExecuteHandler(g){this._executeHandlers[g.charCodeAt(0)]&&delete this._executeHandlers[g.charCodeAt(0)]}setExecuteHandlerFallback(g){this._executeHandlerFb=g}registerCsiHandler(g,h){const _=this._identifier(g);this._csiHandlers[_]===void 0&&(this._csiHandlers[_]=[]);const x=this._csiHandlers[_];return x.push(h),{dispose:()=>{const A=x.indexOf(h);A!==-1&&x.splice(A,1)}}}clearCsiHandler(g){this._csiHandlers[this._identifier(g)]&&delete this._csiHandlers[this._identifier(g)]}setCsiHandlerFallback(g){this._csiHandlerFb=g}registerDcsHandler(g,h){return this._dcsParser.registerHandler(this._identifier(g),h)}clearDcsHandler(g){this._dcsParser.clearHandler(this._identifier(g))}setDcsHandlerFallback(g){this._dcsParser.setHandlerFallback(g)}registerOscHandler(g,h){return this._oscParser.registerHandler(g,h)}clearOscHandler(g){this._oscParser.clearHandler(g)}setOscHandlerFallback(g){this._oscParser.setHandlerFallback(g)}setErrorHandler(g){this._errorHandler=g}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(g,h,_,x,A){this._parseStack.state=g,this._parseStack.handlers=h,this._parseStack.handlerPos=_,this._parseStack.transition=x,this._parseStack.chunkPos=A}parse(g,h,_){let x,A=0,R=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(_===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const T=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(_===!1&&M>-1){for(;M>=0&&(x=T[M](this._params),x!==!0);M--)if(x instanceof Promise)return this._parseStack.handlerPos=M,x}this._parseStack.handlers=[];break;case 4:if(_===!1&&M>-1){for(;M>=0&&(x=T[M](),x!==!0);M--)if(x instanceof Promise)return this._parseStack.handlerPos=M,x}this._parseStack.handlers=[];break;case 6:if(A=g[this._parseStack.chunkPos],x=this._dcsParser.unhook(A!==24&&A!==26,_),x)return x;A===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(A=g[this._parseStack.chunkPos],x=this._oscParser.end(A!==24&&A!==26,_),x)return x;A===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let T=D;T<h;++T){switch(A=g[T],R=this._transitions.table[this.currentState<<8|(A<160?A:O)],R>>4){case 2:for(let F=T+1;;++F){if(F>=h||(A=g[F])<32||A>126&&A<O){this._printHandler(g,T,F),T=F-1;break}if(++F>=h||(A=g[F])<32||A>126&&A<O){this._printHandler(g,T,F),T=F-1;break}if(++F>=h||(A=g[F])<32||A>126&&A<O){this._printHandler(g,T,F),T=F-1;break}if(++F>=h||(A=g[F])<32||A>126&&A<O){this._printHandler(g,T,F),T=F-1;break}}break;case 3:this._executeHandlers[A]?this._executeHandlers[A]():this._executeHandlerFb(A),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:T,code:A,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const M=this._csiHandlers[this._collect<<8|A];let $=M?M.length-1:-1;for(;$>=0&&(x=M[$](this._params),x!==!0);$--)if(x instanceof Promise)return this._preserveStack(3,M,$,R,T),x;$<0&&this._csiHandlerFb(this._collect<<8|A,this._params),this.precedingJoinState=0;break;case 8:do switch(A){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(A-48)}while(++T<h&&(A=g[T])>47&&A<60);T--;break;case 9:this._collect<<=8,this._collect|=A;break;case 10:const Z=this._escHandlers[this._collect<<8|A];let K=Z?Z.length-1:-1;for(;K>=0&&(x=Z[K](),x!==!0);K--)if(x instanceof Promise)return this._preserveStack(4,Z,K,R,T),x;K<0&&this._escHandlerFb(this._collect<<8|A),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|A,this._params);break;case 13:for(let F=T+1;;++F)if(F>=h||(A=g[F])===24||A===26||A===27||A>127&&A<O){this._dcsParser.put(g,T,F),T=F-1;break}break;case 14:if(x=this._dcsParser.unhook(A!==24&&A!==26),x)return this._preserveStack(6,[],0,R,T),x;A===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let F=T+1;;F++)if(F>=h||(A=g[F])<32||A>127&&A<O){this._oscParser.put(g,T,F),T=F-1;break}break;case 6:if(x=this._oscParser.end(A!==24&&A!==26),x)return this._preserveStack(5,[],0,R,T),x;A===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}l.EscapeSequenceParser=C},6242:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const f=u(5770),y=u(482),d=[];l.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(S,E){this._handlers[S]===void 0&&(this._handlers[S]=[]);const O=this._handlers[S];return O.push(E),{dispose:()=>{const C=O.indexOf(E);C!==-1&&O.splice(C,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].start();else this._handlerFb(this._id,"START")}_put(S,E,O){if(this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].put(S,E,O);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(S,E,O))}start(){this.reset(),this._state=1}put(S,E,O){if(this._state!==3){if(this._state===1)for(;E<O;){const C=S[E++];if(C===59){this._state=2,this._start();break}if(C<48||57<C)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+C-48}this._state===2&&O-E>0&&this._put(S,E,O)}}end(S,E=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let O=!1,C=this._active.length-1,m=!1;if(this._stack.paused&&(C=this._stack.loopPosition-1,O=E,m=this._stack.fallThrough,this._stack.paused=!1),!m&&O===!1){for(;C>=0&&(O=this._active[C].end(S),O!==!0);C--)if(O instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!1,O;C--}for(;C>=0;C--)if(O=this._active[C].end(!1),O instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!0,O}else this._handlerFb(this._id,"END",S);this._active=d,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(S){this._handler=S,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(S,E,O){this._hitLimit||(this._data+=(0,y.utf32ToString)(S,E,O),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(S){let E=!1;if(this._hitLimit)E=!1;else if(S&&(E=this._handler(this._data),E instanceof Promise))return E.then((O=>(this._data="",this._hitLimit=!1,O)));return this._data="",this._hitLimit=!1,E}}},8742:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const u=2147483647;class f{static fromArray(d){const S=new f;if(!d.length)return S;for(let E=Array.isArray(d[0])?1:0;E<d.length;++E){const O=d[E];if(Array.isArray(O))for(let C=0;C<O.length;++C)S.addSubParam(O[C]);else S.addParam(O)}return S}constructor(d=32,S=32){if(this.maxLength=d,this.maxSubParamsLength=S,S>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(S),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new f(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let S=0;S<this.length;++S){d.push(this.params[S]);const E=this._subParamsIdx[S]>>8,O=255&this._subParamsIdx[S];O-E>0&&d.push(Array.prototype.slice.call(this._subParams,E,O))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>u?u:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>u?u:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const S=this._subParamsIdx[d]>>8,E=255&this._subParamsIdx[d];return E-S>0?this._subParams.subarray(S,E):null}getSubParamsAll(){const d={};for(let S=0;S<this.length;++S){const E=this._subParamsIdx[S]>>8,O=255&this._subParamsIdx[S];O-E>0&&(d[S]=this._subParams.slice(E,O))}return d}addDigit(d){let S;if(this._rejectDigits||!(S=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const E=this._digitIsSub?this._subParams:this.params,O=E[S-1];E[S-1]=~O?Math.min(10*O+d,u):d}}l.Params=f},5741:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,f){const y={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(y),f.dispose=()=>this._wrappedAddonDispose(y),f.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let f=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===u){f=y;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(f,1)}}},8771:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const f=u(3785),y=u(511);l.BufferApiView=class{constructor(d,S){this._buffer=d,this.type=S}init(d){return this._buffer=d,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(d){const S=this._buffer.lines.get(d);if(S)return new f.BufferLineApiView(S)}getNullCell(){return new y.CellData}}},3785:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const f=u(511);l.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,d){if(!(y<0||y>=this._line.length))return d?(this._line.loadCell(y,d),d):this._line.loadCell(y,new f.CellData)}translateToString(y,d,S){return this._line.translateToString(y,d,S)}}},8285:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const f=u(8771),y=u(8460),d=u(844);class S extends d.Disposable{constructor(O){super(),this._core=O,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}l.BufferNamespaceApi=S},7975:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,f){return this._core.registerCsiHandler(u,(y=>f(y.toArray())))}addCsiHandler(u,f){return this.registerCsiHandler(u,f)}registerDcsHandler(u,f){return this._core.registerDcsHandler(u,((y,d)=>f(y,d.toArray())))}addDcsHandler(u,f){return this.registerDcsHandler(u,f)}registerEscHandler(u,f){return this._core.registerEscHandler(u,f)}addEscHandler(u,f){return this.registerEscHandler(u,f)}registerOscHandler(u,f){return this._core.registerOscHandler(u,f)}addOscHandler(u,f){return this.registerOscHandler(u,f)}}},7090:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(k,l,u){var f=this&&this.__decorate||function(m,g,h,_){var x,A=arguments.length,R=A<3?g:_===null?_=Object.getOwnPropertyDescriptor(g,h):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(m,g,h,_);else for(var D=m.length-1;D>=0;D--)(x=m[D])&&(R=(A<3?x(R):A>3?x(g,h,R):x(g,h))||R);return A>3&&R&&Object.defineProperty(g,h,R),R},y=this&&this.__param||function(m,g){return function(h,_){g(h,_,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const d=u(8460),S=u(844),E=u(5295),O=u(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let C=l.BufferService=class extends S.Disposable{get buffer(){return this.buffers.active}constructor(m){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(m.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(m.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new E.BufferSet(m,this))}resize(m,g){this.cols=m,this.rows=g,this.buffers.resize(m,g),this._onResize.fire({cols:m,rows:g})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(m,g=!1){const h=this.buffer;let _;_=this._cachedBlankLine,_&&_.length===this.cols&&_.getFg(0)===m.fg&&_.getBg(0)===m.bg||(_=h.getBlankLine(m,g),this._cachedBlankLine=_),_.isWrapped=g;const x=h.ybase+h.scrollTop,A=h.ybase+h.scrollBottom;if(h.scrollTop===0){const R=h.lines.isFull;A===h.lines.length-1?R?h.lines.recycle().copyFrom(_):h.lines.push(_.clone()):h.lines.splice(A+1,0,_.clone()),R?this.isUserScrolling&&(h.ydisp=Math.max(h.ydisp-1,0)):(h.ybase++,this.isUserScrolling||h.ydisp++)}else{const R=A-x+1;h.lines.shiftElements(x+1,R-1,-1),h.lines.set(A,_.clone())}this.isUserScrolling||(h.ydisp=h.ybase),this._onScroll.fire(h.ydisp)}scrollLines(m,g,h){const _=this.buffer;if(m<0){if(_.ydisp===0)return;this.isUserScrolling=!0}else m+_.ydisp>=_.ybase&&(this.isUserScrolling=!1);const x=_.ydisp;_.ydisp=Math.max(Math.min(_.ydisp+m,_.ybase),0),x!==_.ydisp&&(g||this._onScroll.fire(_.ydisp))}};l.BufferService=C=f([y(0,O.IOptionsService)],C)},7994:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,f){this._charsets[u]=f,this.glevel===u&&(this.charset=f)}}},1753:function(k,l,u){var f=this&&this.__decorate||function(_,x,A,R){var D,T=arguments.length,M=T<3?x:R===null?R=Object.getOwnPropertyDescriptor(x,A):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(_,x,A,R);else for(var $=_.length-1;$>=0;$--)(D=_[$])&&(M=(T<3?D(M):T>3?D(x,A,M):D(x,A))||M);return T>3&&M&&Object.defineProperty(x,A,M),M},y=this&&this.__param||function(_,x){return function(A,R){x(A,R,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const d=u(2585),S=u(8460),E=u(844),O={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:_=>_.button!==4&&_.action===1&&(_.ctrl=!1,_.alt=!1,_.shift=!1,!0)},VT200:{events:19,restrict:_=>_.action!==32},DRAG:{events:23,restrict:_=>_.action!==32||_.button!==3},ANY:{events:31,restrict:_=>!0}};function C(_,x){let A=(_.ctrl?16:0)|(_.shift?4:0)|(_.alt?8:0);return _.button===4?(A|=64,A|=_.action):(A|=3&_.button,4&_.button&&(A|=64),8&_.button&&(A|=128),_.action===32?A|=32:_.action!==0||x||(A|=3)),A}const m=String.fromCharCode,g={DEFAULT:_=>{const x=[C(_,!1)+32,_.col+32,_.row+32];return x[0]>255||x[1]>255||x[2]>255?"":`\x1B[M${m(x[0])}${m(x[1])}${m(x[2])}`},SGR:_=>{const x=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${C(_,!0)};${_.col};${_.row}${x}`},SGR_PIXELS:_=>{const x=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${C(_,!0)};${_.x};${_.y}${x}`}};let h=l.CoreMouseService=class extends E.Disposable{constructor(_,x){super(),this._bufferService=_,this._coreService=x,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new S.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const A of Object.keys(O))this.addProtocol(A,O[A]);for(const A of Object.keys(g))this.addEncoding(A,g[A]);this.reset()}addProtocol(_,x){this._protocols[_]=x}addEncoding(_,x){this._encodings[_]=x}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(_){if(!this._protocols[_])throw new Error(`unknown protocol "${_}"`);this._activeProtocol=_,this._onProtocolChange.fire(this._protocols[_].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(_){if(!this._encodings[_])throw new Error(`unknown encoding "${_}"`);this._activeEncoding=_}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(_){if(_.col<0||_.col>=this._bufferService.cols||_.row<0||_.row>=this._bufferService.rows||_.button===4&&_.action===32||_.button===3&&_.action!==32||_.button!==4&&(_.action===2||_.action===3)||(_.col++,_.row++,_.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,_,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(_))return!1;const x=this._encodings[this._activeEncoding](_);return x&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(x):this._coreService.triggerDataEvent(x,!0)),this._lastEvent=_,!0}explainEvents(_){return{down:!!(1&_),up:!!(2&_),drag:!!(4&_),move:!!(8&_),wheel:!!(16&_)}}_equalEvents(_,x,A){if(A){if(_.x!==x.x||_.y!==x.y)return!1}else if(_.col!==x.col||_.row!==x.row)return!1;return _.button===x.button&&_.action===x.action&&_.ctrl===x.ctrl&&_.alt===x.alt&&_.shift===x.shift}};l.CoreMouseService=h=f([y(0,d.IBufferService),y(1,d.ICoreService)],h)},6975:function(k,l,u){var f=this&&this.__decorate||function(h,_,x,A){var R,D=arguments.length,T=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,x):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(h,_,x,A);else for(var M=h.length-1;M>=0;M--)(R=h[M])&&(T=(D<3?R(T):D>3?R(_,x,T):R(_,x))||T);return D>3&&T&&Object.defineProperty(_,x,T),T},y=this&&this.__param||function(h,_){return function(x,A){_(x,A,h)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const d=u(1439),S=u(8460),E=u(844),O=u(2585),C=Object.freeze({insertMode:!1}),m=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let g=l.CoreService=class extends E.Disposable{constructor(h,_,x){super(),this._bufferService=h,this._logService=_,this._optionsService=x,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new S.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new S.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new S.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new S.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(C),this.decPrivateModes=(0,d.clone)(m)}reset(){this.modes=(0,d.clone)(C),this.decPrivateModes=(0,d.clone)(m)}triggerDataEvent(h,_=!1){if(this._optionsService.rawOptions.disableStdin)return;const x=this._bufferService.buffer;_&&this._optionsService.rawOptions.scrollOnUserInput&&x.ybase!==x.ydisp&&this._onRequestScrollToBottom.fire(),_&&this._onUserInput.fire(),this._logService.debug(`sending data "${h}"`,(()=>h.split("").map((A=>A.charCodeAt(0))))),this._onData.fire(h)}triggerBinaryEvent(h){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${h}"`,(()=>h.split("").map((_=>_.charCodeAt(0))))),this._onBinary.fire(h))}};l.CoreService=g=f([y(0,O.IBufferService),y(1,O.ILogService),y(2,O.IOptionsService)],g)},9074:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const f=u(8055),y=u(8460),d=u(844),S=u(6106);let E=0,O=0;class C extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new S.SortedList((h=>h==null?void 0:h.marker.line)),this._onDecorationRegistered=this.register(new y.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new y.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(h){if(h.marker.isDisposed)return;const _=new m(h);if(_){const x=_.marker.onDispose((()=>_.dispose()));_.onDispose((()=>{_&&(this._decorations.delete(_)&&this._onDecorationRemoved.fire(_),x.dispose())})),this._decorations.insert(_),this._onDecorationRegistered.fire(_)}return _}reset(){for(const h of this._decorations.values())h.dispose();this._decorations.clear()}*getDecorationsAtCell(h,_,x){let A=0,R=0;for(const D of this._decorations.getKeyIterator(_))A=D.options.x??0,R=A+(D.options.width??1),h>=A&&h<R&&(!x||(D.options.layer??"bottom")===x)&&(yield D)}forEachDecorationAtCell(h,_,x,A){this._decorations.forEachByKey(_,(R=>{E=R.options.x??0,O=E+(R.options.width??1),h>=E&&h<O&&(!x||(R.options.layer??"bottom")===x)&&A(R)}))}}l.DecorationService=C;class m extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(h){super(),this.options=h,this.onRenderEmitter=this.register(new y.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new y.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=h.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const f=u(2585),y=u(8343);class d{constructor(...E){this._entries=new Map;for(const[O,C]of E)this.set(O,C)}set(E,O){const C=this._entries.get(E);return this._entries.set(E,O),C}forEach(E){for(const[O,C]of this._entries.entries())E(O,C)}has(E){return this._entries.has(E)}get(E){return this._entries.get(E)}}l.ServiceCollection=d,l.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(S,E){this._services.set(S,E)}getService(S){return this._services.get(S)}createInstance(S,...E){const O=(0,y.getServiceDependencies)(S).sort(((g,h)=>g.index-h.index)),C=[];for(const g of O){const h=this._services.get(g.id);if(!h)throw new Error(`[createInstance] ${S.name} depends on UNKNOWN service ${g.id}.`);C.push(h)}const m=O.length>0?O[0].index:E.length;if(E.length!==m)throw new Error(`[createInstance] First service dependency of ${S.name} at position ${m+1} conflicts with ${E.length} static arguments`);return new S(...E,...C)}}},7866:function(k,l,u){var f=this&&this.__decorate||function(m,g,h,_){var x,A=arguments.length,R=A<3?g:_===null?_=Object.getOwnPropertyDescriptor(g,h):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(m,g,h,_);else for(var D=m.length-1;D>=0;D--)(x=m[D])&&(R=(A<3?x(R):A>3?x(g,h,R):x(g,h))||R);return A>3&&R&&Object.defineProperty(g,h,R),R},y=this&&this.__param||function(m,g){return function(h,_){g(h,_,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const d=u(844),S=u(2585),E={trace:S.LogLevelEnum.TRACE,debug:S.LogLevelEnum.DEBUG,info:S.LogLevelEnum.INFO,warn:S.LogLevelEnum.WARN,error:S.LogLevelEnum.ERROR,off:S.LogLevelEnum.OFF};let O,C=l.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(m){super(),this._optionsService=m,this._logLevel=S.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),O=this}_updateLogLevel(){this._logLevel=E[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(m){for(let g=0;g<m.length;g++)typeof m[g]=="function"&&(m[g]=m[g]())}_log(m,g,h){this._evalLazyOptionalParams(h),m.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+g,...h)}trace(m,...g){var h;this._logLevel<=S.LogLevelEnum.TRACE&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.trace.bind(this._optionsService.options.logger))??console.log,m,g)}debug(m,...g){var h;this._logLevel<=S.LogLevelEnum.DEBUG&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.debug.bind(this._optionsService.options.logger))??console.log,m,g)}info(m,...g){var h;this._logLevel<=S.LogLevelEnum.INFO&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.info.bind(this._optionsService.options.logger))??console.info,m,g)}warn(m,...g){var h;this._logLevel<=S.LogLevelEnum.WARN&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.warn.bind(this._optionsService.options.logger))??console.warn,m,g)}error(m,...g){var h;this._logLevel<=S.LogLevelEnum.ERROR&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.error.bind(this._optionsService.options.logger))??console.error,m,g)}};l.LogService=C=f([y(0,S.IOptionsService)],C),l.setTraceLogger=function(m){O=m},l.traceCall=function(m,g,h){if(typeof h.value!="function")throw new Error("not supported");const _=h.value;h.value=function(...x){if(O.logLevel!==S.LogLevelEnum.TRACE)return _.apply(this,x);O.trace(`GlyphRenderer#${_.name}(${x.map((R=>JSON.stringify(R))).join(", ")})`);const A=_.apply(this,x);return O.trace(`GlyphRenderer#${_.name} return`,A),A}}},7302:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const f=u(8460),y=u(844),d=u(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const S=["normal","bold","100","200","300","400","500","600","700","800","900"];class E extends y.Disposable{constructor(C){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const m={...l.DEFAULT_OPTIONS};for(const g in C)if(g in m)try{const h=C[g];m[g]=this._sanitizeAndValidateOption(g,h)}catch(h){console.error(h)}this.rawOptions=m,this.options={...m},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(C,m){return this.onOptionChange((g=>{g===C&&m(this.rawOptions[C])}))}onMultipleOptionChange(C,m){return this.onOptionChange((g=>{C.indexOf(g)!==-1&&m()}))}_setupOptions(){const C=g=>{if(!(g in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${g}"`);return this.rawOptions[g]},m=(g,h)=>{if(!(g in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${g}"`);h=this._sanitizeAndValidateOption(g,h),this.rawOptions[g]!==h&&(this.rawOptions[g]=h,this._onOptionChange.fire(g))};for(const g in this.rawOptions){const h={get:C.bind(this,g),set:m.bind(this,g)};Object.defineProperty(this.options,g,h)}}_sanitizeAndValidateOption(C,m){switch(C){case"cursorStyle":if(m||(m=l.DEFAULT_OPTIONS[C]),!(function(g){return g==="block"||g==="underline"||g==="bar"})(m))throw new Error(`"${m}" is not a valid value for ${C}`);break;case"wordSeparator":m||(m=l.DEFAULT_OPTIONS[C]);break;case"fontWeight":case"fontWeightBold":if(typeof m=="number"&&1<=m&&m<=1e3)break;m=S.includes(m)?m:l.DEFAULT_OPTIONS[C];break;case"cursorWidth":m=Math.floor(m);case"lineHeight":case"tabStopWidth":if(m<1)throw new Error(`${C} cannot be less than 1, value: ${m}`);break;case"minimumContrastRatio":m=Math.max(1,Math.min(21,Math.round(10*m)/10));break;case"scrollback":if((m=Math.min(m,4294967295))<0)throw new Error(`${C} cannot be less than 0, value: ${m}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(m<=0)throw new Error(`${C} cannot be less than or equal to 0, value: ${m}`);break;case"rows":case"cols":if(!m&&m!==0)throw new Error(`${C} must be numeric, value: ${m}`);break;case"windowsPty":m=m??{}}return m}}l.OptionsService=E},2660:function(k,l,u){var f=this&&this.__decorate||function(E,O,C,m){var g,h=arguments.length,_=h<3?O:m===null?m=Object.getOwnPropertyDescriptor(O,C):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(E,O,C,m);else for(var x=E.length-1;x>=0;x--)(g=E[x])&&(_=(h<3?g(_):h>3?g(O,C,_):g(O,C))||_);return h>3&&_&&Object.defineProperty(O,C,_),_},y=this&&this.__param||function(E,O){return function(C,m){O(C,m,E)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const d=u(2585);let S=l.OscLinkService=class{constructor(E){this._bufferService=E,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(E){const O=this._bufferService.buffer;if(E.id===void 0){const x=O.addMarker(O.ybase+O.y),A={data:E,id:this._nextId++,lines:[x]};return x.onDispose((()=>this._removeMarkerFromLink(A,x))),this._dataByLinkId.set(A.id,A),A.id}const C=E,m=this._getEntryIdKey(C),g=this._entriesWithId.get(m);if(g)return this.addLineToLink(g.id,O.ybase+O.y),g.id;const h=O.addMarker(O.ybase+O.y),_={id:this._nextId++,key:this._getEntryIdKey(C),data:C,lines:[h]};return h.onDispose((()=>this._removeMarkerFromLink(_,h))),this._entriesWithId.set(_.key,_),this._dataByLinkId.set(_.id,_),_.id}addLineToLink(E,O){const C=this._dataByLinkId.get(E);if(C&&C.lines.every((m=>m.line!==O))){const m=this._bufferService.buffer.addMarker(O);C.lines.push(m),m.onDispose((()=>this._removeMarkerFromLink(C,m)))}}getLinkData(E){var O;return(O=this._dataByLinkId.get(E))==null?void 0:O.data}_getEntryIdKey(E){return`${E.id};;${E.uri}`}_removeMarkerFromLink(E,O){const C=E.lines.indexOf(O);C!==-1&&(E.lines.splice(C,1),E.lines.length===0&&(E.data.id!==void 0&&this._entriesWithId.delete(E.key),this._dataByLinkId.delete(E.id)))}};l.OscLinkService=S=f([y(0,d.IBufferService)],S)},8343:(k,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const u="di$target",f="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(y){return y[f]||[]},l.createDecorator=function(y){if(l.serviceRegistry.has(y))return l.serviceRegistry.get(y);const d=function(S,E,O){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(C,m,g){m[u]===m?m[f].push({id:C,index:g}):(m[f]=[{id:C,index:g}],m[u]=m)})(d,S,O)};return d.toString=()=>y,l.serviceRegistry.set(y,d),d}},2585:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const f=u(8343);var y;l.IBufferService=(0,f.createDecorator)("BufferService"),l.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),l.ICoreService=(0,f.createDecorator)("CoreService"),l.ICharsetService=(0,f.createDecorator)("CharsetService"),l.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(y||(l.LogLevelEnum=y={})),l.ILogService=(0,f.createDecorator)("LogService"),l.IOptionsService=(0,f.createDecorator)("OptionsService"),l.IOscLinkService=(0,f.createDecorator)("OscLinkService"),l.IUnicodeService=(0,f.createDecorator)("UnicodeService"),l.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(k,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const f=u(8460),y=u(225);class d{static extractShouldJoin(E){return(1&E)!=0}static extractWidth(E){return E>>1&3}static extractCharKind(E){return E>>3}static createPropertyValue(E,O,C=!1){return(16777215&E)<<3|(3&O)<<1|(C?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const E=new y.UnicodeV6;this.register(E),this._active=E.version,this._activeProvider=E}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(E){if(!this._providers[E])throw new Error(`unknown Unicode version "${E}"`);this._active=E,this._activeProvider=this._providers[E],this._onChange.fire(E)}register(E){this._providers[E.version]=E}wcwidth(E){return this._activeProvider.wcwidth(E)}getStringCellWidth(E){let O=0,C=0;const m=E.length;for(let g=0;g<m;++g){let h=E.charCodeAt(g);if(55296<=h&&h<=56319){if(++g>=m)return O+this.wcwidth(h);const A=E.charCodeAt(g);56320<=A&&A<=57343?h=1024*(h-55296)+A-56320+65536:O+=this.wcwidth(A)}const _=this.charProperties(h,C);let x=d.extractWidth(_);d.extractShouldJoin(_)&&(x-=d.extractWidth(C)),O+=x,C=_}return O}charProperties(E,O){return this._activeProvider.charProperties(E,O)}}l.UnicodeService=d}},o={};function v(k){var l=o[k];if(l!==void 0)return l.exports;var u=o[k]={exports:{}};return a[k].call(u.exports,u,u.exports,v),u.exports}var w={};return(()=>{var k=w;Object.defineProperty(k,"__esModule",{value:!0}),k.Terminal=void 0;const l=v(9042),u=v(3236),f=v(844),y=v(5741),d=v(8285),S=v(7975),E=v(7090),O=["cols","rows"];class C extends f.Disposable{constructor(g){super(),this._core=this.register(new u.Terminal(g)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const h=x=>this._core.options[x],_=(x,A)=>{this._checkReadonlyOptions(x),this._core.options[x]=A};for(const x in this._core.options){const A={get:h.bind(this,x),set:_.bind(this,x)};Object.defineProperty(this._publicOptions,x,A)}}_checkReadonlyOptions(g){if(O.includes(g))throw new Error(`Option "${g}" 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 S.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new E.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const g=this._core.coreService.decPrivateModes;let h="none";switch(this._core.coreMouseService.activeProtocol){case"X10":h="x10";break;case"VT200":h="vt200";break;case"DRAG":h="drag";break;case"ANY":h="any"}return{applicationCursorKeysMode:g.applicationCursorKeys,applicationKeypadMode:g.applicationKeypad,bracketedPasteMode:g.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:h,originMode:g.origin,reverseWraparoundMode:g.reverseWraparound,sendFocusMode:g.sendFocus,wraparoundMode:g.wraparound}}get options(){return this._publicOptions}set options(g){for(const h in g)this._publicOptions[h]=g[h]}blur(){this._core.blur()}focus(){this._core.focus()}input(g,h=!0){this._core.input(g,h)}resize(g,h){this._verifyIntegers(g,h),this._core.resize(g,h)}open(g){this._core.open(g)}attachCustomKeyEventHandler(g){this._core.attachCustomKeyEventHandler(g)}attachCustomWheelEventHandler(g){this._core.attachCustomWheelEventHandler(g)}registerLinkProvider(g){return this._core.registerLinkProvider(g)}registerCharacterJoiner(g){return this._checkProposedApi(),this._core.registerCharacterJoiner(g)}deregisterCharacterJoiner(g){this._checkProposedApi(),this._core.deregisterCharacterJoiner(g)}registerMarker(g=0){return this._verifyIntegers(g),this._core.registerMarker(g)}registerDecoration(g){return this._checkProposedApi(),this._verifyPositiveIntegers(g.x??0,g.width??0,g.height??0),this._core.registerDecoration(g)}hasSelection(){return this._core.hasSelection()}select(g,h,_){this._verifyIntegers(g,h,_),this._core.select(g,h,_)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(g,h){this._verifyIntegers(g,h),this._core.selectLines(g,h)}dispose(){super.dispose()}scrollLines(g){this._verifyIntegers(g),this._core.scrollLines(g)}scrollPages(g){this._verifyIntegers(g),this._core.scrollPages(g)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(g){this._verifyIntegers(g),this._core.scrollToLine(g)}clear(){this._core.clear()}write(g,h){this._core.write(g,h)}writeln(g,h){this._core.write(g),this._core.write(`\r
|
|
311
311
|
`,h)}paste(g){this._core.paste(g)}refresh(g,h){this._verifyIntegers(g,h),this._core.refresh(g,h)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(g){this._addonManager.loadAddon(this,g)}static get strings(){return l}_verifyIntegers(...g){for(const h of g)if(h===1/0||isNaN(h)||h%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...g){for(const h of g)if(h&&(h===1/0||isNaN(h)||h%1!=0||h<0))throw new Error("This API only accepts positive integers")}}k.Terminal=C})(),w})()))})(fu)),fu.exports}var n4=r4(),mu={exports:{}},Yp;function a4(){return Yp||(Yp=1,(function(i,r){(function(a,o){i.exports=o()})(self,(()=>(()=>{var a={};return(()=>{var o=a;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.FitAddon=class{activate(v){this._terminal=v}dispose(){}fit(){const v=this.proposeDimensions();if(!v||!this._terminal||isNaN(v.cols)||isNaN(v.rows))return;const w=this._terminal._core;this._terminal.rows===v.rows&&this._terminal.cols===v.cols||(w._renderService.clear(),this._terminal.resize(v.cols,v.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const v=this._terminal._core,w=v._renderService.dimensions;if(w.css.cell.width===0||w.css.cell.height===0)return;const k=this._terminal.options.scrollback===0?0:v.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(l.getPropertyValue("height")),f=Math.max(0,parseInt(l.getPropertyValue("width"))),y=window.getComputedStyle(this._terminal.element),d=u-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),S=f-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-k;return{cols:Math.max(2,Math.floor(S/w.css.cell.width)),rows:Math.max(1,Math.floor(d/w.css.cell.height))}}}})(),a})()))})(mu)),mu.exports}var o4=a4();const l4=3e4,c4=300*1e3;class u4{constructor(r,a,o){pt(this,"ws",null);pt(this,"consecutiveFailures",0);pt(this,"failStartTime",null);pt(this,"destroyed",!1);pt(this,"reconnectTimer",null);pt(this,"url");pt(this,"authToken");pt(this,"callbacks");this.url=r,this.authToken=o,this.callbacks=a,this.connect()}connect(){if(!this.destroyed){try{this.ws=new WebSocket(this.url)}catch{this.scheduleReconnect();return}this.ws.onopen=()=>{var r,a,o;this.destroyed||(this.consecutiveFailures=0,this.failStartTime=null,this.authToken&&((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"auth",token:this.authToken})),(o=(a=this.callbacks).onOpen)==null||o.call(a))},this.ws.onmessage=r=>{if(!this.destroyed)try{this.callbacks.onMessage(JSON.parse(r.data))}catch{}},this.ws.onclose=()=>{this.destroyed||(this.ws=null,this.scheduleReconnect())},this.ws.onerror=()=>{this.destroyed}}}scheduleReconnect(){var a,o,v,w,k,l;if(this.destroyed)return;if(this.failStartTime===null&&(this.failStartTime=Date.now()),Date.now()-this.failStartTime>=c4){(o=(a=this.callbacks).onGiveUp)==null||o.call(a),(w=(v=this.callbacks).onClose)==null||w.call(v);return}this.consecutiveFailures++;const r=Math.min(l4,1e3*Math.pow(2,this.consecutiveFailures-1));(l=(k=this.callbacks).onReconnecting)==null||l.call(k,this.consecutiveFailures,r),this.reconnectTimer=setTimeout(()=>this.connect(),r)}send(r){var a;((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(r))}close(){var r;this.destroyed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(r=this.ws)==null||r.close(),this.ws=null}}const yo=1e3;function pu(i){return`${i.timestamp??""}:${i.role}:${i.contentType}:${i.text.length}:${i.text.slice(0,80)}`}function Wp(i){const r=i.role==="assistant"?"Agent":i.role==="user"?"You":i.role,a=i.contentType==="tool_use"?"[Tool]":i.contentType==="tool_result"?"[Result]":i.contentType==="thinking"?"[Thinking]":"",v=`\x1B[36m${a?`${r} ${a}`:r}\x1B[0m:`,w=i.text.split(`
|
|
312
|
-
`)[0].slice(0,200)+(i.text.length>200?"…":"");return`${v} ${w}`}function h4({sessionId:i,status:r}){const a=Fe(M=>M.token),o=P.useRef(null),v=P.useRef(null),w=P.useRef(null),k=P.useRef(null),l=P.useRef(r),u=P.useRef(""),[f,y]=P.useState([]),[d,S]=P.useState(!0),[E,O]=P.useState({thinking:!1,tool_use:!0,tool_result:!0}),C=P.useRef(new Set),m=P.useRef([]),[g,h]=P.useState("connecting"),[_,x]=P.useState(null);P.useEffect(()=>{l.current=r},[r]);const A=P.useMemo(()=>f.filter(M=>M.role==="user"?!0:!(M.contentType==="thinking"&&!E.thinking||M.contentType==="tool_use"&&!E.tool_use||M.contentType==="tool_result"&&!E.tool_result)),[f,E]);P.useEffect(()=>{m.current=A},[A]),P.useEffect(()=>{let M=!1;return Kw(i).then($=>{if(!M){const Z=$.messages??[],K=Z.length>yo?Z.slice(Z.length-yo):Z;y(K),C.current=new Set(K.map(pu))}}).finally(()=>{M||S(!1)}),()=>{M=!0}},[i]),P.useEffect(()=>{const M=av(i,$=>{try{const Z=JSON.parse($.data);if(Z.event!=="message")return;const K=Z.data;y(F=>{const X=pu(K);if(C.current.has(X))return F;C.current.add(X);const ee=[...F,K];if(ee.length>yo){const V=ee.length-yo,Q=ee.slice(V);for(let ae=0;ae<V;ae++)C.current.delete(pu(ee[ae]));return Q}return ee})}catch{}},a);return()=>M()},[i,a]),P.useEffect(()=>{if(!o.current)return;const M=new n4.Terminal({cursorBlink:!0,fontSize:13,fontFamily:'"JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace',theme:{background:"#000000",foreground:"#00ff88",cursor:"#00ff88",cursorAccent:"#000000",selectionBackground:"#00e5ff40"},convertEol:!0,scrollback:2e3}),$=new o4.FitAddon;M.loadAddon($),M.open(o.current),$.fit(),v.current=M,w.current=$;const Z=new ResizeObserver(()=>{var X;$.fit();const{cols:K,rows:F}=M;(X=k.current)==null||X.send({type:"resize",cols:K,rows:F})});return o.current&&Z.observe(o.current),()=>{Z.disconnect(),M.dispose(),v.current=null,w.current=null}},[]),P.useEffect(()=>{var Z;const M=v.current;if(!M||d)return;if(M.reset(),A.length>0){M.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),M.writeln("\x1B[33m║ SESSION TRANSCRIPT ║\x1B[0m"),M.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),M.writeln("");for(const K of A)M.writeln(Wp(K));M.writeln(""),M.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),M.writeln("\x1B[33m║ LIVE TERMINAL OUTPUT ║\x1B[0m"),M.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),M.writeln("")}const $=u.current;$&&M.write($),(Z=w.current)==null||Z.fit()},[A,d]),P.useEffect(()=>{const $=(()=>{const K=window.location.origin,F=`/v1/sessions/${encodeURIComponent(i)}/terminal`;return`${K.replace(/^http/,"ws")}${F}`})(),Z=new u4($,{onMessage:K=>{const F=K,X=v.current;if(X)switch(F.type){case"pane":{const ee=u.current,V=F.content;if(ee&&V.startsWith(ee))X.write(V.slice(ee.length));else{u.current=V;const Q=v.current;if(Q){if(Q.reset(),m.current.length>0){Q.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),Q.writeln("\x1B[33m║ SESSION TRANSCRIPT ║\x1B[0m"),Q.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),Q.writeln("");for(const ae of m.current)Q.writeln(Wp(ae));Q.writeln(""),Q.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),Q.writeln("\x1B[33m║ LIVE TERMINAL OUTPUT ║\x1B[0m"),Q.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),Q.writeln("")}Q.write(V)}}u.current=V,x(null);break}case"status":break;case"error":x(F.message);break}},onOpen:()=>{var F;h("connected"),x(null);const K=v.current;w.current&&K&&((F=k.current)==null||F.send({type:"resize",cols:K.cols,rows:K.rows}))},onReconnecting:()=>{h("reconnecting")},onGiveUp:()=>{h("disconnected")},onClose:()=>{h("disconnected")}},a??void 0);return k.current=Z,()=>{k.current=null,Z.close()}},[i,a]),P.useEffect(()=>{const M=v.current;if(!M)return;const $=M.onData(Z=>{var K;(K=k.current)==null||K.send({type:"input",text:Z})});return()=>{$.dispose()}},[]);const R=P.useCallback(M=>{O($=>({...$,[M]:!$[M]}))},[]),D=r==="working",T=g==="connected";return b.jsxs("div",{className:"flex flex-col h-full bg-[#111118] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[b.jsxs("div",{className:"flex items-center justify-between px-4 py-2 text-xs border-b border-[#1a1a2e] bg-[#0a0a0f] shrink-0 flex-wrap gap-2",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("span",{className:"text-[10px] text-[#555] uppercase tracking-wider",children:"Filter:"}),["thinking","tool_use","tool_result"].map(M=>b.jsx("button",{onClick:()=>R(M),"aria-pressed":E[M],className:`text-xs px-2 py-0.5 rounded border transition-colors ${E[M]?"border-[#00e5ff]/40 text-[#00e5ff] bg-[#00e5ff]/10":"border-[#1a1a2e] text-[#555] hover:text-[#888]"}`,children:M==="tool_use"?"Tools":M==="tool_result"?"Results":M},M)),b.jsxs("span",{className:"text-[10px] text-[#444]",children:[A.length," / ",f.length," messages"]})]}),b.jsxs("div",{className:"flex items-center gap-3 ml-auto",children:[b.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:T?"#00e5ff":g==="reconnecting"?"#ffaa00":"#666",boxShadow:T?"0 0 4px #00e5ff40":"none",animation:g==="reconnecting"?"pulse 1s ease-in-out infinite":"none"}}),b.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:g==="connecting"?"connecting…":g==="reconnecting"?"reconnecting…":g==="connected"?"ws live":"disconnected"})]}),b.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:D?"#00ff88":"#888",boxShadow:D?"0 0 4px #00ff88":"none"}}),b.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:D?"active":"idle"})]})]})]}),_&&b.jsx("div",{className:"px-4 py-2 text-xs text-[#ff3366] bg-[#ff336610] border-b border-[#ff336620]",children:_}),b.jsx("div",{ref:o,className:"flex-1 overflow-hidden"})]})}function bo(i){return i>=1e6?`${(i/1e6).toFixed(2)}M`:i>=1e3?`${(i/1e3).toFixed(1)}k`:i.toString()}function d4({metrics:i,loading:r}){if(r||!i)return b.jsx("div",{className:"flex items-center justify-center h-48 text-[#555] text-sm animate-pulse",children:"Loading metrics..."});const a=[{label:"Duration",value:TE(i.durationSec*1e3),icon:"⏱",color:"#3b82f6"},{label:"Messages",value:i.messages.toString(),icon:"💬",color:"#3b82f6"},{label:"Tool Calls",value:i.toolCalls.toString(),icon:"🔧",color:"#3b82f6"},{label:"Approvals",value:i.approvals.toString(),icon:"✅",color:"#10b981"},{label:"Auto-approvals",value:i.autoApprovals.toString(),icon:"⚡",color:"#f59e0b"},{label:"Status Changes",value:i.statusChanges.length.toString(),icon:"🔄",color:"#8888ff"}],o=i.tokenUsage;return b.jsxs("div",{className:"space-y-4",children:[b.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:a.map(v=>b.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors duration-150 hover:border-[#3b82f6]/30",children:[b.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[b.jsx("span",{className:"text-base",children:v.icon}),b.jsx("span",{className:"text-[10px] text-[#888] uppercase tracking-wider",children:v.label})]}),b.jsx("div",{className:"text-2xl font-semibold font-mono tabular-nums",style:{color:v.color},children:v.value})]},v.label))}),o&&b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-4",children:[b.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider mb-3",children:"Token Usage"}),b.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[b.jsxs("div",{className:"rounded border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsx("div",{className:"text-[10px] text-[#888] uppercase tracking-wider mb-1",children:"Input"}),b.jsx("div",{className:"text-lg font-mono font-semibold text-[#3b82f6]",children:bo(o.inputTokens)})]}),b.jsxs("div",{className:"rounded border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsx("div",{className:"text-[10px] text-[#888] uppercase tracking-wider mb-1",children:"Output"}),b.jsx("div",{className:"text-lg font-mono font-semibold text-[#10b981]",children:bo(o.outputTokens)})]}),b.jsxs("div",{className:"rounded border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsx("div",{className:"text-[10px] text-[#888] uppercase tracking-wider mb-1",children:"Cache Write"}),b.jsx("div",{className:"text-lg font-mono font-semibold text-[#f59e0b]",children:bo(o.cacheCreationTokens)})]}),b.jsxs("div",{className:"rounded border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsx("div",{className:"text-[10px] text-[#888] uppercase tracking-wider mb-1",children:"Cache Read"}),b.jsx("div",{className:"text-lg font-mono font-semibold text-[#f59e0b]",children:bo(o.cacheReadTokens)})]}),b.jsxs("div",{className:"rounded border border-[#1a1a2e] bg-[#001a1f] p-3",children:[b.jsx("div",{className:"text-[10px] text-[#888] uppercase tracking-wider mb-1",children:"Est. Cost"}),b.jsx("div",{className:"text-lg font-mono font-semibold text-[#00e5ff]",children:`$${o.estimatedCostUsd<.01?o.estimatedCostUsd.toFixed(4):o.estimatedCostUsd.toFixed(3)}`})]})]}),b.jsx("div",{className:"mt-2 text-[11px] text-[#444]",children:"Cost estimate uses Anthropic list prices (sonnet tier by default). Actual cost may vary by model and plan."})]}),i.statusChanges.length>0&&b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-4",children:[b.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider mb-3",children:"Status Changes"}),b.jsx("div",{className:"flex flex-wrap gap-2",children:i.statusChanges.map((v,w)=>b.jsx("div",{className:"text-xs font-mono text-[#555] bg-[#0a0a0f] px-2 py-1 rounded border border-[#1a1a2e]",children:v},w))})]})]})}function _u(i){return i===null?"--":`${Math.round(i)} ms`}function f4(i){return i===null?"0%":`${Math.min(100,Math.round(i/500*100))}%`}function m4({latency:i,loading:r}){var o,v,w;if(r)return b.jsx("div",{className:"flex items-center justify-center h-36 text-[#555] text-sm animate-pulse",children:"Loading latency metrics..."});if(!i||!i.aggregated)return b.jsx("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 text-sm text-[#888]",children:"No latency samples yet."});const a=[{label:"State Change Detection",latest:((o=i.realtime)==null?void 0:o.state_change_detection_ms)??null,avg:i.aggregated.state_change_detection_ms.avg,max:i.aggregated.state_change_detection_ms.max,count:i.aggregated.state_change_detection_ms.count},{label:"Channel Delivery",latest:null,avg:i.aggregated.channel_delivery_ms.avg,max:i.aggregated.channel_delivery_ms.max,count:i.aggregated.channel_delivery_ms.count},{label:"Permission Response",latest:((v=i.realtime)==null?void 0:v.permission_response_ms)??null,avg:i.aggregated.permission_response_ms.avg,max:i.aggregated.permission_response_ms.max,count:i.aggregated.permission_response_ms.count},{label:"Hook Processing",latest:((w=i.realtime)==null?void 0:w.hook_latency_ms)??null,avg:i.aggregated.hook_latency_ms.avg,max:i.aggregated.hook_latency_ms.max,count:i.aggregated.hook_latency_ms.count}];return b.jsxs("div",{className:"space-y-3",children:[b.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider",children:"Latency"}),b.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:a.map(k=>b.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4",children:[b.jsxs("div",{className:"flex items-center justify-between text-xs text-[#888] uppercase tracking-wider",children:[b.jsx("span",{children:k.label}),b.jsxs("span",{children:[k.count," sample",k.count===1?"":"s"]})]}),b.jsx("div",{className:"mt-3 h-1.5 rounded bg-[#1a1a2e] overflow-hidden",children:b.jsx("div",{className:"h-full bg-[#00e5ff]/70 transition-all duration-300",style:{width:f4(k.avg)}})}),b.jsxs("div",{className:"mt-3 grid grid-cols-3 gap-2 text-xs font-mono text-[#bbb]",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[#666] mb-1",children:"Latest"}),b.jsx("div",{className:"text-[#00e5ff]",children:_u(k.latest)})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[#666] mb-1",children:"Avg"}),b.jsx("div",{className:"text-[#00ff88]",children:_u(k.avg)})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[#666] mb-1",children:"Max"}),b.jsx("div",{className:"text-[#ffaa00]",children:_u(k.max)})]})]})]},k.label))})]})}const p4=new Set(["bypassPermissions","dontAsk","acceptEdits","plan","auto"]);function _4({prompt:i,permissionMode:r,onApprove:a,onReject:o}){const[v,w]=P.useState(!1);return r&&r!=="default"&&p4.has(r)?b.jsx("div",{className:"flex items-center gap-2 px-4 py-2 bg-[#003322]/50 border border-[#10b981]/30 rounded-lg text-sm",children:b.jsxs("span",{className:"text-[#10b981] font-semibold text-xs uppercase tracking-wider",children:["AUTO-APPROVED (",r,")"]})}):b.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 px-3 sm:px-4 py-3 bg-[#1a1a00]/60 border border-[#f59e0b]/40 rounded-lg",children:[b.jsxs("div",{className:"flex items-center gap-3 sm:gap-2 min-w-0",children:[b.jsx("span",{className:"text-[#f59e0b] text-lg shrink-0",children:"âš "}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("div",{className:"text-xs text-[#f59e0b] font-semibold uppercase tracking-wider mb-0.5",children:"Permission Required"}),b.jsxs("div",{className:`text-sm text-[#e0e0e0] font-mono cursor-pointer ${v?"":"truncate"}`,onClick:()=>w(!v),title:v?void 0:"Click to expand",children:[i,!v&&i.length>60&&b.jsx("span",{className:"text-[#888] ml-1",children:"..."})]})]})]}),b.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[b.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#10b981] border border-[#10b981]/30 transition-colors",children:"Approve"}),b.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ef4444] border border-[#ef4444]/30 transition-colors",children:"Reject"})]})]})}function v4({open:i,onClose:r,sessionId:a}){const o=P.useRef(null),v=P.useRef(null),[w,k]=P.useState(""),[l,u]=P.useState(""),[f,y]=P.useState(!1),[d,S]=P.useState(null),E=$i(m=>m.addToast),O=P.useCallback(()=>{k(""),u(""),S(null),y(!1),r()},[r]);P.useEffect(()=>{if(!i)return;const m=g=>{var h;g.key==="Escape"&&((h=o.current)==null||h.abort(),O())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[i,O]),P.useEffect(()=>{if(!i)return;const m=v.current;if(!m)return;const g='input, textarea, button, [tabindex]:not([tabindex="-1"])',h=_=>{if(_.key!=="Tab")return;const x=Array.from(m.querySelectorAll(g));if(x.length===0)return;const A=x[0],R=x[x.length-1];_.shiftKey?document.activeElement===A&&(_.preventDefault(),R.focus()):document.activeElement===R&&(_.preventDefault(),A.focus())};return m.addEventListener("keydown",h),()=>m.removeEventListener("keydown",h)},[i]);async function C(m){var h;if(m.preventDefault(),S(null),!w.trim()){S("Template name is required");return}y(!0),(h=o.current)==null||h.abort();const g=new AbortController;o.current=g;try{await fE({name:w.trim(),description:l.trim()||void 0,sessionId:a}),E("success","Template saved",`"${w.trim()}" created successfully`),O()}catch(_){if(g.signal.aborted)return;S(_ instanceof Error?_.message:"Failed to save template")}finally{o.current===g&&(o.current=null,y(!1))}}return i?b.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[b.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:O}),b.jsxs("div",{ref:v,role:"dialog","aria-modal":"true","aria-label":"Save session as template",className:"relative w-full max-w-md mx-4 bg-[#111118] border border-[#1a1a2e] rounded-lg shadow-2xl max-h-[90vh] overflow-y-auto",children:[b.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[b.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"Save as Template"}),b.jsx("button",{onClick:O,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:b.jsx(Gn,{className:"h-4 w-4"})})]}),b.jsxs("form",{onSubmit:C,className:"p-4 sm:p-5 space-y-4",children:[d&&b.jsx("div",{className:"p-3 rounded bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:d}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:"template-name",className:"block text-xs font-medium text-gray-300 mb-1.5",children:"Template Name *"}),b.jsx("input",{id:"template-name",type:"text",value:w,onChange:m=>k(m.target.value),placeholder:"My template name",className:"w-full px-3 py-2 text-sm rounded bg-[#0a0a0f] border border-[#1a1a2e] text-gray-100 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] transition-colors",disabled:f})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:"template-desc",className:"block text-xs font-medium text-gray-300 mb-1.5",children:"Description (optional)"}),b.jsx("textarea",{id:"template-desc",value:l,onChange:m=>u(m.target.value),placeholder:"What is this template for?",rows:3,className:"w-full px-3 py-2 text-sm rounded bg-[#0a0a0f] border border-[#1a1a2e] text-gray-100 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] transition-colors resize-none",disabled:f})]}),b.jsxs("div",{className:"flex gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:O,disabled:f,className:"flex-1 px-3 py-2 text-xs font-medium rounded bg-[#0a0a0f] border border-[#1a1a2e] text-gray-300 hover:text-gray-100 hover:border-[#333] transition-colors disabled:opacity-50",children:"Cancel"}),b.jsx("button",{type:"submit",disabled:f,className:"flex-1 px-3 py-2 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-50 flex items-center justify-center gap-2",children:f?b.jsxs(b.Fragment,{children:[b.jsx(In,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save Template"})]})]})]})]}):null}const g4=[{id:"session",label:"Session"},{id:"metrics",label:"Metrics"}],Xp=["/clear","/compact","/cost","/config"];function y4(){const{id:i}=u_(),r=No(),[a,o]=P.useState("session"),[v,w]=P.useState(!1),{session:k,health:l,notFound:u,loading:f,metrics:y,metricsLoading:d,latency:S,latencyLoading:E}=t4(i??""),[O,C]=P.useState(""),[m,g]=P.useState(!1),[h,_]=P.useState(Xp[0]),[x,A]=P.useState(!1),[R,D]=P.useState(""),[T,M]=P.useState(!1),[$,Z]=P.useState(!1),[K,F]=P.useState(!1),[X,ee]=P.useState(!1),[V,Q]=P.useState(null),ae=P.useRef(null),j=P.useRef(!1),U=$i(_e=>_e.addToast);if(f)return b.jsx("div",{className:"min-h-screen bg-[#0a0a0f] flex items-center justify-center text-[#555] text-sm",children:b.jsx("div",{className:"animate-pulse",children:"Loading session…"})});if(u||!k||!l)return b.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-[#555]",children:[b.jsx("div",{className:"text-6xl mb-4",children:"404"}),b.jsx("div",{className:"text-lg mb-6 text-[#e0e0e0]",children:"Session not found"}),b.jsx(di,{to:"/",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Overview"})]});const L=k,H=l,q=H.status==="permission_prompt"||H.status==="bash_approval";function W(){rv(L.id).catch(_e=>U("error","Approve failed",_e instanceof Error?_e.message:void 0))}function le(){Xw(L.id).catch(_e=>U("error","Reject failed",_e instanceof Error?_e.message:void 0))}function fe(){Eu(L.id).catch(_e=>U("error","Interrupt failed",_e instanceof Error?_e.message:void 0))}async function I(){try{const _e=await Qw(L.id,{name:void 0});U("success","Session forked",`New session ${_e.id.slice(0,8)} created`),r(`/sessions/${_e.id}`)}catch(_e){U("error","Fork failed",_e instanceof Error?_e.message:void 0)}}function B(){Jw(L.id).catch(_e=>U("error","Escape failed",_e instanceof Error?_e.message:void 0))}async function ie(){try{await wu(L.id),r("/")}catch(_e){U("error","Failed to kill session",_e instanceof Error?_e.message:void 0)}}async function ne(){if(!K){F(!0);try{const _e=await rE(L.id);Q({image:_e.image,mimeType:_e.mimeType,capturedAt:Date.now()}),U("success","Screenshot captured")}catch(_e){(typeof _e=="object"&&_e!==null&&"statusCode"in _e?_e.statusCode:void 0)===501?(ee(!0),U("warning","Screenshot unavailable","Playwright is not installed on the server.")):U("error","Screenshot failed",_e instanceof Error?_e.message:void 0)}finally{F(!1)}}}async function me(){var Rt;const _e=O.trim();if(_e&&!j.current){j.current=!0,g(!0);try{await Ww(L.id,_e),C("")}catch(mi){U("error","Failed to send message",mi instanceof Error?mi.message:void 0)}finally{g(!1),j.current=!1,(Rt=ae.current)==null||Rt.focus()}}}function pe(){var _e;C(h),(_e=ae.current)==null||_e.focus()}async function Ee(){if(!(!h||x)){A(!0);try{await iE(L.id,h),C("")}catch(_e){U("error","Failed to send slash command",_e instanceof Error?_e.message:void 0)}finally{A(!1)}}}async function je(){const _e=R.trim();if(!(!_e||$)){Z(!0);try{await sE(L.id,_e),D(""),M(!1)}catch(Rt){U("error","Failed to send bash command",Rt instanceof Error?Rt.message:void 0)}finally{Z(!1)}}}function Be(){R.trim()&&M(!0)}function st(_e){D(_e),T&&M(!1)}function Ce(_e){_e.key==="Enter"&&!_e.shiftKey&&(_e.preventDefault(),me())}return b.jsxs("div",{className:"min-h-screen bg-[#0a0a0f]",children:[b.jsxs("div",{className:"max-w-6xl mx-auto px-3 sm:px-4 py-3 sm:py-4 space-y-3 sm:space-y-4",children:[b.jsxs("nav",{className:"text-xs text-[#555] flex items-center gap-1",children:[b.jsx(di,{to:"/",className:"hover:text-[#00e5ff] transition-colors",children:"Overview"}),b.jsx("span",{className:"text-[#333]",children:"/"}),b.jsx("span",{className:"text-[#e0e0e0] truncate max-w-[160px] sm:max-w-xs",children:L.windowName||L.id})]}),b.jsx(s4,{session:L,health:H,onApprove:W,onReject:le,onInterrupt:fe,onFork:I,onKill:ie,onSaveTemplate:()=>w(!0)}),b.jsx("div",{className:"flex border-b border-[#1a1a2e]",role:"tablist",children:g4.map(_e=>b.jsxs("button",{id:`tab-${_e.id}`,onClick:()=>o(_e.id),role:"tab","aria-selected":a===_e.id,"aria-controls":`panel-${_e.id}`,tabIndex:a===_e.id?0:-1,className:`flex-1 min-h-[44px] text-sm font-medium transition-colors relative ${a===_e.id?"text-[#00e5ff]":"text-[#555] hover:text-[#888]"}`,children:[_e.label,a===_e.id&&b.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-[#00e5ff]"})]},_e.id))}),b.jsxs("div",{className:"bg-[#0a0a0f] rounded-lg min-h-[300px] sm:min-h-[400px]",children:[q&&b.jsx("div",{className:"p-3 sm:p-4 pb-0",children:b.jsx(_4,{prompt:H.details,permissionMode:L.permissionMode,onApprove:W,onReject:le})}),a==="session"&&b.jsx("div",{id:"panel-session",role:"tabpanel","aria-labelledby":"tab-session",tabIndex:0,className:"h-[calc(100vh-380px)] sm:h-[calc(100vh-420px)] min-h-[250px] sm:min-h-[300px]",children:b.jsx(h4,{sessionId:L.id,status:H.status})}),a==="metrics"&&b.jsxs("div",{id:"panel-metrics",role:"tabpanel","aria-labelledby":"tab-metrics",tabIndex:0,className:"p-3 sm:p-4",children:[b.jsx(d4,{metrics:y,loading:d}),b.jsx("div",{className:"mt-4",children:b.jsx(m4,{latency:S,loading:E})})]})]}),b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("label",{htmlFor:"session-message-input",className:"sr-only",children:"Session message input"}),b.jsx("input",{id:"session-message-input",ref:ae,type:"text",value:O,onChange:_e=>C(_e.target.value),onKeyDown:Ce,placeholder:"Send a message to Claude…",disabled:m||!H.alive,className:"flex-1 min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] font-mono disabled:opacity-50"}),b.jsx("button",{onClick:me,disabled:m||!O.trim()||!H.alive,className:"min-h-[44px] min-w-[44px] flex items-center justify-center p-2.5 rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Send message",children:b.jsx(bu,{className:"h-4 w-4"})})]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#1a1a2e]/50",children:[b.jsx("label",{className:"sr-only",htmlFor:"slash-command-select",children:"Common slash command"}),b.jsx("select",{id:"slash-command-select",value:h,onChange:_e=>_(_e.target.value),disabled:x||!H.alive,className:"min-h-[44px] rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs font-medium text-gray-200 focus:outline-none focus:border-[#00e5ff] disabled:opacity-50",children:Xp.map(_e=>b.jsx("option",{value:_e,children:_e},_e))}),b.jsx("button",{onClick:pe,disabled:x||!H.alive,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Insert selected slash command into the message input",children:"Insert Slash"}),b.jsx("button",{onClick:Ee,disabled:x||!H.alive,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#002a33] hover:bg-[#003744] text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Send selected slash command immediately",children:x?"Sending Slash…":"Run Slash"}),b.jsx("label",{className:"sr-only",htmlFor:"bash-command-input",children:"Bash command"}),b.jsx("input",{id:"bash-command-input",type:"text",value:R,onChange:_e=>st(_e.target.value),placeholder:"Bash command (requires confirmation)…",disabled:$||!H.alive,className:"min-h-[44px] min-w-[220px] flex-1 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#ffaa00] font-mono disabled:opacity-50"}),T?b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"text-[11px] text-[#ffaa00] italic",children:"Confirm bash command execution."}),b.jsx("button",{onClick:je,disabled:$||!R.trim()||!H.alive,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#3a2e00] hover:bg-[#4a3900] text-[#ffaa00] border border-[#ffaa00]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Send bash command",children:$?"Sending Bash…":"Confirm Bash"}),b.jsx("button",{onClick:()=>M(!1),disabled:$,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:"Cancel Bash"})]}):b.jsx("button",{onClick:Be,disabled:$||!R.trim()||!H.alive,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#2b2200] hover:bg-[#3a2e00] text-[#ffaa00] border border-[#ffaa00]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Review bash command before sending",children:"Review Bash"}),!X&&b.jsxs("button",{onClick:ne,disabled:K||!H.alive,className:"flex items-center gap-1.5 min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",title:"Capture screenshot",children:[b.jsx(x_,{className:"h-3.5 w-3.5"}),K?"Capturing…":"Screenshot"]}),b.jsxs("button",{onClick:fe,"aria-label":"Interrupt session with Ctrl+C",className:"flex items-center gap-1.5 min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors",title:"Interrupt (Ctrl+C)",children:[b.jsx(e1,{className:"h-3.5 w-3.5"}),"Interrupt"]}),b.jsxs("button",{onClick:B,"aria-label":"Send Escape to session",className:"flex items-center gap-1.5 min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors",title:"Send Escape",children:[b.jsx(Ub,{className:"h-3.5 w-3.5"}),"Escape"]})]}),V&&b.jsxs("div",{className:"mt-3 rounded-lg border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[b.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:"Latest screenshot"}),b.jsx("span",{className:"text-[11px] text-gray-500",children:new Date(V.capturedAt).toLocaleTimeString()})]}),b.jsx("img",{src:V.image,alt:"Session screenshot preview",className:"max-h-[420px] w-full rounded border border-[#1a1a2e] object-contain bg-black"}),b.jsx("div",{className:"mt-2 text-[11px] text-gray-500",children:V.mimeType??"image/png"})]})]})]}),b.jsx(v4,{open:v,onClose:()=>w(!1),sessionId:i??""})]})}const b4={running:"bg-cyan/10 text-cyan border-cyan/30",completed:"bg-emerald-400/10 text-emerald-400 border-emerald-400/30",failed:"bg-red-400/10 text-red-400 border-red-400/30",pending:"bg-gray-500/10 text-gray-400 border-gray-500/30"},S4=new Set(["running"]);function dv({status:i}){const r=b4[i]??"bg-gray-500/10 text-gray-500 border-gray-500/30",a=S4.has(i);return b.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${r}`,children:[a&&b.jsxs("span",{className:"relative flex h-2 w-2",children:[b.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75 bg-current"}),b.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]}),i]})}let x4=0;function zn(){return{workDir:"",name:"",prompt:"",_key:x4++}}function C4({open:i,onClose:r}){const a=No(),o=P.useRef(null),v=P.useRef(null),[w,k]=P.useState(""),[l,u]=P.useState([zn(),zn()]),[f,y]=P.useState(!1),[d,S]=P.useState(null),E=P.useCallback(()=>{O(),r()},[r]);function O(){k(""),u([zn(),zn()]),y(!1),S(null)}P.useEffect(()=>{if(!i)return;const x=A=>{A.key==="Escape"&&E()};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[i,E]),P.useEffect(()=>{if(!i)return;const x=o.current;if(!x)return;const A='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',R=D=>{if(D.key!=="Tab")return;const T=Array.from(x.querySelectorAll(A));if(T.length===0)return;const M=T[0],$=T[T.length-1];D.shiftKey?document.activeElement===M&&(D.preventDefault(),$.focus()):document.activeElement===$&&(D.preventDefault(),M.focus())};return x.addEventListener("keydown",R),()=>x.removeEventListener("keydown",R)},[i]),P.useEffect(()=>{if(i){const x=setTimeout(()=>{var A;return(A=v.current)==null?void 0:A.focus()},50);return()=>clearTimeout(x)}},[i]);function C(){l.length>=10||u([...l,zn()])}function m(x){l.length<=1||u(l.filter((A,R)=>R!==x))}function g(x,A,R){u(l.map((D,T)=>T===x?{...D,[A]:R}:D))}async function h(x){x.preventDefault(),S(null);const A=l.filter(R=>R.workDir.trim());if(!w.trim()){S("Pipeline name is required");return}if(A.length===0){S("At least one step with a working directory is required");return}y(!0);try{const R=await aE({name:w.trim(),workDir:A[0].workDir.trim(),stages:A.map(D=>({workDir:D.workDir.trim(),name:D.name.trim()||void 0,prompt:D.prompt.trim()||void 0}))});O(),r(),a(`/pipelines/${R.id}`)}catch(R){S(R instanceof Error?R.message:"Failed to create pipeline")}finally{y(!1)}}if(!i)return null;const _=w.trim()&&l.some(x=>x.workDir.trim());return b.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[b.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:E}),b.jsxs("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":"Create new pipeline",className:"relative w-full max-w-2xl mx-4 bg-[#111118] border border-[#1a1a2e] rounded-lg shadow-2xl max-h-[90vh] overflow-y-auto",children:[b.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[b.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Pipeline"}),b.jsx("button",{onClick:E,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:b.jsx(Gn,{className:"h-4 w-4"})})]}),b.jsxs("form",{onSubmit:h,className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Pipeline Name ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("input",{type:"text",ref:v,value:w,onChange:x=>k(x.target.value),placeholder:"my-pipeline","aria-label":"Pipeline Name",className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"})]}),b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[b.jsxs("span",{children:["Working Directory ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("span",{children:"Name"}),b.jsx("span",{children:"Prompt"}),b.jsx("span",{})]}),b.jsx("div",{className:"space-y-2",children:l.map((x,A)=>b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[b.jsx("input",{type:"text",value:x.workDir,onChange:R=>g(A,"workDir",R.target.value),placeholder:"/home/user/project",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6] font-mono"}),b.jsx("input",{type:"text",value:x.name,onChange:R=>g(A,"name",R.target.value),placeholder:"name",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"}),b.jsx("input",{type:"text",value:x.prompt,onChange:R=>g(A,"prompt",R.target.value),placeholder:"Initial prompt...",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"}),b.jsx("button",{type:"button",onClick:()=>m(A),disabled:l.length<=1,"aria-label":`Remove step ${A+1}`,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ef4444] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:b.jsx(ju,{className:"h-3.5 w-3.5"})})]},x._key))}),l.length<10&&b.jsxs("button",{type:"button",onClick:C,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[b.jsx(Vn,{className:"h-3.5 w-3.5"}),"Add Step"]}),d&&b.jsx("div",{className:"text-xs text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-2",children:d}),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:E,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Cancel"}),b.jsxs("button",{type:"submit",disabled:f||!_,className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#3b82f6]/10 hover:bg-[#3b82f6]/20 text-[#3b82f6] border border-[#3b82f6]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[f&&b.jsx(In,{className:"h-3 w-3 animate-spin"}),"Create Pipeline"]})]})]})]})]})}const w4=5e3,E4=3e4,k4=6e4;function T4(){const[i,r]=P.useState([]),[a,o]=P.useState(!0),[v,w]=P.useState(!1),k=Fe(y=>y.sseConnected),l=$i(y=>y.addToast),u=P.useCallback(async()=>{try{const y=await oE();return r(y),!0}catch(y){return l("error","Failed to fetch pipelines",y instanceof Error?y.message:void 0),!1}finally{o(!1)}},[l]);P.useEffect(()=>{let y,d=!1,S=0;const E=async()=>{if(d)return;const O=await u();if(d)return;const C=k?E4:w4;let m=C;if(O)S=0;else{S+=1;const g=2**S;m=Math.min(C*g,k4)}y=setTimeout(()=>{E()},m)};return E(),()=>{d=!0,y&&clearTimeout(y)}},[u,k]);const f={total:i.length,running:i.filter(y=>y.status==="running").length,completed:i.filter(y=>y.status==="completed").length,failed:i.filter(y=>y.status==="failed").length};return a?b.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:b.jsx("div",{className:"animate-pulse",children:"Loading pipelines…"})}):b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Pipelines"}),b.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Manage and monitor session pipelines"})]}),b.jsxs("button",{onClick:()=>w(!0),className:"flex items-center gap-1.5 px-3 py-2 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors",children:[b.jsx(Vn,{className:"h-3.5 w-3.5"}),"New Pipeline"]})]}),b.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[b.jsx(ut,{label:"Total",value:f.total}),b.jsx(ut,{label:"Running",value:f.running}),b.jsx(ut,{label:"Completed",value:f.completed}),b.jsx(ut,{label:"Failed",value:f.failed})]}),i.length===0?b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:[b.jsx("p",{className:"text-gray-500",children:"No pipelines yet"}),b.jsx("p",{className:"mt-1 text-xs text-gray-600",children:"Create a pipeline to run sessions in sequence"})]}):b.jsx("div",{className:"space-y-3",children:i.map(y=>b.jsx(di,{to:`/pipelines/${y.id}`,className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 hover:border-[#00e5ff]/30 transition-colors",children:b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[b.jsx("span",{className:"font-medium text-gray-200 truncate",children:y.name}),b.jsx(dv,{status:y.status})]}),b.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 shrink-0 ml-4",children:[b.jsxs("span",{children:[y.stages.length," step",y.stages.length!==1?"s":""]}),b.jsx("span",{children:Zs(y.createdAt)})]})]})},y.id))}),b.jsx(C4,{open:v,onClose:()=>w(!1)})]})}const A4=3e3,R4=3e4,D4=6e4,O4=new Set(["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"]);function N4(i){return O4.has(i)}function M4(){const{id:i}=u_(),[r,a]=P.useState(null),[o,v]=P.useState(!0),[w,k]=P.useState(!1),l=Fe(y=>y.sseConnected),u=$i(y=>y.addToast),f=P.useCallback(async()=>{if(!i)return!1;try{const y=await lE(i);return a(y),k(!1),!0}catch(y){return y instanceof Error&&"statusCode"in y&&y.statusCode===404?k(!0):u("error","Failed to fetch pipeline",y instanceof Error?y.message:void 0),!1}finally{v(!1)}},[i,u]);return P.useEffect(()=>{let y,d=!1,S=0;const E=async()=>{if(d)return;const O=await f();if(d)return;const C=l?R4:A4;let m=C;if(O)S=0;else{S+=1;const g=2**S;m=Math.min(C*g,D4)}y=setTimeout(()=>{E()},m)};return E(),()=>{d=!0,y&&clearTimeout(y)}},[f,l]),o?b.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:b.jsx("div",{className:"animate-pulse",children:"Loading pipeline…"})}):w||!r?b.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[50vh] text-gray-500",children:[b.jsx("div",{className:"text-6xl mb-4",children:"404"}),b.jsx("div",{className:"text-lg mb-6 text-gray-200",children:"Pipeline not found"}),b.jsx(di,{to:"/pipelines",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Pipelines"})]}):b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("nav",{className:"text-xs text-gray-500 flex items-center gap-1",children:[b.jsx(di,{to:"/pipelines",className:"hover:text-[#00e5ff] transition-colors",children:"Pipelines"}),b.jsx("span",{className:"text-gray-700",children:"/"}),b.jsx("span",{className:"text-gray-200 truncate max-w-xs",children:r.name})]}),b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:r.name}),b.jsx(dv,{status:r.status})]}),b.jsxs("div",{className:"text-xs text-gray-500",children:["Created ",Zs(r.createdAt)]})]}),b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118]",children:[b.jsx("div",{className:"px-4 py-3 border-b border-void-lighter",children:b.jsxs("h3",{className:"text-sm font-semibold text-gray-200",children:["Steps (",r.stages.length,")"]})}),r.stages.length===0?b.jsx("div",{className:"p-8 text-center text-gray-500 text-sm",children:"No steps yet"}):b.jsxs("table",{className:"w-full text-left text-sm",children:[b.jsx("thead",{children:b.jsxs("tr",{className:"border-b border-void-lighter text-gray-600",children:[b.jsx("th",{className:"px-4 py-3 font-medium w-16",children:"#"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Session"})]})}),b.jsx("tbody",{children:r.stages.map((y,d)=>b.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[b.jsxs("td",{className:"px-4 py-3 text-gray-500 font-mono text-xs",children:["#",d+1]}),b.jsx("td",{className:"px-4 py-3",children:b.jsx(Po,{status:N4(y.status)?y.status:"unknown"})}),b.jsx("td",{className:"px-4 py-3",children:y.sessionId?b.jsx(di,{to:`/sessions/${encodeURIComponent(y.sessionId)}`,className:"font-medium text-gray-200 hover:text-cyan transition-colors",children:y.name}):b.jsx("span",{className:"font-medium text-gray-200",children:y.name})}),b.jsx("td",{className:"px-4 py-3 font-mono text-xs text-gray-400",children:y.sessionId??"—"})]},y.name))})]})]})]})}function L4(){return b.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 text-center",children:[b.jsx("h1",{className:"text-6xl font-bold text-gray-500",children:"404"}),b.jsx("p",{className:"text-lg text-gray-400",children:"Page not found"}),b.jsx(di,{to:"/",className:"mt-2 rounded-lg bg-cyan px-4 py-2 text-sm font-medium text-void transition-colors hover:bg-cyan/80",children:"Back to Dashboard"})]})}function j4(){return b.jsx(bb,{children:b.jsx(Py,{children:b.jsxs(_s,{element:b.jsx(EE,{}),children:[b.jsx(_s,{path:"/",element:b.jsx(e4,{})}),b.jsx(_s,{path:"/auth/keys",element:b.jsx(NE,{})}),b.jsx(_s,{path:"/sessions/:id",element:b.jsx(y4,{})}),b.jsx(_s,{path:"/pipelines",element:b.jsx(T4,{})}),b.jsx(_s,{path:"/pipelines/:id",element:b.jsx(M4,{})}),b.jsx(_s,{path:"*",element:b.jsx(L4,{})})]})})})}P0.createRoot(document.getElementById("root")).render(b.jsx(Hn.StrictMode,{children:b.jsx(hb,{basename:"/dashboard",children:b.jsx(j4,{})})}));
|
|
312
|
+
`)[0].slice(0,200)+(i.text.length>200?"…":"");return`${v} ${w}`}function h4({sessionId:i,status:r}){const a=Fe(M=>M.token),o=P.useRef(null),v=P.useRef(null),w=P.useRef(null),k=P.useRef(null),l=P.useRef(r),u=P.useRef(""),[f,y]=P.useState([]),[d,S]=P.useState(!0),[E,O]=P.useState({thinking:!1,tool_use:!0,tool_result:!0}),C=P.useRef(new Set),m=P.useRef([]),[g,h]=P.useState("connecting"),[_,x]=P.useState(null);P.useEffect(()=>{l.current=r},[r]);const A=P.useMemo(()=>f.filter(M=>M.role==="user"?!0:!(M.contentType==="thinking"&&!E.thinking||M.contentType==="tool_use"&&!E.tool_use||M.contentType==="tool_result"&&!E.tool_result)),[f,E]);P.useEffect(()=>{m.current=A},[A]),P.useEffect(()=>{let M=!1;return Kw(i).then($=>{if(!M){const Z=$.messages??[],K=Z.length>yo?Z.slice(Z.length-yo):Z;y(K),C.current=new Set(K.map(pu))}}).finally(()=>{M||S(!1)}),()=>{M=!0}},[i]),P.useEffect(()=>{const M=av(i,$=>{try{const Z=JSON.parse($.data);if(Z.event!=="message")return;const K=Z.data;y(F=>{const X=pu(K);if(C.current.has(X))return F;C.current.add(X);const ee=[...F,K];if(ee.length>yo){const V=ee.length-yo,Q=ee.slice(V);for(let ae=0;ae<V;ae++)C.current.delete(pu(ee[ae]));return Q}return ee})}catch{}},a);return()=>M()},[i,a]),P.useEffect(()=>{if(!o.current)return;const M=new n4.Terminal({cursorBlink:!0,fontSize:13,fontFamily:'"JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace',theme:{background:"#000000",foreground:"#00ff88",cursor:"#00ff88",cursorAccent:"#000000",selectionBackground:"#00e5ff40"},convertEol:!0,scrollback:2e3}),$=new o4.FitAddon;M.loadAddon($),M.open(o.current),$.fit(),v.current=M,w.current=$;const Z=new ResizeObserver(()=>{var X;$.fit();const{cols:K,rows:F}=M;(X=k.current)==null||X.send({type:"resize",cols:K,rows:F})});return o.current&&Z.observe(o.current),()=>{Z.disconnect(),M.dispose(),v.current=null,w.current=null}},[]),P.useEffect(()=>{var Z;const M=v.current;if(!M||d)return;if(M.reset(),A.length>0){M.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),M.writeln("\x1B[33m║ SESSION TRANSCRIPT ║\x1B[0m"),M.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),M.writeln("");for(const K of A)M.writeln(Wp(K));M.writeln(""),M.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),M.writeln("\x1B[33m║ LIVE TERMINAL OUTPUT ║\x1B[0m"),M.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),M.writeln("")}const $=u.current;$&&M.write($),(Z=w.current)==null||Z.fit()},[A,d]),P.useEffect(()=>{const $=(()=>{const K=window.location.origin,F=`/v1/sessions/${encodeURIComponent(i)}/terminal`;return`${K.replace(/^http/,"ws")}${F}`})(),Z=new u4($,{onMessage:K=>{const F=K,X=v.current;if(X)switch(F.type){case"pane":{const ee=u.current,V=F.content;if(ee&&V.startsWith(ee))X.write(V.slice(ee.length));else{u.current=V;const Q=v.current;if(Q){if(Q.reset(),m.current.length>0){Q.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),Q.writeln("\x1B[33m║ SESSION TRANSCRIPT ║\x1B[0m"),Q.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),Q.writeln("");for(const ae of m.current)Q.writeln(Wp(ae));Q.writeln(""),Q.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),Q.writeln("\x1B[33m║ LIVE TERMINAL OUTPUT ║\x1B[0m"),Q.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),Q.writeln("")}Q.write(V)}}u.current=V,x(null);break}case"status":break;case"error":x(F.message);break}},onOpen:()=>{var F;h("connected"),x(null);const K=v.current;w.current&&K&&((F=k.current)==null||F.send({type:"resize",cols:K.cols,rows:K.rows}))},onReconnecting:()=>{h("reconnecting")},onGiveUp:()=>{h("disconnected")},onClose:()=>{h("disconnected")}},a??void 0);return k.current=Z,()=>{k.current=null,Z.close()}},[i,a]),P.useEffect(()=>{const M=v.current;if(!M)return;const $=M.onData(Z=>{var K;(K=k.current)==null||K.send({type:"input",text:Z})});return()=>{$.dispose()}},[]);const R=P.useCallback(M=>{O($=>({...$,[M]:!$[M]}))},[]),D=r==="working",T=g==="connected";return b.jsxs("div",{className:"flex flex-col h-full bg-[#111118] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[b.jsxs("div",{className:"flex items-center justify-between px-4 py-2 text-xs border-b border-[#1a1a2e] bg-[#0a0a0f] shrink-0 flex-wrap gap-2",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("span",{className:"text-[10px] text-[#555] uppercase tracking-wider",children:"Filter:"}),["thinking","tool_use","tool_result"].map(M=>b.jsx("button",{onClick:()=>R(M),"aria-pressed":E[M],className:`text-xs px-2 py-0.5 rounded border transition-colors ${E[M]?"border-[#00e5ff]/40 text-[#00e5ff] bg-[#00e5ff]/10":"border-[#1a1a2e] text-[#555] hover:text-[#888]"}`,children:M==="tool_use"?"Tools":M==="tool_result"?"Results":M},M)),b.jsxs("span",{className:"text-[10px] text-[#444]",children:[A.length," / ",f.length," messages"]})]}),b.jsxs("div",{className:"flex items-center gap-3 ml-auto",children:[b.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:T?"#00e5ff":g==="reconnecting"?"#ffaa00":"#666",boxShadow:T?"0 0 4px #00e5ff40":"none",animation:g==="reconnecting"?"pulse 1s ease-in-out infinite":"none"}}),b.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:g==="connecting"?"connecting…":g==="reconnecting"?"reconnecting…":g==="connected"?"ws live":"disconnected"})]}),b.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:D?"#00ff88":"#888",boxShadow:D?"0 0 4px #00ff88":"none"}}),b.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:D?"active":"idle"})]})]})]}),_&&b.jsx("div",{className:"px-4 py-2 text-xs text-[#ff3366] bg-[#ff336610] border-b border-[#ff336620]",children:_}),b.jsx("div",{ref:o,className:"flex-1 overflow-hidden"})]})}function bo(i){return i>=1e6?`${(i/1e6).toFixed(2)}M`:i>=1e3?`${(i/1e3).toFixed(1)}k`:i.toString()}function d4({metrics:i,loading:r}){if(r||!i)return b.jsx("div",{className:"flex items-center justify-center h-48 text-[#555] text-sm animate-pulse",children:"Loading metrics..."});const a=[{label:"Duration",value:TE(i.durationSec*1e3),icon:"⏱",color:"#3b82f6"},{label:"Messages",value:i.messages.toString(),icon:"💬",color:"#3b82f6"},{label:"Tool Calls",value:i.toolCalls.toString(),icon:"🔧",color:"#3b82f6"},{label:"Approvals",value:i.approvals.toString(),icon:"✅",color:"#10b981"},{label:"Auto-approvals",value:i.autoApprovals.toString(),icon:"⚡",color:"#f59e0b"},{label:"Status Changes",value:i.statusChanges.length.toString(),icon:"🔄",color:"#8888ff"}],o=i.tokenUsage;return b.jsxs("div",{className:"space-y-4",children:[b.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:a.map(v=>b.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors duration-150 hover:border-[#3b82f6]/30",children:[b.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[b.jsx("span",{className:"text-base",children:v.icon}),b.jsx("span",{className:"text-[10px] text-[#888] uppercase tracking-wider",children:v.label})]}),b.jsx("div",{className:"text-2xl font-semibold font-mono tabular-nums",style:{color:v.color},children:v.value})]},v.label))}),o&&b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-4",children:[b.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider mb-3",children:"Token Usage"}),b.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[b.jsxs("div",{className:"rounded border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsx("div",{className:"text-[10px] text-[#888] uppercase tracking-wider mb-1",children:"Input"}),b.jsx("div",{className:"text-lg font-mono font-semibold text-[#3b82f6]",children:bo(o.inputTokens)})]}),b.jsxs("div",{className:"rounded border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsx("div",{className:"text-[10px] text-[#888] uppercase tracking-wider mb-1",children:"Output"}),b.jsx("div",{className:"text-lg font-mono font-semibold text-[#10b981]",children:bo(o.outputTokens)})]}),b.jsxs("div",{className:"rounded border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsx("div",{className:"text-[10px] text-[#888] uppercase tracking-wider mb-1",children:"Cache Write"}),b.jsx("div",{className:"text-lg font-mono font-semibold text-[#f59e0b]",children:bo(o.cacheCreationTokens)})]}),b.jsxs("div",{className:"rounded border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsx("div",{className:"text-[10px] text-[#888] uppercase tracking-wider mb-1",children:"Cache Read"}),b.jsx("div",{className:"text-lg font-mono font-semibold text-[#f59e0b]",children:bo(o.cacheReadTokens)})]}),b.jsxs("div",{className:"rounded border border-[#1a1a2e] bg-[#001a1f] p-3",children:[b.jsx("div",{className:"text-[10px] text-[#888] uppercase tracking-wider mb-1",children:"Est. Cost"}),b.jsx("div",{className:"text-lg font-mono font-semibold text-[#00e5ff]",children:`$${o.estimatedCostUsd<.01?o.estimatedCostUsd.toFixed(4):o.estimatedCostUsd.toFixed(3)}`})]})]}),b.jsx("div",{className:"mt-2 text-[11px] text-[#444]",children:"Cost estimate uses Anthropic list prices (sonnet tier by default). Actual cost may vary by model and plan."})]}),i.statusChanges.length>0&&b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-4",children:[b.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider mb-3",children:"Status Changes"}),b.jsx("div",{className:"flex flex-wrap gap-2",children:i.statusChanges.map((v,w)=>b.jsx("div",{className:"text-xs font-mono text-[#555] bg-[#0a0a0f] px-2 py-1 rounded border border-[#1a1a2e]",children:v},w))})]})]})}function _u(i){return i===null?"--":`${Math.round(i)} ms`}function f4(i){return i===null?"0%":`${Math.min(100,Math.round(i/500*100))}%`}function m4({latency:i,loading:r}){var o,v,w;if(r)return b.jsx("div",{className:"flex items-center justify-center h-36 text-[#555] text-sm animate-pulse",children:"Loading latency metrics..."});if(!i||!i.aggregated)return b.jsx("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 text-sm text-[#888]",children:"No latency samples yet."});const a=[{label:"State Change Detection",latest:((o=i.realtime)==null?void 0:o.state_change_detection_ms)??null,avg:i.aggregated.state_change_detection_ms.avg,max:i.aggregated.state_change_detection_ms.max,count:i.aggregated.state_change_detection_ms.count},{label:"Channel Delivery",latest:null,avg:i.aggregated.channel_delivery_ms.avg,max:i.aggregated.channel_delivery_ms.max,count:i.aggregated.channel_delivery_ms.count},{label:"Permission Response",latest:((v=i.realtime)==null?void 0:v.permission_response_ms)??null,avg:i.aggregated.permission_response_ms.avg,max:i.aggregated.permission_response_ms.max,count:i.aggregated.permission_response_ms.count},{label:"Hook Processing",latest:((w=i.realtime)==null?void 0:w.hook_latency_ms)??null,avg:i.aggregated.hook_latency_ms.avg,max:i.aggregated.hook_latency_ms.max,count:i.aggregated.hook_latency_ms.count}];return b.jsxs("div",{className:"space-y-3",children:[b.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider",children:"Latency"}),b.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:a.map(k=>b.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4",children:[b.jsxs("div",{className:"flex items-center justify-between text-xs text-[#888] uppercase tracking-wider",children:[b.jsx("span",{children:k.label}),b.jsxs("span",{children:[k.count," sample",k.count===1?"":"s"]})]}),b.jsx("div",{className:"mt-3 h-1.5 rounded bg-[#1a1a2e] overflow-hidden",children:b.jsx("div",{className:"h-full bg-[#00e5ff]/70 transition-all duration-300",style:{width:f4(k.avg)}})}),b.jsxs("div",{className:"mt-3 grid grid-cols-3 gap-2 text-xs font-mono text-[#bbb]",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[#666] mb-1",children:"Latest"}),b.jsx("div",{className:"text-[#00e5ff]",children:_u(k.latest)})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[#666] mb-1",children:"Avg"}),b.jsx("div",{className:"text-[#00ff88]",children:_u(k.avg)})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[#666] mb-1",children:"Max"}),b.jsx("div",{className:"text-[#ffaa00]",children:_u(k.max)})]})]})]},k.label))})]})}const p4=new Set(["bypassPermissions","dontAsk","acceptEdits","plan","auto"]);function _4({prompt:i,permissionMode:r,onApprove:a,onReject:o}){const[v,w]=P.useState(!1);return r&&r!=="default"&&p4.has(r)?b.jsx("div",{className:"flex items-center gap-2 px-4 py-2 bg-[#003322]/50 border border-[#10b981]/30 rounded-lg text-sm",children:b.jsxs("span",{className:"text-[#10b981] font-semibold text-xs uppercase tracking-wider",children:["AUTO-APPROVED (",r,")"]})}):b.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 px-3 sm:px-4 py-3 bg-[#1a1a00]/60 border border-[#f59e0b]/40 rounded-lg",children:[b.jsxs("div",{className:"flex items-center gap-3 sm:gap-2 min-w-0",children:[b.jsx("span",{className:"text-[#f59e0b] text-lg shrink-0",children:"âš "}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("div",{className:"text-xs text-[#f59e0b] font-semibold uppercase tracking-wider mb-0.5",children:"Permission Required"}),b.jsxs("div",{className:`text-sm text-[#e0e0e0] font-mono cursor-pointer ${v?"":"truncate"}`,onClick:()=>w(!v),title:v?void 0:"Click to expand",children:[i,!v&&i.length>60&&b.jsx("span",{className:"text-[#888] ml-1",children:"..."})]})]})]}),b.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[b.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#10b981] border border-[#10b981]/30 transition-colors",children:"Approve"}),b.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ef4444] border border-[#ef4444]/30 transition-colors",children:"Reject"})]})]})}function v4({open:i,onClose:r,sessionId:a}){const o=P.useRef(null),v=P.useRef(null),[w,k]=P.useState(""),[l,u]=P.useState(""),[f,y]=P.useState(!1),[d,S]=P.useState(null),E=$i(m=>m.addToast),O=P.useCallback(()=>{k(""),u(""),S(null),y(!1),r()},[r]);P.useEffect(()=>{if(!i)return;const m=g=>{var h;g.key==="Escape"&&((h=o.current)==null||h.abort(),O())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[i,O]),P.useEffect(()=>{if(!i)return;const m=v.current;if(!m)return;const g='input, textarea, button, [tabindex]:not([tabindex="-1"])',h=_=>{if(_.key!=="Tab")return;const x=Array.from(m.querySelectorAll(g));if(x.length===0)return;const A=x[0],R=x[x.length-1];_.shiftKey?document.activeElement===A&&(_.preventDefault(),R.focus()):document.activeElement===R&&(_.preventDefault(),A.focus())};return m.addEventListener("keydown",h),()=>m.removeEventListener("keydown",h)},[i]);async function C(m){var h;if(m.preventDefault(),S(null),!w.trim()){S("Template name is required");return}y(!0),(h=o.current)==null||h.abort();const g=new AbortController;o.current=g;try{await fE({name:w.trim(),description:l.trim()||void 0,sessionId:a}),E("success","Template saved",`"${w.trim()}" created successfully`),O()}catch(_){if(g.signal.aborted)return;S(_ instanceof Error?_.message:"Failed to save template")}finally{o.current===g&&(o.current=null,y(!1))}}return i?b.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[b.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:O}),b.jsxs("div",{ref:v,role:"dialog","aria-modal":"true","aria-label":"Save session as template",className:"relative w-full max-w-md mx-4 bg-[#111118] border border-[#1a1a2e] rounded-lg shadow-2xl max-h-[90vh] overflow-y-auto",children:[b.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[b.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"Save as Template"}),b.jsx("button",{onClick:O,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:b.jsx(Gn,{className:"h-4 w-4"})})]}),b.jsxs("form",{onSubmit:C,className:"p-4 sm:p-5 space-y-4",children:[d&&b.jsx("div",{className:"p-3 rounded bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:d}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:"template-name",className:"block text-xs font-medium text-gray-300 mb-1.5",children:"Template Name *"}),b.jsx("input",{id:"template-name",type:"text",value:w,onChange:m=>k(m.target.value),placeholder:"My template name",className:"w-full px-3 py-2 text-sm rounded bg-[#0a0a0f] border border-[#1a1a2e] text-gray-100 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] transition-colors",disabled:f})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:"template-desc",className:"block text-xs font-medium text-gray-300 mb-1.5",children:"Description (optional)"}),b.jsx("textarea",{id:"template-desc",value:l,onChange:m=>u(m.target.value),placeholder:"What is this template for?",rows:3,className:"w-full px-3 py-2 text-sm rounded bg-[#0a0a0f] border border-[#1a1a2e] text-gray-100 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] transition-colors resize-none",disabled:f})]}),b.jsxs("div",{className:"flex gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:O,disabled:f,className:"flex-1 px-3 py-2 text-xs font-medium rounded bg-[#0a0a0f] border border-[#1a1a2e] text-gray-300 hover:text-gray-100 hover:border-[#333] transition-colors disabled:opacity-50",children:"Cancel"}),b.jsx("button",{type:"submit",disabled:f,className:"flex-1 px-3 py-2 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-50 flex items-center justify-center gap-2",children:f?b.jsxs(b.Fragment,{children:[b.jsx(In,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save Template"})]})]})]})]}):null}const g4=[{id:"session",label:"Session"},{id:"metrics",label:"Metrics"}],Xp=["/clear","/compact","/cost","/config"];function y4(){const{id:i}=u_(),r=No(),[a,o]=P.useState("session"),[v,w]=P.useState(!1),{session:k,health:l,notFound:u,loading:f,metrics:y,metricsLoading:d,latency:S,latencyLoading:E}=t4(i??""),[O,C]=P.useState(""),[m,g]=P.useState(!1),[h,_]=P.useState(Xp[0]),[x,A]=P.useState(!1),[R,D]=P.useState(""),[T,M]=P.useState(!1),[$,Z]=P.useState(!1),[K,F]=P.useState(!1),[X,ee]=P.useState(!1),[V,Q]=P.useState(null),ae=P.useRef(null),j=P.useRef(!1),I=$i(_e=>_e.addToast);if(f)return b.jsx("div",{className:"min-h-screen bg-[#0a0a0f] flex items-center justify-center text-[#555] text-sm",children:b.jsx("div",{className:"animate-pulse",children:"Loading session…"})});if(u||!k||!l)return b.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-[#555]",children:[b.jsx("div",{className:"text-6xl mb-4",children:"404"}),b.jsx("div",{className:"text-lg mb-6 text-[#e0e0e0]",children:"Session not found"}),b.jsx(di,{to:"/",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Overview"})]});const L=k,H=l,q=H.status==="permission_prompt"||H.status==="bash_approval";function W(){rv(L.id).catch(_e=>I("error","Approve failed",_e instanceof Error?_e.message:void 0))}function le(){Xw(L.id).catch(_e=>I("error","Reject failed",_e instanceof Error?_e.message:void 0))}function fe(){Eu(L.id).catch(_e=>I("error","Interrupt failed",_e instanceof Error?_e.message:void 0))}async function U(){try{const _e=await Qw(L.id,{name:void 0});I("success","Session forked",`New session ${_e.id.slice(0,8)} created`),r(`/sessions/${_e.id}`)}catch(_e){I("error","Fork failed",_e instanceof Error?_e.message:void 0)}}function B(){Jw(L.id).catch(_e=>I("error","Escape failed",_e instanceof Error?_e.message:void 0))}async function ie(){try{await wu(L.id),r("/")}catch(_e){I("error","Failed to kill session",_e instanceof Error?_e.message:void 0)}}async function ne(){if(!K){F(!0);try{const _e=await rE(L.id);Q({image:_e.image,mimeType:_e.mimeType,capturedAt:Date.now()}),I("success","Screenshot captured")}catch(_e){(typeof _e=="object"&&_e!==null&&"statusCode"in _e?_e.statusCode:void 0)===501?(ee(!0),I("warning","Screenshot unavailable","Playwright is not installed on the server.")):I("error","Screenshot failed",_e instanceof Error?_e.message:void 0)}finally{F(!1)}}}async function me(){var Rt;const _e=O.trim();if(_e&&!j.current){j.current=!0,g(!0);try{await Ww(L.id,_e),C("")}catch(mi){I("error","Failed to send message",mi instanceof Error?mi.message:void 0)}finally{g(!1),j.current=!1,(Rt=ae.current)==null||Rt.focus()}}}function pe(){var _e;C(h),(_e=ae.current)==null||_e.focus()}async function Ee(){if(!(!h||x)){A(!0);try{await iE(L.id,h),C("")}catch(_e){I("error","Failed to send slash command",_e instanceof Error?_e.message:void 0)}finally{A(!1)}}}async function je(){const _e=R.trim();if(!(!_e||$)){Z(!0);try{await sE(L.id,_e),D(""),M(!1)}catch(Rt){I("error","Failed to send bash command",Rt instanceof Error?Rt.message:void 0)}finally{Z(!1)}}}function Be(){R.trim()&&M(!0)}function st(_e){D(_e),T&&M(!1)}function Ce(_e){_e.key==="Enter"&&!_e.shiftKey&&(_e.preventDefault(),me())}return b.jsxs("div",{className:"min-h-screen bg-[#0a0a0f]",children:[b.jsxs("div",{className:"max-w-6xl mx-auto px-3 sm:px-4 py-3 sm:py-4 space-y-3 sm:space-y-4",children:[b.jsxs("nav",{className:"text-xs text-[#555] flex items-center gap-1",children:[b.jsx(di,{to:"/",className:"hover:text-[#00e5ff] transition-colors",children:"Overview"}),b.jsx("span",{className:"text-[#333]",children:"/"}),b.jsx("span",{className:"text-[#e0e0e0] truncate max-w-[160px] sm:max-w-xs",children:L.windowName||L.id})]}),b.jsx(s4,{session:L,health:H,onApprove:W,onReject:le,onInterrupt:fe,onFork:U,onKill:ie,onSaveTemplate:()=>w(!0)}),b.jsx("div",{className:"flex border-b border-[#1a1a2e]",role:"tablist",children:g4.map(_e=>b.jsxs("button",{id:`tab-${_e.id}`,onClick:()=>o(_e.id),role:"tab","aria-selected":a===_e.id,"aria-controls":`panel-${_e.id}`,tabIndex:a===_e.id?0:-1,className:`flex-1 min-h-[44px] text-sm font-medium transition-colors relative ${a===_e.id?"text-[#00e5ff]":"text-[#555] hover:text-[#888]"}`,children:[_e.label,a===_e.id&&b.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-[#00e5ff]"})]},_e.id))}),b.jsxs("div",{className:"bg-[#0a0a0f] rounded-lg min-h-[300px] sm:min-h-[400px]",children:[q&&b.jsx("div",{className:"p-3 sm:p-4 pb-0",children:b.jsx(_4,{prompt:H.details,permissionMode:L.permissionMode,onApprove:W,onReject:le})}),a==="session"&&b.jsx("div",{id:"panel-session",role:"tabpanel","aria-labelledby":"tab-session",tabIndex:0,className:"h-[calc(100vh-380px)] sm:h-[calc(100vh-420px)] min-h-[250px] sm:min-h-[300px]",children:b.jsx(h4,{sessionId:L.id,status:H.status})}),a==="metrics"&&b.jsxs("div",{id:"panel-metrics",role:"tabpanel","aria-labelledby":"tab-metrics",tabIndex:0,className:"p-3 sm:p-4",children:[b.jsx(d4,{metrics:y,loading:d}),b.jsx("div",{className:"mt-4",children:b.jsx(m4,{latency:S,loading:E})})]})]}),b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("label",{htmlFor:"session-message-input",className:"sr-only",children:"Session message input"}),b.jsx("input",{id:"session-message-input",ref:ae,type:"text",value:O,onChange:_e=>C(_e.target.value),onKeyDown:Ce,placeholder:"Send a message to Claude…",disabled:m||!H.alive,className:"flex-1 min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] font-mono disabled:opacity-50"}),b.jsx("button",{onClick:me,disabled:m||!O.trim()||!H.alive,className:"min-h-[44px] min-w-[44px] flex items-center justify-center p-2.5 rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Send message",children:b.jsx(bu,{className:"h-4 w-4"})})]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#1a1a2e]/50",children:[b.jsx("label",{className:"sr-only",htmlFor:"slash-command-select",children:"Common slash command"}),b.jsx("select",{id:"slash-command-select",value:h,onChange:_e=>_(_e.target.value),disabled:x||!H.alive,className:"min-h-[44px] rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs font-medium text-gray-200 focus:outline-none focus:border-[#00e5ff] disabled:opacity-50",children:Xp.map(_e=>b.jsx("option",{value:_e,children:_e},_e))}),b.jsx("button",{onClick:pe,disabled:x||!H.alive,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Insert selected slash command into the message input",children:"Insert Slash"}),b.jsx("button",{onClick:Ee,disabled:x||!H.alive,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#002a33] hover:bg-[#003744] text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Send selected slash command immediately",children:x?"Sending Slash…":"Run Slash"}),b.jsx("label",{className:"sr-only",htmlFor:"bash-command-input",children:"Bash command"}),b.jsx("input",{id:"bash-command-input",type:"text",value:R,onChange:_e=>st(_e.target.value),placeholder:"Bash command (requires confirmation)…",disabled:$||!H.alive,className:"min-h-[44px] min-w-[220px] flex-1 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#ffaa00] font-mono disabled:opacity-50"}),T?b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"text-[11px] text-[#ffaa00] italic",children:"Confirm bash command execution."}),b.jsx("button",{onClick:je,disabled:$||!R.trim()||!H.alive,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#3a2e00] hover:bg-[#4a3900] text-[#ffaa00] border border-[#ffaa00]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Send bash command",children:$?"Sending Bash…":"Confirm Bash"}),b.jsx("button",{onClick:()=>M(!1),disabled:$,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:"Cancel Bash"})]}):b.jsx("button",{onClick:Be,disabled:$||!R.trim()||!H.alive,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#2b2200] hover:bg-[#3a2e00] text-[#ffaa00] border border-[#ffaa00]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Review bash command before sending",children:"Review Bash"}),!X&&b.jsxs("button",{onClick:ne,disabled:K||!H.alive,className:"flex items-center gap-1.5 min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",title:"Capture screenshot",children:[b.jsx(x_,{className:"h-3.5 w-3.5"}),K?"Capturing…":"Screenshot"]}),b.jsxs("button",{onClick:fe,"aria-label":"Interrupt session with Ctrl+C",className:"flex items-center gap-1.5 min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors",title:"Interrupt (Ctrl+C)",children:[b.jsx(e1,{className:"h-3.5 w-3.5"}),"Interrupt"]}),b.jsxs("button",{onClick:B,"aria-label":"Send Escape to session",className:"flex items-center gap-1.5 min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors",title:"Send Escape",children:[b.jsx(Ub,{className:"h-3.5 w-3.5"}),"Escape"]})]}),V&&b.jsxs("div",{className:"mt-3 rounded-lg border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[b.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:"Latest screenshot"}),b.jsx("span",{className:"text-[11px] text-gray-500",children:new Date(V.capturedAt).toLocaleTimeString()})]}),b.jsx("img",{src:V.image,alt:"Session screenshot preview",className:"max-h-[420px] w-full rounded border border-[#1a1a2e] object-contain bg-black"}),b.jsx("div",{className:"mt-2 text-[11px] text-gray-500",children:V.mimeType??"image/png"})]})]})]}),b.jsx(v4,{open:v,onClose:()=>w(!1),sessionId:i??""})]})}const b4={running:"bg-cyan/10 text-cyan border-cyan/30",completed:"bg-emerald-400/10 text-emerald-400 border-emerald-400/30",failed:"bg-red-400/10 text-red-400 border-red-400/30",pending:"bg-gray-500/10 text-gray-400 border-gray-500/30"},S4=new Set(["running"]);function dv({status:i}){const r=b4[i]??"bg-gray-500/10 text-gray-500 border-gray-500/30",a=S4.has(i);return b.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${r}`,children:[a&&b.jsxs("span",{className:"relative flex h-2 w-2",children:[b.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75 bg-current"}),b.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]}),i]})}let x4=0;function zn(){return{workDir:"",name:"",prompt:"",_key:x4++}}function C4({open:i,onClose:r}){const a=No(),o=P.useRef(null),v=P.useRef(null),[w,k]=P.useState(""),[l,u]=P.useState([zn(),zn()]),[f,y]=P.useState(!1),[d,S]=P.useState(null),E=P.useCallback(()=>{O(),r()},[r]);function O(){k(""),u([zn(),zn()]),y(!1),S(null)}P.useEffect(()=>{if(!i)return;const x=A=>{A.key==="Escape"&&E()};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[i,E]),P.useEffect(()=>{if(!i)return;const x=o.current;if(!x)return;const A='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',R=D=>{if(D.key!=="Tab")return;const T=Array.from(x.querySelectorAll(A));if(T.length===0)return;const M=T[0],$=T[T.length-1];D.shiftKey?document.activeElement===M&&(D.preventDefault(),$.focus()):document.activeElement===$&&(D.preventDefault(),M.focus())};return x.addEventListener("keydown",R),()=>x.removeEventListener("keydown",R)},[i]),P.useEffect(()=>{if(i){const x=setTimeout(()=>{var A;return(A=v.current)==null?void 0:A.focus()},50);return()=>clearTimeout(x)}},[i]);function C(){l.length>=10||u([...l,zn()])}function m(x){l.length<=1||u(l.filter((A,R)=>R!==x))}function g(x,A,R){u(l.map((D,T)=>T===x?{...D,[A]:R}:D))}async function h(x){x.preventDefault(),S(null);const A=l.filter(R=>R.workDir.trim());if(!w.trim()){S("Pipeline name is required");return}if(A.length===0){S("At least one step with a working directory is required");return}y(!0);try{const R=await aE({name:w.trim(),workDir:A[0].workDir.trim(),stages:A.map(D=>({workDir:D.workDir.trim(),name:D.name.trim()||void 0,prompt:D.prompt.trim()||void 0}))});O(),r(),a(`/pipelines/${R.id}`)}catch(R){S(R instanceof Error?R.message:"Failed to create pipeline")}finally{y(!1)}}if(!i)return null;const _=w.trim()&&l.some(x=>x.workDir.trim());return b.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[b.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:E}),b.jsxs("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":"Create new pipeline",className:"relative w-full max-w-2xl mx-4 bg-[#111118] border border-[#1a1a2e] rounded-lg shadow-2xl max-h-[90vh] overflow-y-auto",children:[b.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[b.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Pipeline"}),b.jsx("button",{onClick:E,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:b.jsx(Gn,{className:"h-4 w-4"})})]}),b.jsxs("form",{onSubmit:h,className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Pipeline Name ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("input",{type:"text",ref:v,value:w,onChange:x=>k(x.target.value),placeholder:"my-pipeline","aria-label":"Pipeline Name",className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"})]}),b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[b.jsxs("span",{children:["Working Directory ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("span",{children:"Name"}),b.jsx("span",{children:"Prompt"}),b.jsx("span",{})]}),b.jsx("div",{className:"space-y-2",children:l.map((x,A)=>b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[b.jsx("input",{type:"text",value:x.workDir,onChange:R=>g(A,"workDir",R.target.value),placeholder:"/home/user/project",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6] font-mono"}),b.jsx("input",{type:"text",value:x.name,onChange:R=>g(A,"name",R.target.value),placeholder:"name",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"}),b.jsx("input",{type:"text",value:x.prompt,onChange:R=>g(A,"prompt",R.target.value),placeholder:"Initial prompt...",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#3b82f6]"}),b.jsx("button",{type:"button",onClick:()=>m(A),disabled:l.length<=1,"aria-label":`Remove step ${A+1}`,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ef4444] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:b.jsx(ju,{className:"h-3.5 w-3.5"})})]},x._key))}),l.length<10&&b.jsxs("button",{type:"button",onClick:C,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[b.jsx(Vn,{className:"h-3.5 w-3.5"}),"Add Step"]}),d&&b.jsx("div",{className:"text-xs text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-2",children:d}),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:E,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Cancel"}),b.jsxs("button",{type:"submit",disabled:f||!_,className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#3b82f6]/10 hover:bg-[#3b82f6]/20 text-[#3b82f6] border border-[#3b82f6]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[f&&b.jsx(In,{className:"h-3 w-3 animate-spin"}),"Create Pipeline"]})]})]})]})]})}const w4=5e3,E4=3e4,k4=6e4;function T4(){const[i,r]=P.useState([]),[a,o]=P.useState(!0),[v,w]=P.useState(!1),k=Fe(y=>y.sseConnected),l=$i(y=>y.addToast),u=P.useCallback(async()=>{try{const y=await oE();return r(y),!0}catch(y){return l("error","Failed to fetch pipelines",y instanceof Error?y.message:void 0),!1}finally{o(!1)}},[l]);P.useEffect(()=>{let y,d=!1,S=0;const E=async()=>{if(d)return;const O=await u();if(d)return;const C=k?E4:w4;let m=C;if(O)S=0;else{S+=1;const g=2**S;m=Math.min(C*g,k4)}y=setTimeout(()=>{E()},m)};return E(),()=>{d=!0,y&&clearTimeout(y)}},[u,k]);const f={total:i.length,running:i.filter(y=>y.status==="running").length,completed:i.filter(y=>y.status==="completed").length,failed:i.filter(y=>y.status==="failed").length};return a?b.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:b.jsx("div",{className:"animate-pulse",children:"Loading pipelines…"})}):b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Pipelines"}),b.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Manage and monitor session pipelines"})]}),b.jsxs("button",{onClick:()=>w(!0),className:"flex items-center gap-1.5 px-3 py-2 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors",children:[b.jsx(Vn,{className:"h-3.5 w-3.5"}),"New Pipeline"]})]}),b.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[b.jsx(ut,{label:"Total",value:f.total}),b.jsx(ut,{label:"Running",value:f.running}),b.jsx(ut,{label:"Completed",value:f.completed}),b.jsx(ut,{label:"Failed",value:f.failed})]}),i.length===0?b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:[b.jsx("p",{className:"text-gray-500",children:"No pipelines yet"}),b.jsx("p",{className:"mt-1 text-xs text-gray-600",children:"Create a pipeline to run sessions in sequence"})]}):b.jsx("div",{className:"space-y-3",children:i.map(y=>b.jsx(di,{to:`/pipelines/${y.id}`,className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 hover:border-[#00e5ff]/30 transition-colors",children:b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[b.jsx("span",{className:"font-medium text-gray-200 truncate",children:y.name}),b.jsx(dv,{status:y.status})]}),b.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 shrink-0 ml-4",children:[b.jsxs("span",{children:[y.stages.length," step",y.stages.length!==1?"s":""]}),b.jsx("span",{children:Zs(y.createdAt)})]})]})},y.id))}),b.jsx(C4,{open:v,onClose:()=>w(!1)})]})}const A4=3e3,R4=3e4,D4=6e4,O4=new Set(["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"]);function N4(i){return O4.has(i)}function M4(){const{id:i}=u_(),[r,a]=P.useState(null),[o,v]=P.useState(!0),[w,k]=P.useState(!1),l=Fe(y=>y.sseConnected),u=$i(y=>y.addToast),f=P.useCallback(async()=>{if(!i)return!1;try{const y=await lE(i);return a(y),k(!1),!0}catch(y){return y instanceof Error&&"statusCode"in y&&y.statusCode===404?k(!0):u("error","Failed to fetch pipeline",y instanceof Error?y.message:void 0),!1}finally{v(!1)}},[i,u]);return P.useEffect(()=>{let y,d=!1,S=0;const E=async()=>{if(d)return;const O=await f();if(d)return;const C=l?R4:A4;let m=C;if(O)S=0;else{S+=1;const g=2**S;m=Math.min(C*g,D4)}y=setTimeout(()=>{E()},m)};return E(),()=>{d=!0,y&&clearTimeout(y)}},[f,l]),o?b.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:b.jsx("div",{className:"animate-pulse",children:"Loading pipeline…"})}):w||!r?b.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[50vh] text-gray-500",children:[b.jsx("div",{className:"text-6xl mb-4",children:"404"}),b.jsx("div",{className:"text-lg mb-6 text-gray-200",children:"Pipeline not found"}),b.jsx(di,{to:"/pipelines",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Pipelines"})]}):b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("nav",{className:"text-xs text-gray-500 flex items-center gap-1",children:[b.jsx(di,{to:"/pipelines",className:"hover:text-[#00e5ff] transition-colors",children:"Pipelines"}),b.jsx("span",{className:"text-gray-700",children:"/"}),b.jsx("span",{className:"text-gray-200 truncate max-w-xs",children:r.name})]}),b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:r.name}),b.jsx(dv,{status:r.status})]}),b.jsxs("div",{className:"text-xs text-gray-500",children:["Created ",Zs(r.createdAt)]})]}),b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118]",children:[b.jsx("div",{className:"px-4 py-3 border-b border-void-lighter",children:b.jsxs("h3",{className:"text-sm font-semibold text-gray-200",children:["Steps (",r.stages.length,")"]})}),r.stages.length===0?b.jsx("div",{className:"p-8 text-center text-gray-500 text-sm",children:"No steps yet"}):b.jsxs("table",{className:"w-full text-left text-sm",children:[b.jsx("thead",{children:b.jsxs("tr",{className:"border-b border-void-lighter text-gray-600",children:[b.jsx("th",{className:"px-4 py-3 font-medium w-16",children:"#"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Session"})]})}),b.jsx("tbody",{children:r.stages.map((y,d)=>b.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[b.jsxs("td",{className:"px-4 py-3 text-gray-500 font-mono text-xs",children:["#",d+1]}),b.jsx("td",{className:"px-4 py-3",children:b.jsx(Po,{status:N4(y.status)?y.status:"unknown"})}),b.jsx("td",{className:"px-4 py-3",children:y.sessionId?b.jsx(di,{to:`/sessions/${encodeURIComponent(y.sessionId)}`,className:"font-medium text-gray-200 hover:text-cyan transition-colors",children:y.name}):b.jsx("span",{className:"font-medium text-gray-200",children:y.name})}),b.jsx("td",{className:"px-4 py-3 font-mono text-xs text-gray-400",children:y.sessionId??"—"})]},y.name))})]})]})]})}function L4(){return b.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 text-center",children:[b.jsx("h1",{className:"text-6xl font-bold text-gray-500",children:"404"}),b.jsx("p",{className:"text-lg text-gray-400",children:"Page not found"}),b.jsx(di,{to:"/",className:"mt-2 rounded-lg bg-cyan px-4 py-2 text-sm font-medium text-void transition-colors hover:bg-cyan/80",children:"Back to Dashboard"})]})}function j4(){return b.jsx(bb,{children:b.jsx(Py,{children:b.jsxs(_s,{element:b.jsx(EE,{}),children:[b.jsx(_s,{path:"/",element:b.jsx(e4,{})}),b.jsx(_s,{path:"/auth/keys",element:b.jsx(NE,{})}),b.jsx(_s,{path:"/sessions/:id",element:b.jsx(y4,{})}),b.jsx(_s,{path:"/pipelines",element:b.jsx(T4,{})}),b.jsx(_s,{path:"/pipelines/:id",element:b.jsx(M4,{})}),b.jsx(_s,{path:"*",element:b.jsx(L4,{})})]})})})}P0.createRoot(document.getElementById("root")).render(b.jsx(Hn.StrictMode,{children:b.jsx(hb,{basename:"/dashboard",children:b.jsx(j4,{})})}));
|