aegis-bridge 2.9.2 → 2.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dashboard/dist/assets/index-PVPEFzdR.js +302 -0
- package/dashboard/dist/assets/index-hkHSc-eI.css +32 -0
- package/dashboard/dist/index.html +2 -2
- package/dist/hook-settings.js +28 -5
- package/package.json +1 -1
- package/dashboard/dist/assets/index-BPztPE61.css +0 -32
- package/dashboard/dist/assets/index-ClB9UIxG.js +0 -282
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
var G0=Object.defineProperty;var K0=(i,r,a)=>r in i?G0(i,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[r]=a;var Et=(i,r,a)=>K0(i,typeof r!="symbol"?r+"":r,a);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const g of document.querySelectorAll('link[rel="modulepreload"]'))o(g);new MutationObserver(g=>{for(const w of g)if(w.type==="childList")for(const A of w.addedNodes)A.tagName==="LINK"&&A.rel==="modulepreload"&&o(A)}).observe(document,{childList:!0,subtree:!0});function a(g){const w={};return g.integrity&&(w.integrity=g.integrity),g.referrerPolicy&&(w.referrerPolicy=g.referrerPolicy),g.crossOrigin==="use-credentials"?w.credentials="include":g.crossOrigin==="anonymous"?w.credentials="omit":w.credentials="same-origin",w}function o(g){if(g.ep)return;g.ep=!0;const w=a(g);fetch(g.href,w)}})();function b_(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ru={exports:{}},oa={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var fp;function V0(){if(fp)return oa;fp=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(o,g,w){var A=null;if(w!==void 0&&(A=""+w),g.key!==void 0&&(A=""+g.key),"key"in g){w={};for(var l in g)l!=="key"&&(w[l]=g[l])}else w=g;return g=w.ref,{$$typeof:i,type:o,key:A,ref:g!==void 0?g:null,props:w}}return oa.Fragment=r,oa.jsx=a,oa.jsxs=a,oa}var dp;function W0(){return dp||(dp=1,Ru.exports=V0()),Ru.exports}var C=W0(),ku={exports:{}},Ae={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var mp;function Y0(){if(mp)return Ae;mp=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),A=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),x=Symbol.iterator;function E(L){return L===null||typeof L!="object"?null:(L=x&&L[x]||L["@@iterator"],typeof L=="function"?L:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,p={};function v(L,H,W){this.props=L,this.context=H,this.refs=p,this.updater=W||O}v.prototype.isReactComponent={},v.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")},v.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function f(){}f.prototype=v.prototype;function _(L,H,W){this.props=L,this.context=H,this.refs=p,this.updater=W||O}var S=_.prototype=new f;S.constructor=_,b(S,v.prototype),S.isPureReactComponent=!0;var R=Array.isArray;function k(){}var M={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function N(L,H,W){var re=W.ref;return{$$typeof:i,type:L,key:H,ref:re!==void 0?re:null,props:W}}function P(L,H){return N(L.type,H,L.props)}function F(L){return typeof L=="object"&&L!==null&&L.$$typeof===i}function G(L){var H={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(W){return H[W]})}var $=/\/+/g;function J(L,H){return typeof L=="object"&&L!==null&&L.key!=null?G(""+L.key):H.toString(36)}function te(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(k,k):(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 q(L,H,W,re,ue){var pe=typeof L;(pe==="undefined"||pe==="boolean")&&(L=null);var V=!1;if(L===null)V=!0;else switch(pe){case"bigint":case"string":case"number":V=!0;break;case"object":switch(L.$$typeof){case i:case r:V=!0;break;case y:return V=L._init,q(V(L._payload),H,W,re,ue)}}if(V)return ue=ue(L),V=re===""?"."+J(L,0):re,R(ue)?(W="",V!=null&&(W=V.replace($,"$&/")+"/"),q(ue,H,W,"",function(oe){return oe})):ue!=null&&(F(ue)&&(ue=P(ue,W+(ue.key==null||L&&L.key===ue.key?"":(""+ue.key).replace($,"$&/")+"/")+V)),H.push(ue)),1;V=0;var U=re===""?".":re+":";if(R(L))for(var ce=0;ce<L.length;ce++)re=L[ce],pe=U+J(re,ce),V+=q(re,H,W,pe,ue);else if(ce=E(L),typeof ce=="function")for(L=ce.call(L),ce=0;!(re=L.next()).done;)re=re.value,pe=U+J(re,ce++),V+=q(re,H,W,pe,ue);else if(pe==="object"){if(typeof L.then=="function")return q(te(L),H,W,re,ue);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 V}function K(L,H,W){if(L==null)return L;var re=[],ue=0;return q(L,re,"","",function(pe){return H.call(W,pe,ue++)}),re}function ee(L){if(L._status===-1){var H=L._result;H=H(),H.then(function(W){(L._status===0||L._status===-1)&&(L._status=1,L._result=W)},function(W){(L._status===0||L._status===-1)&&(L._status=2,L._result=W)}),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)},B={map:K,forEach:function(L,H,W){K(L,function(){H.apply(this,arguments)},W)},count:function(L){var H=0;return K(L,function(){H++}),H},toArray:function(L){return K(L,function(H){return H})||[]},only:function(L){if(!F(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Ae.Activity=d,Ae.Children=B,Ae.Component=v,Ae.Fragment=a,Ae.Profiler=g,Ae.PureComponent=_,Ae.StrictMode=o,Ae.Suspense=h,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(L){return M.H.useMemoCache(L)}},Ae.cache=function(L){return function(){return L.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(L,H,W){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var re=b({},L.props),ue=L.key;if(H!=null)for(pe in H.key!==void 0&&(ue=""+H.key),H)!T.call(H,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&H.ref===void 0||(re[pe]=H[pe]);var pe=arguments.length-2;if(pe===1)re.children=W;else if(1<pe){for(var V=Array(pe),U=0;U<pe;U++)V[U]=arguments[U+2];re.children=V}return N(L.type,ue,re)},Ae.createContext=function(L){return L={$$typeof:A,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:w,_context:L},L},Ae.createElement=function(L,H,W){var re,ue={},pe=null;if(H!=null)for(re in H.key!==void 0&&(pe=""+H.key),H)T.call(H,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ue[re]=H[re]);var V=arguments.length-2;if(V===1)ue.children=W;else if(1<V){for(var U=Array(V),ce=0;ce<V;ce++)U[ce]=arguments[ce+2];ue.children=U}if(L&&L.defaultProps)for(re in V=L.defaultProps,V)ue[re]===void 0&&(ue[re]=V[re]);return N(L,pe,ue)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(L){return{$$typeof:l,render:L}},Ae.isValidElement=F,Ae.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:ee}},Ae.memo=function(L,H){return{$$typeof:u,type:L,compare:H===void 0?null:H}},Ae.startTransition=function(L){var H=M.T,W={};M.T=W;try{var re=L(),ue=M.S;ue!==null&&ue(W,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(k,j)}catch(pe){j(pe)}finally{H!==null&&W.types!==null&&(H.types=W.types),M.T=H}},Ae.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ae.use=function(L){return M.H.use(L)},Ae.useActionState=function(L,H,W){return M.H.useActionState(L,H,W)},Ae.useCallback=function(L,H){return M.H.useCallback(L,H)},Ae.useContext=function(L){return M.H.useContext(L)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(L,H){return M.H.useDeferredValue(L,H)},Ae.useEffect=function(L,H){return M.H.useEffect(L,H)},Ae.useEffectEvent=function(L){return M.H.useEffectEvent(L)},Ae.useId=function(){return M.H.useId()},Ae.useImperativeHandle=function(L,H,W){return M.H.useImperativeHandle(L,H,W)},Ae.useInsertionEffect=function(L,H){return M.H.useInsertionEffect(L,H)},Ae.useLayoutEffect=function(L,H){return M.H.useLayoutEffect(L,H)},Ae.useMemo=function(L,H){return M.H.useMemo(L,H)},Ae.useOptimistic=function(L,H){return M.H.useOptimistic(L,H)},Ae.useReducer=function(L,H,W){return M.H.useReducer(L,H,W)},Ae.useRef=function(L){return M.H.useRef(L)},Ae.useState=function(L){return M.H.useState(L)},Ae.useSyncExternalStore=function(L,H,W){return M.H.useSyncExternalStore(L,H,W)},Ae.useTransition=function(){return M.H.useTransition()},Ae.version="19.2.4",Ae}var pp;function lh(){return pp||(pp=1,ku.exports=Y0()),ku.exports}var I=lh();const ga=b_(I);var Du={exports:{}},la={},Ou={exports:{}},Mu={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var _p;function X0(){return _p||(_p=1,(function(i){function r(q,K){var ee=q.length;q.push(K);e:for(;0<ee;){var j=ee-1>>>1,B=q[j];if(0<g(B,K))q[j]=K,q[ee]=B,ee=j;else break e}}function a(q){return q.length===0?null:q[0]}function o(q){if(q.length===0)return null;var K=q[0],ee=q.pop();if(ee!==K){q[0]=ee;e:for(var j=0,B=q.length,L=B>>>1;j<L;){var H=2*(j+1)-1,W=q[H],re=H+1,ue=q[re];if(0>g(W,ee))re<B&&0>g(ue,W)?(q[j]=ue,q[re]=ee,j=re):(q[j]=W,q[H]=ee,j=H);else if(re<B&&0>g(ue,ee))q[j]=ue,q[re]=ee,j=re;else break e}}return K}function g(q,K){var ee=q.sortIndex-K.sortIndex;return ee!==0?ee:q.id-K.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 A=Date,l=A.now();i.unstable_now=function(){return A.now()-l}}var h=[],u=[],y=1,d=null,x=3,E=!1,O=!1,b=!1,p=!1,v=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function S(q){for(var K=a(u);K!==null;){if(K.callback===null)o(u);else if(K.startTime<=q)o(u),K.sortIndex=K.expirationTime,r(h,K);else break;K=a(u)}}function R(q){if(b=!1,S(q),!O)if(a(h)!==null)O=!0,k||(k=!0,G());else{var K=a(u);K!==null&&te(R,K.startTime-q)}}var k=!1,M=-1,T=5,N=-1;function P(){return p?!0:!(i.unstable_now()-N<T)}function F(){if(p=!1,k){var q=i.unstable_now();N=q;var K=!0;try{e:{O=!1,b&&(b=!1,f(M),M=-1),E=!0;var ee=x;try{t:{for(S(q),d=a(h);d!==null&&!(d.expirationTime>q&&P());){var j=d.callback;if(typeof j=="function"){d.callback=null,x=d.priorityLevel;var B=j(d.expirationTime<=q);if(q=i.unstable_now(),typeof B=="function"){d.callback=B,S(q),K=!0;break t}d===a(h)&&o(h),S(q)}else o(h);d=a(h)}if(d!==null)K=!0;else{var L=a(u);L!==null&&te(R,L.startTime-q),K=!1}}break e}finally{d=null,x=ee,E=!1}K=void 0}}finally{K?G():k=!1}}}var G;if(typeof _=="function")G=function(){_(F)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,J=$.port2;$.port1.onmessage=F,G=function(){J.postMessage(null)}}else G=function(){v(F,0)};function te(q,K){M=v(function(){q(i.unstable_now())},K)}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(q){q.callback=null},i.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<q?Math.floor(1e3/q):5},i.unstable_getCurrentPriorityLevel=function(){return x},i.unstable_next=function(q){switch(x){case 1:case 2:case 3:var K=3;break;default:K=x}var ee=x;x=K;try{return q()}finally{x=ee}},i.unstable_requestPaint=function(){p=!0},i.unstable_runWithPriority=function(q,K){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var ee=x;x=q;try{return K()}finally{x=ee}},i.unstable_scheduleCallback=function(q,K,ee){var j=i.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?j+ee:j):ee=j,q){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=ee+B,q={id:y++,callback:K,priorityLevel:q,startTime:ee,expirationTime:B,sortIndex:-1},ee>j?(q.sortIndex=ee,r(u,q),a(h)===null&&q===a(u)&&(b?(f(M),M=-1):b=!0,te(R,ee-j))):(q.sortIndex=B,r(h,q),O||E||(O=!0,k||(k=!0,G()))),q},i.unstable_shouldYield=P,i.unstable_wrapCallback=function(q){var K=x;return function(){var ee=x;x=K;try{return q.apply(this,arguments)}finally{x=ee}}}})(Mu)),Mu}var gp;function J0(){return gp||(gp=1,Ou.exports=X0()),Ou.exports}var Lu={exports:{}},$t={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var vp;function Q0(){if(vp)return $t;vp=1;var i=lh();function r(h){var u="https://react.dev/errors/"+h;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)u+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var o={d:{f:a,r:function(){throw Error(r(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},g=Symbol.for("react.portal");function w(h,u,y){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:g,key:d==null?null:""+d,children:h,containerInfo:u,implementation:y}}var A=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(h,u){if(h==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return $t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,$t.createPortal=function(h,u){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(r(299));return w(h,u,null,y)},$t.flushSync=function(h){var u=A.T,y=o.p;try{if(A.T=null,o.p=2,h)return h()}finally{A.T=u,o.p=y,o.d.f()}},$t.preconnect=function(h,u){typeof h=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,o.d.C(h,u))},$t.prefetchDNS=function(h){typeof h=="string"&&o.d.D(h)},$t.preinit=function(h,u){if(typeof h=="string"&&u&&typeof u.as=="string"){var y=u.as,d=l(y,u.crossOrigin),x=typeof u.integrity=="string"?u.integrity:void 0,E=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;y==="style"?o.d.S(h,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:d,integrity:x,fetchPriority:E}):y==="script"&&o.d.X(h,{crossOrigin:d,integrity:x,fetchPriority:E,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},$t.preinitModule=function(h,u){if(typeof h=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var y=l(u.as,u.crossOrigin);o.d.M(h,{crossOrigin:y,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&o.d.M(h)},$t.preload=function(h,u){if(typeof h=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var y=u.as,d=l(y,u.crossOrigin);o.d.L(h,y,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},$t.preloadModule=function(h,u){if(typeof h=="string")if(u){var y=l(u.as,u.crossOrigin);o.d.m(h,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:y,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else o.d.m(h)},$t.requestFormReset=function(h){o.d.r(h)},$t.unstable_batchedUpdates=function(h,u){return h(u)},$t.useFormState=function(h,u,y){return A.H.useFormState(h,u,y)},$t.useFormStatus=function(){return A.H.useHostTransitionStatus()},$t.version="19.2.4",$t}var yp;function ey(){if(yp)return Lu.exports;yp=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(),Lu.exports=Q0(),Lu.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var Sp;function ty(){if(Sp)return la;Sp=1;var i=J0(),r=lh(),a=ey();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 g(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 A(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 h(e){if(w(e)!==e)throw Error(o(188))}function u(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 m=c.alternate;if(m===null){if(n=c.return,n!==null){s=n;continue}break}if(c.child===m.child){for(m=c.child;m;){if(m===s)return h(c),e;if(m===n)return h(c),t;m=m.sibling}throw Error(o(188))}if(s.return!==n.return)s=c,n=m;else{for(var D=!1,z=c.child;z;){if(z===s){D=!0,s=c,n=m;break}if(z===n){D=!0,n=c,s=m;break}z=z.sibling}if(!D){for(z=m.child;z;){if(z===s){D=!0,s=m,n=c;break}if(z===n){D=!0,n=m,s=c;break}z=z.sibling}if(!D)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,x=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),_=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function G(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var $=Symbol.for("react.client.reference");function J(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===$?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case b:return"Fragment";case v:return"Profiler";case p:return"StrictMode";case R:return"Suspense";case k:return"SuspenseList";case N:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case O:return"Portal";case _:return e.displayName||"Context";case f:return(e._context.displayName||"Context")+".Consumer";case S:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case M:return t=e.displayName||null,t!==null?t:J(e.type)||"Memo";case T:t=e._payload,e=e._init;try{return J(e(t))}catch{}}return null}var te=Array.isArray,q=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},j=[],B=-1;function L(e){return{current:e}}function H(e){0>B||(e.current=j[B],j[B]=null,B--)}function W(e,t){B++,j[B]=e.current,e.current=t}var re=L(null),ue=L(null),pe=L(null),V=L(null);function U(e,t){switch(W(pe,t),W(ue,e),W(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?jm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=jm(t),e=Bm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(re),W(re,e)}function ce(){H(re),H(ue),H(pe)}function oe(e){e.memoizedState!==null&&W(V,e);var t=re.current,s=Bm(t,e.type);t!==s&&(W(ue,e),W(re,s))}function ve(e){ue.current===e&&(H(re),H(ue)),V.current===e&&(H(V),sa._currentValue=ee)}var ge,me;function Re(e){if(ge===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);ge=t&&t[1]||"",me=-1<s.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+ge+e+me}var je=!1;function ut(e,t){if(!e||je)return"";je=!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(ae){var ne=ae}Reflect.construct(e,[],de)}else{try{de.call()}catch(ae){ne=ae}e.call(de.prototype)}}else{try{throw Error()}catch(ae){ne=ae}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ae){if(ae&&ne&&typeof ae.stack=="string")return[ae.stack,ne.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 m=n.DetermineComponentFrameRoot(),D=m[0],z=m[1];if(D&&z){var Z=D.split(`
|
|
44
|
+
`),se=z.split(`
|
|
45
|
+
`);for(c=n=0;n<Z.length&&!Z[n].includes("DetermineComponentFrameRoot");)n++;for(;c<se.length&&!se[c].includes("DetermineComponentFrameRoot");)c++;if(n===Z.length||c===se.length)for(n=Z.length-1,c=se.length-1;1<=n&&0<=c&&Z[n]!==se[c];)c--;for(;1<=n&&0<=c;n--,c--)if(Z[n]!==se[c]){if(n!==1||c!==1)do if(n--,c--,0>c||Z[n]!==se[c]){var le=`
|
|
46
|
+
`+Z[n].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=n&&0<=c);break}}}finally{je=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Re(s):""}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return Re(e.type);case 16:return Re("Lazy");case 13:return e.child!==t&&t!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return ut(e.type,!1);case 11:return ut(e.type.render,!1);case 1:return ut(e.type,!0);case 31:return Re("Activity");default:return""}}function Ft(e){try{var t="",s=null;do t+=Te(e,s),s=e,e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}var pi=Object.prototype.hasOwnProperty,_i=i.unstable_scheduleCallback,Ii=i.unstable_cancelCallback,Wi=i.unstable_shouldYield,Pt=i.unstable_requestPaint,at=i.unstable_now,Dt=i.unstable_getCurrentPriorityLevel,Zt=i.unstable_ImmediatePriority,Nt=i.unstable_UserBlockingPriority,jt=i.unstable_NormalPriority,Yi=i.unstable_LowPriority,Yt=i.unstable_IdlePriority,Li=i.log,We=i.unstable_setDisableYieldValue,gi=null,Ot=null;function Mt(e){if(typeof Li=="function"&&We(e),Ot&&typeof Ot.setStrictMode=="function")try{Ot.setStrictMode(gi,e)}catch{}}var yt=Math.clz32?Math.clz32:Sl,un=Math.log,hn=Math.LN2;function Sl(e){return e>>>=0,e===0?32:31-(un(e)/hn|0)|0}var Xi=256,Ji=262144,yr=4194304;function ai(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Sr(e,t,s){var n=e.pendingLanes;if(n===0)return 0;var c=0,m=e.suspendedLanes,D=e.pingedLanes;e=e.warmLanes;var z=n&134217727;return z!==0?(n=z&~m,n!==0?c=ai(n):(D&=z,D!==0?c=ai(D):s||(s=z&~e,s!==0&&(c=ai(s))))):(z=n&~m,z!==0?c=ai(z):D!==0?c=ai(D):s||(s=n&~e,s!==0&&(c=ai(s)))),c===0?0:t!==0&&t!==c&&(t&m)===0&&(m=c&-c,s=t&-t,m>=s||m===32&&(s&4194048)!==0)?t:c}function Qs(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _t(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 Qi(){var e=yr;return yr<<=1,(yr&62914560)===0&&(yr=4194304),e}function fn(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function xs(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dn(e,t,s,n,c,m){var D=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,Z=e.expirationTimes,se=e.hiddenUpdates;for(s=D&~s;0<s;){var le=31-yt(s),de=1<<le;z[le]=0,Z[le]=-1;var ne=se[le];if(ne!==null)for(se[le]=null,le=0;le<ne.length;le++){var ae=ne[le];ae!==null&&(ae.lane&=-536870913)}s&=~de}n!==0&&mn(e,n,0),m!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=m&~(D&~t))}function mn(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-yt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|s&261930}function pn(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var n=31-yt(s),c=1<<n;c&t|e[n]&t&&(e[n]|=t),s&=~c}}function Aa(e,t){var s=t&-t;return s=(s&42)!==0?1:Xt(s),(s&(e.suspendedLanes|t))!==0?0:s}function Xt(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 Ni(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function _n(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:np(e.type))}function gn(e,t){var s=K.p;try{return K.p=e,t()}finally{K.p=s}}var vi=Math.random().toString(36).slice(2),St="__reactFiber$"+vi,st="__reactProps$"+vi,es="__reactContainer$"+vi,br="__reactEvents$"+vi,Ra="__reactListeners$"+vi,ka="__reactHandles$"+vi,Da="__reactResources$"+vi,be="__reactMarker$"+vi;function Y(e){delete e[St],delete e[st],delete e[br],delete e[Ra],delete e[ka]}function _e(e){var t=e[St];if(t)return t;for(var s=e.parentNode;s;){if(t=s[es]||s[St]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=Fm(e);e!==null;){if(s=e[St])return s;e=Fm(e)}return t}e=s,s=e.parentNode}return null}function ye(e){if(e=e[St]||e[es]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function qe(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function ot(e){var t=e[Da];return t||(t=e[Da]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Me(e){e[be]=!0}var Bt=new Set,yi={};function Jt(e,t){Pi(e,t),Pi(e+"Capture",t)}function Pi(e,t){for(yi[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var Rt=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]*$"),vn={},yn={};function Hg(e){return pi.call(yn,e)?!0:pi.call(vn,e)?!1:Rt.test(e)?yn[e]=!0:(vn[e]=!0,!1)}function Oa(e,t,s){if(Hg(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 Ma(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 ts(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 Si(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Th(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ug(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,m=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(D){s=""+D,m.call(this,D)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(D){s=""+D},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bl(e){if(!e._valueTracker){var t=Th(e)?"checked":"value";e._valueTracker=Ug(e,t,""+e[t])}}function Ah(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),n="";return e&&(n=Th(e)?e.checked?"true":"false":e.value),e=n,e!==s?(t.setValue(e),!0):!1}function La(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 Ig=/[\n"\\]/g;function bi(e){return e.replace(Ig,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function xl(e,t,s,n,c,m,D,z){e.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?e.type=D:e.removeAttribute("type"),t!=null?D==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Si(t)):e.value!==""+Si(t)&&(e.value=""+Si(t)):D!=="submit"&&D!=="reset"||e.removeAttribute("value"),t!=null?Cl(e,D,Si(t)):s!=null?Cl(e,D,Si(s)):n!=null&&e.removeAttribute("value"),c==null&&m!=null&&(e.defaultChecked=!!m),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?e.name=""+Si(z):e.removeAttribute("name")}function Rh(e,t,s,n,c,m,D,z){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.type=m),t!=null||s!=null){if(!(m!=="submit"&&m!=="reset"||t!=null)){bl(e);return}s=s!=null?""+Si(s):"",t=t!=null?""+Si(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,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(e.name=D),bl(e)}function Cl(e,t,s){t==="number"&&La(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function xr(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=""+Si(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 kh(e,t,s){if(t!=null&&(t=""+Si(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Si(s):""}function Dh(e,t,s,n){if(t==null){if(n!=null){if(s!=null)throw Error(o(92));if(te(n)){if(1<n.length)throw Error(o(93));n=n[0]}s=n}s==null&&(s=""),t=s}s=Si(t),e.defaultValue=s,n=e.textContent,n===s&&n!==""&&n!==null&&(e.value=n),bl(e)}function Cr(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var Pg=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 Oh(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||Pg.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Mh(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&&Oh(e,c,n)}else for(var m in t)t.hasOwnProperty(m)&&Oh(e,m,t[m])}function wl(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 $g=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"]]),Fg=/^[\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 Na(e){return Fg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function is(){}var El=null;function Tl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wr=null,Er=null;function Lh(e){var t=ye(e);if(t&&(e=t.stateNode)){var s=e[st]||null;e:switch(e=t.stateNode,t.type){case"input":if(xl(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="'+bi(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var n=s[t];if(n!==e&&n.form===e.form){var c=n[st]||null;if(!c)throw Error(o(90));xl(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&&Ah(n)}break e;case"textarea":kh(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&xr(e,!!s.multiple,t,!1)}}}var Al=!1;function Nh(e,t,s){if(Al)return e(t,s);Al=!0;try{var n=e(t);return n}finally{if(Al=!1,(wr!==null||Er!==null)&&(xo(),wr&&(t=wr,e=Er,Er=wr=null,Lh(t),e)))for(t=0;t<e.length;t++)Lh(e[t])}}function Sn(e,t){var s=e.stateNode;if(s===null)return null;var n=s[st]||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 ss=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rl=!1;if(ss)try{var bn={};Object.defineProperty(bn,"passive",{get:function(){Rl=!0}}),window.addEventListener("test",bn,bn),window.removeEventListener("test",bn,bn)}catch{Rl=!1}var Cs=null,kl=null,ja=null;function jh(){if(ja)return ja;var e,t=kl,s=t.length,n,c="value"in Cs?Cs.value:Cs.textContent,m=c.length;for(e=0;e<s&&t[e]===c[e];e++);var D=s-e;for(n=1;n<=D&&t[s-n]===c[m-n];n++);return ja=c.slice(e,1<n?1-n:void 0)}function Ba(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 za(){return!0}function Bh(){return!1}function Qt(e){function t(s,n,c,m,D){this._reactName=s,this._targetInst=c,this.type=n,this.nativeEvent=m,this.target=D,this.currentTarget=null;for(var z in e)e.hasOwnProperty(z)&&(s=e[z],this[z]=s?s(m):m[z]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?za:Bh,this.isPropagationStopped=Bh,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=za)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=za)},persist:function(){},isPersistent:za}),t}var er={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ha=Qt(er),xn=d({},er,{view:0,detail:0}),Zg=Qt(xn),Dl,Ol,Cn,Ua=d({},xn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ll,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!==Cn&&(Cn&&e.type==="mousemove"?(Dl=e.screenX-Cn.screenX,Ol=e.screenY-Cn.screenY):Ol=Dl=0,Cn=e),Dl)},movementY:function(e){return"movementY"in e?e.movementY:Ol}}),zh=Qt(Ua),qg=d({},Ua,{dataTransfer:0}),Gg=Qt(qg),Kg=d({},xn,{relatedTarget:0}),Ml=Qt(Kg),Vg=d({},er,{animationName:0,elapsedTime:0,pseudoElement:0}),Wg=Qt(Vg),Yg=d({},er,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Xg=Qt(Yg),Jg=d({},er,{data:0}),Hh=Qt(Jg),Qg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ev={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"},tv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function iv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tv[e])?!!t[e]:!1}function Ll(){return iv}var sv=d({},xn,{key:function(e){if(e.key){var t=Qg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ba(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ev[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ll,charCode:function(e){return e.type==="keypress"?Ba(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ba(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),rv=Qt(sv),nv=d({},Ua,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Uh=Qt(nv),av=d({},xn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ll}),ov=Qt(av),lv=d({},er,{propertyName:0,elapsedTime:0,pseudoElement:0}),cv=Qt(lv),uv=d({},Ua,{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}),hv=Qt(uv),fv=d({},er,{newState:0,oldState:0}),dv=Qt(fv),mv=[9,13,27,32],Nl=ss&&"CompositionEvent"in window,wn=null;ss&&"documentMode"in document&&(wn=document.documentMode);var pv=ss&&"TextEvent"in window&&!wn,Ih=ss&&(!Nl||wn&&8<wn&&11>=wn),Ph=" ",$h=!1;function Fh(e,t){switch(e){case"keyup":return mv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Tr=!1;function _v(e,t){switch(e){case"compositionend":return Zh(t);case"keypress":return t.which!==32?null:($h=!0,Ph);case"textInput":return e=t.data,e===Ph&&$h?null:e;default:return null}}function gv(e,t){if(Tr)return e==="compositionend"||!Nl&&Fh(e,t)?(e=jh(),ja=kl=Cs=null,Tr=!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 Ih&&t.locale!=="ko"?null:t.data;default:return null}}var vv={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 qh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!vv[e.type]:t==="textarea"}function Gh(e,t,s,n){wr?Er?Er.push(n):Er=[n]:wr=n,t=ko(t,"onChange"),0<t.length&&(s=new Ha("onChange","change",null,s,n),e.push({event:s,listeners:t}))}var En=null,Tn=null;function yv(e){km(e,0)}function Ia(e){var t=qe(e);if(Ah(t))return e}function Kh(e,t){if(e==="change")return t}var Vh=!1;if(ss){var jl;if(ss){var Bl="oninput"in document;if(!Bl){var Wh=document.createElement("div");Wh.setAttribute("oninput","return;"),Bl=typeof Wh.oninput=="function"}jl=Bl}else jl=!1;Vh=jl&&(!document.documentMode||9<document.documentMode)}function Yh(){En&&(En.detachEvent("onpropertychange",Xh),Tn=En=null)}function Xh(e){if(e.propertyName==="value"&&Ia(Tn)){var t=[];Gh(t,Tn,e,Tl(e)),Nh(yv,t)}}function Sv(e,t,s){e==="focusin"?(Yh(),En=t,Tn=s,En.attachEvent("onpropertychange",Xh)):e==="focusout"&&Yh()}function bv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ia(Tn)}function xv(e,t){if(e==="click")return Ia(t)}function Cv(e,t){if(e==="input"||e==="change")return Ia(t)}function wv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oi=typeof Object.is=="function"?Object.is:wv;function An(e,t){if(oi(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(!pi.call(t,c)||!oi(e[c],t[c]))return!1}return!0}function Jh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qh(e,t){var s=Jh(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=Jh(s)}}function ef(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ef(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function tf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=La(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=La(e.document)}return t}function zl(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 Ev=ss&&"documentMode"in document&&11>=document.documentMode,Ar=null,Hl=null,Rn=null,Ul=!1;function sf(e,t,s){var n=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Ul||Ar==null||Ar!==La(n)||(n=Ar,"selectionStart"in n&&zl(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}),Rn&&An(Rn,n)||(Rn=n,n=ko(Hl,"onSelect"),0<n.length&&(t=new Ha("onSelect","select",null,t,s),e.push({event:t,listeners:n}),t.target=Ar)))}function tr(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Rr={animationend:tr("Animation","AnimationEnd"),animationiteration:tr("Animation","AnimationIteration"),animationstart:tr("Animation","AnimationStart"),transitionrun:tr("Transition","TransitionRun"),transitionstart:tr("Transition","TransitionStart"),transitioncancel:tr("Transition","TransitionCancel"),transitionend:tr("Transition","TransitionEnd")},Il={},rf={};ss&&(rf=document.createElement("div").style,"AnimationEvent"in window||(delete Rr.animationend.animation,delete Rr.animationiteration.animation,delete Rr.animationstart.animation),"TransitionEvent"in window||delete Rr.transitionend.transition);function ir(e){if(Il[e])return Il[e];if(!Rr[e])return e;var t=Rr[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in rf)return Il[e]=t[s];return e}var nf=ir("animationend"),af=ir("animationiteration"),of=ir("animationstart"),Tv=ir("transitionrun"),Av=ir("transitionstart"),Rv=ir("transitioncancel"),lf=ir("transitionend"),cf=new Map,Pl="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(" ");Pl.push("scrollEnd");function ji(e,t){cf.set(e,t),Jt(t,[e])}var Pa=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)},xi=[],kr=0,$l=0;function $a(){for(var e=kr,t=$l=kr=0;t<e;){var s=xi[t];xi[t++]=null;var n=xi[t];xi[t++]=null;var c=xi[t];xi[t++]=null;var m=xi[t];if(xi[t++]=null,n!==null&&c!==null){var D=n.pending;D===null?c.next=c:(c.next=D.next,D.next=c),n.pending=c}m!==0&&uf(s,c,m)}}function Fa(e,t,s,n){xi[kr++]=e,xi[kr++]=t,xi[kr++]=s,xi[kr++]=n,$l|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Fl(e,t,s,n){return Fa(e,t,s,n),Za(e)}function sr(e,t){return Fa(e,null,null,t),Za(e)}function uf(e,t,s){e.lanes|=s;var n=e.alternate;n!==null&&(n.lanes|=s);for(var c=!1,m=e.return;m!==null;)m.childLanes|=s,n=m.alternate,n!==null&&(n.childLanes|=s),m.tag===22&&(e=m.stateNode,e===null||e._visibility&1||(c=!0)),e=m,m=m.return;return e.tag===3?(m=e.stateNode,c&&t!==null&&(c=31-yt(s),e=m.hiddenUpdates,n=e[c],n===null?e[c]=[t]:n.push(t),t.lane=s|536870912),m):null}function Za(e){if(50<Yn)throw Yn=0,Jc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Dr={};function kv(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 li(e,t,s,n){return new kv(e,t,s,n)}function Zl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rs(e,t){var s=e.alternate;return s===null?(s=li(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 hf(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 qa(e,t,s,n,c,m){var D=0;if(n=e,typeof e=="function")Zl(e)&&(D=1);else if(typeof e=="string")D=N0(e,s,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case N:return e=li(31,s,t,c),e.elementType=N,e.lanes=m,e;case b:return rr(s.children,c,m,t);case p:D=8,c|=24;break;case v:return e=li(12,s,t,c|2),e.elementType=v,e.lanes=m,e;case R:return e=li(13,s,t,c),e.elementType=R,e.lanes=m,e;case k:return e=li(19,s,t,c),e.elementType=k,e.lanes=m,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _:D=10;break e;case f:D=9;break e;case S:D=11;break e;case M:D=14;break e;case T:D=16,n=null;break e}D=29,s=Error(o(130,e===null?"null":typeof e,"")),n=null}return t=li(D,s,t,c),t.elementType=e,t.type=n,t.lanes=m,t}function rr(e,t,s,n){return e=li(7,e,n,t),e.lanes=s,e}function ql(e,t,s){return e=li(6,e,null,t),e.lanes=s,e}function ff(e){var t=li(18,null,null,0);return t.stateNode=e,t}function Gl(e,t,s){return t=li(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var df=new WeakMap;function Ci(e,t){if(typeof e=="object"&&e!==null){var s=df.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Ft(t)},df.set(e,t),t)}return{value:e,source:t,stack:Ft(t)}}var Or=[],Mr=0,Ga=null,kn=0,wi=[],Ei=0,ws=null,$i=1,Fi="";function ns(e,t){Or[Mr++]=kn,Or[Mr++]=Ga,Ga=e,kn=t}function mf(e,t,s){wi[Ei++]=$i,wi[Ei++]=Fi,wi[Ei++]=ws,ws=e;var n=$i;e=Fi;var c=32-yt(n)-1;n&=~(1<<c),s+=1;var m=32-yt(t)+c;if(30<m){var D=c-c%5;m=(n&(1<<D)-1).toString(32),n>>=D,c-=D,$i=1<<32-yt(t)+c|s<<c|n,Fi=m+e}else $i=1<<m|s<<c|n,Fi=e}function Kl(e){e.return!==null&&(ns(e,1),mf(e,1,0))}function Vl(e){for(;e===Ga;)Ga=Or[--Mr],Or[Mr]=null,kn=Or[--Mr],Or[Mr]=null;for(;e===ws;)ws=wi[--Ei],wi[Ei]=null,Fi=wi[--Ei],wi[Ei]=null,$i=wi[--Ei],wi[Ei]=null}function pf(e,t){wi[Ei++]=$i,wi[Ei++]=Fi,wi[Ei++]=ws,$i=t.id,Fi=t.overflow,ws=e}var zt=null,tt=null,Ie=!1,Es=null,Ti=!1,Wl=Error(o(519));function Ts(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Dn(Ci(t,e)),Wl}function _f(e){var t=e.stateNode,s=e.type,n=e.memoizedProps;switch(t[St]=e,t[st]=n,s){case"dialog":ze("cancel",t),ze("close",t);break;case"iframe":case"object":case"embed":ze("load",t);break;case"video":case"audio":for(s=0;s<Jn.length;s++)ze(Jn[s],t);break;case"source":ze("error",t);break;case"img":case"image":case"link":ze("error",t),ze("load",t);break;case"details":ze("toggle",t);break;case"input":ze("invalid",t),Rh(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":ze("invalid",t);break;case"textarea":ze("invalid",t),Dh(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||Lm(t.textContent,s)?(n.popover!=null&&(ze("beforetoggle",t),ze("toggle",t)),n.onScroll!=null&&ze("scroll",t),n.onScrollEnd!=null&&ze("scrollend",t),n.onClick!=null&&(t.onclick=is),t=!0):t=!1,t||Ts(e,!0)}function gf(e){for(zt=e.return;zt;)switch(zt.tag){case 5:case 31:case 13:Ti=!1;return;case 27:case 3:Ti=!0;return;default:zt=zt.return}}function Lr(e){if(e!==zt)return!1;if(!Ie)return gf(e),Ie=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||du(e.type,e.memoizedProps)),s=!s),s&&tt&&Ts(e),gf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));tt=$m(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));tt=$m(e)}else t===27?(t=tt,Is(e.type)?(e=vu,vu=null,tt=e):tt=t):tt=zt?Ri(e.stateNode.nextSibling):null;return!0}function nr(){tt=zt=null,Ie=!1}function Yl(){var e=Es;return e!==null&&(si===null?si=e:si.push.apply(si,e),Es=null),e}function Dn(e){Es===null?Es=[e]:Es.push(e)}var Xl=L(null),ar=null,as=null;function As(e,t,s){W(Xl,t._currentValue),t._currentValue=s}function os(e){e._currentValue=Xl.current,H(Xl)}function Jl(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 Ql(e,t,s,n){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var m=c.dependencies;if(m!==null){var D=c.child;m=m.firstContext;e:for(;m!==null;){var z=m;m=c;for(var Z=0;Z<t.length;Z++)if(z.context===t[Z]){m.lanes|=s,z=m.alternate,z!==null&&(z.lanes|=s),Jl(m.return,s,e),n||(D=null);break e}m=z.next}}else if(c.tag===18){if(D=c.return,D===null)throw Error(o(341));D.lanes|=s,m=D.alternate,m!==null&&(m.lanes|=s),Jl(D,s,e),D=null}else D=c.child;if(D!==null)D.return=c;else for(D=c;D!==null;){if(D===e){D=null;break}if(c=D.sibling,c!==null){c.return=D.return,D=c;break}D=D.return}c=D}}function Nr(e,t,s,n){e=null;for(var c=t,m=!1;c!==null;){if(!m){if((c.flags&524288)!==0)m=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var D=c.alternate;if(D===null)throw Error(o(387));if(D=D.memoizedProps,D!==null){var z=c.type;oi(c.pendingProps.value,D.value)||(e!==null?e.push(z):e=[z])}}else if(c===V.current){if(D=c.alternate,D===null)throw Error(o(387));D.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(sa):e=[sa])}c=c.return}e!==null&&Ql(t,e,s,n),t.flags|=262144}function Ka(e){for(e=e.firstContext;e!==null;){if(!oi(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function or(e){ar=e,as=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ht(e){return vf(ar,e)}function Va(e,t){return ar===null&&or(e),vf(e,t)}function vf(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},as===null){if(e===null)throw Error(o(308));as=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else as=as.next=t;return s}var Dv=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()})}},Ov=i.unstable_scheduleCallback,Mv=i.unstable_NormalPriority,bt={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ec(){return{controller:new Dv,data:new Map,refCount:0}}function On(e){e.refCount--,e.refCount===0&&Ov(Mv,function(){e.controller.abort()})}var Mn=null,tc=0,jr=0,Br=null;function Lv(e,t){if(Mn===null){var s=Mn=[];tc=0,jr=ru(),Br={status:"pending",value:void 0,then:function(n){s.push(n)}}}return tc++,t.then(yf,yf),t}function yf(){if(--tc===0&&Mn!==null){Br!==null&&(Br.status="fulfilled");var e=Mn;Mn=null,jr=0,Br=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Nv(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 Sf=q.S;q.S=function(e,t){sm=at(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Lv(e,t),Sf!==null&&Sf(e,t)};var lr=L(null);function ic(){var e=lr.current;return e!==null?e:Qe.pooledCache}function Wa(e,t){t===null?W(lr,lr.current):W(lr,t.pool)}function bf(){var e=ic();return e===null?null:{parent:bt._currentValue,pool:e}}var zr=Error(o(460)),sc=Error(o(474)),Ya=Error(o(542)),Xa={then:function(){}};function xf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Cf(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(is,is),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ef(e),e;default:if(typeof t.status=="string")t.then(is,is);else{if(e=Qe,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,Ef(e),e}throw ur=t,zr}}function cr(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ur=s,zr):s}}var ur=null;function wf(){if(ur===null)throw Error(o(459));var e=ur;return ur=null,e}function Ef(e){if(e===zr||e===Ya)throw Error(o(483))}var Hr=null,Ln=0;function Ja(e){var t=Ln;return Ln+=1,Hr===null&&(Hr=[]),Cf(Hr,e,t)}function Nn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Qa(e,t){throw t.$$typeof===x?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Tf(e){function t(Q,X){if(e){var ie=Q.deletions;ie===null?(Q.deletions=[X],Q.flags|=16):ie.push(X)}}function s(Q,X){if(!e)return null;for(;X!==null;)t(Q,X),X=X.sibling;return null}function n(Q){for(var X=new Map;Q!==null;)Q.key!==null?X.set(Q.key,Q):X.set(Q.index,Q),Q=Q.sibling;return X}function c(Q,X){return Q=rs(Q,X),Q.index=0,Q.sibling=null,Q}function m(Q,X,ie){return Q.index=ie,e?(ie=Q.alternate,ie!==null?(ie=ie.index,ie<X?(Q.flags|=67108866,X):ie):(Q.flags|=67108866,X)):(Q.flags|=1048576,X)}function D(Q){return e&&Q.alternate===null&&(Q.flags|=67108866),Q}function z(Q,X,ie,he){return X===null||X.tag!==6?(X=ql(ie,Q.mode,he),X.return=Q,X):(X=c(X,ie),X.return=Q,X)}function Z(Q,X,ie,he){var Ce=ie.type;return Ce===b?le(Q,X,ie.props.children,he,ie.key):X!==null&&(X.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===T&&cr(Ce)===X.type)?(X=c(X,ie.props),Nn(X,ie),X.return=Q,X):(X=qa(ie.type,ie.key,ie.props,null,Q.mode,he),Nn(X,ie),X.return=Q,X)}function se(Q,X,ie,he){return X===null||X.tag!==4||X.stateNode.containerInfo!==ie.containerInfo||X.stateNode.implementation!==ie.implementation?(X=Gl(ie,Q.mode,he),X.return=Q,X):(X=c(X,ie.children||[]),X.return=Q,X)}function le(Q,X,ie,he,Ce){return X===null||X.tag!==7?(X=rr(ie,Q.mode,he,Ce),X.return=Q,X):(X=c(X,ie),X.return=Q,X)}function de(Q,X,ie){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=ql(""+X,Q.mode,ie),X.return=Q,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case E:return ie=qa(X.type,X.key,X.props,null,Q.mode,ie),Nn(ie,X),ie.return=Q,ie;case O:return X=Gl(X,Q.mode,ie),X.return=Q,X;case T:return X=cr(X),de(Q,X,ie)}if(te(X)||G(X))return X=rr(X,Q.mode,ie,null),X.return=Q,X;if(typeof X.then=="function")return de(Q,Ja(X),ie);if(X.$$typeof===_)return de(Q,Va(Q,X),ie);Qa(Q,X)}return null}function ne(Q,X,ie,he){var Ce=X!==null?X.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Ce!==null?null:z(Q,X,""+ie,he);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case E:return ie.key===Ce?Z(Q,X,ie,he):null;case O:return ie.key===Ce?se(Q,X,ie,he):null;case T:return ie=cr(ie),ne(Q,X,ie,he)}if(te(ie)||G(ie))return Ce!==null?null:le(Q,X,ie,he,null);if(typeof ie.then=="function")return ne(Q,X,Ja(ie),he);if(ie.$$typeof===_)return ne(Q,X,Va(Q,ie),he);Qa(Q,ie)}return null}function ae(Q,X,ie,he,Ce){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return Q=Q.get(ie)||null,z(X,Q,""+he,Ce);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case E:return Q=Q.get(he.key===null?ie:he.key)||null,Z(X,Q,he,Ce);case O:return Q=Q.get(he.key===null?ie:he.key)||null,se(X,Q,he,Ce);case T:return he=cr(he),ae(Q,X,ie,he,Ce)}if(te(he)||G(he))return Q=Q.get(ie)||null,le(X,Q,he,Ce,null);if(typeof he.then=="function")return ae(Q,X,ie,Ja(he),Ce);if(he.$$typeof===_)return ae(Q,X,ie,Va(X,he),Ce);Qa(X,he)}return null}function Se(Q,X,ie,he){for(var Ce=null,$e=null,xe=X,Oe=X=0,Ue=null;xe!==null&&Oe<ie.length;Oe++){xe.index>Oe?(Ue=xe,xe=null):Ue=xe.sibling;var Fe=ne(Q,xe,ie[Oe],he);if(Fe===null){xe===null&&(xe=Ue);break}e&&xe&&Fe.alternate===null&&t(Q,xe),X=m(Fe,X,Oe),$e===null?Ce=Fe:$e.sibling=Fe,$e=Fe,xe=Ue}if(Oe===ie.length)return s(Q,xe),Ie&&ns(Q,Oe),Ce;if(xe===null){for(;Oe<ie.length;Oe++)xe=de(Q,ie[Oe],he),xe!==null&&(X=m(xe,X,Oe),$e===null?Ce=xe:$e.sibling=xe,$e=xe);return Ie&&ns(Q,Oe),Ce}for(xe=n(xe);Oe<ie.length;Oe++)Ue=ae(xe,Q,Oe,ie[Oe],he),Ue!==null&&(e&&Ue.alternate!==null&&xe.delete(Ue.key===null?Oe:Ue.key),X=m(Ue,X,Oe),$e===null?Ce=Ue:$e.sibling=Ue,$e=Ue);return e&&xe.forEach(function(qs){return t(Q,qs)}),Ie&&ns(Q,Oe),Ce}function Ee(Q,X,ie,he){if(ie==null)throw Error(o(151));for(var Ce=null,$e=null,xe=X,Oe=X=0,Ue=null,Fe=ie.next();xe!==null&&!Fe.done;Oe++,Fe=ie.next()){xe.index>Oe?(Ue=xe,xe=null):Ue=xe.sibling;var qs=ne(Q,xe,Fe.value,he);if(qs===null){xe===null&&(xe=Ue);break}e&&xe&&qs.alternate===null&&t(Q,xe),X=m(qs,X,Oe),$e===null?Ce=qs:$e.sibling=qs,$e=qs,xe=Ue}if(Fe.done)return s(Q,xe),Ie&&ns(Q,Oe),Ce;if(xe===null){for(;!Fe.done;Oe++,Fe=ie.next())Fe=de(Q,Fe.value,he),Fe!==null&&(X=m(Fe,X,Oe),$e===null?Ce=Fe:$e.sibling=Fe,$e=Fe);return Ie&&ns(Q,Oe),Ce}for(xe=n(xe);!Fe.done;Oe++,Fe=ie.next())Fe=ae(xe,Q,Oe,Fe.value,he),Fe!==null&&(e&&Fe.alternate!==null&&xe.delete(Fe.key===null?Oe:Fe.key),X=m(Fe,X,Oe),$e===null?Ce=Fe:$e.sibling=Fe,$e=Fe);return e&&xe.forEach(function(q0){return t(Q,q0)}),Ie&&ns(Q,Oe),Ce}function Je(Q,X,ie,he){if(typeof ie=="object"&&ie!==null&&ie.type===b&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case E:e:{for(var Ce=ie.key;X!==null;){if(X.key===Ce){if(Ce=ie.type,Ce===b){if(X.tag===7){s(Q,X.sibling),he=c(X,ie.props.children),he.return=Q,Q=he;break e}}else if(X.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===T&&cr(Ce)===X.type){s(Q,X.sibling),he=c(X,ie.props),Nn(he,ie),he.return=Q,Q=he;break e}s(Q,X);break}else t(Q,X);X=X.sibling}ie.type===b?(he=rr(ie.props.children,Q.mode,he,ie.key),he.return=Q,Q=he):(he=qa(ie.type,ie.key,ie.props,null,Q.mode,he),Nn(he,ie),he.return=Q,Q=he)}return D(Q);case O:e:{for(Ce=ie.key;X!==null;){if(X.key===Ce)if(X.tag===4&&X.stateNode.containerInfo===ie.containerInfo&&X.stateNode.implementation===ie.implementation){s(Q,X.sibling),he=c(X,ie.children||[]),he.return=Q,Q=he;break e}else{s(Q,X);break}else t(Q,X);X=X.sibling}he=Gl(ie,Q.mode,he),he.return=Q,Q=he}return D(Q);case T:return ie=cr(ie),Je(Q,X,ie,he)}if(te(ie))return Se(Q,X,ie,he);if(G(ie)){if(Ce=G(ie),typeof Ce!="function")throw Error(o(150));return ie=Ce.call(ie),Ee(Q,X,ie,he)}if(typeof ie.then=="function")return Je(Q,X,Ja(ie),he);if(ie.$$typeof===_)return Je(Q,X,Va(Q,ie),he);Qa(Q,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,X!==null&&X.tag===6?(s(Q,X.sibling),he=c(X,ie),he.return=Q,Q=he):(s(Q,X),he=ql(ie,Q.mode,he),he.return=Q,Q=he),D(Q)):s(Q,X)}return function(Q,X,ie,he){try{Ln=0;var Ce=Je(Q,X,ie,he);return Hr=null,Ce}catch(xe){if(xe===zr||xe===Ya)throw xe;var $e=li(29,xe,null,Q.mode);return $e.lanes=he,$e.return=Q,$e}finally{}}}var hr=Tf(!0),Af=Tf(!1),Rs=!1;function rc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ks(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ds(e,t,s){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Ze&2)!==0){var c=n.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),n.pending=t,t=Za(e),uf(e,null,s),t}return Fa(e,n,t,s),Za(e)}function jn(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,pn(e,s)}}function ac(e,t){var s=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,s===n)){var c=null,m=null;if(s=s.firstBaseUpdate,s!==null){do{var D={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};m===null?c=m=D:m=m.next=D,s=s.next}while(s!==null);m===null?c=m=t:m=m.next=t}else c=m=t;s={baseState:n.baseState,firstBaseUpdate:c,lastBaseUpdate:m,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 oc=!1;function Bn(){if(oc){var e=Br;if(e!==null)throw e}}function zn(e,t,s,n){oc=!1;var c=e.updateQueue;Rs=!1;var m=c.firstBaseUpdate,D=c.lastBaseUpdate,z=c.shared.pending;if(z!==null){c.shared.pending=null;var Z=z,se=Z.next;Z.next=null,D===null?m=se:D.next=se,D=Z;var le=e.alternate;le!==null&&(le=le.updateQueue,z=le.lastBaseUpdate,z!==D&&(z===null?le.firstBaseUpdate=se:z.next=se,le.lastBaseUpdate=Z))}if(m!==null){var de=c.baseState;D=0,le=se=Z=null,z=m;do{var ne=z.lane&-536870913,ae=ne!==z.lane;if(ae?(He&ne)===ne:(n&ne)===ne){ne!==0&&ne===jr&&(oc=!0),le!==null&&(le=le.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var Se=e,Ee=z;ne=t;var Je=s;switch(Ee.tag){case 1:if(Se=Ee.payload,typeof Se=="function"){de=Se.call(Je,de,ne);break e}de=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ee.payload,ne=typeof Se=="function"?Se.call(Je,de,ne):Se,ne==null)break e;de=d({},de,ne);break e;case 2:Rs=!0}}ne=z.callback,ne!==null&&(e.flags|=64,ae&&(e.flags|=8192),ae=c.callbacks,ae===null?c.callbacks=[ne]:ae.push(ne))}else ae={lane:ne,tag:z.tag,payload:z.payload,callback:z.callback,next:null},le===null?(se=le=ae,Z=de):le=le.next=ae,D|=ne;if(z=z.next,z===null){if(z=c.shared.pending,z===null)break;ae=z,z=ae.next,ae.next=null,c.lastBaseUpdate=ae,c.shared.pending=null}}while(!0);le===null&&(Z=de),c.baseState=Z,c.firstBaseUpdate=se,c.lastBaseUpdate=le,m===null&&(c.shared.lanes=0),js|=D,e.lanes=D,e.memoizedState=de}}function Rf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function kf(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Rf(s[e],t)}var Ur=L(null),eo=L(0);function Df(e,t){e=_s,W(eo,e),W(Ur,t),_s=e|t.baseLanes}function lc(){W(eo,_s),W(Ur,Ur.current)}function cc(){_s=eo.current,H(Ur),H(eo)}var ci=L(null),Ai=null;function Os(e){var t=e.alternate;W(gt,gt.current&1),W(ci,e),Ai===null&&(t===null||Ur.current!==null||t.memoizedState!==null)&&(Ai=e)}function uc(e){W(gt,gt.current),W(ci,e),Ai===null&&(Ai=e)}function Of(e){e.tag===22?(W(gt,gt.current),W(ci,e),Ai===null&&(Ai=e)):Ms()}function Ms(){W(gt,gt.current),W(ci,ci.current)}function ui(e){H(ci),Ai===e&&(Ai=null),H(gt)}var gt=L(0);function to(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||_u(s)||gu(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 ls=0,ke=null,Ye=null,xt=null,io=!1,Ir=!1,fr=!1,so=0,Hn=0,Pr=null,jv=0;function ht(){throw Error(o(321))}function hc(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!oi(e[s],t[s]))return!1;return!0}function fc(e,t,s,n,c,m){return ls=m,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,q.H=e===null||e.memoizedState===null?md:Ac,fr=!1,m=s(n,c),fr=!1,Ir&&(m=Lf(t,s,n,c)),Mf(e),m}function Mf(e){q.H=Pn;var t=Ye!==null&&Ye.next!==null;if(ls=0,xt=Ye=ke=null,io=!1,Hn=0,Pr=null,t)throw Error(o(300));e===null||Ct||(e=e.dependencies,e!==null&&Ka(e)&&(Ct=!0))}function Lf(e,t,s,n){ke=e;var c=0;do{if(Ir&&(Pr=null),Hn=0,Ir=!1,25<=c)throw Error(o(301));if(c+=1,xt=Ye=null,e.updateQueue!=null){var m=e.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}q.H=pd,m=t(s,n)}while(Ir);return m}function Bv(){var e=q.H,t=e.useState()[0];return t=typeof t.then=="function"?Un(t):t,e=e.useState()[0],(Ye!==null?Ye.memoizedState:null)!==e&&(ke.flags|=1024),t}function dc(){var e=so!==0;return so=0,e}function mc(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function pc(e){if(io){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}io=!1}ls=0,xt=Ye=ke=null,Ir=!1,Hn=so=0,Pr=null}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?ke.memoizedState=xt=e:xt=xt.next=e,xt}function vt(){if(Ye===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var t=xt===null?ke.memoizedState:xt.next;if(t!==null)xt=t,Ye=e;else{if(e===null)throw ke.alternate===null?Error(o(467)):Error(o(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},xt===null?ke.memoizedState=xt=e:xt=xt.next=e}return xt}function ro(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Un(e){var t=Hn;return Hn+=1,Pr===null&&(Pr=[]),e=Cf(Pr,e,t),t=ke,(xt===null?t.memoizedState:xt.next)===null&&(t=t.alternate,q.H=t===null||t.memoizedState===null?md:Ac),e}function no(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Un(e);if(e.$$typeof===_)return Ht(e)}throw Error(o(438,String(e)))}function _c(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=ro(),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]=P;return t.index++,s}function cs(e,t){return typeof t=="function"?t(e):t}function ao(e){var t=vt();return gc(t,Ye,e)}function gc(e,t,s){var n=e.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=s;var c=e.baseQueue,m=n.pending;if(m!==null){if(c!==null){var D=c.next;c.next=m.next,m.next=D}t.baseQueue=c=m,n.pending=null}if(m=e.baseState,c===null)e.memoizedState=m;else{t=c.next;var z=D=null,Z=null,se=t,le=!1;do{var de=se.lane&-536870913;if(de!==se.lane?(He&de)===de:(ls&de)===de){var ne=se.revertLane;if(ne===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),de===jr&&(le=!0);else if((ls&ne)===ne){se=se.next,ne===jr&&(le=!0);continue}else de={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},Z===null?(z=Z=de,D=m):Z=Z.next=de,ke.lanes|=ne,js|=ne;de=se.action,fr&&s(m,de),m=se.hasEagerState?se.eagerState:s(m,de)}else ne={lane:de,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},Z===null?(z=Z=ne,D=m):Z=Z.next=ne,ke.lanes|=de,js|=de;se=se.next}while(se!==null&&se!==t);if(Z===null?D=m:Z.next=z,!oi(m,e.memoizedState)&&(Ct=!0,le&&(s=Br,s!==null)))throw s;e.memoizedState=m,e.baseState=D,e.baseQueue=Z,n.lastRenderedState=m}return c===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function vc(e){var t=vt(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var n=s.dispatch,c=s.pending,m=t.memoizedState;if(c!==null){s.pending=null;var D=c=c.next;do m=e(m,D.action),D=D.next;while(D!==c);oi(m,t.memoizedState)||(Ct=!0),t.memoizedState=m,t.baseQueue===null&&(t.baseState=m),s.lastRenderedState=m}return[m,n]}function Nf(e,t,s){var n=ke,c=vt(),m=Ie;if(m){if(s===void 0)throw Error(o(407));s=s()}else s=t();var D=!oi((Ye||c).memoizedState,s);if(D&&(c.memoizedState=s,Ct=!0),c=c.queue,bc(zf.bind(null,n,c,e),[e]),c.getSnapshot!==t||D||xt!==null&&xt.memoizedState.tag&1){if(n.flags|=2048,$r(9,{destroy:void 0},Bf.bind(null,n,c,s,t),null),Qe===null)throw Error(o(349));m||(ls&127)!==0||jf(n,t,s)}return s}function jf(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=ke.updateQueue,t===null?(t=ro(),ke.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Bf(e,t,s,n){t.value=s,t.getSnapshot=n,Hf(t)&&Uf(e)}function zf(e,t,s){return s(function(){Hf(t)&&Uf(e)})}function Hf(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!oi(e,s)}catch{return!0}}function Uf(e){var t=sr(e,2);t!==null&&ri(t,e,2)}function yc(e){var t=qt();if(typeof e=="function"){var s=e;if(e=s(),fr){Mt(!0);try{s()}finally{Mt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:e},t}function If(e,t,s,n){return e.baseState=s,gc(e,Ye,typeof n=="function"?n:cs)}function zv(e,t,s,n,c){if(co(e))throw Error(o(485));if(e=t.action,e!==null){var m={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){m.listeners.push(D)}};q.T!==null?s(!0):m.isTransition=!1,n(m),s=t.pending,s===null?(m.next=t.pending=m,Pf(t,m)):(m.next=s.next,t.pending=s.next=m)}}function Pf(e,t){var s=t.action,n=t.payload,c=e.state;if(t.isTransition){var m=q.T,D={};q.T=D;try{var z=s(c,n),Z=q.S;Z!==null&&Z(D,z),$f(e,t,z)}catch(se){Sc(e,t,se)}finally{m!==null&&D.types!==null&&(m.types=D.types),q.T=m}}else try{m=s(c,n),$f(e,t,m)}catch(se){Sc(e,t,se)}}function $f(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(n){Ff(e,t,n)},function(n){return Sc(e,t,n)}):Ff(e,t,s)}function Ff(e,t,s){t.status="fulfilled",t.value=s,Zf(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Pf(e,s)))}function Sc(e,t,s){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=s,Zf(t),t=t.next;while(t!==n)}e.action=null}function Zf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qf(e,t){return t}function Gf(e,t){if(Ie){var s=Qe.formState;if(s!==null){e:{var n=ke;if(Ie){if(tt){t:{for(var c=tt,m=Ti;c.nodeType!==8;){if(!m){c=null;break t}if(c=Ri(c.nextSibling),c===null){c=null;break t}}m=c.data,c=m==="F!"||m==="F"?c:null}if(c){tt=Ri(c.nextSibling),n=c.data==="F!";break e}}Ts(n)}n=!1}n&&(t=s[0])}}return s=qt(),s.memoizedState=s.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qf,lastRenderedState:t},s.queue=n,s=hd.bind(null,ke,n),n.dispatch=s,n=yc(!1),m=Tc.bind(null,ke,!1,n.queue),n=qt(),c={state:t,dispatch:null,action:e,pending:null},n.queue=c,s=zv.bind(null,ke,c,m,s),c.dispatch=s,n.memoizedState=e,[t,s,!1]}function Kf(e){var t=vt();return Vf(t,Ye,e)}function Vf(e,t,s){if(t=gc(e,t,qf)[0],e=ao(cs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Un(t)}catch(D){throw D===zr?Ya:D}else n=t;t=vt();var c=t.queue,m=c.dispatch;return s!==t.memoizedState&&(ke.flags|=2048,$r(9,{destroy:void 0},Hv.bind(null,c,s),null)),[n,m,e]}function Hv(e,t){e.action=t}function Wf(e){var t=vt(),s=Ye;if(s!==null)return Vf(t,s,e);vt(),t=t.memoizedState,s=vt();var n=s.queue.dispatch;return s.memoizedState=e,[t,n,!1]}function $r(e,t,s,n){return e={tag:e,create:s,deps:n,inst:t,next:null},t=ke.updateQueue,t===null&&(t=ro(),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 Yf(){return vt().memoizedState}function oo(e,t,s,n){var c=qt();ke.flags|=e,c.memoizedState=$r(1|t,{destroy:void 0},s,n===void 0?null:n)}function lo(e,t,s,n){var c=vt();n=n===void 0?null:n;var m=c.memoizedState.inst;Ye!==null&&n!==null&&hc(n,Ye.memoizedState.deps)?c.memoizedState=$r(t,m,s,n):(ke.flags|=e,c.memoizedState=$r(1|t,m,s,n))}function Xf(e,t){oo(8390656,8,e,t)}function bc(e,t){lo(2048,8,e,t)}function Uv(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=ro(),ke.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Jf(e){var t=vt().memoizedState;return Uv({ref:t,nextImpl:e}),function(){if((Ze&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Qf(e,t){return lo(4,2,e,t)}function ed(e,t){return lo(4,4,e,t)}function td(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 id(e,t,s){s=s!=null?s.concat([e]):null,lo(4,4,td.bind(null,t,e),s)}function xc(){}function sd(e,t){var s=vt();t=t===void 0?null:t;var n=s.memoizedState;return t!==null&&hc(t,n[1])?n[0]:(s.memoizedState=[e,t],e)}function rd(e,t){var s=vt();t=t===void 0?null:t;var n=s.memoizedState;if(t!==null&&hc(t,n[1]))return n[0];if(n=e(),fr){Mt(!0);try{e()}finally{Mt(!1)}}return s.memoizedState=[n,t],n}function Cc(e,t,s){return s===void 0||(ls&1073741824)!==0&&(He&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=nm(),ke.lanes|=e,js|=e,s)}function nd(e,t,s,n){return oi(s,t)?s:Ur.current!==null?(e=Cc(e,s,n),oi(e,t)||(Ct=!0),e):(ls&42)===0||(ls&1073741824)!==0&&(He&261930)===0?(Ct=!0,e.memoizedState=s):(e=nm(),ke.lanes|=e,js|=e,t)}function ad(e,t,s,n,c){var m=K.p;K.p=m!==0&&8>m?m:8;var D=q.T,z={};q.T=z,Tc(e,!1,t,s);try{var Z=c(),se=q.S;if(se!==null&&se(z,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var le=Nv(Z,n);In(e,t,le,di(e))}else In(e,t,n,di(e))}catch(de){In(e,t,{then:function(){},status:"rejected",reason:de},di())}finally{K.p=m,D!==null&&z.types!==null&&(D.types=z.types),q.T=D}}function Iv(){}function wc(e,t,s,n){if(e.tag!==5)throw Error(o(476));var c=od(e).queue;ad(e,c,t,ee,s===null?Iv:function(){return ld(e),s(n)})}function od(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:ee},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ld(e){var t=od(e);t.next===null&&(t=e.alternate.memoizedState),In(e,t.next.queue,{},di())}function Ec(){return Ht(sa)}function cd(){return vt().memoizedState}function ud(){return vt().memoizedState}function Pv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=di();e=ks(s);var n=Ds(t,e,s);n!==null&&(ri(n,t,s),jn(n,t,s)),t={cache:ec()},e.payload=t;return}t=t.return}}function $v(e,t,s){var n=di();s={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},co(e)?fd(t,s):(s=Fl(e,t,s,n),s!==null&&(ri(s,e,n),dd(s,t,n)))}function hd(e,t,s){var n=di();In(e,t,s,n)}function In(e,t,s,n){var c={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(co(e))fd(t,c);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=t.lastRenderedReducer,m!==null))try{var D=t.lastRenderedState,z=m(D,s);if(c.hasEagerState=!0,c.eagerState=z,oi(z,D))return Fa(e,t,c,0),Qe===null&&$a(),!1}catch{}finally{}if(s=Fl(e,t,c,n),s!==null)return ri(s,e,n),dd(s,t,n),!0}return!1}function Tc(e,t,s,n){if(n={lane:2,revertLane:ru(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},co(e)){if(t)throw Error(o(479))}else t=Fl(e,s,n,2),t!==null&&ri(t,e,2)}function co(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function fd(e,t){Ir=io=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function dd(e,t,s){if((s&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,s|=n,t.lanes=s,pn(e,s)}}var Pn={readContext:Ht,use:no,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useLayoutEffect:ht,useInsertionEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useSyncExternalStore:ht,useId:ht,useHostTransitionStatus:ht,useFormState:ht,useActionState:ht,useOptimistic:ht,useMemoCache:ht,useCacheRefresh:ht};Pn.useEffectEvent=ht;var md={readContext:Ht,use:no,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:Xf,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,oo(4194308,4,td.bind(null,t,e),s)},useLayoutEffect:function(e,t){return oo(4194308,4,e,t)},useInsertionEffect:function(e,t){oo(4,2,e,t)},useMemo:function(e,t){var s=qt();t=t===void 0?null:t;var n=e();if(fr){Mt(!0);try{e()}finally{Mt(!1)}}return s.memoizedState=[n,t],n},useReducer:function(e,t,s){var n=qt();if(s!==void 0){var c=s(t);if(fr){Mt(!0);try{s(t)}finally{Mt(!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=$v.bind(null,ke,e),[n.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:function(e){e=yc(e);var t=e.queue,s=hd.bind(null,ke,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:xc,useDeferredValue:function(e,t){var s=qt();return Cc(s,e,t)},useTransition:function(){var e=yc(!1);return e=ad.bind(null,ke,e.queue,!0,!1),qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var n=ke,c=qt();if(Ie){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),Qe===null)throw Error(o(349));(He&127)!==0||jf(n,t,s)}c.memoizedState=s;var m={value:s,getSnapshot:t};return c.queue=m,Xf(zf.bind(null,n,m,e),[e]),n.flags|=2048,$r(9,{destroy:void 0},Bf.bind(null,n,m,s,t),null),s},useId:function(){var e=qt(),t=Qe.identifierPrefix;if(Ie){var s=Fi,n=$i;s=(n&~(1<<32-yt(n)-1)).toString(32)+s,t="_"+t+"R_"+s,s=so++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=jv++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ec,useFormState:Gf,useActionState:Gf,useOptimistic:function(e){var t=qt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Tc.bind(null,ke,!0,s),s.dispatch=t,[e,t]},useMemoCache:_c,useCacheRefresh:function(){return qt().memoizedState=Pv.bind(null,ke)},useEffectEvent:function(e){var t=qt(),s={impl:e};return t.memoizedState=s,function(){if((Ze&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Ac={readContext:Ht,use:no,useCallback:sd,useContext:Ht,useEffect:bc,useImperativeHandle:id,useInsertionEffect:Qf,useLayoutEffect:ed,useMemo:rd,useReducer:ao,useRef:Yf,useState:function(){return ao(cs)},useDebugValue:xc,useDeferredValue:function(e,t){var s=vt();return nd(s,Ye.memoizedState,e,t)},useTransition:function(){var e=ao(cs)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Un(e),t]},useSyncExternalStore:Nf,useId:cd,useHostTransitionStatus:Ec,useFormState:Kf,useActionState:Kf,useOptimistic:function(e,t){var s=vt();return If(s,Ye,e,t)},useMemoCache:_c,useCacheRefresh:ud};Ac.useEffectEvent=Jf;var pd={readContext:Ht,use:no,useCallback:sd,useContext:Ht,useEffect:bc,useImperativeHandle:id,useInsertionEffect:Qf,useLayoutEffect:ed,useMemo:rd,useReducer:vc,useRef:Yf,useState:function(){return vc(cs)},useDebugValue:xc,useDeferredValue:function(e,t){var s=vt();return Ye===null?Cc(s,e,t):nd(s,Ye.memoizedState,e,t)},useTransition:function(){var e=vc(cs)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Un(e),t]},useSyncExternalStore:Nf,useId:cd,useHostTransitionStatus:Ec,useFormState:Wf,useActionState:Wf,useOptimistic:function(e,t){var s=vt();return Ye!==null?If(s,Ye,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:_c,useCacheRefresh:ud};pd.useEffectEvent=Jf;function Rc(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 kc={enqueueSetState:function(e,t,s){e=e._reactInternals;var n=di(),c=ks(n);c.payload=t,s!=null&&(c.callback=s),t=Ds(e,c,n),t!==null&&(ri(t,e,n),jn(t,e,n))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var n=di(),c=ks(n);c.tag=1,c.payload=t,s!=null&&(c.callback=s),t=Ds(e,c,n),t!==null&&(ri(t,e,n),jn(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=di(),n=ks(s);n.tag=2,t!=null&&(n.callback=t),t=Ds(e,n,s),t!==null&&(ri(t,e,s),jn(t,e,s))}};function _d(e,t,s,n,c,m,D){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,m,D):t.prototype&&t.prototype.isPureReactComponent?!An(s,n)||!An(c,m):!0}function gd(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&&kc.enqueueReplaceState(t,t.state,null)}function dr(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 vd(e){Pa(e)}function yd(e){console.error(e)}function Sd(e){Pa(e)}function uo(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function bd(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 Dc(e,t,s){return s=ks(s),s.tag=3,s.payload={element:null},s.callback=function(){uo(e,t)},s}function xd(e){return e=ks(e),e.tag=3,e}function Cd(e,t,s,n){var c=s.type.getDerivedStateFromError;if(typeof c=="function"){var m=n.value;e.payload=function(){return c(m)},e.callback=function(){bd(t,s,n)}}var D=s.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(e.callback=function(){bd(t,s,n),typeof c!="function"&&(Bs===null?Bs=new Set([this]):Bs.add(this));var z=n.stack;this.componentDidCatch(n.value,{componentStack:z!==null?z:""})})}function Fv(e,t,s,n,c){if(s.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=s.alternate,t!==null&&Nr(t,s,c,!0),s=ci.current,s!==null){switch(s.tag){case 31:case 13:return Ai===null?Co():s.alternate===null&&ft===0&&(ft=3),s.flags&=-257,s.flags|=65536,s.lanes=c,n===Xa?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([n]):t.add(n),tu(e,n,c)),!1;case 22:return s.flags|=65536,n===Xa?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)),tu(e,n,c)),!1}throw Error(o(435,s.tag))}return tu(e,n,c),Co(),!1}if(Ie)return t=ci.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,n!==Wl&&(e=Error(o(422),{cause:n}),Dn(Ci(e,s)))):(n!==Wl&&(t=Error(o(423),{cause:n}),Dn(Ci(t,s))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,n=Ci(n,s),c=Dc(e.stateNode,n,c),ac(e,c),ft!==4&&(ft=2)),!1;var m=Error(o(520),{cause:n});if(m=Ci(m,s),Wn===null?Wn=[m]:Wn.push(m),ft!==4&&(ft=2),t===null)return!0;n=Ci(n,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=c&-c,s.lanes|=e,e=Dc(s.stateNode,n,e),ac(s,e),!1;case 1:if(t=s.type,m=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Bs===null||!Bs.has(m))))return s.flags|=65536,c&=-c,s.lanes|=c,c=xd(c),Cd(c,e,s,n),ac(s,c),!1}s=s.return}while(s!==null);return!1}var Oc=Error(o(461)),Ct=!1;function Ut(e,t,s,n){t.child=e===null?Af(t,null,s,n):hr(t,e.child,s,n)}function wd(e,t,s,n,c){s=s.render;var m=t.ref;if("ref"in n){var D={};for(var z in n)z!=="ref"&&(D[z]=n[z])}else D=n;return or(t),n=fc(e,t,s,D,m,c),z=dc(),e!==null&&!Ct?(mc(e,t,c),us(e,t,c)):(Ie&&z&&Kl(t),t.flags|=1,Ut(e,t,n,c),t.child)}function Ed(e,t,s,n,c){if(e===null){var m=s.type;return typeof m=="function"&&!Zl(m)&&m.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=m,Td(e,t,m,n,c)):(e=qa(s.type,null,n,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(m=e.child,!Uc(e,c)){var D=m.memoizedProps;if(s=s.compare,s=s!==null?s:An,s(D,n)&&e.ref===t.ref)return us(e,t,c)}return t.flags|=1,e=rs(m,n),e.ref=t.ref,e.return=t,t.child=e}function Td(e,t,s,n,c){if(e!==null){var m=e.memoizedProps;if(An(m,n)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=n=m,Uc(e,c))(e.flags&131072)!==0&&(Ct=!0);else return t.lanes=e.lanes,us(e,t,c)}return Mc(e,t,s,n,c)}function Ad(e,t,s,n){var c=n.children,m=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(m=m!==null?m.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&~m}else n=0,t.child=null;return Rd(e,t,m,s,n)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Wa(t,m!==null?m.cachePool:null),m!==null?Df(t,m):lc(),Of(t);else return n=t.lanes=536870912,Rd(e,t,m!==null?m.baseLanes|s:s,s,n)}else m!==null?(Wa(t,m.cachePool),Df(t,m),Ms(),t.memoizedState=null):(e!==null&&Wa(t,null),lc(),Ms());return Ut(e,t,c,s),t.child}function $n(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Rd(e,t,s,n,c){var m=ic();return m=m===null?null:{parent:bt._currentValue,pool:m},t.memoizedState={baseLanes:s,cachePool:m},e!==null&&Wa(t,null),lc(),Of(t),e!==null&&Nr(e,t,n,!0),t.childLanes=c,null}function ho(e,t){return t=mo({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function kd(e,t,s){return hr(t,e.child,null,s),e=ho(t,t.pendingProps),e.flags|=2,ui(t),t.memoizedState=null,e}function Zv(e,t,s){var n=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ie){if(n.mode==="hidden")return e=ho(t,n),t.lanes=536870912,$n(null,e);if(uc(t),(e=tt)?(e=Pm(e,Ti),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ws!==null?{id:$i,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},s=ff(e),s.return=t,t.child=s,zt=t,tt=null)):e=null,e===null)throw Ts(t);return t.lanes=536870912,null}return ho(t,n)}var m=e.memoizedState;if(m!==null){var D=m.dehydrated;if(uc(t),c)if(t.flags&256)t.flags&=-257,t=kd(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ct||Nr(e,t,s,!1),c=(s&e.childLanes)!==0,Ct||c){if(n=Qe,n!==null&&(D=Aa(n,s),D!==0&&D!==m.retryLane))throw m.retryLane=D,sr(e,D),ri(n,e,D),Oc;Co(),t=kd(e,t,s)}else e=m.treeContext,tt=Ri(D.nextSibling),zt=t,Ie=!0,Es=null,Ti=!1,e!==null&&pf(t,e),t=ho(t,n),t.flags|=4096;return t}return e=rs(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fo(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 Mc(e,t,s,n,c){return or(t),s=fc(e,t,s,n,void 0,c),n=dc(),e!==null&&!Ct?(mc(e,t,c),us(e,t,c)):(Ie&&n&&Kl(t),t.flags|=1,Ut(e,t,s,c),t.child)}function Dd(e,t,s,n,c,m){return or(t),t.updateQueue=null,s=Lf(t,n,s,c),Mf(e),n=dc(),e!==null&&!Ct?(mc(e,t,m),us(e,t,m)):(Ie&&n&&Kl(t),t.flags|=1,Ut(e,t,s,m),t.child)}function Od(e,t,s,n,c){if(or(t),t.stateNode===null){var m=Dr,D=s.contextType;typeof D=="object"&&D!==null&&(m=Ht(D)),m=new s(n,m),t.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=kc,t.stateNode=m,m._reactInternals=t,m=t.stateNode,m.props=n,m.state=t.memoizedState,m.refs={},rc(t),D=s.contextType,m.context=typeof D=="object"&&D!==null?Ht(D):Dr,m.state=t.memoizedState,D=s.getDerivedStateFromProps,typeof D=="function"&&(Rc(t,s,D,n),m.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(D=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),D!==m.state&&kc.enqueueReplaceState(m,m.state,null),zn(t,n,m,c),Bn(),m.state=t.memoizedState),typeof m.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){m=t.stateNode;var z=t.memoizedProps,Z=dr(s,z);m.props=Z;var se=m.context,le=s.contextType;D=Dr,typeof le=="object"&&le!==null&&(D=Ht(le));var de=s.getDerivedStateFromProps;le=typeof de=="function"||typeof m.getSnapshotBeforeUpdate=="function",z=t.pendingProps!==z,le||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(z||se!==D)&&gd(t,m,n,D),Rs=!1;var ne=t.memoizedState;m.state=ne,zn(t,n,m,c),Bn(),se=t.memoizedState,z||ne!==se||Rs?(typeof de=="function"&&(Rc(t,s,de,n),se=t.memoizedState),(Z=Rs||_d(t,s,Z,n,ne,se,D))?(le||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(t.flags|=4194308)):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=se),m.props=n,m.state=se,m.context=D,n=Z):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{m=t.stateNode,nc(e,t),D=t.memoizedProps,le=dr(s,D),m.props=le,de=t.pendingProps,ne=m.context,se=s.contextType,Z=Dr,typeof se=="object"&&se!==null&&(Z=Ht(se)),z=s.getDerivedStateFromProps,(se=typeof z=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(D!==de||ne!==Z)&&gd(t,m,n,Z),Rs=!1,ne=t.memoizedState,m.state=ne,zn(t,n,m,c),Bn();var ae=t.memoizedState;D!==de||ne!==ae||Rs||e!==null&&e.dependencies!==null&&Ka(e.dependencies)?(typeof z=="function"&&(Rc(t,s,z,n),ae=t.memoizedState),(le=Rs||_d(t,s,le,n,ne,ae,Z)||e!==null&&e.dependencies!==null&&Ka(e.dependencies))?(se||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(n,ae,Z),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(n,ae,Z)),typeof m.componentDidUpdate=="function"&&(t.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof m.componentDidUpdate!="function"||D===e.memoizedProps&&ne===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&ne===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=ae),m.props=n,m.state=ae,m.context=Z,n=le):(typeof m.componentDidUpdate!="function"||D===e.memoizedProps&&ne===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&ne===e.memoizedState||(t.flags|=1024),n=!1)}return m=n,fo(e,t),n=(t.flags&128)!==0,m||n?(m=t.stateNode,s=n&&typeof s.getDerivedStateFromError!="function"?null:m.render(),t.flags|=1,e!==null&&n?(t.child=hr(t,e.child,null,c),t.child=hr(t,null,s,c)):Ut(e,t,s,c),t.memoizedState=m.state,e=t.child):e=us(e,t,c),e}function Md(e,t,s,n){return nr(),t.flags|=256,Ut(e,t,s,n),t.child}var Lc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Nc(e){return{baseLanes:e,cachePool:bf()}}function jc(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=fi),e}function Ld(e,t,s){var n=t.pendingProps,c=!1,m=(t.flags&128)!==0,D;if((D=m)||(D=e!==null&&e.memoizedState===null?!1:(gt.current&2)!==0),D&&(c=!0,t.flags&=-129),D=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ie){if(c?Os(t):Ms(),(e=tt)?(e=Pm(e,Ti),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ws!==null?{id:$i,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},s=ff(e),s.return=t,t.child=s,zt=t,tt=null)):e=null,e===null)throw Ts(t);return gu(e)?t.lanes=32:t.lanes=536870912,null}var z=n.children;return n=n.fallback,c?(Ms(),c=t.mode,z=mo({mode:"hidden",children:z},c),n=rr(n,c,s,null),z.return=t,n.return=t,z.sibling=n,t.child=z,n=t.child,n.memoizedState=Nc(s),n.childLanes=jc(e,D,s),t.memoizedState=Lc,$n(null,n)):(Os(t),Bc(t,z))}var Z=e.memoizedState;if(Z!==null&&(z=Z.dehydrated,z!==null)){if(m)t.flags&256?(Os(t),t.flags&=-257,t=zc(e,t,s)):t.memoizedState!==null?(Ms(),t.child=e.child,t.flags|=128,t=null):(Ms(),z=n.fallback,c=t.mode,n=mo({mode:"visible",children:n.children},c),z=rr(z,c,s,null),z.flags|=2,n.return=t,z.return=t,n.sibling=z,t.child=n,hr(t,e.child,null,s),n=t.child,n.memoizedState=Nc(s),n.childLanes=jc(e,D,s),t.memoizedState=Lc,t=$n(null,n));else if(Os(t),gu(z)){if(D=z.nextSibling&&z.nextSibling.dataset,D)var se=D.dgst;D=se,n=Error(o(419)),n.stack="",n.digest=D,Dn({value:n,source:null,stack:null}),t=zc(e,t,s)}else if(Ct||Nr(e,t,s,!1),D=(s&e.childLanes)!==0,Ct||D){if(D=Qe,D!==null&&(n=Aa(D,s),n!==0&&n!==Z.retryLane))throw Z.retryLane=n,sr(e,n),ri(D,e,n),Oc;_u(z)||Co(),t=zc(e,t,s)}else _u(z)?(t.flags|=192,t.child=e.child,t=null):(e=Z.treeContext,tt=Ri(z.nextSibling),zt=t,Ie=!0,Es=null,Ti=!1,e!==null&&pf(t,e),t=Bc(t,n.children),t.flags|=4096);return t}return c?(Ms(),z=n.fallback,c=t.mode,Z=e.child,se=Z.sibling,n=rs(Z,{mode:"hidden",children:n.children}),n.subtreeFlags=Z.subtreeFlags&65011712,se!==null?z=rs(se,z):(z=rr(z,c,s,null),z.flags|=2),z.return=t,n.return=t,n.sibling=z,t.child=n,$n(null,n),n=t.child,z=e.child.memoizedState,z===null?z=Nc(s):(c=z.cachePool,c!==null?(Z=bt._currentValue,c=c.parent!==Z?{parent:Z,pool:Z}:c):c=bf(),z={baseLanes:z.baseLanes|s,cachePool:c}),n.memoizedState=z,n.childLanes=jc(e,D,s),t.memoizedState=Lc,$n(e.child,n)):(Os(t),s=e.child,e=s.sibling,s=rs(s,{mode:"visible",children:n.children}),s.return=t,s.sibling=null,e!==null&&(D=t.deletions,D===null?(t.deletions=[e],t.flags|=16):D.push(e)),t.child=s,t.memoizedState=null,s)}function Bc(e,t){return t=mo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function mo(e,t){return e=li(22,e,null,t),e.lanes=0,e}function zc(e,t,s){return hr(t,e.child,null,s),e=Bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Nd(e,t,s){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Jl(e.return,t,s)}function Hc(e,t,s,n,c,m){var D=e.memoizedState;D===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:s,tailMode:c,treeForkCount:m}:(D.isBackwards=t,D.rendering=null,D.renderingStartTime=0,D.last=n,D.tail=s,D.tailMode=c,D.treeForkCount=m)}function jd(e,t,s){var n=t.pendingProps,c=n.revealOrder,m=n.tail;n=n.children;var D=gt.current,z=(D&2)!==0;if(z?(D=D&1|2,t.flags|=128):D&=1,W(gt,D),Ut(e,t,n,s),n=Ie?kn:0,!z&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Nd(e,s,t);else if(e.tag===19)Nd(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&&to(e)===null&&(c=s),s=s.sibling;s=c,s===null?(c=t.child,t.child=null):(c=s.sibling,s.sibling=null),Hc(t,!1,c,s,m,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&&to(e)===null){t.child=c;break}e=c.sibling,c.sibling=s,s=c,c=e}Hc(t,!0,s,null,m,n);break;case"together":Hc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function us(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),js|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(Nr(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=rs(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=rs(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Uc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ka(e)))}function qv(e,t,s){switch(t.tag){case 3:U(t,t.stateNode.containerInfo),As(t,bt,e.memoizedState.cache),nr();break;case 27:case 5:oe(t);break;case 4:U(t,t.stateNode.containerInfo);break;case 10:As(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,uc(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Os(t),t.flags|=128,null):(s&t.child.childLanes)!==0?Ld(e,t,s):(Os(t),e=us(e,t,s),e!==null?e.sibling:null);Os(t);break;case 19:var c=(e.flags&128)!==0;if(n=(s&t.childLanes)!==0,n||(Nr(e,t,s,!1),n=(s&t.childLanes)!==0),c){if(n)return jd(e,t,s);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),W(gt,gt.current),n)break;return null;case 22:return t.lanes=0,Ad(e,t,s,t.pendingProps);case 24:As(t,bt,e.memoizedState.cache)}return us(e,t,s)}function Bd(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ct=!0;else{if(!Uc(e,s)&&(t.flags&128)===0)return Ct=!1,qv(e,t,s);Ct=(e.flags&131072)!==0}else Ct=!1,Ie&&(t.flags&1048576)!==0&&mf(t,kn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=cr(t.elementType),t.type=e,typeof e=="function")Zl(e)?(n=dr(e,n),t.tag=1,t=Od(null,t,e,n,s)):(t.tag=0,t=Mc(null,t,e,n,s));else{if(e!=null){var c=e.$$typeof;if(c===S){t.tag=11,t=wd(null,t,e,n,s);break e}else if(c===M){t.tag=14,t=Ed(null,t,e,n,s);break e}}throw t=J(e)||e,Error(o(306,t,""))}}return t;case 0:return Mc(e,t,t.type,t.pendingProps,s);case 1:return n=t.type,c=dr(n,t.pendingProps),Od(e,t,n,c,s);case 3:e:{if(U(t,t.stateNode.containerInfo),e===null)throw Error(o(387));n=t.pendingProps;var m=t.memoizedState;c=m.element,nc(e,t),zn(t,n,null,s);var D=t.memoizedState;if(n=D.cache,As(t,bt,n),n!==m.cache&&Ql(t,[bt],s,!0),Bn(),n=D.element,m.isDehydrated)if(m={element:n,isDehydrated:!1,cache:D.cache},t.updateQueue.baseState=m,t.memoizedState=m,t.flags&256){t=Md(e,t,n,s);break e}else if(n!==c){c=Ci(Error(o(424)),t),Dn(c),t=Md(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(tt=Ri(e.firstChild),zt=t,Ie=!0,Es=null,Ti=!0,s=Af(t,null,n,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(nr(),n===c){t=us(e,t,s);break e}Ut(e,t,n,s)}t=t.child}return t;case 26:return fo(e,t),e===null?(s=Km(t.type,null,t.pendingProps,null))?t.memoizedState=s:Ie||(s=t.type,e=t.pendingProps,n=Do(pe.current).createElement(s),n[St]=t,n[st]=e,It(n,s,e),Me(n),t.stateNode=n):t.memoizedState=Km(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return oe(t),e===null&&Ie&&(n=t.stateNode=Zm(t.type,t.pendingProps,pe.current),zt=t,Ti=!0,c=tt,Is(t.type)?(vu=c,tt=Ri(n.firstChild)):tt=c),Ut(e,t,t.pendingProps.children,s),fo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ie&&((c=n=tt)&&(n=b0(n,t.type,t.pendingProps,Ti),n!==null?(t.stateNode=n,zt=t,tt=Ri(n.firstChild),Ti=!1,c=!0):c=!1),c||Ts(t)),oe(t),c=t.type,m=t.pendingProps,D=e!==null?e.memoizedProps:null,n=m.children,du(c,m)?n=null:D!==null&&du(c,D)&&(t.flags|=32),t.memoizedState!==null&&(c=fc(e,t,Bv,null,null,s),sa._currentValue=c),fo(e,t),Ut(e,t,n,s),t.child;case 6:return e===null&&Ie&&((e=s=tt)&&(s=x0(s,t.pendingProps,Ti),s!==null?(t.stateNode=s,zt=t,tt=null,e=!0):e=!1),e||Ts(t)),null;case 13:return Ld(e,t,s);case 4:return U(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=hr(t,null,n,s):Ut(e,t,n,s),t.child;case 11:return wd(e,t,t.type,t.pendingProps,s);case 7:return Ut(e,t,t.pendingProps,s),t.child;case 8:return Ut(e,t,t.pendingProps.children,s),t.child;case 12:return Ut(e,t,t.pendingProps.children,s),t.child;case 10:return n=t.pendingProps,As(t,t.type,n.value),Ut(e,t,n.children,s),t.child;case 9:return c=t.type._context,n=t.pendingProps.children,or(t),c=Ht(c),n=n(c),t.flags|=1,Ut(e,t,n,s),t.child;case 14:return Ed(e,t,t.type,t.pendingProps,s);case 15:return Td(e,t,t.type,t.pendingProps,s);case 19:return jd(e,t,s);case 31:return Zv(e,t,s);case 22:return Ad(e,t,s,t.pendingProps);case 24:return or(t),n=Ht(bt),e===null?(c=ic(),c===null&&(c=Qe,m=ec(),c.pooledCache=m,m.refCount++,m!==null&&(c.pooledCacheLanes|=s),c=m),t.memoizedState={parent:n,cache:c},rc(t),As(t,bt,c)):((e.lanes&s)!==0&&(nc(e,t),zn(t,null,null,s),Bn()),c=e.memoizedState,m=t.memoizedState,c.parent!==n?(c={parent:n,cache:n},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),As(t,bt,n)):(n=m.cache,As(t,bt,n),n!==c.cache&&Ql(t,[bt],s,!0))),Ut(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function hs(e){e.flags|=4}function Ic(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(cm())e.flags|=8192;else throw ur=Xa,sc}else e.flags&=-16777217}function zd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Jm(t))if(cm())e.flags|=8192;else throw ur=Xa,sc}function po(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Qi():536870912,e.lanes|=t,Gr|=t)}function Fn(e,t){if(!Ie)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 it(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 Gv(e,t,s){var n=t.pendingProps;switch(Vl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(t),null;case 1:return it(t),null;case 3:return s=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),os(bt),ce(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Lr(t)?hs(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Yl())),it(t),null;case 26:var c=t.type,m=t.memoizedState;return e===null?(hs(t),m!==null?(it(t),zd(t,m)):(it(t),Ic(t,c,null,n,s))):m?m!==e.memoizedState?(hs(t),it(t),zd(t,m)):(it(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&hs(t),it(t),Ic(t,c,e,n,s)),null;case 27:if(ve(t),s=pe.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&hs(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return it(t),null}e=re.current,Lr(t)?_f(t):(e=Zm(c,n,s),t.stateNode=e,hs(t))}return it(t),null;case 5:if(ve(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&hs(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return it(t),null}if(m=re.current,Lr(t))_f(t);else{var D=Do(pe.current);switch(m){case 1:m=D.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:m=D.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":m=D.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":m=D.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":m=D.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof n.is=="string"?D.createElement("select",{is:n.is}):D.createElement("select"),n.multiple?m.multiple=!0:n.size&&(m.size=n.size);break;default:m=typeof n.is=="string"?D.createElement(c,{is:n.is}):D.createElement(c)}}m[St]=t,m[st]=n;e:for(D=t.child;D!==null;){if(D.tag===5||D.tag===6)m.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===t)break e;for(;D.sibling===null;){if(D.return===null||D.return===t)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}t.stateNode=m;e:switch(It(m,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&&hs(t)}}return it(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&hs(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(o(166));if(e=pe.current,Lr(t)){if(e=t.stateNode,s=t.memoizedProps,n=null,c=zt,c!==null)switch(c.tag){case 27:case 5:n=c.memoizedProps}e[St]=t,e=!!(e.nodeValue===s||n!==null&&n.suppressHydrationWarning===!0||Lm(e.nodeValue,s)),e||Ts(t,!0)}else e=Do(e).createTextNode(n),e[St]=t,t.stateNode=e}return it(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(n=Lr(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 nr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),e=!1}else s=Yl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(ui(t),t):(ui(t),null);if((t.flags&128)!==0)throw Error(o(558))}return it(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Lr(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 nr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),c=!1}else c=Yl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(ui(t),t):(ui(t),null)}return ui(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),m=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(m=n.memoizedState.cachePool.pool),m!==c&&(n.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),po(t,t.updateQueue),it(t),null);case 4:return ce(),e===null&&lu(t.stateNode.containerInfo),it(t),null;case 10:return os(t.type),it(t),null;case 19:if(H(gt),n=t.memoizedState,n===null)return it(t),null;if(c=(t.flags&128)!==0,m=n.rendering,m===null)if(c)Fn(n,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(m=to(e),m!==null){for(t.flags|=128,Fn(n,!1),e=m.updateQueue,t.updateQueue=e,po(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)hf(s,e),s=s.sibling;return W(gt,gt.current&1|2),Ie&&ns(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&at()>So&&(t.flags|=128,c=!0,Fn(n,!1),t.lanes=4194304)}else{if(!c)if(e=to(m),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,po(t,e),Fn(n,!0),n.tail===null&&n.tailMode==="hidden"&&!m.alternate&&!Ie)return it(t),null}else 2*at()-n.renderingStartTime>So&&s!==536870912&&(t.flags|=128,c=!0,Fn(n,!1),t.lanes=4194304);n.isBackwards?(m.sibling=t.child,t.child=m):(e=n.last,e!==null?e.sibling=m:t.child=m,n.last=m)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=at(),e.sibling=null,s=gt.current,W(gt,c?s&1|2:s&1),Ie&&ns(t,n.treeForkCount),e):(it(t),null);case 22:case 23:return ui(t),cc(),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&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),s=t.updateQueue,s!==null&&po(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(lr),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),os(bt),it(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Kv(e,t){switch(Vl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return os(bt),ce(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(ui(t),t.alternate===null)throw Error(o(340));nr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ui(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));nr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(gt),null;case 4:return ce(),null;case 10:return os(t.type),null;case 22:case 23:return ui(t),cc(),e!==null&&H(lr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return os(bt),null;case 25:return null;default:return null}}function Hd(e,t){switch(Vl(t),t.tag){case 3:os(bt),ce();break;case 26:case 27:case 5:ve(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&ui(t);break;case 13:ui(t);break;case 19:H(gt);break;case 10:os(t.type);break;case 22:case 23:ui(t),cc(),e!==null&&H(lr);break;case 24:os(bt)}}function Zn(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 m=s.create,D=s.inst;n=m(),D.destroy=n}s=s.next}while(s!==c)}}catch(z){Ke(t,t.return,z)}}function Ls(e,t,s){try{var n=t.updateQueue,c=n!==null?n.lastEffect:null;if(c!==null){var m=c.next;n=m;do{if((n.tag&e)===e){var D=n.inst,z=D.destroy;if(z!==void 0){D.destroy=void 0,c=t;var Z=s,se=z;try{se()}catch(le){Ke(c,Z,le)}}}n=n.next}while(n!==m)}}catch(le){Ke(t,t.return,le)}}function Ud(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{kf(t,s)}catch(n){Ke(e,e.return,n)}}}function Id(e,t,s){s.props=dr(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(n){Ke(e,t,n)}}function qn(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){Ke(e,t,c)}}function Zi(e,t){var s=e.ref,n=e.refCleanup;if(s!==null)if(typeof n=="function")try{n()}catch(c){Ke(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){Ke(e,t,c)}else s.current=null}function Pd(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){Ke(e,e.return,c)}}function Pc(e,t,s){try{var n=e.stateNode;p0(n,e.type,s,t),n[st]=t}catch(c){Ke(e,e.return,c)}}function $d(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Is(e.type)||e.tag===4}function $c(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$d(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&&Is(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 Fc(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=is));else if(n!==4&&(n===27&&Is(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Fc(e,t,s),e=e.sibling;e!==null;)Fc(e,t,s),e=e.sibling}function _o(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&&Is(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(_o(e,t,s),e=e.sibling;e!==null;)_o(e,t,s),e=e.sibling}function Fd(e){var t=e.stateNode,s=e.memoizedProps;try{for(var n=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);It(t,n,s),t[St]=e,t[st]=s}catch(m){Ke(e,e.return,m)}}var fs=!1,wt=!1,Zc=!1,Zd=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function Vv(e,t){if(e=e.containerInfo,hu=zo,e=tf(e),zl(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,m=n.focusNode;n=n.focusOffset;try{s.nodeType,m.nodeType}catch{s=null;break e}var D=0,z=-1,Z=-1,se=0,le=0,de=e,ne=null;t:for(;;){for(var ae;de!==s||c!==0&&de.nodeType!==3||(z=D+c),de!==m||n!==0&&de.nodeType!==3||(Z=D+n),de.nodeType===3&&(D+=de.nodeValue.length),(ae=de.firstChild)!==null;)ne=de,de=ae;for(;;){if(de===e)break t;if(ne===s&&++se===c&&(z=D),ne===m&&++le===n&&(Z=D),(ae=de.nextSibling)!==null)break;de=ne,ne=de.parentNode}de=ae}s=z===-1||Z===-1?null:{start:z,end:Z}}else s=null}s=s||{start:0,end:0}}else s=null;for(fu={focusedElem:e,selectionRange:s},zo=!1,Lt=t;Lt!==null;)if(t=Lt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Lt=e;else for(;Lt!==null;){switch(t=Lt,m=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&&m!==null){e=void 0,s=t,c=m.memoizedProps,m=m.memoizedState,n=s.stateNode;try{var Se=dr(s.type,c);e=n.getSnapshotBeforeUpdate(Se,m),n.__reactInternalSnapshotBeforeUpdate=e}catch(Ee){Ke(s,s.return,Ee)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)pu(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":pu(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,Lt=e;break}Lt=t.return}}function qd(e,t,s){var n=s.flags;switch(s.tag){case 0:case 11:case 15:ms(e,s),n&4&&Zn(5,s);break;case 1:if(ms(e,s),n&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(D){Ke(s,s.return,D)}else{var c=dr(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(D){Ke(s,s.return,D)}}n&64&&Ud(s),n&512&&qn(s,s.return);break;case 3:if(ms(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{kf(e,t)}catch(D){Ke(s,s.return,D)}}break;case 27:t===null&&n&4&&Fd(s);case 26:case 5:ms(e,s),t===null&&n&4&&Pd(s),n&512&&qn(s,s.return);break;case 12:ms(e,s);break;case 31:ms(e,s),n&4&&Vd(e,s);break;case 13:ms(e,s),n&4&&Wd(e,s),n&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=s0.bind(null,s),C0(e,s))));break;case 22:if(n=s.memoizedState!==null||fs,!n){t=t!==null&&t.memoizedState!==null||wt,c=fs;var m=wt;fs=n,(wt=t)&&!m?ps(e,s,(s.subtreeFlags&8772)!==0):ms(e,s),fs=c,wt=m}break;case 30:break;default:ms(e,s)}}function Gd(e){var t=e.alternate;t!==null&&(e.alternate=null,Gd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Y(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 rt=null,ei=!1;function ds(e,t,s){for(s=s.child;s!==null;)Kd(e,t,s),s=s.sibling}function Kd(e,t,s){if(Ot&&typeof Ot.onCommitFiberUnmount=="function")try{Ot.onCommitFiberUnmount(gi,s)}catch{}switch(s.tag){case 26:wt||Zi(s,t),ds(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:wt||Zi(s,t);var n=rt,c=ei;Is(s.type)&&(rt=s.stateNode,ei=!1),ds(e,t,s),ea(s.stateNode),rt=n,ei=c;break;case 5:wt||Zi(s,t);case 6:if(n=rt,c=ei,rt=null,ds(e,t,s),rt=n,ei=c,rt!==null)if(ei)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(s.stateNode)}catch(m){Ke(s,t,m)}else try{rt.removeChild(s.stateNode)}catch(m){Ke(s,t,m)}break;case 18:rt!==null&&(ei?(e=rt,Um(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),en(e)):Um(rt,s.stateNode));break;case 4:n=rt,c=ei,rt=s.stateNode.containerInfo,ei=!0,ds(e,t,s),rt=n,ei=c;break;case 0:case 11:case 14:case 15:Ls(2,s,t),wt||Ls(4,s,t),ds(e,t,s);break;case 1:wt||(Zi(s,t),n=s.stateNode,typeof n.componentWillUnmount=="function"&&Id(s,t,n)),ds(e,t,s);break;case 21:ds(e,t,s);break;case 22:wt=(n=wt)||s.memoizedState!==null,ds(e,t,s),wt=n;break;default:ds(e,t,s)}}function Vd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{en(e)}catch(s){Ke(t,t.return,s)}}}function Wd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{en(e)}catch(s){Ke(t,t.return,s)}}function Wv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zd),t;default:throw Error(o(435,e.tag))}}function go(e,t){var s=Wv(e);t.forEach(function(n){if(!s.has(n)){s.add(n);var c=r0.bind(null,e,n);n.then(c,c)}})}function ti(e,t){var s=t.deletions;if(s!==null)for(var n=0;n<s.length;n++){var c=s[n],m=e,D=t,z=D;e:for(;z!==null;){switch(z.tag){case 27:if(Is(z.type)){rt=z.stateNode,ei=!1;break e}break;case 5:rt=z.stateNode,ei=!1;break e;case 3:case 4:rt=z.stateNode.containerInfo,ei=!0;break e}z=z.return}if(rt===null)throw Error(o(160));Kd(m,D,c),rt=null,ei=!1,m=c.alternate,m!==null&&(m.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Yd(t,e),t=t.sibling}var Bi=null;function Yd(e,t){var s=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ti(t,e),ii(e),n&4&&(Ls(3,e,e.return),Zn(3,e),Ls(5,e,e.return));break;case 1:ti(t,e),ii(e),n&512&&(wt||s===null||Zi(s,s.return)),n&64&&fs&&(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=Bi;if(ti(t,e),ii(e),n&512&&(wt||s===null||Zi(s,s.return)),n&4){var m=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":m=c.getElementsByTagName("title")[0],(!m||m[be]||m[St]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=c.createElement(n),c.head.insertBefore(m,c.querySelector("head > title"))),It(m,n,s),m[St]=e,Me(m),n=m;break e;case"link":var D=Ym("link","href",c).get(n+(s.href||""));if(D){for(var z=0;z<D.length;z++)if(m=D[z],m.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&m.getAttribute("rel")===(s.rel==null?null:s.rel)&&m.getAttribute("title")===(s.title==null?null:s.title)&&m.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){D.splice(z,1);break t}}m=c.createElement(n),It(m,n,s),c.head.appendChild(m);break;case"meta":if(D=Ym("meta","content",c).get(n+(s.content||""))){for(z=0;z<D.length;z++)if(m=D[z],m.getAttribute("content")===(s.content==null?null:""+s.content)&&m.getAttribute("name")===(s.name==null?null:s.name)&&m.getAttribute("property")===(s.property==null?null:s.property)&&m.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&m.getAttribute("charset")===(s.charSet==null?null:s.charSet)){D.splice(z,1);break t}}m=c.createElement(n),It(m,n,s),c.head.appendChild(m);break;default:throw Error(o(468,n))}m[St]=e,Me(m),n=m}e.stateNode=n}else Xm(c,e.type,e.stateNode);else e.stateNode=Wm(c,n,e.memoizedProps);else m!==n?(m===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):m.count--,n===null?Xm(c,e.type,e.stateNode):Wm(c,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Pc(e,e.memoizedProps,s.memoizedProps)}break;case 27:ti(t,e),ii(e),n&512&&(wt||s===null||Zi(s,s.return)),s!==null&&n&4&&Pc(e,e.memoizedProps,s.memoizedProps);break;case 5:if(ti(t,e),ii(e),n&512&&(wt||s===null||Zi(s,s.return)),e.flags&32){c=e.stateNode;try{Cr(c,"")}catch(Se){Ke(e,e.return,Se)}}n&4&&e.stateNode!=null&&(c=e.memoizedProps,Pc(e,c,s!==null?s.memoizedProps:c)),n&1024&&(Zc=!0);break;case 6:if(ti(t,e),ii(e),n&4){if(e.stateNode===null)throw Error(o(162));n=e.memoizedProps,s=e.stateNode;try{s.nodeValue=n}catch(Se){Ke(e,e.return,Se)}}break;case 3:if(Lo=null,c=Bi,Bi=Oo(t.containerInfo),ti(t,e),Bi=c,ii(e),n&4&&s!==null&&s.memoizedState.isDehydrated)try{en(t.containerInfo)}catch(Se){Ke(e,e.return,Se)}Zc&&(Zc=!1,Xd(e));break;case 4:n=Bi,Bi=Oo(e.stateNode.containerInfo),ti(t,e),ii(e),Bi=n;break;case 12:ti(t,e),ii(e);break;case 31:ti(t,e),ii(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,go(e,n)));break;case 13:ti(t,e),ii(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(yo=at()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,go(e,n)));break;case 22:c=e.memoizedState!==null;var Z=s!==null&&s.memoizedState!==null,se=fs,le=wt;if(fs=se||c,wt=le||Z,ti(t,e),wt=le,fs=se,ii(e),n&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(s===null||Z||fs||wt||mr(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){Z=s=t;try{if(m=Z.stateNode,c)D=m.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{z=Z.stateNode;var de=Z.memoizedProps.style,ne=de!=null&&de.hasOwnProperty("display")?de.display:null;z.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Se){Ke(Z,Z.return,Se)}}}else if(t.tag===6){if(s===null){Z=t;try{Z.stateNode.nodeValue=c?"":Z.memoizedProps}catch(Se){Ke(Z,Z.return,Se)}}}else if(t.tag===18){if(s===null){Z=t;try{var ae=Z.stateNode;c?Im(ae,!0):Im(Z.stateNode,!1)}catch(Se){Ke(Z,Z.return,Se)}}}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,go(e,s))));break;case 19:ti(t,e),ii(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,go(e,n)));break;case 30:break;case 21:break;default:ti(t,e),ii(e)}}function ii(e){var t=e.flags;if(t&2){try{for(var s,n=e.return;n!==null;){if($d(n)){s=n;break}n=n.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var c=s.stateNode,m=$c(e);_o(e,m,c);break;case 5:var D=s.stateNode;s.flags&32&&(Cr(D,""),s.flags&=-33);var z=$c(e);_o(e,z,D);break;case 3:case 4:var Z=s.stateNode.containerInfo,se=$c(e);Fc(e,se,Z);break;default:throw Error(o(161))}}catch(le){Ke(e,e.return,le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Xd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Xd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ms(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)qd(e,t.alternate,t),t=t.sibling}function mr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ls(4,t,t.return),mr(t);break;case 1:Zi(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&Id(t,t.return,s),mr(t);break;case 27:ea(t.stateNode);case 26:case 5:Zi(t,t.return),mr(t);break;case 22:t.memoizedState===null&&mr(t);break;case 30:mr(t);break;default:mr(t)}e=e.sibling}}function ps(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,c=e,m=t,D=m.flags;switch(m.tag){case 0:case 11:case 15:ps(c,m,s),Zn(4,m);break;case 1:if(ps(c,m,s),n=m,c=n.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(se){Ke(n,n.return,se)}if(n=m,c=n.updateQueue,c!==null){var z=n.stateNode;try{var Z=c.shared.hiddenCallbacks;if(Z!==null)for(c.shared.hiddenCallbacks=null,c=0;c<Z.length;c++)Rf(Z[c],z)}catch(se){Ke(n,n.return,se)}}s&&D&64&&Ud(m),qn(m,m.return);break;case 27:Fd(m);case 26:case 5:ps(c,m,s),s&&n===null&&D&4&&Pd(m),qn(m,m.return);break;case 12:ps(c,m,s);break;case 31:ps(c,m,s),s&&D&4&&Vd(c,m);break;case 13:ps(c,m,s),s&&D&4&&Wd(c,m);break;case 22:m.memoizedState===null&&ps(c,m,s),qn(m,m.return);break;case 30:break;default:ps(c,m,s)}t=t.sibling}}function qc(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&&On(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&&On(e))}function zi(e,t,s,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Jd(e,t,s,n),t=t.sibling}function Jd(e,t,s,n){var c=t.flags;switch(t.tag){case 0:case 11:case 15:zi(e,t,s,n),c&2048&&Zn(9,t);break;case 1:zi(e,t,s,n);break;case 3:zi(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&&On(e)));break;case 12:if(c&2048){zi(e,t,s,n),e=t.stateNode;try{var m=t.memoizedProps,D=m.id,z=m.onPostCommit;typeof z=="function"&&z(D,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Z){Ke(t,t.return,Z)}}else zi(e,t,s,n);break;case 31:zi(e,t,s,n);break;case 13:zi(e,t,s,n);break;case 23:break;case 22:m=t.stateNode,D=t.alternate,t.memoizedState!==null?m._visibility&2?zi(e,t,s,n):Gn(e,t):m._visibility&2?zi(e,t,s,n):(m._visibility|=2,Fr(e,t,s,n,(t.subtreeFlags&10256)!==0||!1)),c&2048&&qc(D,t);break;case 24:zi(e,t,s,n),c&2048&&Gc(t.alternate,t);break;default:zi(e,t,s,n)}}function Fr(e,t,s,n,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var m=e,D=t,z=s,Z=n,se=D.flags;switch(D.tag){case 0:case 11:case 15:Fr(m,D,z,Z,c),Zn(8,D);break;case 23:break;case 22:var le=D.stateNode;D.memoizedState!==null?le._visibility&2?Fr(m,D,z,Z,c):Gn(m,D):(le._visibility|=2,Fr(m,D,z,Z,c)),c&&se&2048&&qc(D.alternate,D);break;case 24:Fr(m,D,z,Z,c),c&&se&2048&&Gc(D.alternate,D);break;default:Fr(m,D,z,Z,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&&qc(n.alternate,n);break;case 24:Gn(s,n),c&2048&&Gc(n.alternate,n);break;default:Gn(s,n)}t=t.sibling}}var Kn=8192;function Zr(e,t,s){if(e.subtreeFlags&Kn)for(e=e.child;e!==null;)Qd(e,t,s),e=e.sibling}function Qd(e,t,s){switch(e.tag){case 26:Zr(e,t,s),e.flags&Kn&&e.memoizedState!==null&&j0(s,Bi,e.memoizedState,e.memoizedProps);break;case 5:Zr(e,t,s);break;case 3:case 4:var n=Bi;Bi=Oo(e.stateNode.containerInfo),Zr(e,t,s),Bi=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Kn,Kn=16777216,Zr(e,t,s),Kn=n):Zr(e,t,s));break;default:Zr(e,t,s)}}function em(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 Vn(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];Lt=n,im(n,e)}em(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)tm(e),e=e.sibling}function tm(e){switch(e.tag){case 0:case 11:case 15:Vn(e),e.flags&2048&&Ls(9,e,e.return);break;case 3:Vn(e);break;case 12:Vn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,vo(e)):Vn(e);break;default:Vn(e)}}function vo(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];Lt=n,im(n,e)}em(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ls(8,t,t.return),vo(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,vo(t));break;default:vo(t)}e=e.sibling}}function im(e,t){for(;Lt!==null;){var s=Lt;switch(s.tag){case 0:case 11:case 15:Ls(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:On(s.memoizedState.cache)}if(n=s.child,n!==null)n.return=s,Lt=n;else e:for(s=e;Lt!==null;){n=Lt;var c=n.sibling,m=n.return;if(Gd(n),n===s){Lt=null;break e}if(c!==null){c.return=m,Lt=c;break e}Lt=m}}}var Yv={getCacheForType:function(e){var t=Ht(bt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Ht(bt).controller.signal}},Xv=typeof WeakMap=="function"?WeakMap:Map,Ze=0,Qe=null,Be=null,He=0,Ge=0,hi=null,Ns=!1,qr=!1,Kc=!1,_s=0,ft=0,js=0,pr=0,Vc=0,fi=0,Gr=0,Wn=null,si=null,Wc=!1,yo=0,sm=0,So=1/0,bo=null,Bs=null,kt=0,zs=null,Kr=null,gs=0,Yc=0,Xc=null,rm=null,Yn=0,Jc=null;function di(){return(Ze&2)!==0&&He!==0?He&-He:q.T!==null?ru():_n()}function nm(){if(fi===0)if((He&536870912)===0||Ie){var e=Ji;Ji<<=1,(Ji&3932160)===0&&(Ji=262144),fi=e}else fi=536870912;return e=ci.current,e!==null&&(e.flags|=32),fi}function ri(e,t,s){(e===Qe&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)&&(Vr(e,0),Hs(e,He,fi,!1)),xs(e,s),((Ze&2)===0||e!==Qe)&&(e===Qe&&((Ze&2)===0&&(pr|=s),ft===4&&Hs(e,He,fi,!1)),qi(e))}function am(e,t,s){if((Ze&6)!==0)throw Error(o(327));var n=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Qs(e,t),c=n?e0(e,t):eu(e,t,!0),m=n;do{if(c===0){qr&&!n&&Hs(e,t,0,!1);break}else{if(s=e.current.alternate,m&&!Jv(s)){c=eu(e,t,!1),m=!1;continue}if(c===2){if(m=t,e.errorRecoveryDisabledLanes&m)var D=0;else D=e.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){t=D;e:{var z=e;c=Wn;var Z=z.current.memoizedState.isDehydrated;if(Z&&(Vr(z,D).flags|=256),D=eu(z,D,!1),D!==2){if(Kc&&!Z){z.errorRecoveryDisabledLanes|=m,pr|=m,c=4;break e}m=si,si=c,m!==null&&(si===null?si=m:si.push.apply(si,m))}c=D}if(m=!1,c!==2)continue}}if(c===1){Vr(e,0),Hs(e,t,0,!0);break}e:{switch(n=e,m=c,m){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Hs(n,t,fi,!Ns);break e;case 2:si=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=yo+300-at(),10<c)){if(Hs(n,t,fi,!Ns),Sr(n,0,!0)!==0)break e;gs=t,n.timeoutHandle=zm(om.bind(null,n,s,si,bo,Wc,t,fi,pr,Gr,Ns,m,"Throttled",-0,0),c);break e}om(n,s,si,bo,Wc,t,fi,pr,Gr,Ns,m,null,-0,0)}}break}while(!0);qi(e)}function om(e,t,s,n,c,m,D,z,Z,se,le,de,ne,ae){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:is},Qd(t,m,de);var Se=(m&62914560)===m?yo-at():(m&4194048)===m?sm-at():0;if(Se=B0(de,Se),Se!==null){gs=m,e.cancelPendingCommit=Se(pm.bind(null,e,t,m,s,n,c,D,z,Z,le,de,null,ne,ae)),Hs(e,m,D,!se);return}}pm(e,t,m,s,n,c,D,z,Z)}function Jv(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],m=c.getSnapshot;c=c.value;try{if(!oi(m(),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 Hs(e,t,s,n){t&=~Vc,t&=~pr,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var c=t;0<c;){var m=31-yt(c),D=1<<m;n[m]=-1,c&=~D}s!==0&&mn(e,s,t)}function xo(){return(Ze&6)===0?(Xn(0),!1):!0}function Qc(){if(Be!==null){if(Ge===0)var e=Be.return;else e=Be,as=ar=null,pc(e),Hr=null,Ln=0,e=Be;for(;e!==null;)Hd(e.alternate,e),e=e.return;Be=null}}function Vr(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,v0(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),gs=0,Qc(),Qe=e,Be=s=rs(e.current,null),He=t,Ge=0,hi=null,Ns=!1,qr=Qs(e,t),Kc=!1,Gr=fi=Vc=pr=js=ft=0,si=Wn=null,Wc=!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-yt(n),m=1<<c;t|=e[c],n&=~m}return _s=t,$a(),s}function lm(e,t){ke=null,q.H=Pn,t===zr||t===Ya?(t=wf(),Ge=3):t===sc?(t=wf(),Ge=4):Ge=t===Oc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hi=t,Be===null&&(ft=1,uo(e,Ci(t,e.current)))}function cm(){var e=ci.current;return e===null?!0:(He&4194048)===He?Ai===null:(He&62914560)===He||(He&536870912)!==0?e===Ai:!1}function um(){var e=q.H;return q.H=Pn,e===null?Pn:e}function hm(){var e=q.A;return q.A=Yv,e}function Co(){ft=4,Ns||(He&4194048)!==He&&ci.current!==null||(qr=!0),(js&134217727)===0&&(pr&134217727)===0||Qe===null||Hs(Qe,He,fi,!1)}function eu(e,t,s){var n=Ze;Ze|=2;var c=um(),m=hm();(Qe!==e||He!==t)&&(bo=null,Vr(e,t)),t=!1;var D=ft;e:do try{if(Ge!==0&&Be!==null){var z=Be,Z=hi;switch(Ge){case 8:Qc(),D=6;break e;case 3:case 2:case 9:case 6:ci.current===null&&(t=!0);var se=Ge;if(Ge=0,hi=null,Wr(e,z,Z,se),s&&qr){D=0;break e}break;default:se=Ge,Ge=0,hi=null,Wr(e,z,Z,se)}}Qv(),D=ft;break}catch(le){lm(e,le)}while(!0);return t&&e.shellSuspendCounter++,as=ar=null,Ze=n,q.H=c,q.A=m,Be===null&&(Qe=null,He=0,$a()),D}function Qv(){for(;Be!==null;)fm(Be)}function e0(e,t){var s=Ze;Ze|=2;var n=um(),c=hm();Qe!==e||He!==t?(bo=null,So=at()+500,Vr(e,t)):qr=Qs(e,t);e:do try{if(Ge!==0&&Be!==null){t=Be;var m=hi;t:switch(Ge){case 1:Ge=0,hi=null,Wr(e,t,m,1);break;case 2:case 9:if(xf(m)){Ge=0,hi=null,dm(t);break}t=function(){Ge!==2&&Ge!==9||Qe!==e||(Ge=7),qi(e)},m.then(t,t);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:xf(m)?(Ge=0,hi=null,dm(t)):(Ge=0,hi=null,Wr(e,t,m,7));break;case 5:var D=null;switch(Be.tag){case 26:D=Be.memoizedState;case 5:case 27:var z=Be;if(D?Jm(D):z.stateNode.complete){Ge=0,hi=null;var Z=z.sibling;if(Z!==null)Be=Z;else{var se=z.return;se!==null?(Be=se,wo(se)):Be=null}break t}}Ge=0,hi=null,Wr(e,t,m,5);break;case 6:Ge=0,hi=null,Wr(e,t,m,6);break;case 8:Qc(),ft=6;break e;default:throw Error(o(462))}}t0();break}catch(le){lm(e,le)}while(!0);return as=ar=null,q.H=n,q.A=c,Ze=s,Be!==null?0:(Qe=null,He=0,$a(),ft)}function t0(){for(;Be!==null&&!Wi();)fm(Be)}function fm(e){var t=Bd(e.alternate,e,_s);e.memoizedProps=e.pendingProps,t===null?wo(e):Be=t}function dm(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Dd(s,t,t.pendingProps,t.type,void 0,He);break;case 11:t=Dd(s,t,t.pendingProps,t.type.render,t.ref,He);break;case 5:pc(t);default:Hd(s,t),t=Be=hf(t,_s),t=Bd(s,t,_s)}e.memoizedProps=e.pendingProps,t===null?wo(e):Be=t}function Wr(e,t,s,n){as=ar=null,pc(t),Hr=null,Ln=0;var c=t.return;try{if(Fv(e,c,t,s,He)){ft=1,uo(e,Ci(s,e.current)),Be=null;return}}catch(m){if(c!==null)throw Be=c,m;ft=1,uo(e,Ci(s,e.current)),Be=null;return}t.flags&32768?(Ie||n===1?e=!0:qr||(He&536870912)!==0?e=!1:(Ns=e=!0,(n===2||n===9||n===3||n===6)&&(n=ci.current,n!==null&&n.tag===13&&(n.flags|=16384))),mm(t,e)):wo(t)}function wo(e){var t=e;do{if((t.flags&32768)!==0){mm(t,Ns);return}e=t.return;var s=Gv(t.alternate,t,_s);if(s!==null){Be=s;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);ft===0&&(ft=5)}function mm(e,t){do{var s=Kv(e.alternate,e);if(s!==null){s.flags&=32767,Be=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=s}while(e!==null);ft=6,Be=null}function pm(e,t,s,n,c,m,D,z,Z){e.cancelPendingCommit=null;do Eo();while(kt!==0);if((Ze&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(m=t.lanes|t.childLanes,m|=$l,dn(e,s,m,D,z,Z),e===Qe&&(Be=Qe=null,He=0),Kr=t,zs=e,gs=s,Yc=m,Xc=c,rm=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,n0(jt,function(){return Sm(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=q.T,q.T=null,c=K.p,K.p=2,D=Ze,Ze|=4;try{Vv(e,t,s)}finally{Ze=D,K.p=c,q.T=n}}kt=1,_m(),gm(),vm()}}function _m(){if(kt===1){kt=0;var e=zs,t=Kr,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=q.T,q.T=null;var n=K.p;K.p=2;var c=Ze;Ze|=4;try{Yd(t,e);var m=fu,D=tf(e.containerInfo),z=m.focusedElem,Z=m.selectionRange;if(D!==z&&z&&z.ownerDocument&&ef(z.ownerDocument.documentElement,z)){if(Z!==null&&zl(z)){var se=Z.start,le=Z.end;if(le===void 0&&(le=se),"selectionStart"in z)z.selectionStart=se,z.selectionEnd=Math.min(le,z.value.length);else{var de=z.ownerDocument||document,ne=de&&de.defaultView||window;if(ne.getSelection){var ae=ne.getSelection(),Se=z.textContent.length,Ee=Math.min(Z.start,Se),Je=Z.end===void 0?Ee:Math.min(Z.end,Se);!ae.extend&&Ee>Je&&(D=Je,Je=Ee,Ee=D);var Q=Qh(z,Ee),X=Qh(z,Je);if(Q&&X&&(ae.rangeCount!==1||ae.anchorNode!==Q.node||ae.anchorOffset!==Q.offset||ae.focusNode!==X.node||ae.focusOffset!==X.offset)){var ie=de.createRange();ie.setStart(Q.node,Q.offset),ae.removeAllRanges(),Ee>Je?(ae.addRange(ie),ae.extend(X.node,X.offset)):(ie.setEnd(X.node,X.offset),ae.addRange(ie))}}}}for(de=[],ae=z;ae=ae.parentNode;)ae.nodeType===1&&de.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<de.length;z++){var he=de[z];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}zo=!!hu,fu=hu=null}finally{Ze=c,K.p=n,q.T=s}}e.current=t,kt=2}}function gm(){if(kt===2){kt=0;var e=zs,t=Kr,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=q.T,q.T=null;var n=K.p;K.p=2;var c=Ze;Ze|=4;try{qd(e,t.alternate,t)}finally{Ze=c,K.p=n,q.T=s}}kt=3}}function vm(){if(kt===4||kt===3){kt=0,Pt();var e=zs,t=Kr,s=gs,n=rm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?kt=5:(kt=0,Kr=zs=null,ym(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Bs=null),Ni(s),t=t.stateNode,Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(gi,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=q.T,c=K.p,K.p=2,q.T=null;try{for(var m=e.onRecoverableError,D=0;D<n.length;D++){var z=n[D];m(z.value,{componentStack:z.stack})}}finally{q.T=t,K.p=c}}(gs&3)!==0&&Eo(),qi(e),c=e.pendingLanes,(s&261930)!==0&&(c&42)!==0?e===Jc?Yn++:(Yn=0,Jc=e):Yn=0,Xn(0)}}function ym(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,On(t)))}function Eo(){return _m(),gm(),vm(),Sm()}function Sm(){if(kt!==5)return!1;var e=zs,t=Yc;Yc=0;var s=Ni(gs),n=q.T,c=K.p;try{K.p=32>s?32:s,q.T=null,s=Xc,Xc=null;var m=zs,D=gs;if(kt=0,Kr=zs=null,gs=0,(Ze&6)!==0)throw Error(o(331));var z=Ze;if(Ze|=4,tm(m.current),Jd(m,m.current,D,s),Ze=z,Xn(0,!1),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(gi,m)}catch{}return!0}finally{K.p=c,q.T=n,ym(e,t)}}function bm(e,t,s){t=Ci(s,t),t=Dc(e.stateNode,t,2),e=Ds(e,t,2),e!==null&&(xs(e,2),qi(e))}function Ke(e,t,s){if(e.tag===3)bm(e,e,s);else for(;t!==null;){if(t.tag===3){bm(t,e,s);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Bs===null||!Bs.has(n))){e=Ci(s,e),s=xd(2),n=Ds(t,s,2),n!==null&&(Cd(s,n,t,e),xs(n,2),qi(n));break}}t=t.return}}function tu(e,t,s){var n=e.pingCache;if(n===null){n=e.pingCache=new Xv;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)||(Kc=!0,c.add(s),e=i0.bind(null,e,t,s),t.then(e,e))}function i0(e,t,s){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Qe===e&&(He&s)===s&&(ft===4||ft===3&&(He&62914560)===He&&300>at()-yo?(Ze&2)===0&&Vr(e,0):Vc|=s,Gr===He&&(Gr=0)),qi(e)}function xm(e,t){t===0&&(t=Qi()),e=sr(e,t),e!==null&&(xs(e,t),qi(e))}function s0(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),xm(e,s)}function r0(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),xm(e,s)}function n0(e,t){return _i(e,t)}var To=null,Yr=null,iu=!1,Ao=!1,su=!1,Us=0;function qi(e){e!==Yr&&e.next===null&&(Yr===null?To=Yr=e:Yr=Yr.next=e),Ao=!0,iu||(iu=!0,o0())}function Xn(e,t){if(!su&&Ao){su=!0;do for(var s=!1,n=To;n!==null;){if(e!==0){var c=n.pendingLanes;if(c===0)var m=0;else{var D=n.suspendedLanes,z=n.pingedLanes;m=(1<<31-yt(42|e)+1)-1,m&=c&~(D&~z),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(s=!0,Tm(n,m))}else m=He,m=Sr(n,n===Qe?m:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(m&3)===0||Qs(n,m)||(s=!0,Tm(n,m));n=n.next}while(s);su=!1}}function a0(){Cm()}function Cm(){Ao=iu=!1;var e=0;Us!==0&&g0()&&(e=Us);for(var t=at(),s=null,n=To;n!==null;){var c=n.next,m=wm(n,t);m===0?(n.next=null,s===null?To=c:s.next=c,c===null&&(Yr=s)):(s=n,(e!==0||(m&3)!==0)&&(Ao=!0)),n=c}kt!==0&&kt!==5||Xn(e),Us!==0&&(Us=0)}function wm(e,t){for(var s=e.suspendedLanes,n=e.pingedLanes,c=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var D=31-yt(m),z=1<<D,Z=c[D];Z===-1?((z&s)===0||(z&n)!==0)&&(c[D]=_t(z,t)):Z<=t&&(e.expiredLanes|=z),m&=~z}if(t=Qe,s=He,s=Sr(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,s===0||e===t&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Ii(n),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Qs(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(n!==null&&Ii(n),Ni(s)){case 2:case 8:s=Nt;break;case 32:s=jt;break;case 268435456:s=Yt;break;default:s=jt}return n=Em.bind(null,e),s=_i(s,n),e.callbackPriority=t,e.callbackNode=s,t}return n!==null&&n!==null&&Ii(n),e.callbackPriority=2,e.callbackNode=null,2}function Em(e,t){if(kt!==0&&kt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Eo()&&e.callbackNode!==s)return null;var n=He;return n=Sr(e,e===Qe?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(am(e,n,t),wm(e,at()),e.callbackNode!=null&&e.callbackNode===s?Em.bind(null,e):null)}function Tm(e,t){if(Eo())return null;am(e,t,!0)}function o0(){y0(function(){(Ze&6)!==0?_i(Zt,a0):Cm()})}function ru(){if(Us===0){var e=jr;e===0&&(e=Xi,Xi<<=1,(Xi&261888)===0&&(Xi=256)),Us=e}return Us}function Am(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Na(""+e)}function Rm(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 l0(e,t,s,n,c){if(t==="submit"&&s&&s.stateNode===c){var m=Am((c[st]||null).action),D=n.submitter;D&&(t=(t=D[st]||null)?Am(t.formAction):D.getAttribute("formAction"),t!==null&&(m=t,D=null));var z=new Ha("action","action",null,n,c);e.push({event:z,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Us!==0){var Z=D?Rm(c,D):new FormData(c);wc(s,{pending:!0,data:Z,method:c.method,action:m},null,Z)}}else typeof m=="function"&&(z.preventDefault(),Z=D?Rm(c,D):new FormData(c),wc(s,{pending:!0,data:Z,method:c.method,action:m},m,Z))},currentTarget:c}]})}}for(var nu=0;nu<Pl.length;nu++){var au=Pl[nu],c0=au.toLowerCase(),u0=au[0].toUpperCase()+au.slice(1);ji(c0,"on"+u0)}ji(nf,"onAnimationEnd"),ji(af,"onAnimationIteration"),ji(of,"onAnimationStart"),ji("dblclick","onDoubleClick"),ji("focusin","onFocus"),ji("focusout","onBlur"),ji(Tv,"onTransitionRun"),ji(Av,"onTransitionStart"),ji(Rv,"onTransitionCancel"),ji(lf,"onTransitionEnd"),Pi("onMouseEnter",["mouseout","mouseover"]),Pi("onMouseLeave",["mouseout","mouseover"]),Pi("onPointerEnter",["pointerout","pointerover"]),Pi("onPointerLeave",["pointerout","pointerover"]),Jt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Jt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Jt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Jt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Jt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Jt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jn="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(" "),h0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jn));function km(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 m=void 0;if(t)for(var D=n.length-1;0<=D;D--){var z=n[D],Z=z.instance,se=z.currentTarget;if(z=z.listener,Z!==m&&c.isPropagationStopped())break e;m=z,c.currentTarget=se;try{m(c)}catch(le){Pa(le)}c.currentTarget=null,m=Z}else for(D=0;D<n.length;D++){if(z=n[D],Z=z.instance,se=z.currentTarget,z=z.listener,Z!==m&&c.isPropagationStopped())break e;m=z,c.currentTarget=se;try{m(c)}catch(le){Pa(le)}c.currentTarget=null,m=Z}}}}function ze(e,t){var s=t[br];s===void 0&&(s=t[br]=new Set);var n=e+"__bubble";s.has(n)||(Dm(t,e,2,!1),s.add(n))}function ou(e,t,s){var n=0;t&&(n|=4),Dm(s,e,n,t)}var Ro="_reactListening"+Math.random().toString(36).slice(2);function lu(e){if(!e[Ro]){e[Ro]=!0,Bt.forEach(function(s){s!=="selectionchange"&&(h0.has(s)||ou(s,!1,e),ou(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ro]||(t[Ro]=!0,ou("selectionchange",!1,t))}}function Dm(e,t,s,n){switch(np(t)){case 2:var c=U0;break;case 8:c=I0;break;default:c=Cu}s=c.bind(null,t,s,e),c=void 0,!Rl||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 cu(e,t,s,n,c){var m=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var D=n.tag;if(D===3||D===4){var z=n.stateNode.containerInfo;if(z===c)break;if(D===4)for(D=n.return;D!==null;){var Z=D.tag;if((Z===3||Z===4)&&D.stateNode.containerInfo===c)return;D=D.return}for(;z!==null;){if(D=_e(z),D===null)return;if(Z=D.tag,Z===5||Z===6||Z===26||Z===27){n=m=D;continue e}z=z.parentNode}}n=n.return}Nh(function(){var se=m,le=Tl(s),de=[];e:{var ne=cf.get(e);if(ne!==void 0){var ae=Ha,Se=e;switch(e){case"keypress":if(Ba(s)===0)break e;case"keydown":case"keyup":ae=rv;break;case"focusin":Se="focus",ae=Ml;break;case"focusout":Se="blur",ae=Ml;break;case"beforeblur":case"afterblur":ae=Ml;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":ae=zh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=Gg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=ov;break;case nf:case af:case of:ae=Wg;break;case lf:ae=cv;break;case"scroll":case"scrollend":ae=Zg;break;case"wheel":ae=hv;break;case"copy":case"cut":case"paste":ae=Xg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=Uh;break;case"toggle":case"beforetoggle":ae=dv}var Ee=(t&4)!==0,Je=!Ee&&(e==="scroll"||e==="scrollend"),Q=Ee?ne!==null?ne+"Capture":null:ne;Ee=[];for(var X=se,ie;X!==null;){var he=X;if(ie=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ie===null||Q===null||(he=Sn(X,Q),he!=null&&Ee.push(Qn(X,he,ie))),Je)break;X=X.return}0<Ee.length&&(ne=new ae(ne,Se,null,s,le),de.push({event:ne,listeners:Ee}))}}if((t&7)===0){e:{if(ne=e==="mouseover"||e==="pointerover",ae=e==="mouseout"||e==="pointerout",ne&&s!==El&&(Se=s.relatedTarget||s.fromElement)&&(_e(Se)||Se[es]))break e;if((ae||ne)&&(ne=le.window===le?le:(ne=le.ownerDocument)?ne.defaultView||ne.parentWindow:window,ae?(Se=s.relatedTarget||s.toElement,ae=se,Se=Se?_e(Se):null,Se!==null&&(Je=w(Se),Ee=Se.tag,Se!==Je||Ee!==5&&Ee!==27&&Ee!==6)&&(Se=null)):(ae=null,Se=se),ae!==Se)){if(Ee=zh,he="onMouseLeave",Q="onMouseEnter",X="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=Uh,he="onPointerLeave",Q="onPointerEnter",X="pointer"),Je=ae==null?ne:qe(ae),ie=Se==null?ne:qe(Se),ne=new Ee(he,X+"leave",ae,s,le),ne.target=Je,ne.relatedTarget=ie,he=null,_e(le)===se&&(Ee=new Ee(Q,X+"enter",Se,s,le),Ee.target=ie,Ee.relatedTarget=Je,he=Ee),Je=he,ae&&Se)t:{for(Ee=f0,Q=ae,X=Se,ie=0,he=Q;he;he=Ee(he))ie++;he=0;for(var Ce=X;Ce;Ce=Ee(Ce))he++;for(;0<ie-he;)Q=Ee(Q),ie--;for(;0<he-ie;)X=Ee(X),he--;for(;ie--;){if(Q===X||X!==null&&Q===X.alternate){Ee=Q;break t}Q=Ee(Q),X=Ee(X)}Ee=null}else Ee=null;ae!==null&&Om(de,ne,ae,Ee,!1),Se!==null&&Je!==null&&Om(de,Je,Se,Ee,!0)}}e:{if(ne=se?qe(se):window,ae=ne.nodeName&&ne.nodeName.toLowerCase(),ae==="select"||ae==="input"&&ne.type==="file")var $e=Kh;else if(qh(ne))if(Vh)$e=Cv;else{$e=bv;var xe=Sv}else ae=ne.nodeName,!ae||ae.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?se&&wl(se.elementType)&&($e=Kh):$e=xv;if($e&&($e=$e(e,se))){Gh(de,$e,s,le);break e}xe&&xe(e,ne,se),e==="focusout"&&se&&ne.type==="number"&&se.memoizedProps.value!=null&&Cl(ne,"number",ne.value)}switch(xe=se?qe(se):window,e){case"focusin":(qh(xe)||xe.contentEditable==="true")&&(Ar=xe,Hl=se,Rn=null);break;case"focusout":Rn=Hl=Ar=null;break;case"mousedown":Ul=!0;break;case"contextmenu":case"mouseup":case"dragend":Ul=!1,sf(de,s,le);break;case"selectionchange":if(Ev)break;case"keydown":case"keyup":sf(de,s,le)}var Oe;if(Nl)e:{switch(e){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else Tr?Fh(e,s)&&(Ue="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ue="onCompositionStart");Ue&&(Ih&&s.locale!=="ko"&&(Tr||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Tr&&(Oe=jh()):(Cs=le,kl="value"in Cs?Cs.value:Cs.textContent,Tr=!0)),xe=ko(se,Ue),0<xe.length&&(Ue=new Hh(Ue,e,null,s,le),de.push({event:Ue,listeners:xe}),Oe?Ue.data=Oe:(Oe=Zh(s),Oe!==null&&(Ue.data=Oe)))),(Oe=pv?_v(e,s):gv(e,s))&&(Ue=ko(se,"onBeforeInput"),0<Ue.length&&(xe=new Hh("onBeforeInput","beforeinput",null,s,le),de.push({event:xe,listeners:Ue}),xe.data=Oe)),l0(de,e,se,s,le)}km(de,t)})}function Qn(e,t,s){return{instance:e,listener:t,currentTarget:s}}function ko(e,t){for(var s=t+"Capture",n=[];e!==null;){var c=e,m=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||m===null||(c=Sn(e,s),c!=null&&n.unshift(Qn(e,c,m)),c=Sn(e,t),c!=null&&n.push(Qn(e,c,m))),e.tag===3)return n;e=e.return}return[]}function f0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Om(e,t,s,n,c){for(var m=t._reactName,D=[];s!==null&&s!==n;){var z=s,Z=z.alternate,se=z.stateNode;if(z=z.tag,Z!==null&&Z===n)break;z!==5&&z!==26&&z!==27||se===null||(Z=se,c?(se=Sn(s,m),se!=null&&D.unshift(Qn(s,se,Z))):c||(se=Sn(s,m),se!=null&&D.push(Qn(s,se,Z)))),s=s.return}D.length!==0&&e.push({event:t,listeners:D})}var d0=/\r\n?/g,m0=/\u0000|\uFFFD/g;function Mm(e){return(typeof e=="string"?e:""+e).replace(d0,`
|
|
49
|
+
`).replace(m0,"")}function Lm(e,t){return t=Mm(t),Mm(e)===t}function Xe(e,t,s,n,c,m){switch(s){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Cr(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Cr(e,""+n);break;case"className":Ma(e,"class",n);break;case"tabIndex":Ma(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Ma(e,s,n);break;case"style":Mh(e,n,m);break;case"data":if(t!=="object"){Ma(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=Na(""+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 m=="function"&&(s==="formAction"?(t!=="input"&&Xe(e,t,"name",c.name,c,null),Xe(e,t,"formEncType",c.formEncType,c,null),Xe(e,t,"formMethod",c.formMethod,c,null),Xe(e,t,"formTarget",c.formTarget,c,null)):(Xe(e,t,"encType",c.encType,c,null),Xe(e,t,"method",c.method,c,null),Xe(e,t,"target",c.target,c,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(s);break}n=Na(""+n),e.setAttribute(s,n);break;case"onClick":n!=null&&(e.onclick=is);break;case"onScroll":n!=null&&ze("scroll",e);break;case"onScrollEnd":n!=null&&ze("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=Na(""+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":ze("beforetoggle",e),ze("toggle",e),Oa(e,"popover",n);break;case"xlinkActuate":ts(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":ts(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":ts(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":ts(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":ts(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":ts(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":ts(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":ts(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":ts(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Oa(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=$g.get(s)||s,Oa(e,s,n))}}function uu(e,t,s,n,c,m){switch(s){case"style":Mh(e,n,m);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"?Cr(e,n):(typeof n=="number"||typeof n=="bigint")&&Cr(e,""+n);break;case"onScroll":n!=null&&ze("scroll",e);break;case"onScrollEnd":n!=null&&ze("scrollend",e);break;case"onClick":n!=null&&(e.onclick=is);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yi.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(c=s.endsWith("Capture"),t=s.slice(2,c?s.length-7:void 0),m=e[st]||null,m=m!=null?m[s]:null,typeof m=="function"&&e.removeEventListener(t,m,c),typeof n=="function")){typeof m!="function"&&m!==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,""):Oa(e,s,n)}}}function It(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",e),ze("load",e);var n=!1,c=!1,m;for(m in s)if(s.hasOwnProperty(m)){var D=s[m];if(D!=null)switch(m){case"src":n=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Xe(e,t,m,D,s,null)}}c&&Xe(e,t,"srcSet",s.srcSet,s,null),n&&Xe(e,t,"src",s.src,s,null);return;case"input":ze("invalid",e);var z=m=D=c=null,Z=null,se=null;for(n in s)if(s.hasOwnProperty(n)){var le=s[n];if(le!=null)switch(n){case"name":c=le;break;case"type":D=le;break;case"checked":Z=le;break;case"defaultChecked":se=le;break;case"value":m=le;break;case"defaultValue":z=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(o(137,t));break;default:Xe(e,t,n,le,s,null)}}Rh(e,m,z,Z,se,D,c,!1);return;case"select":ze("invalid",e),n=D=m=null;for(c in s)if(s.hasOwnProperty(c)&&(z=s[c],z!=null))switch(c){case"value":m=z;break;case"defaultValue":D=z;break;case"multiple":n=z;default:Xe(e,t,c,z,s,null)}t=m,s=D,e.multiple=!!n,t!=null?xr(e,!!n,t,!1):s!=null&&xr(e,!!n,s,!0);return;case"textarea":ze("invalid",e),m=c=n=null;for(D in s)if(s.hasOwnProperty(D)&&(z=s[D],z!=null))switch(D){case"value":n=z;break;case"defaultValue":c=z;break;case"children":m=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(o(91));break;default:Xe(e,t,D,z,s,null)}Dh(e,n,c,m);return;case"option":for(Z in s)if(s.hasOwnProperty(Z)&&(n=s[Z],n!=null))switch(Z){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Xe(e,t,Z,n,s,null)}return;case"dialog":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(n=0;n<Jn.length;n++)ze(Jn[n],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("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:Xe(e,t,se,n,s,null)}return;default:if(wl(t)){for(le in s)s.hasOwnProperty(le)&&(n=s[le],n!==void 0&&uu(e,t,le,n,s,void 0));return}}for(z in s)s.hasOwnProperty(z)&&(n=s[z],n!=null&&Xe(e,t,z,n,s,null))}function p0(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,m=null,D=null,z=null,Z=null,se=null,le=null;for(ae in s){var de=s[ae];if(s.hasOwnProperty(ae)&&de!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":Z=de;default:n.hasOwnProperty(ae)||Xe(e,t,ae,null,n,de)}}for(var ne in n){var ae=n[ne];if(de=s[ne],n.hasOwnProperty(ne)&&(ae!=null||de!=null))switch(ne){case"type":m=ae;break;case"name":c=ae;break;case"checked":se=ae;break;case"defaultChecked":le=ae;break;case"value":D=ae;break;case"defaultValue":z=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(o(137,t));break;default:ae!==de&&Xe(e,t,ne,ae,n,de)}}xl(e,D,z,Z,se,le,m,c);return;case"select":ae=D=z=ne=null;for(m in s)if(Z=s[m],s.hasOwnProperty(m)&&Z!=null)switch(m){case"value":break;case"multiple":ae=Z;default:n.hasOwnProperty(m)||Xe(e,t,m,null,n,Z)}for(c in n)if(m=n[c],Z=s[c],n.hasOwnProperty(c)&&(m!=null||Z!=null))switch(c){case"value":ne=m;break;case"defaultValue":z=m;break;case"multiple":D=m;default:m!==Z&&Xe(e,t,c,m,n,Z)}t=z,s=D,n=ae,ne!=null?xr(e,!!s,ne,!1):!!n!=!!s&&(t!=null?xr(e,!!s,t,!0):xr(e,!!s,s?[]:"",!1));return;case"textarea":ae=ne=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:Xe(e,t,z,null,n,c)}for(D in n)if(c=n[D],m=s[D],n.hasOwnProperty(D)&&(c!=null||m!=null))switch(D){case"value":ne=c;break;case"defaultValue":ae=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==m&&Xe(e,t,D,c,n,m)}kh(e,ne,ae);return;case"option":for(var Se in s)if(ne=s[Se],s.hasOwnProperty(Se)&&ne!=null&&!n.hasOwnProperty(Se))switch(Se){case"selected":e.selected=!1;break;default:Xe(e,t,Se,null,n,ne)}for(Z in n)if(ne=n[Z],ae=s[Z],n.hasOwnProperty(Z)&&ne!==ae&&(ne!=null||ae!=null))switch(Z){case"selected":e.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:Xe(e,t,Z,ne,n,ae)}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 Ee in s)ne=s[Ee],s.hasOwnProperty(Ee)&&ne!=null&&!n.hasOwnProperty(Ee)&&Xe(e,t,Ee,null,n,ne);for(se in n)if(ne=n[se],ae=s[se],n.hasOwnProperty(se)&&ne!==ae&&(ne!=null||ae!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(o(137,t));break;default:Xe(e,t,se,ne,n,ae)}return;default:if(wl(t)){for(var Je in s)ne=s[Je],s.hasOwnProperty(Je)&&ne!==void 0&&!n.hasOwnProperty(Je)&&uu(e,t,Je,void 0,n,ne);for(le in n)ne=n[le],ae=s[le],!n.hasOwnProperty(le)||ne===ae||ne===void 0&&ae===void 0||uu(e,t,le,ne,n,ae);return}}for(var Q in s)ne=s[Q],s.hasOwnProperty(Q)&&ne!=null&&!n.hasOwnProperty(Q)&&Xe(e,t,Q,null,n,ne);for(de in n)ne=n[de],ae=s[de],!n.hasOwnProperty(de)||ne===ae||ne==null&&ae==null||Xe(e,t,de,ne,n,ae)}function Nm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _0(){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],m=c.transferSize,D=c.initiatorType,z=c.duration;if(m&&z&&Nm(D)){for(D=0,z=c.responseEnd,n+=1;n<s.length;n++){var Z=s[n],se=Z.startTime;if(se>z)break;var le=Z.transferSize,de=Z.initiatorType;le&&Nm(de)&&(Z=Z.responseEnd,D+=le*(Z<z?1:(z-se)/(Z-se)))}if(--n,t+=8*(m+D)/(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 hu=null,fu=null;function Do(e){return e.nodeType===9?e:e.ownerDocument}function jm(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 Bm(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 du(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 mu=null;function g0(){var e=window.event;return e&&e.type==="popstate"?e===mu?!1:(mu=e,!0):(mu=null,!1)}var zm=typeof setTimeout=="function"?setTimeout:void 0,v0=typeof clearTimeout=="function"?clearTimeout:void 0,Hm=typeof Promise=="function"?Promise:void 0,y0=typeof queueMicrotask=="function"?queueMicrotask:typeof Hm<"u"?function(e){return Hm.resolve(null).then(e).catch(S0)}:zm;function S0(e){setTimeout(function(){throw e})}function Is(e){return e==="head"}function Um(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),en(t);return}n--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")n++;else if(s==="html")ea(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,ea(s);for(var m=s.firstChild;m;){var D=m.nextSibling,z=m.nodeName;m[be]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&m.rel.toLowerCase()==="stylesheet"||s.removeChild(m),m=D}}else s==="body"&&ea(e.ownerDocument.body);s=c}while(s);en(t)}function Im(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 pu(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":pu(s),Y(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function b0(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[be])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(m=e.getAttribute("rel"),m==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(m!==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(m=e.getAttribute("src"),(m!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&m&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var m=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===m)return e}else return e;if(e=Ri(e.nextSibling),e===null)break}return null}function x0(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 Pm(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 _u(e){return e.data==="$?"||e.data==="$~"}function gu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function C0(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 vu=null;function $m(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 Fm(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 Zm(e,t,s){switch(t=Do(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 ea(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Y(e)}var ki=new Map,qm=new Set;function Oo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var vs=K.d;K.d={f:w0,r:E0,D:T0,C:A0,L:R0,m:k0,X:O0,S:D0,M:M0};function w0(){var e=vs.f(),t=xo();return e||t}function E0(e){var t=ye(e);t!==null&&t.tag===5&&t.type==="form"?ld(t):vs.r(e)}var Xr=typeof document>"u"?null:document;function Gm(e,t,s){var n=Xr;if(n&&typeof t=="string"&&t){var c=bi(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof s=="string"&&(c+='[crossorigin="'+s+'"]'),qm.has(c)||(qm.add(c),e={rel:e,crossOrigin:s,href:t},n.querySelector(c)===null&&(t=n.createElement("link"),It(t,"link",e),Me(t),n.head.appendChild(t)))}}function T0(e){vs.D(e),Gm("dns-prefetch",e,null)}function A0(e,t){vs.C(e,t),Gm("preconnect",e,t)}function R0(e,t,s){vs.L(e,t,s);var n=Xr;if(n&&e&&t){var c='link[rel="preload"][as="'+bi(t)+'"]';t==="image"&&s&&s.imageSrcSet?(c+='[imagesrcset="'+bi(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(c+='[imagesizes="'+bi(s.imageSizes)+'"]')):c+='[href="'+bi(e)+'"]';var m=c;switch(t){case"style":m=Jr(e);break;case"script":m=Qr(e)}ki.has(m)||(e=d({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),ki.set(m,e),n.querySelector(c)!==null||t==="style"&&n.querySelector(ta(m))||t==="script"&&n.querySelector(ia(m))||(t=n.createElement("link"),It(t,"link",e),Me(t),n.head.appendChild(t)))}}function k0(e,t){vs.m(e,t);var s=Xr;if(s&&e){var n=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+bi(n)+'"][href="'+bi(e)+'"]',m=c;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Qr(e)}if(!ki.has(m)&&(e=d({rel:"modulepreload",href:e},t),ki.set(m,e),s.querySelector(c)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ia(m)))return}n=s.createElement("link"),It(n,"link",e),Me(n),s.head.appendChild(n)}}}function D0(e,t,s){vs.S(e,t,s);var n=Xr;if(n&&e){var c=ot(n).hoistableStyles,m=Jr(e);t=t||"default";var D=c.get(m);if(!D){var z={loading:0,preload:null};if(D=n.querySelector(ta(m)))z.loading=5;else{e=d({rel:"stylesheet",href:e,"data-precedence":t},s),(s=ki.get(m))&&yu(e,s);var Z=D=n.createElement("link");Me(Z),It(Z,"link",e),Z._p=new Promise(function(se,le){Z.onload=se,Z.onerror=le}),Z.addEventListener("load",function(){z.loading|=1}),Z.addEventListener("error",function(){z.loading|=2}),z.loading|=4,Mo(D,t,n)}D={type:"stylesheet",instance:D,count:1,state:z},c.set(m,D)}}}function O0(e,t){vs.X(e,t);var s=Xr;if(s&&e){var n=ot(s).hoistableScripts,c=Qr(e),m=n.get(c);m||(m=s.querySelector(ia(c)),m||(e=d({src:e,async:!0},t),(t=ki.get(c))&&Su(e,t),m=s.createElement("script"),Me(m),It(m,"link",e),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},n.set(c,m))}}function M0(e,t){vs.M(e,t);var s=Xr;if(s&&e){var n=ot(s).hoistableScripts,c=Qr(e),m=n.get(c);m||(m=s.querySelector(ia(c)),m||(e=d({src:e,async:!0,type:"module"},t),(t=ki.get(c))&&Su(e,t),m=s.createElement("script"),Me(m),It(m,"link",e),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},n.set(c,m))}}function Km(e,t,s,n){var c=(c=pe.current)?Oo(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=Jr(s.href),s=ot(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=Jr(s.href);var m=ot(c).hoistableStyles,D=m.get(e);if(D||(c=c.ownerDocument||c,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,D),(m=c.querySelector(ta(e)))&&!m._p&&(D.instance=m,D.state.loading=5),ki.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},ki.set(e,s),m||L0(c,e,s,D.state))),t&&n===null)throw Error(o(528,""));return D}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=Qr(s),s=ot(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 Jr(e){return'href="'+bi(e)+'"'}function ta(e){return'link[rel="stylesheet"]['+e+"]"}function Vm(e){return d({},e,{"data-precedence":e.precedence,precedence:null})}function L0(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}),It(t,"link",s),Me(t),e.head.appendChild(t))}function Qr(e){return'[src="'+bi(e)+'"]'}function ia(e){return"script[async]"+e}function Wm(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+bi(s.href)+'"]');if(n)return t.instance=n,Me(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"),Me(n),It(n,"style",c),Mo(n,s.precedence,e),t.instance=n;case"stylesheet":c=Jr(s.href);var m=e.querySelector(ta(c));if(m)return t.state.loading|=4,t.instance=m,Me(m),m;n=Vm(s),(c=ki.get(c))&&yu(n,c),m=(e.ownerDocument||e).createElement("link"),Me(m);var D=m;return D._p=new Promise(function(z,Z){D.onload=z,D.onerror=Z}),It(m,"link",n),t.state.loading|=4,Mo(m,s.precedence,e),t.instance=m;case"script":return m=Qr(s.src),(c=e.querySelector(ia(m)))?(t.instance=c,Me(c),c):(n=s,(c=ki.get(m))&&(n=d({},s),Su(n,c)),e=e.ownerDocument||e,c=e.createElement("script"),Me(c),It(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,Mo(n,s.precedence,e));return t.instance}function Mo(e,t,s){for(var n=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=n.length?n[n.length-1]:null,m=c,D=0;D<n.length;D++){var z=n[D];if(z.dataset.precedence===t)m=z;else if(m!==c)break}m?m.parentNode.insertBefore(e,m.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function yu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Su(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Lo=null;function Ym(e,t,s){if(Lo===null){var n=new Map,c=Lo=new Map;c.set(s,n)}else c=Lo,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 m=s[c];if(!(m[be]||m[St]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var D=m.getAttribute(t)||"";D=e+D;var z=n.get(D);z?z.push(m):n.set(D,[m])}}return n}function Xm(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function N0(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 Jm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function j0(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=Jr(n.href),m=t.querySelector(ta(c));if(m){t=m._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=No.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=m,Me(m);return}m=t.ownerDocument||t,n=Vm(n),(c=ki.get(c))&&yu(n,c),m=m.createElement("link"),Me(m);var D=m;D._p=new Promise(function(z,Z){D.onload=z,D.onerror=Z}),It(m,"link",n),s.instance=m}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=No.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var bu=0;function B0(e,t){return e.stylesheets&&e.count===0&&Bo(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var n=setTimeout(function(){if(e.stylesheets&&Bo(e,e.stylesheets),e.unsuspend){var m=e.unsuspend;e.unsuspend=null,m()}},6e4+t);0<e.imgBytes&&bu===0&&(bu=62500*_0());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bo(e,e.stylesheets),e.unsuspend)){var m=e.unsuspend;e.unsuspend=null,m()}},(e.imgBytes>bu?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(c)}}:null}function No(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var jo=null;function Bo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,jo=new Map,t.forEach(z0,e),jo=null,No.call(e))}function z0(e,t){if(!(t.state.loading&4)){var s=jo.get(e);if(s)var n=s.get(null);else{s=new Map,jo.set(e,s);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<c.length;m++){var D=c[m];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(s.set(D.dataset.precedence,D),n=D)}n&&s.set(null,n)}c=t.instance,D=c.getAttribute("data-precedence"),m=s.get(D)||n,m===n&&s.set(null,c),s.set(D,c),this.count++,n=No.bind(this),c.addEventListener("load",n),c.addEventListener("error",n),m?m.parentNode.insertBefore(c,m.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var sa={$$typeof:_,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function H0(e,t,s,n,c,m,D,z,Z){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=fn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fn(0),this.hiddenUpdates=fn(null),this.identifierPrefix=n,this.onUncaughtError=c,this.onCaughtError=m,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function Qm(e,t,s,n,c,m,D,z,Z,se,le,de){return e=new H0(e,t,s,D,Z,se,le,de,z),t=1,m===!0&&(t|=24),m=li(3,null,null,t),e.current=m,m.stateNode=e,t=ec(),t.refCount++,e.pooledCache=t,t.refCount++,m.memoizedState={element:n,isDehydrated:s,cache:t},rc(m),e}function ep(e){return e?(e=Dr,e):Dr}function tp(e,t,s,n,c,m){c=ep(c),n.context===null?n.context=c:n.pendingContext=c,n=ks(t),n.payload={element:s},m=m===void 0?null:m,m!==null&&(n.callback=m),s=Ds(e,n,t),s!==null&&(ri(s,e,t),jn(s,e,t))}function ip(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function xu(e,t){ip(e,t),(e=e.alternate)&&ip(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=sr(e,67108864);t!==null&&ri(t,e,67108864),xu(e,67108864)}}function rp(e){if(e.tag===13||e.tag===31){var t=di();t=Xt(t);var s=sr(e,t);s!==null&&ri(s,e,t),xu(e,t)}}var zo=!0;function U0(e,t,s,n){var c=q.T;q.T=null;var m=K.p;try{K.p=2,Cu(e,t,s,n)}finally{K.p=m,q.T=c}}function I0(e,t,s,n){var c=q.T;q.T=null;var m=K.p;try{K.p=8,Cu(e,t,s,n)}finally{K.p=m,q.T=c}}function Cu(e,t,s,n){if(zo){var c=wu(n);if(c===null)cu(e,t,n,Ho,s),ap(e,n);else if($0(c,e,t,s,n))n.stopPropagation();else if(ap(e,n),t&4&&-1<P0.indexOf(e)){for(;c!==null;){var m=ye(c);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var D=ai(m.pendingLanes);if(D!==0){var z=m;for(z.pendingLanes|=2,z.entangledLanes|=2;D;){var Z=1<<31-yt(D);z.entanglements[1]|=Z,D&=~Z}qi(m),(Ze&6)===0&&(So=at()+500,Xn(0))}}break;case 31:case 13:z=sr(m,2),z!==null&&ri(z,m,2),xo(),xu(m,2)}if(m=wu(n),m===null&&cu(e,t,n,Ho,s),m===c)break;c=m}c!==null&&n.stopPropagation()}else cu(e,t,n,null,s)}}function wu(e){return e=Tl(e),Eu(e)}var Ho=null;function Eu(e){if(Ho=null,e=_e(e),e!==null){var t=w(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=A(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 Ho=e,null}function np(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(Dt()){case Zt:return 2;case Nt:return 8;case jt:case Yi:return 32;case Yt:return 268435456;default:return 32}default:return 32}}var Tu=!1,Ps=null,$s=null,Fs=null,ra=new Map,na=new Map,Zs=[],P0="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 ap(e,t){switch(e){case"focusin":case"focusout":Ps=null;break;case"dragenter":case"dragleave":$s=null;break;case"mouseover":case"mouseout":Fs=null;break;case"pointerover":case"pointerout":ra.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":na.delete(t.pointerId)}}function aa(e,t,s,n,c,m){return e===null||e.nativeEvent!==m?(e={blockedOn:t,domEventName:s,eventSystemFlags:n,nativeEvent:m,targetContainers:[c]},t!==null&&(t=ye(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function $0(e,t,s,n,c){switch(t){case"focusin":return Ps=aa(Ps,e,t,s,n,c),!0;case"dragenter":return $s=aa($s,e,t,s,n,c),!0;case"mouseover":return Fs=aa(Fs,e,t,s,n,c),!0;case"pointerover":var m=c.pointerId;return ra.set(m,aa(ra.get(m)||null,e,t,s,n,c)),!0;case"gotpointercapture":return m=c.pointerId,na.set(m,aa(na.get(m)||null,e,t,s,n,c)),!0}return!1}function op(e){var t=_e(e.target);if(t!==null){var s=w(t);if(s!==null){if(t=s.tag,t===13){if(t=A(s),t!==null){e.blockedOn=t,gn(e.priority,function(){rp(s)});return}}else if(t===31){if(t=l(s),t!==null){e.blockedOn=t,gn(e.priority,function(){rp(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 Uo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=wu(e.nativeEvent);if(s===null){s=e.nativeEvent;var n=new s.constructor(s.type,s);El=n,s.target.dispatchEvent(n),El=null}else return t=ye(s),t!==null&&sp(t),e.blockedOn=s,!1;t.shift()}return!0}function lp(e,t,s){Uo(e)&&s.delete(t)}function F0(){Tu=!1,Ps!==null&&Uo(Ps)&&(Ps=null),$s!==null&&Uo($s)&&($s=null),Fs!==null&&Uo(Fs)&&(Fs=null),ra.forEach(lp),na.forEach(lp)}function Io(e,t){e.blockedOn===t&&(e.blockedOn=null,Tu||(Tu=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,F0)))}var Po=null;function cp(e){Po!==e&&(Po=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Po===e&&(Po=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(Eu(n||s)===null)continue;break}var m=ye(s);m!==null&&(e.splice(t,3),t-=3,wc(m,{pending:!0,data:c,method:s.method,action:n},n,c))}}))}function en(e){function t(Z){return Io(Z,e)}Ps!==null&&Io(Ps,e),$s!==null&&Io($s,e),Fs!==null&&Io(Fs,e),ra.forEach(t),na.forEach(t);for(var s=0;s<Zs.length;s++){var n=Zs[s];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Zs.length&&(s=Zs[0],s.blockedOn===null);)op(s),s.blockedOn===null&&Zs.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(n=0;n<s.length;n+=3){var c=s[n],m=s[n+1],D=c[st]||null;if(typeof m=="function")D||cp(s);else if(D){var z=null;if(m&&m.hasAttribute("formAction")){if(c=m,D=m[st]||null)z=D.formAction;else if(Eu(c)!==null)continue}else z=D.action;typeof z=="function"?s[n+1]=z:(s.splice(n,3),n-=3),cp(s)}}}function up(){function e(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(D){return c=D})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),n||setTimeout(s,20)}function s(){if(!n&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.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 Au(e){this._internalRoot=e}$o.prototype.render=Au.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,n=di();tp(s,n,e,t,null,null)},$o.prototype.unmount=Au.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;tp(e.current,2,null,e,null,null),xo(),t[es]=null}};function $o(e){this._internalRoot=e}$o.prototype.unstable_scheduleHydration=function(e){if(e){var t=_n();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Zs.length&&t!==0&&t<Zs[s].priority;s++);Zs.splice(s,0,e),s===0&&op(e)}};var hp=r.version;if(hp!=="19.2.4")throw Error(o(527,hp,"19.2.4"));K.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=u(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Z0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fo.isDisabled&&Fo.supportsFiber)try{gi=Fo.inject(Z0),Ot=Fo}catch{}}return la.createRoot=function(e,t){if(!g(e))throw Error(o(299));var s=!1,n="",c=vd,m=yd,D=Sd;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&&(m=t.onCaughtError),t.onRecoverableError!==void 0&&(D=t.onRecoverableError)),t=Qm(e,1,!1,null,null,s,n,null,c,m,D,up),e[es]=t.current,lu(e),new Au(t)},la.hydrateRoot=function(e,t,s){if(!g(e))throw Error(o(299));var n=!1,c="",m=vd,D=yd,z=Sd,Z=null;return s!=null&&(s.unstable_strictMode===!0&&(n=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(m=s.onUncaughtError),s.onCaughtError!==void 0&&(D=s.onCaughtError),s.onRecoverableError!==void 0&&(z=s.onRecoverableError),s.formState!==void 0&&(Z=s.formState)),t=Qm(e,1,!0,t,s??null,n,c,Z,m,D,z,up),t.context=ep(null),s=t.current,n=di(),n=Xt(n),c=ks(n),c.callback=null,Ds(s,c,n),s=n,t.current.lanes=s,xs(t,s),qi(t),e[es]=t.current,lu(e),new $o(t)},la.version="19.2.4",la}var bp;function iy(){if(bp)return Du.exports;bp=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(),Du.exports=ty(),Du.exports}var sy=iy();const ry=b_(sy);/**
|
|
50
|
+
* react-router v7.13.2
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var xp="popstate";function Cp(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function ny(i={}){function r(o,g){var u;let w=(u=g.state)==null?void 0:u.masked,{pathname:A,search:l,hash:h}=w||o.location;return Yu("",{pathname:A,search:l,hash:h},g.state&&g.state.usr||null,g.state&&g.state.key||"default",w?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,g){return typeof g=="string"?g:ya(g)}return oy(r,a,null,i)}function lt(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function Vi(i,r){if(!i){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function ay(){return Math.random().toString(36).substring(2,10)}function wp(i,r){return{usr:i.state,key:i.key,idx:r,masked:i.unstable_mask?{pathname:i.pathname,search:i.search,hash:i.hash}:void 0}}function Yu(i,r,a=null,o,g){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof r=="string"?on(r):r,state:a,key:r&&r.key||o||ay(),unstable_mask:g}}function ya({pathname:i="/",search:r="",hash:a=""}){return r&&r!=="?"&&(i+=r.charAt(0)==="?"?r:"?"+r),a&&a!=="#"&&(i+=a.charAt(0)==="#"?a:"#"+a),i}function on(i){let r={};if(i){let a=i.indexOf("#");a>=0&&(r.hash=i.substring(a),i=i.substring(0,a));let o=i.indexOf("?");o>=0&&(r.search=i.substring(o),i=i.substring(0,o)),i&&(r.pathname=i)}return r}function oy(i,r,a,o={}){let{window:g=document.defaultView,v5Compat:w=!1}=o,A=g.history,l="POP",h=null,u=y();u==null&&(u=0,A.replaceState({...A.state,idx:u},""));function y(){return(A.state||{idx:null}).idx}function d(){l="POP";let p=y(),v=p==null?null:p-u;u=p,h&&h({action:l,location:b.location,delta:v})}function x(p,v){l="PUSH";let f=Cp(p)?p:Yu(b.location,p,v);u=y()+1;let _=wp(f,u),S=b.createHref(f.unstable_mask||f);try{A.pushState(_,"",S)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;g.location.assign(S)}w&&h&&h({action:l,location:b.location,delta:1})}function E(p,v){l="REPLACE";let f=Cp(p)?p:Yu(b.location,p,v);u=y();let _=wp(f,u),S=b.createHref(f.unstable_mask||f);A.replaceState(_,"",S),w&&h&&h({action:l,location:b.location,delta:0})}function O(p){return ly(p)}let b={get action(){return l},get location(){return i(g,A)},listen(p){if(h)throw new Error("A history only accepts one active listener");return g.addEventListener(xp,d),h=p,()=>{g.removeEventListener(xp,d),h=null}},createHref(p){return r(g,p)},createURL:O,encodeLocation(p){let v=O(p);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:x,replace:E,go(p){return A.go(p)}};return b}function ly(i,r=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),lt(a,"No window.location.(origin|href) available to create URL");let o=typeof i=="string"?i:ya(i);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function x_(i,r,a="/"){return cy(i,r,a,!1)}function cy(i,r,a,o){let g=typeof r=="string"?on(r):r,w=Ss(g.pathname||"/",a);if(w==null)return null;let A=C_(i);uy(A);let l=null;for(let h=0;l==null&&h<A.length;++h){let u=by(w);l=yy(A[h],u,o)}return l}function C_(i,r=[],a=[],o="",g=!1){let w=(A,l,h=g,u)=>{let y={relativePath:u===void 0?A.path||"":u,caseSensitive:A.caseSensitive===!0,childrenIndex:l,route:A};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&h)return;lt(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let d=Ki([o,y.relativePath]),x=a.concat(y);A.children&&A.children.length>0&&(lt(A.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),C_(A.children,r,x,d,h)),!(A.path==null&&!A.index)&&r.push({path:d,score:gy(d,A.index),routesMeta:x})};return i.forEach((A,l)=>{var h;if(A.path===""||!((h=A.path)!=null&&h.includes("?")))w(A,l);else for(let u of w_(A.path))w(A,l,!0,u)}),r}function w_(i){let r=i.split("/");if(r.length===0)return[];let[a,...o]=r,g=a.endsWith("?"),w=a.replace(/\?$/,"");if(o.length===0)return g?[w,""]:[w];let A=w_(o.join("/")),l=[];return l.push(...A.map(h=>h===""?w:[w,h].join("/"))),g&&l.push(...A),l.map(h=>i.startsWith("/")&&h===""?"/":h)}function uy(i){i.sort((r,a)=>r.score!==a.score?a.score-r.score:vy(r.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var hy=/^:[\w-]+$/,fy=3,dy=2,my=1,py=10,_y=-2,Ep=i=>i==="*";function gy(i,r){let a=i.split("/"),o=a.length;return a.some(Ep)&&(o+=_y),r&&(o+=dy),a.filter(g=>!Ep(g)).reduce((g,w)=>g+(hy.test(w)?fy:w===""?my:py),o)}function vy(i,r){return i.length===r.length&&i.slice(0,-1).every((o,g)=>o===r[g])?i[i.length-1]-r[r.length-1]:0}function yy(i,r,a=!1){let{routesMeta:o}=i,g={},w="/",A=[];for(let l=0;l<o.length;++l){let h=o[l],u=l===o.length-1,y=w==="/"?r:r.slice(w.length)||"/",d=il({path:h.relativePath,caseSensitive:h.caseSensitive,end:u},y),x=h.route;if(!d&&u&&a&&!o[o.length-1].route.index&&(d=il({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},y)),!d)return null;Object.assign(g,d.params),A.push({params:g,pathname:Ki([w,d.pathname]),pathnameBase:Ey(Ki([w,d.pathnameBase])),route:x}),d.pathnameBase!=="/"&&(w=Ki([w,d.pathnameBase]))}return A}function il(i,r){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[a,o]=Sy(i.path,i.caseSensitive,i.end),g=r.match(a);if(!g)return null;let w=g[0],A=w.replace(/(.)\/+$/,"$1"),l=g.slice(1);return{params:o.reduce((u,{paramName:y,isOptional:d},x)=>{if(y==="*"){let O=l[x]||"";A=w.slice(0,w.length-O.length).replace(/(.)\/+$/,"$1")}const E=l[x];return d&&!E?u[y]=void 0:u[y]=(E||"").replace(/%2F/g,"/"),u},{}),pathname:w,pathnameBase:A,pattern:i}}function Sy(i,r=!1,a=!0){Vi(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let o=[],g="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(A,l,h,u,y)=>{if(o.push({paramName:l,isOptional:h!=null}),h){let d=y.charAt(u+A.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(o.push({paramName:"*"}),g+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?g+="\\/*$":i!==""&&i!=="/"&&(g+="(?:(?=\\/|$))"),[new RegExp(g,r?void 0:"i"),o]}function by(i){try{return i.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Vi(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),i}}function Ss(i,r){if(r==="/")return i;if(!i.toLowerCase().startsWith(r.toLowerCase()))return null;let a=r.endsWith("/")?r.length-1:r.length,o=i.charAt(a);return o&&o!=="/"?null:i.slice(a)||"/"}var xy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Cy(i,r="/"){let{pathname:a,search:o="",hash:g=""}=typeof i=="string"?on(i):i,w;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?w=Tp(a.substring(1),"/"):w=Tp(a,r)):w=r,{pathname:w,search:Ty(o),hash:Ay(g)}}function Tp(i,r){let a=r.replace(/\/+$/,"").split("/");return i.split("/").forEach(g=>{g===".."?a.length>1&&a.pop():g!=="."&&a.push(g)}),a.length>1?a.join("/"):"/"}function Nu(i,r,a,o){return`Cannot include a '${i}' character in a manually specified \`to.${r}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function wy(i){return i.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function E_(i){let r=wy(i);return r.map((a,o)=>o===r.length-1?a.pathname:a.pathnameBase)}function ch(i,r,a,o=!1){let g;typeof i=="string"?g=on(i):(g={...i},lt(!g.pathname||!g.pathname.includes("?"),Nu("?","pathname","search",g)),lt(!g.pathname||!g.pathname.includes("#"),Nu("#","pathname","hash",g)),lt(!g.search||!g.search.includes("#"),Nu("#","search","hash",g)));let w=i===""||g.pathname==="",A=w?"/":g.pathname,l;if(A==null)l=a;else{let d=r.length-1;if(!o&&A.startsWith("..")){let x=A.split("/");for(;x[0]==="..";)x.shift(),d-=1;g.pathname=x.join("/")}l=d>=0?r[d]:"/"}let h=Cy(g,l),u=A&&A!=="/"&&A.endsWith("/"),y=(w||A===".")&&a.endsWith("/");return!h.pathname.endsWith("/")&&(u||y)&&(h.pathname+="/"),h}var Ki=i=>i.join("/").replace(/\/\/+/g,"/"),Ey=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),Ty=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,Ay=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,Ry=class{constructor(i,r,a,o=!1){this.status=i,this.statusText=r||"",this.internal=o,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function ky(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function Dy(i){return i.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var T_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function A_(i,r){let a=i;if(typeof a!="string"||!xy.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,g=!1;if(T_)try{let w=new URL(window.location.href),A=a.startsWith("//")?new URL(w.protocol+a):new URL(a),l=Ss(A.pathname,r);A.origin===w.origin&&l!=null?a=l+A.search+A.hash:g=!0}catch{Vi(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:g,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var R_=["POST","PUT","PATCH","DELETE"];new Set(R_);var Oy=["GET",...R_];new Set(Oy);var ln=I.createContext(null);ln.displayName="DataRouter";var ul=I.createContext(null);ul.displayName="DataRouterState";var My=I.createContext(!1),k_=I.createContext({isTransitioning:!1});k_.displayName="ViewTransition";var Ly=I.createContext(new Map);Ly.displayName="Fetchers";var Ny=I.createContext(null);Ny.displayName="Await";var Oi=I.createContext(null);Oi.displayName="Navigation";var ba=I.createContext(null);ba.displayName="Location";var Ui=I.createContext({outlet:null,matches:[],isDataRoute:!1});Ui.displayName="Route";var uh=I.createContext(null);uh.displayName="RouteError";var D_="REACT_ROUTER_ERROR",jy="REDIRECT",By="ROUTE_ERROR_RESPONSE";function zy(i){if(i.startsWith(`${D_}:${jy}:{`))try{let r=JSON.parse(i.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function Hy(i){if(i.startsWith(`${D_}:${By}:{`))try{let r=JSON.parse(i.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new Ry(r.status,r.statusText,r.data)}catch{}}function Uy(i,{relative:r}={}){lt(xa(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:o}=I.useContext(Oi),{hash:g,pathname:w,search:A}=Ca(i,{relative:r}),l=w;return a!=="/"&&(l=w==="/"?a:Ki([a,w])),o.createHref({pathname:l,search:A,hash:g})}function xa(){return I.useContext(ba)!=null}function Ys(){return lt(xa(),"useLocation() may be used only in the context of a <Router> component."),I.useContext(ba).location}var O_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function M_(i){I.useContext(Oi).static||I.useLayoutEffect(i)}function hl(){let{isDataRoute:i}=I.useContext(Ui);return i?eS():Iy()}function Iy(){lt(xa(),"useNavigate() may be used only in the context of a <Router> component.");let i=I.useContext(ln),{basename:r,navigator:a}=I.useContext(Oi),{matches:o}=I.useContext(Ui),{pathname:g}=Ys(),w=JSON.stringify(E_(o)),A=I.useRef(!1);return M_(()=>{A.current=!0}),I.useCallback((h,u={})=>{if(Vi(A.current,O_),!A.current)return;if(typeof h=="number"){a.go(h);return}let y=ch(h,JSON.parse(w),g,u.relative==="path");i==null&&r!=="/"&&(y.pathname=y.pathname==="/"?r:Ki([r,y.pathname])),(u.replace?a.replace:a.push)(y,u.state,u)},[r,a,w,g,i])}var Py=I.createContext(null);function $y(i){let r=I.useContext(Ui).outlet;return I.useMemo(()=>r&&I.createElement(Py.Provider,{value:i},r),[r,i])}function L_(){let{matches:i}=I.useContext(Ui),r=i[i.length-1];return r?r.params:{}}function Ca(i,{relative:r}={}){let{matches:a}=I.useContext(Ui),{pathname:o}=Ys(),g=JSON.stringify(E_(a));return I.useMemo(()=>ch(i,JSON.parse(g),o,r==="path"),[i,g,o,r])}function Fy(i,r){return N_(i,r)}function N_(i,r,a){var p;lt(xa(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=I.useContext(Oi),{matches:g}=I.useContext(Ui),w=g[g.length-1],A=w?w.params:{},l=w?w.pathname:"/",h=w?w.pathnameBase:"/",u=w&&w.route;{let v=u&&u.path||"";B_(l,!u||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let y=Ys(),d;if(r){let v=typeof r=="string"?on(r):r;lt(h==="/"||((p=v.pathname)==null?void 0:p.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${v.pathname}" was given in the \`location\` prop.`),d=v}else d=y;let x=d.pathname||"/",E=x;if(h!=="/"){let v=h.replace(/^\//,"").split("/");E="/"+x.replace(/^\//,"").split("/").slice(v.length).join("/")}let O=x_(i,{pathname:E});Vi(u||O!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Vi(O==null||O[O.length-1].route.element!==void 0||O[O.length-1].route.Component!==void 0||O[O.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let b=Vy(O&&O.map(v=>Object.assign({},v,{params:Object.assign({},A,v.params),pathname:Ki([h,o.encodeLocation?o.encodeLocation(v.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?h:Ki([h,o.encodeLocation?o.encodeLocation(v.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathnameBase])})),g,a);return r&&b?I.createElement(ba.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...d},navigationType:"POP"}},b):b}function Zy(){let i=Qy(),r=ky(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),a=i instanceof Error?i.stack:null,o="rgba(200,200,200, 0.5)",g={padding:"0.5rem",backgroundColor:o},w={padding:"2px 4px",backgroundColor:o},A=null;return console.error("Error handled by React Router default ErrorBoundary:",i),A=I.createElement(I.Fragment,null,I.createElement("p",null,"💿 Hey developer 👋"),I.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",I.createElement("code",{style:w},"ErrorBoundary")," or"," ",I.createElement("code",{style:w},"errorElement")," prop on your route.")),I.createElement(I.Fragment,null,I.createElement("h2",null,"Unexpected Application Error!"),I.createElement("h3",{style:{fontStyle:"italic"}},r),a?I.createElement("pre",{style:g},a):null,A)}var qy=I.createElement(Zy,null),j_=class extends I.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,r){return r.location!==i.location||r.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:r.error,location:r.location,revalidation:i.revalidation||r.revalidation}}componentDidCatch(i,r){this.props.onError?this.props.onError(i,r):console.error("React Router caught the following error during render",i)}render(){let i=this.state.error;if(this.context&&typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){const a=Hy(i.digest);a&&(i=a)}let r=i!==void 0?I.createElement(Ui.Provider,{value:this.props.routeContext},I.createElement(uh.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?I.createElement(Gy,{error:i},r):r}};j_.contextType=My;var ju=new WeakMap;function Gy({children:i,error:r}){let{basename:a}=I.useContext(Oi);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let o=zy(r.digest);if(o){let g=ju.get(r);if(g)throw g;let w=A_(o.location,a);if(T_&&!ju.get(r))if(w.isExternal||o.reloadDocument)window.location.href=w.absoluteURL||w.to;else{const A=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(w.to,{replace:o.replace}));throw ju.set(r,A),A}return I.createElement("meta",{httpEquiv:"refresh",content:`0;url=${w.absoluteURL||w.to}`})}}return i}function Ky({routeContext:i,match:r,children:a}){let o=I.useContext(ln);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),I.createElement(Ui.Provider,{value:i},a)}function Vy(i,r=[],a){let o=a==null?void 0:a.state;if(i==null){if(!o)return null;if(o.errors)i=o.matches;else if(r.length===0&&!o.initialized&&o.matches.length>0)i=o.matches;else return null}let g=i,w=o==null?void 0:o.errors;if(w!=null){let y=g.findIndex(d=>d.route.id&&(w==null?void 0:w[d.route.id])!==void 0);lt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(w).join(",")}`),g=g.slice(0,Math.min(g.length,y+1))}let A=!1,l=-1;if(a&&o){A=o.renderFallback;for(let y=0;y<g.length;y++){let d=g[y];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=y),d.route.id){let{loaderData:x,errors:E}=o,O=d.route.loader&&!x.hasOwnProperty(d.route.id)&&(!E||E[d.route.id]===void 0);if(d.route.lazy||O){a.isStatic&&(A=!0),l>=0?g=g.slice(0,l+1):g=[g[0]];break}}}}let h=a==null?void 0:a.onError,u=o&&h?(y,d)=>{var x,E;h(y,{location:o.location,params:((E=(x=o.matches)==null?void 0:x[0])==null?void 0:E.params)??{},unstable_pattern:Dy(o.matches),errorInfo:d})}:void 0;return g.reduceRight((y,d,x)=>{let E,O=!1,b=null,p=null;o&&(E=w&&d.route.id?w[d.route.id]:void 0,b=d.route.errorElement||qy,A&&(l<0&&x===0?(B_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),O=!0,p=null):l===x&&(O=!0,p=d.route.hydrateFallbackElement||null)));let v=r.concat(g.slice(0,x+1)),f=()=>{let _;return E?_=b:O?_=p:d.route.Component?_=I.createElement(d.route.Component,null):d.route.element?_=d.route.element:_=y,I.createElement(Ky,{match:d,routeContext:{outlet:y,matches:v,isDataRoute:o!=null},children:_})};return o&&(d.route.ErrorBoundary||d.route.errorElement||x===0)?I.createElement(j_,{location:o.location,revalidation:o.revalidation,component:b,error:E,children:f(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:u}):f()},null)}function hh(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Wy(i){let r=I.useContext(ln);return lt(r,hh(i)),r}function Yy(i){let r=I.useContext(ul);return lt(r,hh(i)),r}function Xy(i){let r=I.useContext(Ui);return lt(r,hh(i)),r}function fh(i){let r=Xy(i),a=r.matches[r.matches.length-1];return lt(a.route.id,`${i} can only be used on routes that contain a unique "id"`),a.route.id}function Jy(){return fh("useRouteId")}function Qy(){var o;let i=I.useContext(uh),r=Yy("useRouteError"),a=fh("useRouteError");return i!==void 0?i:(o=r.errors)==null?void 0:o[a]}function eS(){let{router:i}=Wy("useNavigate"),r=fh("useNavigate"),a=I.useRef(!1);return M_(()=>{a.current=!0}),I.useCallback(async(g,w={})=>{Vi(a.current,O_),a.current&&(typeof g=="number"?await i.navigate(g):await i.navigate(g,{fromRouteId:r,...w}))},[i,r])}var Ap={};function B_(i,r,a){!r&&!Ap[i]&&(Ap[i]=!0,Vi(!1,a))}I.memo(tS);function tS({routes:i,future:r,state:a,isStatic:o,onError:g}){return N_(i,void 0,{state:a,isStatic:o,onError:g})}function iS(i){return $y(i.context)}function Gs(i){lt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function sS({basename:i="/",children:r=null,location:a,navigationType:o="POP",navigator:g,static:w=!1,unstable_useTransitions:A}){lt(!xa(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=i.replace(/^\/*/,"/"),h=I.useMemo(()=>({basename:l,navigator:g,static:w,unstable_useTransitions:A,future:{}}),[l,g,w,A]);typeof a=="string"&&(a=on(a));let{pathname:u="/",search:y="",hash:d="",state:x=null,key:E="default",unstable_mask:O}=a,b=I.useMemo(()=>{let p=Ss(u,l);return p==null?null:{location:{pathname:p,search:y,hash:d,state:x,key:E,unstable_mask:O},navigationType:o}},[l,u,y,d,x,E,o,O]);return Vi(b!=null,`<Router basename="${l}"> is not able to match the URL "${u}${y}${d}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:I.createElement(Oi.Provider,{value:h},I.createElement(ba.Provider,{children:r,value:b}))}function rS({children:i,location:r}){return Fy(Xu(i),r)}function Xu(i,r=[]){let a=[];return I.Children.forEach(i,(o,g)=>{if(!I.isValidElement(o))return;let w=[...r,g];if(o.type===I.Fragment){a.push.apply(a,Xu(o.props.children,w));return}lt(o.type===Gs,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),lt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let A={id:o.props.id||w.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(A.children=Xu(o.props.children,w)),a.push(A)}),a}var Jo="get",Qo="application/x-www-form-urlencoded";function fl(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function nS(i){return fl(i)&&i.tagName.toLowerCase()==="button"}function aS(i){return fl(i)&&i.tagName.toLowerCase()==="form"}function oS(i){return fl(i)&&i.tagName.toLowerCase()==="input"}function lS(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function cS(i,r){return i.button===0&&(!r||r==="_self")&&!lS(i)}var Zo=null;function uS(){if(Zo===null)try{new FormData(document.createElement("form"),0),Zo=!1}catch{Zo=!0}return Zo}var hS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Bu(i){return i!=null&&!hS.has(i)?(Vi(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Qo}"`),null):i}function fS(i,r){let a,o,g,w,A;if(aS(i)){let l=i.getAttribute("action");o=l?Ss(l,r):null,a=i.getAttribute("method")||Jo,g=Bu(i.getAttribute("enctype"))||Qo,w=new FormData(i)}else if(nS(i)||oS(i)&&(i.type==="submit"||i.type==="image")){let l=i.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=i.getAttribute("formaction")||l.getAttribute("action");if(o=h?Ss(h,r):null,a=i.getAttribute("formmethod")||l.getAttribute("method")||Jo,g=Bu(i.getAttribute("formenctype"))||Bu(l.getAttribute("enctype"))||Qo,w=new FormData(l,i),!uS()){let{name:u,type:y,value:d}=i;if(y==="image"){let x=u?`${u}.`:"";w.append(`${x}x`,"0"),w.append(`${x}y`,"0")}else u&&w.append(u,d)}}else{if(fl(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Jo,o=null,g=Qo,A=i}return w&&g==="text/plain"&&(A=w,w=void 0),{action:o,method:a.toLowerCase(),encType:g,formData:w,body:A}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function dh(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function dS(i,r,a,o){let g=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return a?g.pathname.endsWith("/")?g.pathname=`${g.pathname}_.${o}`:g.pathname=`${g.pathname}.${o}`:g.pathname==="/"?g.pathname=`_root.${o}`:r&&Ss(g.pathname,r)==="/"?g.pathname=`${r.replace(/\/$/,"")}/_root.${o}`:g.pathname=`${g.pathname.replace(/\/$/,"")}.${o}`,g}async function mS(i,r){if(i.id in r)return r[i.id];try{let a=await import(i.module);return r[i.id]=a,a}catch(a){return console.error(`Error loading route module \`${i.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function pS(i){return i==null?!1:i.href==null?i.rel==="preload"&&typeof i.imageSrcSet=="string"&&typeof i.imageSizes=="string":typeof i.rel=="string"&&typeof i.href=="string"}async function _S(i,r,a){let o=await Promise.all(i.map(async g=>{let w=r.routes[g.route.id];if(w){let A=await mS(w,a);return A.links?A.links():[]}return[]}));return SS(o.flat(1).filter(pS).filter(g=>g.rel==="stylesheet"||g.rel==="preload").map(g=>g.rel==="stylesheet"?{...g,rel:"prefetch",as:"style"}:{...g,rel:"prefetch"}))}function Rp(i,r,a,o,g,w){let A=(h,u)=>a[u]?h.route.id!==a[u].route.id:!0,l=(h,u)=>{var y;return a[u].pathname!==h.pathname||((y=a[u].route.path)==null?void 0:y.endsWith("*"))&&a[u].params["*"]!==h.params["*"]};return w==="assets"?r.filter((h,u)=>A(h,u)||l(h,u)):w==="data"?r.filter((h,u)=>{var d;let y=o.routes[h.route.id];if(!y||!y.hasLoader)return!1;if(A(h,u)||l(h,u))return!0;if(h.route.shouldRevalidate){let x=h.route.shouldRevalidate({currentUrl:new URL(g.pathname+g.search+g.hash,window.origin),currentParams:((d=a[0])==null?void 0:d.params)||{},nextUrl:new URL(i,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function gS(i,r,{includeHydrateFallback:a}={}){return vS(i.map(o=>{let g=r.routes[o.route.id];if(!g)return[];let w=[g.module];return g.clientActionModule&&(w=w.concat(g.clientActionModule)),g.clientLoaderModule&&(w=w.concat(g.clientLoaderModule)),a&&g.hydrateFallbackModule&&(w=w.concat(g.hydrateFallbackModule)),g.imports&&(w=w.concat(g.imports)),w}).flat(1))}function vS(i){return[...new Set(i)]}function yS(i){let r={},a=Object.keys(i).sort();for(let o of a)r[o]=i[o];return r}function SS(i,r){let a=new Set;return new Set(r),i.reduce((o,g)=>{let w=JSON.stringify(yS(g));return a.has(w)||(a.add(w),o.push({key:w,link:g})),o},[])}function z_(){let i=I.useContext(ln);return dh(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function bS(){let i=I.useContext(ul);return dh(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var mh=I.createContext(void 0);mh.displayName="FrameworkContext";function H_(){let i=I.useContext(mh);return dh(i,"You must render this element inside a <HydratedRouter> element"),i}function xS(i,r){let a=I.useContext(mh),[o,g]=I.useState(!1),[w,A]=I.useState(!1),{onFocus:l,onBlur:h,onMouseEnter:u,onMouseLeave:y,onTouchStart:d}=r,x=I.useRef(null);I.useEffect(()=>{if(i==="render"&&A(!0),i==="viewport"){let b=v=>{v.forEach(f=>{A(f.isIntersecting)})},p=new IntersectionObserver(b,{threshold:.5});return x.current&&p.observe(x.current),()=>{p.disconnect()}}},[i]),I.useEffect(()=>{if(o){let b=setTimeout(()=>{A(!0)},100);return()=>{clearTimeout(b)}}},[o]);let E=()=>{g(!0)},O=()=>{g(!1),A(!1)};return a?i!=="intent"?[w,x,{}]:[w,x,{onFocus:ca(l,E),onBlur:ca(h,O),onMouseEnter:ca(u,E),onMouseLeave:ca(y,O),onTouchStart:ca(d,E)}]:[!1,x,{}]}function ca(i,r){return a=>{i&&i(a),a.defaultPrevented||r(a)}}function CS({page:i,...r}){let{router:a}=z_(),o=I.useMemo(()=>x_(a.routes,i,a.basename),[a.routes,i,a.basename]);return o?I.createElement(ES,{page:i,matches:o,...r}):null}function wS(i){let{manifest:r,routeModules:a}=H_(),[o,g]=I.useState([]);return I.useEffect(()=>{let w=!1;return _S(i,r,a).then(A=>{w||g(A)}),()=>{w=!0}},[i,r,a]),o}function ES({page:i,matches:r,...a}){let o=Ys(),{future:g,manifest:w,routeModules:A}=H_(),{basename:l}=z_(),{loaderData:h,matches:u}=bS(),y=I.useMemo(()=>Rp(i,r,u,w,o,"data"),[i,r,u,w,o]),d=I.useMemo(()=>Rp(i,r,u,w,o,"assets"),[i,r,u,w,o]),x=I.useMemo(()=>{if(i===o.pathname+o.search+o.hash)return[];let b=new Set,p=!1;if(r.forEach(f=>{var S;let _=w.routes[f.route.id];!_||!_.hasLoader||(!y.some(R=>R.route.id===f.route.id)&&f.route.id in h&&((S=A[f.route.id])!=null&&S.shouldRevalidate)||_.hasClientLoader?p=!0:b.add(f.route.id))}),b.size===0)return[];let v=dS(i,l,g.unstable_trailingSlashAwareDataRequests,"data");return p&&b.size>0&&v.searchParams.set("_routes",r.filter(f=>b.has(f.route.id)).map(f=>f.route.id).join(",")),[v.pathname+v.search]},[l,g.unstable_trailingSlashAwareDataRequests,h,o,w,y,r,i,A]),E=I.useMemo(()=>gS(d,w),[d,w]),O=wS(d);return I.createElement(I.Fragment,null,x.map(b=>I.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...a})),E.map(b=>I.createElement("link",{key:b,rel:"modulepreload",href:b,...a})),O.map(({key:b,link:p})=>I.createElement("link",{key:b,nonce:a.nonce,...p,crossOrigin:p.crossOrigin??a.crossOrigin})))}function TS(...i){return r=>{i.forEach(a=>{typeof a=="function"?a(r):a!=null&&(a.current=r)})}}var AS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{AS&&(window.__reactRouterVersion="7.13.2")}catch{}function RS({basename:i,children:r,unstable_useTransitions:a,window:o}){let g=I.useRef();g.current==null&&(g.current=ny({window:o,v5Compat:!0}));let w=g.current,[A,l]=I.useState({action:w.action,location:w.location}),h=I.useCallback(u=>{a===!1?l(u):I.startTransition(()=>l(u))},[a]);return I.useLayoutEffect(()=>w.listen(h),[w,h]),I.createElement(sS,{basename:i,children:r,location:A.location,navigationType:A.action,navigator:w,unstable_useTransitions:a})}var U_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hi=I.forwardRef(function({onClick:r,discover:a="render",prefetch:o="none",relative:g,reloadDocument:w,replace:A,unstable_mask:l,state:h,target:u,to:y,preventScrollReset:d,viewTransition:x,unstable_defaultShouldRevalidate:E,...O},b){let{basename:p,navigator:v,unstable_useTransitions:f}=I.useContext(Oi),_=typeof y=="string"&&U_.test(y),S=A_(y,p);y=S.to;let R=Uy(y,{relative:g}),k=Ys(),M=null;if(l){let te=ch(l,[],k.unstable_mask?k.unstable_mask.pathname:"/",!0);p!=="/"&&(te.pathname=te.pathname==="/"?p:Ki([p,te.pathname])),M=v.createHref(te)}let[T,N,P]=xS(o,O),F=OS(y,{replace:A,unstable_mask:l,state:h,target:u,preventScrollReset:d,relative:g,viewTransition:x,unstable_defaultShouldRevalidate:E,unstable_useTransitions:f});function G(te){r&&r(te),te.defaultPrevented||F(te)}let $=!(S.isExternal||w),J=I.createElement("a",{...O,...P,href:($?M:void 0)||S.absoluteURL||R,onClick:$?G:r,ref:TS(b,N),target:u,"data-discover":!_&&a==="render"?"true":void 0});return T&&!_?I.createElement(I.Fragment,null,J,I.createElement(CS,{page:R})):J});Hi.displayName="Link";var I_=I.forwardRef(function({"aria-current":r="page",caseSensitive:a=!1,className:o="",end:g=!1,style:w,to:A,viewTransition:l,children:h,...u},y){let d=Ca(A,{relative:u.relative}),x=Ys(),E=I.useContext(ul),{navigator:O,basename:b}=I.useContext(Oi),p=E!=null&&BS(d)&&l===!0,v=O.encodeLocation?O.encodeLocation(d).pathname:d.pathname,f=x.pathname,_=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;a||(f=f.toLowerCase(),_=_?_.toLowerCase():null,v=v.toLowerCase()),_&&b&&(_=Ss(_,b)||_);const S=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let R=f===v||!g&&f.startsWith(v)&&f.charAt(S)==="/",k=_!=null&&(_===v||!g&&_.startsWith(v)&&_.charAt(v.length)==="/"),M={isActive:R,isPending:k,isTransitioning:p},T=R?r:void 0,N;typeof o=="function"?N=o(M):N=[o,R?"active":null,k?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let P=typeof w=="function"?w(M):w;return I.createElement(Hi,{...u,"aria-current":T,className:N,ref:y,style:P,to:A,viewTransition:l},typeof h=="function"?h(M):h)});I_.displayName="NavLink";var kS=I.forwardRef(({discover:i="render",fetcherKey:r,navigate:a,reloadDocument:o,replace:g,state:w,method:A=Jo,action:l,onSubmit:h,relative:u,preventScrollReset:y,viewTransition:d,unstable_defaultShouldRevalidate:x,...E},O)=>{let{unstable_useTransitions:b}=I.useContext(Oi),p=NS(),v=jS(l,{relative:u}),f=A.toLowerCase()==="get"?"get":"post",_=typeof l=="string"&&U_.test(l),S=R=>{if(h&&h(R),R.defaultPrevented)return;R.preventDefault();let k=R.nativeEvent.submitter,M=(k==null?void 0:k.getAttribute("formmethod"))||A,T=()=>p(k||R.currentTarget,{fetcherKey:r,method:M,navigate:a,replace:g,state:w,relative:u,preventScrollReset:y,viewTransition:d,unstable_defaultShouldRevalidate:x});b&&a!==!1?I.startTransition(()=>T()):T()};return I.createElement("form",{ref:O,method:f,action:v,onSubmit:o?h:S,...E,"data-discover":!_&&i==="render"?"true":void 0})});kS.displayName="Form";function DS(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function P_(i){let r=I.useContext(ln);return lt(r,DS(i)),r}function OS(i,{target:r,replace:a,unstable_mask:o,state:g,preventScrollReset:w,relative:A,viewTransition:l,unstable_defaultShouldRevalidate:h,unstable_useTransitions:u}={}){let y=hl(),d=Ys(),x=Ca(i,{relative:A});return I.useCallback(E=>{if(cS(E,r)){E.preventDefault();let O=a!==void 0?a:ya(d)===ya(x),b=()=>y(i,{replace:O,unstable_mask:o,state:g,preventScrollReset:w,relative:A,viewTransition:l,unstable_defaultShouldRevalidate:h});u?I.startTransition(()=>b()):b()}},[d,y,x,a,o,g,r,i,w,A,l,h,u])}var MS=0,LS=()=>`__${String(++MS)}__`;function NS(){let{router:i}=P_("useSubmit"),{basename:r}=I.useContext(Oi),a=Jy(),o=i.fetch,g=i.navigate;return I.useCallback(async(w,A={})=>{let{action:l,method:h,encType:u,formData:y,body:d}=fS(w,r);if(A.navigate===!1){let x=A.fetcherKey||LS();await o(x,a,A.action||l,{unstable_defaultShouldRevalidate:A.unstable_defaultShouldRevalidate,preventScrollReset:A.preventScrollReset,formData:y,body:d,formMethod:A.method||h,formEncType:A.encType||u,flushSync:A.flushSync})}else await g(A.action||l,{unstable_defaultShouldRevalidate:A.unstable_defaultShouldRevalidate,preventScrollReset:A.preventScrollReset,formData:y,body:d,formMethod:A.method||h,formEncType:A.encType||u,replace:A.replace,state:A.state,fromRouteId:a,flushSync:A.flushSync,viewTransition:A.viewTransition})},[o,g,r,a])}function jS(i,{relative:r}={}){let{basename:a}=I.useContext(Oi),o=I.useContext(Ui);lt(o,"useFormAction must be used inside a RouteContext");let[g]=o.matches.slice(-1),w={...Ca(i||".",{relative:r})},A=Ys();if(i==null){w.search=A.search;let l=new URLSearchParams(w.search),h=l.getAll("index");if(h.some(y=>y==="")){l.delete("index"),h.filter(d=>d).forEach(d=>l.append("index",d));let y=l.toString();w.search=y?`?${y}`:""}}return(!i||i===".")&&g.route.index&&(w.search=w.search?w.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(w.pathname=w.pathname==="/"?a:Ki([a,w.pathname])),ya(w)}function BS(i,{relative:r}={}){let a=I.useContext(k_);lt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=P_("useViewTransitionState"),g=Ca(i,{relative:r});if(!a.isTransitioning)return!1;let w=Ss(a.currentLocation.pathname,o)||a.currentLocation.pathname,A=Ss(a.nextLocation.pathname,o)||a.nextLocation.pathname;return il(g.pathname,A)!=null||il(g.pathname,w)!=null}class zS extends I.Component{constructor(){super(...arguments);Et(this,"state",{hasError:!1,error:null});Et(this,"handleReload",()=>{this.setState({hasError:!1,error:null}),window.location.reload()})}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,o){console.error("[ErrorBoundary]",a,o.componentStack)}render(){var a;return this.state.hasError?C.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-center px-4",children:[C.jsx("div",{className:"text-6xl mb-4",children:"⚠"}),C.jsx("h1",{className:"text-lg text-[#e0e0e0] mb-2",children:"Something went wrong"}),C.jsx("p",{className:"text-sm text-[#555] mb-6 max-w-md",children:((a=this.state.error)==null?void 0:a.message)??"An unexpected error occurred."}),C.jsx("button",{onClick:this.handleReload,className:"px-4 py-2 text-sm font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors",children:"Reload"})]}):this.props.children}}/**
|
|
61
|
+
* @license lucide-react v0.474.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const HS=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$_=(...i)=>i.filter((r,a,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===a).join(" ").trim();/**
|
|
66
|
+
* @license lucide-react v0.474.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/var US={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
71
|
+
* @license lucide-react v0.474.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const IS=I.forwardRef(({color:i="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:g="",children:w,iconNode:A,...l},h)=>I.createElement("svg",{ref:h,...US,width:r,height:r,stroke:i,strokeWidth:o?Number(a)*24/Number(r):a,className:$_("lucide",g),...l},[...A.map(([u,y])=>I.createElement(u,y)),...Array.isArray(w)?w:[w]]));/**
|
|
76
|
+
* @license lucide-react v0.474.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const Pe=(i,r)=>{const a=I.forwardRef(({className:o,...g},w)=>I.createElement(IS,{ref:w,iconNode:r,className:$_(`lucide-${HS(i)}`,o),...g}));return a.displayName=`${i}`,a};/**
|
|
81
|
+
* @license lucide-react v0.474.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const PS=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],F_=Pe("Activity",PS);/**
|
|
86
|
+
* @license lucide-react v0.474.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const $S=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],Z_=Pe("Ban",$S);/**
|
|
91
|
+
* @license lucide-react v0.474.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const FS=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],ZS=Pe("Camera",FS);/**
|
|
96
|
+
* @license lucide-react v0.474.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const qS=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],GS=Pe("ChevronLeft",qS);/**
|
|
101
|
+
* @license lucide-react v0.474.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const KS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],VS=Pe("ChevronRight",KS);/**
|
|
106
|
+
* @license lucide-react v0.474.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const WS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],q_=Pe("CircleCheck",WS);/**
|
|
111
|
+
* @license lucide-react v0.474.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const YS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],XS=Pe("CirclePlus",YS);/**
|
|
116
|
+
* @license lucide-react v0.474.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const JS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],sl=Pe("CircleX",JS);/**
|
|
121
|
+
* @license lucide-react v0.474.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const QS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],eb=Pe("Clock",QS);/**
|
|
126
|
+
* @license lucide-react v0.474.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const tb=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ib=Pe("Copy",tb);/**
|
|
131
|
+
* @license lucide-react v0.474.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const sb=[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]],rb=Pe("CornerDownLeft",sb);/**
|
|
136
|
+
* @license lucide-react v0.474.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const nb=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ab=Pe("EyeOff",nb);/**
|
|
141
|
+
* @license lucide-react v0.474.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const ob=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],lb=Pe("Eye",ob);/**
|
|
146
|
+
* @license lucide-react v0.474.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const cb=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Ju=Pe("KeyRound",cb);/**
|
|
151
|
+
* @license lucide-react v0.474.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const ub=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],hb=Pe("Layers",ub);/**
|
|
156
|
+
* @license lucide-react v0.474.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const fb=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],db=Pe("LayoutDashboard",fb);/**
|
|
161
|
+
* @license lucide-react v0.474.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const mb=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qu=Pe("LoaderCircle",mb);/**
|
|
166
|
+
* @license lucide-react v0.474.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const pb=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],_b=Pe("MessageSquare",pb);/**
|
|
171
|
+
* @license lucide-react v0.474.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const gb=[["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}]],vb=Pe("Octagon",gb);/**
|
|
176
|
+
* @license lucide-react v0.474.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const yb=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],G_=Pe("Play",yb);/**
|
|
181
|
+
* @license lucide-react v0.474.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const Sb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],wa=Pe("Plus",Sb);/**
|
|
186
|
+
* @license lucide-react v0.474.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const bb=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],xb=Pe("Power",bb);/**
|
|
191
|
+
* @license lucide-react v0.474.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const Cb=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],K_=Pe("RefreshCw",Cb);/**
|
|
196
|
+
* @license lucide-react v0.474.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const wb=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Eb=Pe("Search",wb);/**
|
|
201
|
+
* @license lucide-react v0.474.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const Tb=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Ab=Pe("Send",Tb);/**
|
|
206
|
+
* @license lucide-react v0.474.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const Rb=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],kb=Pe("ShieldAlert",Rb);/**
|
|
211
|
+
* @license lucide-react v0.474.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const Db=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Ob=Pe("Shield",Db);/**
|
|
216
|
+
* @license lucide-react v0.474.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const Mb=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],Lb=Pe("Skull",Mb);/**
|
|
221
|
+
* @license lucide-react v0.474.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const Nb=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],jb=Pe("Terminal",Nb);/**
|
|
226
|
+
* @license lucide-react v0.474.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const Bb=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],ph=Pe("Trash2",Bb);/**
|
|
231
|
+
* @license lucide-react v0.474.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const zb=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],V_=Pe("TriangleAlert",zb);/**
|
|
236
|
+
* @license lucide-react v0.474.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const Hb=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]],Ub=Pe("UserCheck",Hb);/**
|
|
241
|
+
* @license lucide-react v0.474.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const Ib=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],Pb=Pe("Users",Ib);/**
|
|
246
|
+
* @license lucide-react v0.474.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const $b=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],dl=Pe("X",$b);/**
|
|
251
|
+
* @license lucide-react v0.474.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const Fb=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Zb=Pe("Zap",Fb),kp=i=>{let r;const a=new Set,o=(u,y)=>{const d=typeof u=="function"?u(r):u;if(!Object.is(d,r)){const x=r;r=y??(typeof d!="object"||d===null)?d:Object.assign({},r,d),a.forEach(E=>E(r,x))}},g=()=>r,l={setState:o,getState:g,getInitialState:()=>h,subscribe:u=>(a.add(u),()=>a.delete(u))},h=r=i(o,g,l);return l},qb=(i=>i?kp(i):kp),Gb=i=>i;function Kb(i,r=Gb){const a=ga.useSyncExternalStore(i.subscribe,ga.useCallback(()=>r(i.getState()),[i,r]),ga.useCallback(()=>r(i.getInitialState()),[i,r]));return ga.useDebugValue(a),a}const Dp=i=>{const r=qb(i),a=o=>Kb(r,o);return Object.assign(a,r),a},W_=(i=>i?Dp(i):Dp),dt=W_(i=>({token:localStorage.getItem("aegis_token"),setToken:r=>{localStorage.setItem("aegis_token",r),i({token:r})},clearToken:()=>{localStorage.removeItem("aegis_token"),i({token:null})},sessions:[],setSessions:r=>i({sessions:r}),healthMap:{},setSessionsAndHealth:(r,a)=>i({sessions:r,healthMap:a}),metrics:null,setMetrics:r=>i({metrics:r}),sseConnected:!1,setSseConnected:r=>i({sseConnected:r}),sseError:null,setSseError:r=>i({sseError:r}),activities:[],addActivity:r=>i(a=>({activities:[r,...a.activities].slice(0,200)})),clearActivities:()=>i({activities:[]}),activityFilterSession:null,setActivityFilterSession:r=>i({activityFilterSession:r}),activityFilterType:null,setActivityFilterType:r=>i({activityFilterType:r})}));function fe(i,r,a){function o(l,h){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:h,constr:A,traits:new Set},enumerable:!1}),l._zod.traits.has(i))return;l._zod.traits.add(i),r(l,h);const u=A.prototype,y=Object.keys(u);for(let d=0;d<y.length;d++){const x=y[d];x in l||(l[x]=u[x].bind(l))}}const g=(a==null?void 0:a.Parent)??Object;class w extends g{}Object.defineProperty(w,"name",{value:i});function A(l){var h;const u=a!=null&&a.Parent?new w:this;o(u,l),(h=u._zod).deferred??(h.deferred=[]);for(const y of u._zod.deferred)y();return u}return Object.defineProperty(A,"init",{value:o}),Object.defineProperty(A,Symbol.hasInstance,{value:l=>{var h,u;return a!=null&&a.Parent&&l instanceof a.Parent?!0:(u=(h=l==null?void 0:l._zod)==null?void 0:h.traits)==null?void 0:u.has(i)}}),Object.defineProperty(A,"name",{value:i}),A}class rn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Y_ extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const X_={};function Vs(i){return X_}function J_(i){const r=Object.values(i).filter(o=>typeof o=="number");return Object.entries(i).filter(([o,g])=>r.indexOf(+o)===-1).map(([o,g])=>g)}function eh(i,r){return typeof r=="bigint"?r.toString():r}function _h(i){return{get value(){{const r=i();return Object.defineProperty(this,"value",{value:r}),r}}}}function gh(i){return i==null}function vh(i){const r=i.startsWith("^")?1:0,a=i.endsWith("$")?i.length-1:i.length;return i.slice(r,a)}function Vb(i,r){const a=(i.toString().split(".")[1]||"").length,o=r.toString();let g=(o.split(".")[1]||"").length;if(g===0&&/\d?e-\d?/.test(o)){const h=o.match(/\d?e-(\d?)/);h!=null&&h[1]&&(g=Number.parseInt(h[1]))}const w=a>g?a:g,A=Number.parseInt(i.toFixed(w).replace(".","")),l=Number.parseInt(r.toFixed(w).replace(".",""));return A%l/10**w}const Op=Symbol("evaluating");function Ve(i,r,a){let o;Object.defineProperty(i,r,{get(){if(o!==Op)return o===void 0&&(o=Op,o=a()),o},set(g){Object.defineProperty(i,r,{value:g})},configurable:!0})}function vr(i,r,a){Object.defineProperty(i,r,{value:a,writable:!0,enumerable:!0,configurable:!0})}function Xs(...i){const r={};for(const a of i){const o=Object.getOwnPropertyDescriptors(a);Object.assign(r,o)}return Object.defineProperties({},r)}function Mp(i){return JSON.stringify(i)}function Wb(i){return i.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Q_="captureStackTrace"in Error?Error.captureStackTrace:(...i)=>{};function rl(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}const Yb=_h(()=>{var i;if(typeof navigator<"u"&&((i=navigator==null?void 0:navigator.userAgent)!=null&&i.includes("Cloudflare")))return!1;try{const r=Function;return new r(""),!0}catch{return!1}});function nn(i){if(rl(i)===!1)return!1;const r=i.constructor;if(r===void 0||typeof r!="function")return!0;const a=r.prototype;return!(rl(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function eg(i){return nn(i)?{...i}:Array.isArray(i)?[...i]:i}const Xb=new Set(["string","number","symbol"]);function ml(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Js(i,r,a){const o=new i._zod.constr(r??i._zod.def);return(!r||a!=null&&a.parent)&&(o._zod.parent=i),o}function we(i){const r=i;if(!r)return{};if(typeof r=="string")return{error:()=>r};if((r==null?void 0:r.message)!==void 0){if((r==null?void 0:r.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function Jb(i){return Object.keys(i).filter(r=>i[r]._zod.optin==="optional"&&i[r]._zod.optout==="optional")}const Qb={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function e1(i,r){const a=i._zod.def,o=a.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const w=Xs(i._zod.def,{get shape(){const A={};for(const l in r){if(!(l in a.shape))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(A[l]=a.shape[l])}return vr(this,"shape",A),A},checks:[]});return Js(i,w)}function t1(i,r){const a=i._zod.def,o=a.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const w=Xs(i._zod.def,{get shape(){const A={...i._zod.def.shape};for(const l in r){if(!(l in a.shape))throw new Error(`Unrecognized key: "${l}"`);r[l]&&delete A[l]}return vr(this,"shape",A),A},checks:[]});return Js(i,w)}function i1(i,r){if(!nn(r))throw new Error("Invalid input to extend: expected a plain object");const a=i._zod.def.checks;if(a&&a.length>0){const w=i._zod.def.shape;for(const A in r)if(Object.getOwnPropertyDescriptor(w,A)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const g=Xs(i._zod.def,{get shape(){const w={...i._zod.def.shape,...r};return vr(this,"shape",w),w}});return Js(i,g)}function s1(i,r){if(!nn(r))throw new Error("Invalid input to safeExtend: expected a plain object");const a=Xs(i._zod.def,{get shape(){const o={...i._zod.def.shape,...r};return vr(this,"shape",o),o}});return Js(i,a)}function r1(i,r){const a=Xs(i._zod.def,{get shape(){const o={...i._zod.def.shape,...r._zod.def.shape};return vr(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:[]});return Js(i,a)}function n1(i,r,a){const g=r._zod.def.checks;if(g&&g.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const A=Xs(r._zod.def,{get shape(){const l=r._zod.def.shape,h={...l};if(a)for(const u in a){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);a[u]&&(h[u]=i?new i({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)h[u]=i?new i({type:"optional",innerType:l[u]}):l[u];return vr(this,"shape",h),h},checks:[]});return Js(r,A)}function a1(i,r,a){const o=Xs(r._zod.def,{get shape(){const g=r._zod.def.shape,w={...g};if(a)for(const A in a){if(!(A in w))throw new Error(`Unrecognized key: "${A}"`);a[A]&&(w[A]=new i({type:"nonoptional",innerType:g[A]}))}else for(const A in g)w[A]=new i({type:"nonoptional",innerType:g[A]});return vr(this,"shape",w),w}});return Js(r,o)}function tn(i,r=0){var a;if(i.aborted===!0)return!0;for(let o=r;o<i.issues.length;o++)if(((a=i.issues[o])==null?void 0:a.continue)!==!0)return!0;return!1}function sn(i,r){return r.map(a=>{var o;return(o=a).path??(o.path=[]),a.path.unshift(i),a})}function qo(i){return typeof i=="string"?i:i==null?void 0:i.message}function Ws(i,r,a){var g,w,A,l,h,u;const o={...i,path:i.path??[]};if(!i.message){const y=qo((A=(w=(g=i.inst)==null?void 0:g._zod.def)==null?void 0:w.error)==null?void 0:A.call(w,i))??qo((l=r==null?void 0:r.error)==null?void 0:l.call(r,i))??qo((h=a.customError)==null?void 0:h.call(a,i))??qo((u=a.localeError)==null?void 0:u.call(a,i))??"Invalid input";o.message=y}return delete o.inst,delete o.continue,r!=null&&r.reportInput||delete o.input,o}function yh(i){return Array.isArray(i)?"array":typeof i=="string"?"string":"unknown"}function Sa(...i){const[r,a,o]=i;return typeof r=="string"?{message:r,code:"custom",input:a,inst:o}:{...r}}const tg=(i,r)=>{i.name="$ZodError",Object.defineProperty(i,"_zod",{value:i._zod,enumerable:!1}),Object.defineProperty(i,"issues",{value:r,enumerable:!1}),i.message=JSON.stringify(r,eh,2),Object.defineProperty(i,"toString",{value:()=>i.message,enumerable:!1})},ig=fe("$ZodError",tg),sg=fe("$ZodError",tg,{Parent:Error});function o1(i,r=a=>a.message){const a={},o=[];for(const g of i.issues)g.path.length>0?(a[g.path[0]]=a[g.path[0]]||[],a[g.path[0]].push(r(g))):o.push(r(g));return{formErrors:o,fieldErrors:a}}function l1(i,r=a=>a.message){const a={_errors:[]},o=g=>{for(const w of g.issues)if(w.code==="invalid_union"&&w.errors.length)w.errors.map(A=>o({issues:A}));else if(w.code==="invalid_key")o({issues:w.issues});else if(w.code==="invalid_element")o({issues:w.issues});else if(w.path.length===0)a._errors.push(r(w));else{let A=a,l=0;for(;l<w.path.length;){const h=w.path[l];l===w.path.length-1?(A[h]=A[h]||{_errors:[]},A[h]._errors.push(r(w))):A[h]=A[h]||{_errors:[]},A=A[h],l++}}};return o(i),a}const Sh=i=>(r,a,o,g)=>{const w=o?Object.assign(o,{async:!1}):{async:!1},A=r._zod.run({value:a,issues:[]},w);if(A instanceof Promise)throw new rn;if(A.issues.length){const l=new((g==null?void 0:g.Err)??i)(A.issues.map(h=>Ws(h,w,Vs())));throw Q_(l,g==null?void 0:g.callee),l}return A.value},bh=i=>async(r,a,o,g)=>{const w=o?Object.assign(o,{async:!0}):{async:!0};let A=r._zod.run({value:a,issues:[]},w);if(A instanceof Promise&&(A=await A),A.issues.length){const l=new((g==null?void 0:g.Err)??i)(A.issues.map(h=>Ws(h,w,Vs())));throw Q_(l,g==null?void 0:g.callee),l}return A.value},pl=i=>(r,a,o)=>{const g=o?{...o,async:!1}:{async:!1},w=r._zod.run({value:a,issues:[]},g);if(w instanceof Promise)throw new rn;return w.issues.length?{success:!1,error:new(i??ig)(w.issues.map(A=>Ws(A,g,Vs())))}:{success:!0,data:w.value}},c1=pl(sg),_l=i=>async(r,a,o)=>{const g=o?Object.assign(o,{async:!0}):{async:!0};let w=r._zod.run({value:a,issues:[]},g);return w instanceof Promise&&(w=await w),w.issues.length?{success:!1,error:new i(w.issues.map(A=>Ws(A,g,Vs())))}:{success:!0,data:w.value}},u1=_l(sg),h1=i=>(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Sh(i)(r,a,g)},f1=i=>(r,a,o)=>Sh(i)(r,a,o),d1=i=>async(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return bh(i)(r,a,g)},m1=i=>async(r,a,o)=>bh(i)(r,a,o),p1=i=>(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return pl(i)(r,a,g)},_1=i=>(r,a,o)=>pl(i)(r,a,o),g1=i=>async(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return _l(i)(r,a,g)},v1=i=>async(r,a,o)=>_l(i)(r,a,o),y1=/^[cC][^\s-]{8,}$/,S1=/^[0-9a-z]+$/,b1=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,x1=/^[0-9a-vA-V]{20}$/,C1=/^[A-Za-z0-9]{27}$/,w1=/^[a-zA-Z0-9_-]{21}$/,E1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,T1=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Lp=i=>i?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${i}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,A1=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,R1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function k1(){return new RegExp(R1,"u")}const D1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,O1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,M1=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,L1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,N1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rg=/^[A-Za-z0-9_-]*$/,j1=/^\+[1-9]\d{6,14}$/,ng="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",B1=new RegExp(`^${ng}$`);function ag(i){const r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof i.precision=="number"?i.precision===-1?`${r}`:i.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${i.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function z1(i){return new RegExp(`^${ag(i)}$`)}function H1(i){const r=ag({precision:i.precision}),a=["Z"];i.local&&a.push(""),i.offset&&a.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${r}(?:${a.join("|")})`;return new RegExp(`^${ng}T(?:${o})$`)}const U1=i=>{const r=i?`[\\s\\S]{${(i==null?void 0:i.minimum)??0},${(i==null?void 0:i.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},I1=/^-?\d+$/,og=/^-?\d+(?:\.\d+)?$/,P1=/^(?:true|false)$/i,$1=/^[^A-Z]*$/,F1=/^[^a-z]*$/,ni=fe("$ZodCheck",(i,r)=>{var a;i._zod??(i._zod={}),i._zod.def=r,(a=i._zod).onattach??(a.onattach=[])}),lg={number:"number",bigint:"bigint",object:"date"},cg=fe("$ZodCheckLessThan",(i,r)=>{ni.init(i,r);const a=lg[typeof r.value];i._zod.onattach.push(o=>{const g=o._zod.bag,w=(r.inclusive?g.maximum:g.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<w&&(r.inclusive?g.maximum=r.value:g.exclusiveMaximum=r.value)}),i._zod.check=o=>{(r.inclusive?o.value<=r.value:o.value<r.value)||o.issues.push({origin:a,code:"too_big",maximum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:i,continue:!r.abort})}}),ug=fe("$ZodCheckGreaterThan",(i,r)=>{ni.init(i,r);const a=lg[typeof r.value];i._zod.onattach.push(o=>{const g=o._zod.bag,w=(r.inclusive?g.minimum:g.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>w&&(r.inclusive?g.minimum=r.value:g.exclusiveMinimum=r.value)}),i._zod.check=o=>{(r.inclusive?o.value>=r.value:o.value>r.value)||o.issues.push({origin:a,code:"too_small",minimum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:i,continue:!r.abort})}}),Z1=fe("$ZodCheckMultipleOf",(i,r)=>{ni.init(i,r),i._zod.onattach.push(a=>{var o;(o=a._zod.bag).multipleOf??(o.multipleOf=r.value)}),i._zod.check=a=>{if(typeof a.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof a.value=="bigint"?a.value%r.value===BigInt(0):Vb(a.value,r.value)===0)||a.issues.push({origin:typeof a.value,code:"not_multiple_of",divisor:r.value,input:a.value,inst:i,continue:!r.abort})}}),q1=fe("$ZodCheckNumberFormat",(i,r)=>{var A;ni.init(i,r),r.format=r.format||"float64";const a=(A=r.format)==null?void 0:A.includes("int"),o=a?"int":"number",[g,w]=Qb[r.format];i._zod.onattach.push(l=>{const h=l._zod.bag;h.format=r.format,h.minimum=g,h.maximum=w,a&&(h.pattern=I1)}),i._zod.check=l=>{const h=l.value;if(a){if(!Number.isInteger(h)){l.issues.push({expected:o,format:r.format,code:"invalid_type",continue:!1,input:h,inst:i});return}if(!Number.isSafeInteger(h)){h>0?l.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:o,inclusive:!0,continue:!r.abort}):l.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:o,inclusive:!0,continue:!r.abort});return}}h<g&&l.issues.push({origin:"number",input:h,code:"too_small",minimum:g,inclusive:!0,inst:i,continue:!r.abort}),h>w&&l.issues.push({origin:"number",input:h,code:"too_big",maximum:w,inclusive:!0,inst:i,continue:!r.abort})}}),G1=fe("$ZodCheckMaxLength",(i,r)=>{var a;ni.init(i,r),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!gh(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<g&&(o._zod.bag.maximum=r.maximum)}),i._zod.check=o=>{const g=o.value;if(g.length<=r.maximum)return;const A=yh(g);o.issues.push({origin:A,code:"too_big",maximum:r.maximum,inclusive:!0,input:g,inst:i,continue:!r.abort})}}),K1=fe("$ZodCheckMinLength",(i,r)=>{var a;ni.init(i,r),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!gh(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>g&&(o._zod.bag.minimum=r.minimum)}),i._zod.check=o=>{const g=o.value;if(g.length>=r.minimum)return;const A=yh(g);o.issues.push({origin:A,code:"too_small",minimum:r.minimum,inclusive:!0,input:g,inst:i,continue:!r.abort})}}),V1=fe("$ZodCheckLengthEquals",(i,r)=>{var a;ni.init(i,r),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!gh(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag;g.minimum=r.length,g.maximum=r.length,g.length=r.length}),i._zod.check=o=>{const g=o.value,w=g.length;if(w===r.length)return;const A=yh(g),l=w>r.length;o.issues.push({origin:A,...l?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:i,continue:!r.abort})}}),gl=fe("$ZodCheckStringFormat",(i,r)=>{var a,o;ni.init(i,r),i._zod.onattach.push(g=>{const w=g._zod.bag;w.format=r.format,r.pattern&&(w.patterns??(w.patterns=new Set),w.patterns.add(r.pattern))}),r.pattern?(a=i._zod).check??(a.check=g=>{r.pattern.lastIndex=0,!r.pattern.test(g.value)&&g.issues.push({origin:"string",code:"invalid_format",format:r.format,input:g.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:i,continue:!r.abort})}):(o=i._zod).check??(o.check=()=>{})}),W1=fe("$ZodCheckRegex",(i,r)=>{gl.init(i,r),i._zod.check=a=>{r.pattern.lastIndex=0,!r.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:"regex",input:a.value,pattern:r.pattern.toString(),inst:i,continue:!r.abort})}}),Y1=fe("$ZodCheckLowerCase",(i,r)=>{r.pattern??(r.pattern=$1),gl.init(i,r)}),X1=fe("$ZodCheckUpperCase",(i,r)=>{r.pattern??(r.pattern=F1),gl.init(i,r)}),J1=fe("$ZodCheckIncludes",(i,r)=>{ni.init(i,r);const a=ml(r.includes),o=new RegExp(typeof r.position=="number"?`^.{${r.position}}${a}`:a);r.pattern=o,i._zod.onattach.push(g=>{const w=g._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(o)}),i._zod.check=g=>{g.value.includes(r.includes,r.position)||g.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:g.value,inst:i,continue:!r.abort})}}),Q1=fe("$ZodCheckStartsWith",(i,r)=>{ni.init(i,r);const a=new RegExp(`^${ml(r.prefix)}.*`);r.pattern??(r.pattern=a),i._zod.onattach.push(o=>{const g=o._zod.bag;g.patterns??(g.patterns=new Set),g.patterns.add(a)}),i._zod.check=o=>{o.value.startsWith(r.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:o.value,inst:i,continue:!r.abort})}}),ex=fe("$ZodCheckEndsWith",(i,r)=>{ni.init(i,r);const a=new RegExp(`.*${ml(r.suffix)}$`);r.pattern??(r.pattern=a),i._zod.onattach.push(o=>{const g=o._zod.bag;g.patterns??(g.patterns=new Set),g.patterns.add(a)}),i._zod.check=o=>{o.value.endsWith(r.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:o.value,inst:i,continue:!r.abort})}}),tx=fe("$ZodCheckOverwrite",(i,r)=>{ni.init(i,r),i._zod.check=a=>{a.value=r.tx(a.value)}});class ix{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}const o=r.split(`
|
|
256
|
+
`).filter(A=>A),g=Math.min(...o.map(A=>A.length-A.trimStart().length)),w=o.map(A=>A.slice(g)).map(A=>" ".repeat(this.indent*2)+A);for(const A of w)this.content.push(A)}compile(){const r=Function,a=this==null?void 0:this.args,g=[...((this==null?void 0:this.content)??[""]).map(w=>` ${w}`)];return new r(...a,g.join(`
|
|
257
|
+
`))}}const sx={major:4,minor:3,patch:6},mt=fe("$ZodType",(i,r)=>{var g;var a;i??(i={}),i._zod.def=r,i._zod.bag=i._zod.bag||{},i._zod.version=sx;const o=[...i._zod.def.checks??[]];i._zod.traits.has("$ZodCheck")&&o.unshift(i);for(const w of o)for(const A of w._zod.onattach)A(i);if(o.length===0)(a=i._zod).deferred??(a.deferred=[]),(g=i._zod.deferred)==null||g.push(()=>{i._zod.run=i._zod.parse});else{const w=(l,h,u)=>{let y=tn(l),d;for(const x of h){if(x._zod.def.when){if(!x._zod.def.when(l))continue}else if(y)continue;const E=l.issues.length,O=x._zod.check(l);if(O instanceof Promise&&(u==null?void 0:u.async)===!1)throw new rn;if(d||O instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await O,l.issues.length!==E&&(y||(y=tn(l,E)))});else{if(l.issues.length===E)continue;y||(y=tn(l,E))}}return d?d.then(()=>l):l},A=(l,h,u)=>{if(tn(l))return l.aborted=!0,l;const y=w(h,o,u);if(y instanceof Promise){if(u.async===!1)throw new rn;return y.then(d=>i._zod.parse(d,u))}return i._zod.parse(y,u)};i._zod.run=(l,h)=>{if(h.skipChecks)return i._zod.parse(l,h);if(h.direction==="backward"){const y=i._zod.parse({value:l.value,issues:[]},{...h,skipChecks:!0});return y instanceof Promise?y.then(d=>A(d,l,h)):A(y,l,h)}const u=i._zod.parse(l,h);if(u instanceof Promise){if(h.async===!1)throw new rn;return u.then(y=>w(y,o,h))}return w(u,o,h)}}Ve(i,"~standard",()=>({validate:w=>{var A;try{const l=c1(i,w);return l.success?{value:l.data}:{issues:(A=l.error)==null?void 0:A.issues}}catch{return u1(i,w).then(h=>{var u;return h.success?{value:h.data}:{issues:(u=h.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),xh=fe("$ZodString",(i,r)=>{var a;mt.init(i,r),i._zod.pattern=[...((a=i==null?void 0:i._zod.bag)==null?void 0:a.patterns)??[]].pop()??U1(i._zod.bag),i._zod.parse=(o,g)=>{if(r.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:i}),o}}),nt=fe("$ZodStringFormat",(i,r)=>{gl.init(i,r),xh.init(i,r)}),rx=fe("$ZodGUID",(i,r)=>{r.pattern??(r.pattern=T1),nt.init(i,r)}),nx=fe("$ZodUUID",(i,r)=>{if(r.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(o===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=Lp(o))}else r.pattern??(r.pattern=Lp());nt.init(i,r)}),ax=fe("$ZodEmail",(i,r)=>{r.pattern??(r.pattern=A1),nt.init(i,r)}),ox=fe("$ZodURL",(i,r)=>{nt.init(i,r),i._zod.check=a=>{try{const o=a.value.trim(),g=new URL(o);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(g.hostname)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:r.hostname.source,input:a.value,inst:i,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(g.protocol.endsWith(":")?g.protocol.slice(0,-1):g.protocol)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:a.value,inst:i,continue:!r.abort})),r.normalize?a.value=g.href:a.value=o;return}catch{a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:i,continue:!r.abort})}}}),lx=fe("$ZodEmoji",(i,r)=>{r.pattern??(r.pattern=k1()),nt.init(i,r)}),cx=fe("$ZodNanoID",(i,r)=>{r.pattern??(r.pattern=w1),nt.init(i,r)}),ux=fe("$ZodCUID",(i,r)=>{r.pattern??(r.pattern=y1),nt.init(i,r)}),hx=fe("$ZodCUID2",(i,r)=>{r.pattern??(r.pattern=S1),nt.init(i,r)}),fx=fe("$ZodULID",(i,r)=>{r.pattern??(r.pattern=b1),nt.init(i,r)}),dx=fe("$ZodXID",(i,r)=>{r.pattern??(r.pattern=x1),nt.init(i,r)}),mx=fe("$ZodKSUID",(i,r)=>{r.pattern??(r.pattern=C1),nt.init(i,r)}),px=fe("$ZodISODateTime",(i,r)=>{r.pattern??(r.pattern=H1(r)),nt.init(i,r)}),_x=fe("$ZodISODate",(i,r)=>{r.pattern??(r.pattern=B1),nt.init(i,r)}),gx=fe("$ZodISOTime",(i,r)=>{r.pattern??(r.pattern=z1(r)),nt.init(i,r)}),vx=fe("$ZodISODuration",(i,r)=>{r.pattern??(r.pattern=E1),nt.init(i,r)}),yx=fe("$ZodIPv4",(i,r)=>{r.pattern??(r.pattern=D1),nt.init(i,r),i._zod.bag.format="ipv4"}),Sx=fe("$ZodIPv6",(i,r)=>{r.pattern??(r.pattern=O1),nt.init(i,r),i._zod.bag.format="ipv6",i._zod.check=a=>{try{new URL(`http://[${a.value}]`)}catch{a.issues.push({code:"invalid_format",format:"ipv6",input:a.value,inst:i,continue:!r.abort})}}}),bx=fe("$ZodCIDRv4",(i,r)=>{r.pattern??(r.pattern=M1),nt.init(i,r)}),xx=fe("$ZodCIDRv6",(i,r)=>{r.pattern??(r.pattern=L1),nt.init(i,r),i._zod.check=a=>{const o=a.value.split("/");try{if(o.length!==2)throw new Error;const[g,w]=o;if(!w)throw new Error;const A=Number(w);if(`${A}`!==w)throw new Error;if(A<0||A>128)throw new Error;new URL(`http://[${g}]`)}catch{a.issues.push({code:"invalid_format",format:"cidrv6",input:a.value,inst:i,continue:!r.abort})}}});function hg(i){if(i==="")return!0;if(i.length%4!==0)return!1;try{return atob(i),!0}catch{return!1}}const Cx=fe("$ZodBase64",(i,r)=>{r.pattern??(r.pattern=N1),nt.init(i,r),i._zod.bag.contentEncoding="base64",i._zod.check=a=>{hg(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:i,continue:!r.abort})}});function wx(i){if(!rg.test(i))return!1;const r=i.replace(/[-_]/g,o=>o==="-"?"+":"/"),a=r.padEnd(Math.ceil(r.length/4)*4,"=");return hg(a)}const Ex=fe("$ZodBase64URL",(i,r)=>{r.pattern??(r.pattern=rg),nt.init(i,r),i._zod.bag.contentEncoding="base64url",i._zod.check=a=>{wx(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:i,continue:!r.abort})}}),Tx=fe("$ZodE164",(i,r)=>{r.pattern??(r.pattern=j1),nt.init(i,r)});function Ax(i,r=null){try{const a=i.split(".");if(a.length!==3)return!1;const[o]=a;if(!o)return!1;const g=JSON.parse(atob(o));return!("typ"in g&&(g==null?void 0:g.typ)!=="JWT"||!g.alg||r&&(!("alg"in g)||g.alg!==r))}catch{return!1}}const Rx=fe("$ZodJWT",(i,r)=>{nt.init(i,r),i._zod.check=a=>{Ax(a.value,r.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:i,continue:!r.abort})}}),fg=fe("$ZodNumber",(i,r)=>{mt.init(i,r),i._zod.pattern=i._zod.bag.pattern??og,i._zod.parse=(a,o)=>{if(r.coerce)try{a.value=Number(a.value)}catch{}const g=a.value;if(typeof g=="number"&&!Number.isNaN(g)&&Number.isFinite(g))return a;const w=typeof g=="number"?Number.isNaN(g)?"NaN":Number.isFinite(g)?void 0:"Infinity":void 0;return a.issues.push({expected:"number",code:"invalid_type",input:g,inst:i,...w?{received:w}:{}}),a}}),kx=fe("$ZodNumberFormat",(i,r)=>{q1.init(i,r),fg.init(i,r)}),Dx=fe("$ZodBoolean",(i,r)=>{mt.init(i,r),i._zod.pattern=P1,i._zod.parse=(a,o)=>{if(r.coerce)try{a.value=!!a.value}catch{}const g=a.value;return typeof g=="boolean"||a.issues.push({expected:"boolean",code:"invalid_type",input:g,inst:i}),a}}),Ox=fe("$ZodUnknown",(i,r)=>{mt.init(i,r),i._zod.parse=a=>a}),Mx=fe("$ZodNever",(i,r)=>{mt.init(i,r),i._zod.parse=(a,o)=>(a.issues.push({expected:"never",code:"invalid_type",input:a.value,inst:i}),a)});function Np(i,r,a){i.issues.length&&r.issues.push(...sn(a,i.issues)),r.value[a]=i.value}const Lx=fe("$ZodArray",(i,r)=>{mt.init(i,r),i._zod.parse=(a,o)=>{const g=a.value;if(!Array.isArray(g))return a.issues.push({expected:"array",code:"invalid_type",input:g,inst:i}),a;a.value=Array(g.length);const w=[];for(let A=0;A<g.length;A++){const l=g[A],h=r.element._zod.run({value:l,issues:[]},o);h instanceof Promise?w.push(h.then(u=>Np(u,a,A))):Np(h,a,A)}return w.length?Promise.all(w).then(()=>a):a}});function nl(i,r,a,o,g){if(i.issues.length){if(g&&!(a in o))return;r.issues.push(...sn(a,i.issues))}i.value===void 0?a in o&&(r.value[a]=void 0):r.value[a]=i.value}function dg(i){var o,g,w,A;const r=Object.keys(i.shape);for(const l of r)if(!((A=(w=(g=(o=i.shape)==null?void 0:o[l])==null?void 0:g._zod)==null?void 0:w.traits)!=null&&A.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const a=Jb(i.shape);return{...i,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(a)}}function mg(i,r,a,o,g,w){const A=[],l=g.keySet,h=g.catchall._zod,u=h.def.type,y=h.optout==="optional";for(const d in r){if(l.has(d))continue;if(u==="never"){A.push(d);continue}const x=h.run({value:r[d],issues:[]},o);x instanceof Promise?i.push(x.then(E=>nl(E,a,d,r,y))):nl(x,a,d,r,y)}return A.length&&a.issues.push({code:"unrecognized_keys",keys:A,input:r,inst:w}),i.length?Promise.all(i).then(()=>a):a}const Nx=fe("$ZodObject",(i,r)=>{mt.init(i,r);const a=Object.getOwnPropertyDescriptor(r,"shape");if(!(a!=null&&a.get)){const l=r.shape;Object.defineProperty(r,"shape",{get:()=>{const h={...l};return Object.defineProperty(r,"shape",{value:h}),h}})}const o=_h(()=>dg(r));Ve(i._zod,"propValues",()=>{const l=r.shape,h={};for(const u in l){const y=l[u]._zod;if(y.values){h[u]??(h[u]=new Set);for(const d of y.values)h[u].add(d)}}return h});const g=rl,w=r.catchall;let A;i._zod.parse=(l,h)=>{A??(A=o.value);const u=l.value;if(!g(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:i}),l;l.value={};const y=[],d=A.shape;for(const x of A.keys){const E=d[x],O=E._zod.optout==="optional",b=E._zod.run({value:u[x],issues:[]},h);b instanceof Promise?y.push(b.then(p=>nl(p,l,x,u,O))):nl(b,l,x,u,O)}return w?mg(y,u,l,h,o.value,i):y.length?Promise.all(y).then(()=>l):l}}),jx=fe("$ZodObjectJIT",(i,r)=>{Nx.init(i,r);const a=i._zod.parse,o=_h(()=>dg(r)),g=x=>{var _;const E=new ix(["shape","payload","ctx"]),O=o.value,b=S=>{const R=Mp(S);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};E.write("const input = payload.value;");const p=Object.create(null);let v=0;for(const S of O.keys)p[S]=`key_${v++}`;E.write("const newResult = {};");for(const S of O.keys){const R=p[S],k=Mp(S),M=x[S],T=((_=M==null?void 0:M._zod)==null?void 0:_.optout)==="optional";E.write(`const ${R} = ${b(S)};`),T?E.write(`
|
|
258
|
+
if (${R}.issues.length) {
|
|
259
|
+
if (${k} in input) {
|
|
260
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
261
|
+
...iss,
|
|
262
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
263
|
+
})));
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
if (${R}.value === undefined) {
|
|
268
|
+
if (${k} in input) {
|
|
269
|
+
newResult[${k}] = undefined;
|
|
270
|
+
}
|
|
271
|
+
} else {
|
|
272
|
+
newResult[${k}] = ${R}.value;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
`):E.write(`
|
|
276
|
+
if (${R}.issues.length) {
|
|
277
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
278
|
+
...iss,
|
|
279
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
280
|
+
})));
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if (${R}.value === undefined) {
|
|
284
|
+
if (${k} in input) {
|
|
285
|
+
newResult[${k}] = undefined;
|
|
286
|
+
}
|
|
287
|
+
} else {
|
|
288
|
+
newResult[${k}] = ${R}.value;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
`)}E.write("payload.value = newResult;"),E.write("return payload;");const f=E.compile();return(S,R)=>f(x,S,R)};let w;const A=rl,l=!X_.jitless,u=l&&Yb.value,y=r.catchall;let d;i._zod.parse=(x,E)=>{d??(d=o.value);const O=x.value;return A(O)?l&&u&&(E==null?void 0:E.async)===!1&&E.jitless!==!0?(w||(w=g(r.shape)),x=w(x,E),y?mg([],O,x,E,d,i):x):a(x,E):(x.issues.push({expected:"object",code:"invalid_type",input:O,inst:i}),x)}});function jp(i,r,a,o){for(const w of i)if(w.issues.length===0)return r.value=w.value,r;const g=i.filter(w=>!tn(w));return g.length===1?(r.value=g[0].value,g[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:a,errors:i.map(w=>w.issues.map(A=>Ws(A,o,Vs())))}),r)}const Bx=fe("$ZodUnion",(i,r)=>{mt.init(i,r),Ve(i._zod,"optin",()=>r.options.some(g=>g._zod.optin==="optional")?"optional":void 0),Ve(i._zod,"optout",()=>r.options.some(g=>g._zod.optout==="optional")?"optional":void 0),Ve(i._zod,"values",()=>{if(r.options.every(g=>g._zod.values))return new Set(r.options.flatMap(g=>Array.from(g._zod.values)))}),Ve(i._zod,"pattern",()=>{if(r.options.every(g=>g._zod.pattern)){const g=r.options.map(w=>w._zod.pattern);return new RegExp(`^(${g.map(w=>vh(w.source)).join("|")})$`)}});const a=r.options.length===1,o=r.options[0]._zod.run;i._zod.parse=(g,w)=>{if(a)return o(g,w);let A=!1;const l=[];for(const h of r.options){const u=h._zod.run({value:g.value,issues:[]},w);if(u instanceof Promise)l.push(u),A=!0;else{if(u.issues.length===0)return u;l.push(u)}}return A?Promise.all(l).then(h=>jp(h,g,i,w)):jp(l,g,i,w)}}),zx=fe("$ZodIntersection",(i,r)=>{mt.init(i,r),i._zod.parse=(a,o)=>{const g=a.value,w=r.left._zod.run({value:g,issues:[]},o),A=r.right._zod.run({value:g,issues:[]},o);return w instanceof Promise||A instanceof Promise?Promise.all([w,A]).then(([h,u])=>Bp(a,h,u)):Bp(a,w,A)}});function th(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(nn(i)&&nn(r)){const a=Object.keys(r),o=Object.keys(i).filter(w=>a.indexOf(w)!==-1),g={...i,...r};for(const w of o){const A=th(i[w],r[w]);if(!A.valid)return{valid:!1,mergeErrorPath:[w,...A.mergeErrorPath]};g[w]=A.data}return{valid:!0,data:g}}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 g=i[o],w=r[o],A=th(g,w);if(!A.valid)return{valid:!1,mergeErrorPath:[o,...A.mergeErrorPath]};a.push(A.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function Bp(i,r,a){const o=new Map;let g;for(const l of r.issues)if(l.code==="unrecognized_keys"){g??(g=l);for(const h of l.keys)o.has(h)||o.set(h,{}),o.get(h).l=!0}else i.issues.push(l);for(const l of a.issues)if(l.code==="unrecognized_keys")for(const h of l.keys)o.has(h)||o.set(h,{}),o.get(h).r=!0;else i.issues.push(l);const w=[...o].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(w.length&&g&&i.issues.push({...g,keys:w}),tn(i))return i;const A=th(r.value,a.value);if(!A.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(A.mergeErrorPath)}`);return i.value=A.data,i}const Hx=fe("$ZodRecord",(i,r)=>{mt.init(i,r),i._zod.parse=(a,o)=>{const g=a.value;if(!nn(g))return a.issues.push({expected:"record",code:"invalid_type",input:g,inst:i}),a;const w=[],A=r.keyType._zod.values;if(A){a.value={};const l=new Set;for(const u of A)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const y=r.valueType._zod.run({value:g[u],issues:[]},o);y instanceof Promise?w.push(y.then(d=>{d.issues.length&&a.issues.push(...sn(u,d.issues)),a.value[u]=d.value})):(y.issues.length&&a.issues.push(...sn(u,y.issues)),a.value[u]=y.value)}let h;for(const u in g)l.has(u)||(h=h??[],h.push(u));h&&h.length>0&&a.issues.push({code:"unrecognized_keys",input:g,inst:i,keys:h})}else{a.value={};for(const l of Reflect.ownKeys(g)){if(l==="__proto__")continue;let h=r.keyType._zod.run({value:l,issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&og.test(l)&&h.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&&(h=d)}if(h.issues.length){r.mode==="loose"?a.value[l]=g[l]:a.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(d=>Ws(d,o,Vs())),input:l,path:[l],inst:i});continue}const y=r.valueType._zod.run({value:g[l],issues:[]},o);y instanceof Promise?w.push(y.then(d=>{d.issues.length&&a.issues.push(...sn(l,d.issues)),a.value[h.value]=d.value})):(y.issues.length&&a.issues.push(...sn(l,y.issues)),a.value[h.value]=y.value)}}return w.length?Promise.all(w).then(()=>a):a}}),Ux=fe("$ZodEnum",(i,r)=>{mt.init(i,r);const a=J_(r.entries),o=new Set(a);i._zod.values=o,i._zod.pattern=new RegExp(`^(${a.filter(g=>Xb.has(typeof g)).map(g=>typeof g=="string"?ml(g):g.toString()).join("|")})$`),i._zod.parse=(g,w)=>{const A=g.value;return o.has(A)||g.issues.push({code:"invalid_value",values:a,input:A,inst:i}),g}}),Ix=fe("$ZodTransform",(i,r)=>{mt.init(i,r),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new Y_(i.constructor.name);const g=r.transform(a.value,a);if(o.async)return(g instanceof Promise?g:Promise.resolve(g)).then(A=>(a.value=A,a));if(g instanceof Promise)throw new rn;return a.value=g,a}});function zp(i,r){return i.issues.length&&r===void 0?{issues:[],value:void 0}:i}const pg=fe("$ZodOptional",(i,r)=>{mt.init(i,r),i._zod.optin="optional",i._zod.optout="optional",Ve(i._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),Ve(i._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${vh(a.source)})?$`):void 0}),i._zod.parse=(a,o)=>{if(r.innerType._zod.optin==="optional"){const g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(w=>zp(w,a.value)):zp(g,a.value)}return a.value===void 0?a:r.innerType._zod.run(a,o)}}),Px=fe("$ZodExactOptional",(i,r)=>{pg.init(i,r),Ve(i._zod,"values",()=>r.innerType._zod.values),Ve(i._zod,"pattern",()=>r.innerType._zod.pattern),i._zod.parse=(a,o)=>r.innerType._zod.run(a,o)}),$x=fe("$ZodNullable",(i,r)=>{mt.init(i,r),Ve(i._zod,"optin",()=>r.innerType._zod.optin),Ve(i._zod,"optout",()=>r.innerType._zod.optout),Ve(i._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${vh(a.source)}|null)$`):void 0}),Ve(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)}),Fx=fe("$ZodDefault",(i,r)=>{mt.init(i,r),i._zod.optin="optional",Ve(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 g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(w=>Hp(w,r)):Hp(g,r)}});function Hp(i,r){return i.value===void 0&&(i.value=r.defaultValue),i}const Zx=fe("$ZodPrefault",(i,r)=>{mt.init(i,r),i._zod.optin="optional",Ve(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))}),qx=fe("$ZodNonOptional",(i,r)=>{mt.init(i,r),Ve(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 g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(w=>Up(w,i)):Up(g,i)}});function Up(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 Gx=fe("$ZodCatch",(i,r)=>{mt.init(i,r),Ve(i._zod,"optin",()=>r.innerType._zod.optin),Ve(i._zod,"optout",()=>r.innerType._zod.optout),Ve(i._zod,"values",()=>r.innerType._zod.values),i._zod.parse=(a,o)=>{if(o.direction==="backward")return r.innerType._zod.run(a,o);const g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(w=>(a.value=w.value,w.issues.length&&(a.value=r.catchValue({...a,error:{issues:w.issues.map(A=>Ws(A,o,Vs()))},input:a.value}),a.issues=[]),a)):(a.value=g.value,g.issues.length&&(a.value=r.catchValue({...a,error:{issues:g.issues.map(w=>Ws(w,o,Vs()))},input:a.value}),a.issues=[]),a)}}),Kx=fe("$ZodPipe",(i,r)=>{mt.init(i,r),Ve(i._zod,"values",()=>r.in._zod.values),Ve(i._zod,"optin",()=>r.in._zod.optin),Ve(i._zod,"optout",()=>r.out._zod.optout),Ve(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(A=>Go(A,r.in,o)):Go(w,r.in,o)}const g=r.in._zod.run(a,o);return g instanceof Promise?g.then(w=>Go(w,r.out,o)):Go(g,r.out,o)}});function Go(i,r,a){return i.issues.length?(i.aborted=!0,i):r._zod.run({value:i.value,issues:i.issues},a)}const Vx=fe("$ZodReadonly",(i,r)=>{mt.init(i,r),Ve(i._zod,"propValues",()=>r.innerType._zod.propValues),Ve(i._zod,"values",()=>r.innerType._zod.values),Ve(i._zod,"optin",()=>{var a,o;return(o=(a=r.innerType)==null?void 0:a._zod)==null?void 0:o.optin}),Ve(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 g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(Ip):Ip(g)}});function Ip(i){return i.value=Object.freeze(i.value),i}const Wx=fe("$ZodCustom",(i,r)=>{ni.init(i,r),mt.init(i,r),i._zod.parse=(a,o)=>a,i._zod.check=a=>{const o=a.value,g=r.fn(o);if(g instanceof Promise)return g.then(w=>Pp(w,a,o,i));Pp(g,a,o,i)}});function Pp(i,r,a,o){if(!i){const g={code:"custom",input:a,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(g.params=o._zod.def.params),r.issues.push(Sa(g))}}var $p;class Yx{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 g={...o,...this._map.get(r)};return Object.keys(g).length?g:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function Xx(){return new Yx}($p=globalThis).__zod_globalRegistry??($p.__zod_globalRegistry=Xx());const va=globalThis.__zod_globalRegistry;function Jx(i,r){return new i({type:"string",...we(r)})}function Qx(i,r){return new i({type:"string",format:"email",check:"string_format",abort:!1,...we(r)})}function Fp(i,r){return new i({type:"string",format:"guid",check:"string_format",abort:!1,...we(r)})}function eC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,...we(r)})}function tC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...we(r)})}function iC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...we(r)})}function sC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...we(r)})}function rC(i,r){return new i({type:"string",format:"url",check:"string_format",abort:!1,...we(r)})}function nC(i,r){return new i({type:"string",format:"emoji",check:"string_format",abort:!1,...we(r)})}function aC(i,r){return new i({type:"string",format:"nanoid",check:"string_format",abort:!1,...we(r)})}function oC(i,r){return new i({type:"string",format:"cuid",check:"string_format",abort:!1,...we(r)})}function lC(i,r){return new i({type:"string",format:"cuid2",check:"string_format",abort:!1,...we(r)})}function cC(i,r){return new i({type:"string",format:"ulid",check:"string_format",abort:!1,...we(r)})}function uC(i,r){return new i({type:"string",format:"xid",check:"string_format",abort:!1,...we(r)})}function hC(i,r){return new i({type:"string",format:"ksuid",check:"string_format",abort:!1,...we(r)})}function fC(i,r){return new i({type:"string",format:"ipv4",check:"string_format",abort:!1,...we(r)})}function dC(i,r){return new i({type:"string",format:"ipv6",check:"string_format",abort:!1,...we(r)})}function mC(i,r){return new i({type:"string",format:"cidrv4",check:"string_format",abort:!1,...we(r)})}function pC(i,r){return new i({type:"string",format:"cidrv6",check:"string_format",abort:!1,...we(r)})}function _C(i,r){return new i({type:"string",format:"base64",check:"string_format",abort:!1,...we(r)})}function gC(i,r){return new i({type:"string",format:"base64url",check:"string_format",abort:!1,...we(r)})}function vC(i,r){return new i({type:"string",format:"e164",check:"string_format",abort:!1,...we(r)})}function yC(i,r){return new i({type:"string",format:"jwt",check:"string_format",abort:!1,...we(r)})}function SC(i,r){return new i({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...we(r)})}function bC(i,r){return new i({type:"string",format:"date",check:"string_format",...we(r)})}function xC(i,r){return new i({type:"string",format:"time",check:"string_format",precision:null,...we(r)})}function CC(i,r){return new i({type:"string",format:"duration",check:"string_format",...we(r)})}function wC(i,r){return new i({type:"number",checks:[],...we(r)})}function EC(i,r){return new i({type:"number",check:"number_format",abort:!1,format:"safeint",...we(r)})}function TC(i,r){return new i({type:"boolean",...we(r)})}function AC(i){return new i({type:"unknown"})}function RC(i,r){return new i({type:"never",...we(r)})}function Zp(i,r){return new cg({check:"less_than",...we(r),value:i,inclusive:!1})}function zu(i,r){return new cg({check:"less_than",...we(r),value:i,inclusive:!0})}function qp(i,r){return new ug({check:"greater_than",...we(r),value:i,inclusive:!1})}function Hu(i,r){return new ug({check:"greater_than",...we(r),value:i,inclusive:!0})}function Gp(i,r){return new Z1({check:"multiple_of",...we(r),value:i})}function _g(i,r){return new G1({check:"max_length",...we(r),maximum:i})}function al(i,r){return new K1({check:"min_length",...we(r),minimum:i})}function gg(i,r){return new V1({check:"length_equals",...we(r),length:i})}function kC(i,r){return new W1({check:"string_format",format:"regex",...we(r),pattern:i})}function DC(i){return new Y1({check:"string_format",format:"lowercase",...we(i)})}function OC(i){return new X1({check:"string_format",format:"uppercase",...we(i)})}function MC(i,r){return new J1({check:"string_format",format:"includes",...we(r),includes:i})}function LC(i,r){return new Q1({check:"string_format",format:"starts_with",...we(r),prefix:i})}function NC(i,r){return new ex({check:"string_format",format:"ends_with",...we(r),suffix:i})}function cn(i){return new tx({check:"overwrite",tx:i})}function jC(i){return cn(r=>r.normalize(i))}function BC(){return cn(i=>i.trim())}function zC(){return cn(i=>i.toLowerCase())}function HC(){return cn(i=>i.toUpperCase())}function UC(){return cn(i=>Wb(i))}function IC(i,r,a){return new i({type:"array",element:r,...we(a)})}function PC(i,r,a){return new i({type:"custom",check:"custom",fn:r,...we(a)})}function $C(i){const r=FC(a=>(a.addIssue=o=>{if(typeof o=="string")a.issues.push(Sa(o,a.value,r._zod.def));else{const g=o;g.fatal&&(g.continue=!1),g.code??(g.code="custom"),g.input??(g.input=a.value),g.inst??(g.inst=r),g.continue??(g.continue=!r._zod.def.abort),a.issues.push(Sa(g))}},i(a.value,a)));return r}function FC(i,r){const a=new ni({check:"custom",...we(r)});return a._zod.check=i,a}function vg(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)??va,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 Tt(i,r,a={path:[],schemaPath:[]}){var y,d;var o;const g=i._zod.def,w=r.seen.get(i);if(w)return w.count++,a.schemaPath.includes(i)&&(w.cycle=a.path),w.schema;const A={schema:{},count:1,cycle:void 0,path:a.path};r.seen.set(i,A);const l=(d=(y=i._zod).toJSONSchema)==null?void 0:d.call(y);if(l)A.schema=l;else{const x={...a,schemaPath:[...a.schemaPath,i],path:a.path};if(i._zod.processJSONSchema)i._zod.processJSONSchema(r,A.schema,x);else{const O=A.schema,b=r.processors[g.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${g.type}`);b(i,r,O,x)}const E=i._zod.parent;E&&(A.ref||(A.ref=E),Tt(E,r,x),r.seen.get(E).isParent=!0)}const h=r.metadataRegistry.get(i);return h&&Object.assign(A.schema,h),r.io==="input"&&Kt(i)&&(delete A.schema.examples,delete A.schema.default),r.io==="input"&&A.schema._prefault&&((o=A.schema).default??(o.default=A.schema._prefault)),delete A.schema._prefault,r.seen.get(i).schema}function yg(i,r){var A,l,h,u;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=(A=i.metadataRegistry.get(y[0]))==null?void 0:A.id;if(d){const x=o.get(d);if(x&&x!==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 g=y=>{var b;const d=i.target==="draft-2020-12"?"$defs":"definitions";if(i.external){const p=(b=i.external.registry.get(y[0]))==null?void 0:b.id,v=i.external.uri??(_=>_);if(p)return{ref:v(p)};const f=y[1].defId??y[1].schema.id??`schema${i.counter++}`;return y[1].defId=f,{defId:f,ref:`${v("__shared")}#/${d}/${f}`}}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:x,defId:E}=g(y);d.def={...d.schema},E&&(d.defId=E);const O=d.schema;for(const b in O)delete O[b];O.$ref=x};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>
|
|
292
|
+
|
|
293
|
+
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=(h=i.external.registry.get(y[0]))==null?void 0:h.id;if(r!==y[0]&&E){w(y);continue}}if((u=i.metadataRegistry.get(y[0]))==null?void 0:u.id){w(y);continue}if(d.cycle){w(y);continue}if(d.count>1&&i.reused==="ref"){w(y);continue}}}function Sg(i,r){var A,l,h;const a=i.seen.get(r);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=u=>{const y=i.seen.get(u);if(y.ref===null)return;const d=y.def??y.schema,x={...d},E=y.ref;if(y.ref=null,E){o(E);const b=i.seen.get(E),p=b.schema;if(p.$ref&&(i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(p)):Object.assign(d,p),Object.assign(d,x),u._zod.parent===E)for(const f in d)f==="$ref"||f==="allOf"||f in x||delete d[f];if(p.$ref&&b.def)for(const f in d)f==="$ref"||f==="allOf"||f in b.def&&JSON.stringify(d[f])===JSON.stringify(b.def[f])&&delete d[f]}const O=u._zod.parent;if(O&&O!==E){o(O);const b=i.seen.get(O);if(b!=null&&b.schema.$ref&&(d.$ref=b.schema.$ref,b.def))for(const p in d)p==="$ref"||p==="allOf"||p in b.def&&JSON.stringify(d[p])===JSON.stringify(b.def[p])&&delete d[p]}i.override({zodSchema:u,jsonSchema:d,path:y.path??[]})};for(const u of[...i.seen.entries()].reverse())o(u[0]);const g={};if(i.target==="draft-2020-12"?g.$schema="https://json-schema.org/draft/2020-12/schema":i.target==="draft-07"?g.$schema="http://json-schema.org/draft-07/schema#":i.target==="draft-04"?g.$schema="http://json-schema.org/draft-04/schema#":i.target,(A=i.external)!=null&&A.uri){const u=(l=i.external.registry.get(r))==null?void 0:l.id;if(!u)throw new Error("Schema is missing an `id` property");g.$id=i.external.uri(u)}Object.assign(g,a.def??a.schema);const w=((h=i.external)==null?void 0:h.defs)??{};for(const u of i.seen.entries()){const y=u[1];y.def&&y.defId&&(w[y.defId]=y.def)}i.external||Object.keys(w).length>0&&(i.target==="draft-2020-12"?g.$defs=w:g.definitions=w);try{const u=JSON.parse(JSON.stringify(g));return Object.defineProperty(u,"~standard",{value:{...r["~standard"],jsonSchema:{input:ol(r,"input",i.processors),output:ol(r,"output",i.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function Kt(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 Kt(o.element,a);if(o.type==="set")return Kt(o.valueType,a);if(o.type==="lazy")return Kt(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 Kt(o.innerType,a);if(o.type==="intersection")return Kt(o.left,a)||Kt(o.right,a);if(o.type==="record"||o.type==="map")return Kt(o.keyType,a)||Kt(o.valueType,a);if(o.type==="pipe")return Kt(o.in,a)||Kt(o.out,a);if(o.type==="object"){for(const g in o.shape)if(Kt(o.shape[g],a))return!0;return!1}if(o.type==="union"){for(const g of o.options)if(Kt(g,a))return!0;return!1}if(o.type==="tuple"){for(const g of o.items)if(Kt(g,a))return!0;return!!(o.rest&&Kt(o.rest,a))}return!1}const ZC=(i,r={})=>a=>{const o=vg({...a,processors:r});return Tt(i,o),yg(o,i),Sg(o,i)},ol=(i,r,a={})=>o=>{const{libraryOptions:g,target:w}=o??{},A=vg({...g??{},target:w,io:r,processors:a});return Tt(i,A),yg(A,i),Sg(A,i)},qC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},GC=(i,r,a,o)=>{const g=a;g.type="string";const{minimum:w,maximum:A,format:l,patterns:h,contentEncoding:u}=i._zod.bag;if(typeof w=="number"&&(g.minLength=w),typeof A=="number"&&(g.maxLength=A),l&&(g.format=qC[l]??l,g.format===""&&delete g.format,l==="time"&&delete g.format),u&&(g.contentEncoding=u),h&&h.size>0){const y=[...h];y.length===1?g.pattern=y[0].source:y.length>1&&(g.allOf=[...y.map(d=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},KC=(i,r,a,o)=>{const g=a,{minimum:w,maximum:A,format:l,multipleOf:h,exclusiveMaximum:u,exclusiveMinimum:y}=i._zod.bag;typeof l=="string"&&l.includes("int")?g.type="integer":g.type="number",typeof y=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(g.minimum=y,g.exclusiveMinimum=!0):g.exclusiveMinimum=y),typeof w=="number"&&(g.minimum=w,typeof y=="number"&&r.target!=="draft-04"&&(y>=w?delete g.minimum:delete g.exclusiveMinimum)),typeof u=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(g.maximum=u,g.exclusiveMaximum=!0):g.exclusiveMaximum=u),typeof A=="number"&&(g.maximum=A,typeof u=="number"&&r.target!=="draft-04"&&(u<=A?delete g.maximum:delete g.exclusiveMaximum)),typeof h=="number"&&(g.multipleOf=h)},VC=(i,r,a,o)=>{a.type="boolean"},WC=(i,r,a,o)=>{a.not={}},YC=(i,r,a,o)=>{},XC=(i,r,a,o)=>{const g=i._zod.def,w=J_(g.entries);w.every(A=>typeof A=="number")&&(a.type="number"),w.every(A=>typeof A=="string")&&(a.type="string"),a.enum=w},JC=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},QC=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ew=(i,r,a,o)=>{const g=a,w=i._zod.def,{minimum:A,maximum:l}=i._zod.bag;typeof A=="number"&&(g.minItems=A),typeof l=="number"&&(g.maxItems=l),g.type="array",g.items=Tt(w.element,r,{...o,path:[...o.path,"items"]})},tw=(i,r,a,o)=>{var u;const g=a,w=i._zod.def;g.type="object",g.properties={};const A=w.shape;for(const y in A)g.properties[y]=Tt(A[y],r,{...o,path:[...o.path,"properties",y]});const l=new Set(Object.keys(A)),h=new Set([...l].filter(y=>{const d=w.shape[y]._zod;return r.io==="input"?d.optin===void 0:d.optout===void 0}));h.size>0&&(g.required=Array.from(h)),((u=w.catchall)==null?void 0:u._zod.def.type)==="never"?g.additionalProperties=!1:w.catchall?w.catchall&&(g.additionalProperties=Tt(w.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(g.additionalProperties=!1)},iw=(i,r,a,o)=>{const g=i._zod.def,w=g.inclusive===!1,A=g.options.map((l,h)=>Tt(l,r,{...o,path:[...o.path,w?"oneOf":"anyOf",h]}));w?a.oneOf=A:a.anyOf=A},sw=(i,r,a,o)=>{const g=i._zod.def,w=Tt(g.left,r,{...o,path:[...o.path,"allOf",0]}),A=Tt(g.right,r,{...o,path:[...o.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,h=[...l(w)?w.allOf:[w],...l(A)?A.allOf:[A]];a.allOf=h},rw=(i,r,a,o)=>{const g=a,w=i._zod.def;g.type="object";const A=w.keyType,l=A._zod.bag,h=l==null?void 0:l.patterns;if(w.mode==="loose"&&h&&h.size>0){const y=Tt(w.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});g.patternProperties={};for(const d of h)g.patternProperties[d.source]=y}else(r.target==="draft-07"||r.target==="draft-2020-12")&&(g.propertyNames=Tt(w.keyType,r,{...o,path:[...o.path,"propertyNames"]})),g.additionalProperties=Tt(w.valueType,r,{...o,path:[...o.path,"additionalProperties"]});const u=A._zod.values;if(u){const y=[...u].filter(d=>typeof d=="string"||typeof d=="number");y.length>0&&(g.required=y)}},nw=(i,r,a,o)=>{const g=i._zod.def,w=Tt(g.innerType,r,o),A=r.seen.get(i);r.target==="openapi-3.0"?(A.ref=g.innerType,a.nullable=!0):a.anyOf=[w,{type:"null"}]},aw=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const w=r.seen.get(i);w.ref=g.innerType},ow=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const w=r.seen.get(i);w.ref=g.innerType,a.default=JSON.parse(JSON.stringify(g.defaultValue))},lw=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const w=r.seen.get(i);w.ref=g.innerType,r.io==="input"&&(a._prefault=JSON.parse(JSON.stringify(g.defaultValue)))},cw=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const w=r.seen.get(i);w.ref=g.innerType;let A;try{A=g.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}a.default=A},uw=(i,r,a,o)=>{const g=i._zod.def,w=r.io==="input"?g.in._zod.def.type==="transform"?g.out:g.in:g.out;Tt(w,r,o);const A=r.seen.get(i);A.ref=w},hw=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const w=r.seen.get(i);w.ref=g.innerType,a.readOnly=!0},bg=(i,r,a,o)=>{const g=i._zod.def;Tt(g.innerType,r,o);const w=r.seen.get(i);w.ref=g.innerType},fw=fe("ZodISODateTime",(i,r)=>{px.init(i,r),ct.init(i,r)});function dw(i){return SC(fw,i)}const mw=fe("ZodISODate",(i,r)=>{_x.init(i,r),ct.init(i,r)});function pw(i){return bC(mw,i)}const _w=fe("ZodISOTime",(i,r)=>{gx.init(i,r),ct.init(i,r)});function gw(i){return xC(_w,i)}const vw=fe("ZodISODuration",(i,r)=>{vx.init(i,r),ct.init(i,r)});function yw(i){return CC(vw,i)}const Sw=(i,r)=>{ig.init(i,r),i.name="ZodError",Object.defineProperties(i,{format:{value:a=>l1(i,a)},flatten:{value:a=>o1(i,a)},addIssue:{value:a=>{i.issues.push(a),i.message=JSON.stringify(i.issues,eh,2)}},addIssues:{value:a=>{i.issues.push(...a),i.message=JSON.stringify(i.issues,eh,2)}},isEmpty:{get(){return i.issues.length===0}}})},Mi=fe("ZodError",Sw,{Parent:Error}),bw=Sh(Mi),xw=bh(Mi),Cw=pl(Mi),ww=_l(Mi),Ew=h1(Mi),Tw=f1(Mi),Aw=d1(Mi),Rw=m1(Mi),kw=p1(Mi),Dw=_1(Mi),Ow=g1(Mi),Mw=v1(Mi),pt=fe("ZodType",(i,r)=>(mt.init(i,r),Object.assign(i["~standard"],{jsonSchema:{input:ol(i,"input"),output:ol(i,"output")}}),i.toJSONSchema=ZC(i,{}),i.def=r,i.type=r.type,Object.defineProperty(i,"_def",{value:r}),i.check=(...a)=>i.clone(Xs(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)=>Js(i,a,o),i.brand=()=>i,i.register=((a,o)=>(a.add(i,o),i)),i.parse=(a,o)=>bw(i,a,o,{callee:i.parse}),i.safeParse=(a,o)=>Cw(i,a,o),i.parseAsync=async(a,o)=>xw(i,a,o,{callee:i.parseAsync}),i.safeParseAsync=async(a,o)=>ww(i,a,o),i.spa=i.safeParseAsync,i.encode=(a,o)=>Ew(i,a,o),i.decode=(a,o)=>Tw(i,a,o),i.encodeAsync=async(a,o)=>Aw(i,a,o),i.decodeAsync=async(a,o)=>Rw(i,a,o),i.safeEncode=(a,o)=>kw(i,a,o),i.safeDecode=(a,o)=>Dw(i,a,o),i.safeEncodeAsync=async(a,o)=>Ow(i,a,o),i.safeDecodeAsync=async(a,o)=>Mw(i,a,o),i.refine=(a,o)=>i.check(E2(a,o)),i.superRefine=a=>i.check(T2(a)),i.overwrite=a=>i.check(cn(a)),i.optional=()=>Wp(i),i.exactOptional=()=>f2(i),i.nullable=()=>Yp(i),i.nullish=()=>Wp(Yp(i)),i.nonoptional=a=>v2(i,a),i.array=()=>Ea(i),i.or=a=>n2([i,a]),i.and=a=>o2(i,a),i.transform=a=>Xp(i,u2(a)),i.default=a=>p2(i,a),i.prefault=a=>g2(i,a),i.catch=a=>S2(i,a),i.pipe=a=>Xp(i,a),i.readonly=()=>C2(i),i.describe=a=>{const o=i.clone();return va.add(o,{description:a}),o},Object.defineProperty(i,"description",{get(){var a;return(a=va.get(i))==null?void 0:a.description},configurable:!0}),i.meta=(...a)=>{if(a.length===0)return va.get(i);const o=i.clone();return va.add(o,a[0]),o},i.isOptional=()=>i.safeParse(void 0).success,i.isNullable=()=>i.safeParse(null).success,i.apply=a=>a(i),i)),xg=fe("_ZodString",(i,r)=>{xh.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(o,g,w)=>GC(i,o,g);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(kC(...o)),i.includes=(...o)=>i.check(MC(...o)),i.startsWith=(...o)=>i.check(LC(...o)),i.endsWith=(...o)=>i.check(NC(...o)),i.min=(...o)=>i.check(al(...o)),i.max=(...o)=>i.check(_g(...o)),i.length=(...o)=>i.check(gg(...o)),i.nonempty=(...o)=>i.check(al(1,...o)),i.lowercase=o=>i.check(DC(o)),i.uppercase=o=>i.check(OC(o)),i.trim=()=>i.check(BC()),i.normalize=(...o)=>i.check(jC(...o)),i.toLowerCase=()=>i.check(zC()),i.toUpperCase=()=>i.check(HC()),i.slugify=()=>i.check(UC())}),Lw=fe("ZodString",(i,r)=>{xh.init(i,r),xg.init(i,r),i.email=a=>i.check(Qx(Nw,a)),i.url=a=>i.check(rC(jw,a)),i.jwt=a=>i.check(yC(Yw,a)),i.emoji=a=>i.check(nC(Bw,a)),i.guid=a=>i.check(Fp(Kp,a)),i.uuid=a=>i.check(eC(Ko,a)),i.uuidv4=a=>i.check(tC(Ko,a)),i.uuidv6=a=>i.check(iC(Ko,a)),i.uuidv7=a=>i.check(sC(Ko,a)),i.nanoid=a=>i.check(aC(zw,a)),i.guid=a=>i.check(Fp(Kp,a)),i.cuid=a=>i.check(oC(Hw,a)),i.cuid2=a=>i.check(lC(Uw,a)),i.ulid=a=>i.check(cC(Iw,a)),i.base64=a=>i.check(_C(Kw,a)),i.base64url=a=>i.check(gC(Vw,a)),i.xid=a=>i.check(uC(Pw,a)),i.ksuid=a=>i.check(hC($w,a)),i.ipv4=a=>i.check(fC(Fw,a)),i.ipv6=a=>i.check(dC(Zw,a)),i.cidrv4=a=>i.check(mC(qw,a)),i.cidrv6=a=>i.check(pC(Gw,a)),i.e164=a=>i.check(vC(Ww,a)),i.datetime=a=>i.check(dw(a)),i.date=a=>i.check(pw(a)),i.time=a=>i.check(gw(a)),i.duration=a=>i.check(yw(a))});function Ne(i){return Jx(Lw,i)}const ct=fe("ZodStringFormat",(i,r)=>{nt.init(i,r),xg.init(i,r)}),Nw=fe("ZodEmail",(i,r)=>{ax.init(i,r),ct.init(i,r)}),Kp=fe("ZodGUID",(i,r)=>{rx.init(i,r),ct.init(i,r)}),Ko=fe("ZodUUID",(i,r)=>{nx.init(i,r),ct.init(i,r)}),jw=fe("ZodURL",(i,r)=>{ox.init(i,r),ct.init(i,r)}),Bw=fe("ZodEmoji",(i,r)=>{lx.init(i,r),ct.init(i,r)}),zw=fe("ZodNanoID",(i,r)=>{cx.init(i,r),ct.init(i,r)}),Hw=fe("ZodCUID",(i,r)=>{ux.init(i,r),ct.init(i,r)}),Uw=fe("ZodCUID2",(i,r)=>{hx.init(i,r),ct.init(i,r)}),Iw=fe("ZodULID",(i,r)=>{fx.init(i,r),ct.init(i,r)}),Pw=fe("ZodXID",(i,r)=>{dx.init(i,r),ct.init(i,r)}),$w=fe("ZodKSUID",(i,r)=>{mx.init(i,r),ct.init(i,r)}),Fw=fe("ZodIPv4",(i,r)=>{yx.init(i,r),ct.init(i,r)}),Zw=fe("ZodIPv6",(i,r)=>{Sx.init(i,r),ct.init(i,r)}),qw=fe("ZodCIDRv4",(i,r)=>{bx.init(i,r),ct.init(i,r)}),Gw=fe("ZodCIDRv6",(i,r)=>{xx.init(i,r),ct.init(i,r)}),Kw=fe("ZodBase64",(i,r)=>{Cx.init(i,r),ct.init(i,r)}),Vw=fe("ZodBase64URL",(i,r)=>{Ex.init(i,r),ct.init(i,r)}),Ww=fe("ZodE164",(i,r)=>{Tx.init(i,r),ct.init(i,r)}),Yw=fe("ZodJWT",(i,r)=>{Rx.init(i,r),ct.init(i,r)}),Cg=fe("ZodNumber",(i,r)=>{fg.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(o,g,w)=>KC(i,o,g),i.gt=(o,g)=>i.check(qp(o,g)),i.gte=(o,g)=>i.check(Hu(o,g)),i.min=(o,g)=>i.check(Hu(o,g)),i.lt=(o,g)=>i.check(Zp(o,g)),i.lte=(o,g)=>i.check(zu(o,g)),i.max=(o,g)=>i.check(zu(o,g)),i.int=o=>i.check(Vp(o)),i.safe=o=>i.check(Vp(o)),i.positive=o=>i.check(qp(0,o)),i.nonnegative=o=>i.check(Hu(0,o)),i.negative=o=>i.check(Zp(0,o)),i.nonpositive=o=>i.check(zu(0,o)),i.multipleOf=(o,g)=>i.check(Gp(o,g)),i.step=(o,g)=>i.check(Gp(o,g)),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 De(i){return wC(Cg,i)}const Xw=fe("ZodNumberFormat",(i,r)=>{kx.init(i,r),Cg.init(i,r)});function Vp(i){return EC(Xw,i)}const Jw=fe("ZodBoolean",(i,r)=>{Dx.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>VC(i,a,o)});function ys(i){return TC(Jw,i)}const Qw=fe("ZodUnknown",(i,r)=>{Ox.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>YC()});function ll(){return AC(Qw)}const e2=fe("ZodNever",(i,r)=>{Mx.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>WC(i,a,o)});function t2(i){return RC(e2,i)}const i2=fe("ZodArray",(i,r)=>{Lx.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>ew(i,a,o,g),i.element=r.element,i.min=(a,o)=>i.check(al(a,o)),i.nonempty=a=>i.check(al(1,a)),i.max=(a,o)=>i.check(_g(a,o)),i.length=(a,o)=>i.check(gg(a,o)),i.unwrap=()=>i.element});function Ea(i,r){return IC(i2,i,r)}const s2=fe("ZodObject",(i,r)=>{jx.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>tw(i,a,o,g),Ve(i,"shape",()=>r.shape),i.keyof=()=>an(Object.keys(i._zod.def.shape)),i.catchall=a=>i.clone({...i._zod.def,catchall:a}),i.passthrough=()=>i.clone({...i._zod.def,catchall:ll()}),i.loose=()=>i.clone({...i._zod.def,catchall:ll()}),i.strict=()=>i.clone({...i._zod.def,catchall:t2()}),i.strip=()=>i.clone({...i._zod.def,catchall:void 0}),i.extend=a=>i1(i,a),i.safeExtend=a=>s1(i,a),i.merge=a=>r1(i,a),i.pick=a=>e1(i,a),i.omit=a=>t1(i,a),i.partial=(...a)=>n1(wg,i,a[0]),i.required=(...a)=>a1(Eg,i,a[0])});function At(i,r){const a={type:"object",shape:i??{},...we(r)};return new s2(a)}const r2=fe("ZodUnion",(i,r)=>{Bx.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>iw(i,a,o,g),i.options=r.options});function n2(i,r){return new r2({type:"union",options:i,...we(r)})}const a2=fe("ZodIntersection",(i,r)=>{zx.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>sw(i,a,o,g)});function o2(i,r){return new a2({type:"intersection",left:i,right:r})}const l2=fe("ZodRecord",(i,r)=>{Hx.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>rw(i,a,o,g),i.keyType=r.keyType,i.valueType=r.valueType});function vl(i,r,a){return new l2({type:"record",keyType:i,valueType:r,...we(a)})}const ih=fe("ZodEnum",(i,r)=>{Ux.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(o,g,w)=>XC(i,o,g),i.enum=r.entries,i.options=Object.values(r.entries);const a=new Set(Object.keys(r.entries));i.extract=(o,g)=>{const w={};for(const A of o)if(a.has(A))w[A]=r.entries[A];else throw new Error(`Key ${A} not found in enum`);return new ih({...r,checks:[],...we(g),entries:w})},i.exclude=(o,g)=>{const w={...r.entries};for(const A of o)if(a.has(A))delete w[A];else throw new Error(`Key ${A} not found in enum`);return new ih({...r,checks:[],...we(g),entries:w})}});function an(i,r){const a=Array.isArray(i)?Object.fromEntries(i.map(o=>[o,o])):i;return new ih({type:"enum",entries:a,...we(r)})}const c2=fe("ZodTransform",(i,r)=>{Ix.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>QC(i,a),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new Y_(i.constructor.name);a.addIssue=w=>{if(typeof w=="string")a.issues.push(Sa(w,a.value,r));else{const A=w;A.fatal&&(A.continue=!1),A.code??(A.code="custom"),A.input??(A.input=a.value),A.inst??(A.inst=i),a.issues.push(Sa(A))}};const g=r.transform(a.value,a);return g instanceof Promise?g.then(w=>(a.value=w,a)):(a.value=g,a)}});function u2(i){return new c2({type:"transform",transform:i})}const wg=fe("ZodOptional",(i,r)=>{pg.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>bg(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Wp(i){return new wg({type:"optional",innerType:i})}const h2=fe("ZodExactOptional",(i,r)=>{Px.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>bg(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function f2(i){return new h2({type:"optional",innerType:i})}const d2=fe("ZodNullable",(i,r)=>{$x.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>nw(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Yp(i){return new d2({type:"nullable",innerType:i})}const m2=fe("ZodDefault",(i,r)=>{Fx.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>ow(i,a,o,g),i.unwrap=()=>i._zod.def.innerType,i.removeDefault=i.unwrap});function p2(i,r){return new m2({type:"default",innerType:i,get defaultValue(){return typeof r=="function"?r():eg(r)}})}const _2=fe("ZodPrefault",(i,r)=>{Zx.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>lw(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function g2(i,r){return new _2({type:"prefault",innerType:i,get defaultValue(){return typeof r=="function"?r():eg(r)}})}const Eg=fe("ZodNonOptional",(i,r)=>{qx.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>aw(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function v2(i,r){return new Eg({type:"nonoptional",innerType:i,...we(r)})}const y2=fe("ZodCatch",(i,r)=>{Gx.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>cw(i,a,o,g),i.unwrap=()=>i._zod.def.innerType,i.removeCatch=i.unwrap});function S2(i,r){return new y2({type:"catch",innerType:i,catchValue:typeof r=="function"?r:()=>r})}const b2=fe("ZodPipe",(i,r)=>{Kx.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>uw(i,a,o,g),i.in=r.in,i.out=r.out});function Xp(i,r){return new b2({type:"pipe",in:i,out:r})}const x2=fe("ZodReadonly",(i,r)=>{Vx.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>hw(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function C2(i){return new x2({type:"readonly",innerType:i})}const w2=fe("ZodCustom",(i,r)=>{Wx.init(i,r),pt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>JC(i,a)});function E2(i,r={}){return PC(w2,i,r)}function T2(i){return $C(i)}const Ch=an(["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"]),wh=At({ok:ys()}),A2=At({id:Ne(),name:Ne(),createdAt:De(),lastUsedAt:De(),rateLimit:De()}),R2=At({id:Ne(),name:Ne(),key:Ne()}),k2=wh.extend({delivered:ys(),attempts:De()}),D2=At({status:Ne(),version:Ne(),uptime:De(),sessions:At({active:De(),total:De()}),timestamp:Ne()}),Eh=At({id:Ne(),windowId:Ne(),windowName:Ne(),workDir:Ne(),claudeSessionId:Ne().optional(),jsonlPath:Ne().optional(),byteOffset:De(),monitorOffset:De(),status:Ch,createdAt:De(),lastActivity:De(),stallThresholdMs:De(),permissionMode:Ne(),autoApprove:ys().optional(),settingsPatched:ys().optional(),promptDelivery:At({delivered:ys(),attempts:De()}).optional(),actionHints:vl(Ne(),At({method:Ne(),url:Ne(),description:Ne()})).optional()}),O2=At({sessions:Ea(Eh),pagination:At({page:De(),limit:De(),total:De(),totalPages:De()})}),M2=At({alive:ys(),windowExists:ys(),claudeRunning:ys(),paneCommand:Ne().nullable(),status:Ch,hasTranscript:ys(),lastActivity:De(),lastActivityAgo:De(),sessionAge:De(),details:Ne(),actionHints:vl(Ne(),At({method:Ne(),url:Ne(),description:Ne()})).optional()}),L2=At({durationSec:De(),messages:De(),toolCalls:De(),approvals:De(),autoApprovals:De(),statusChanges:Ea(Ne())}),N2=At({role:an(["user","assistant","system"]),contentType:an(["text","thinking","tool_use","tool_result","permission_request"]),text:Ne(),toolName:Ne().optional(),toolUseId:Ne().optional(),timestamp:Ne().optional()}),j2=At({messages:Ea(N2),status:Ch,statusText:Ne().nullable(),interactiveContent:Ne().nullable()}),B2=At({uptime:De(),sessions:At({total_created:De(),currently_active:De(),completed:De(),failed:De(),avg_duration_sec:De(),avg_messages_per_session:De()}),auto_approvals:De(),webhooks_sent:De(),webhooks_failed:De(),screenshots_taken:De(),pipelines_created:De(),batches_created:De(),prompt_delivery:At({sent:De(),delivered:De(),failed:De(),success_rate:De().nullable()})}),z2=an(["status","message","approval","ended","heartbeat","stall","dead","system","hook","subagent_start","subagent_stop"]),H2=At({event:z2,sessionId:Ne(),timestamp:Ne(),data:vl(Ne(),ll()).optional()}),U2=an(["session_status_change","session_message","session_approval","session_ended","session_created","session_stall","session_dead","session_subagent_start","session_subagent_stop"]),I2=At({event:U2,sessionId:Ne(),timestamp:Ne(),data:vl(Ne(),ll())}),P2=3e4,$2=300*1e3;class cl{constructor(r,a,o={}){Et(this,"eventSource",null);Et(this,"consecutiveFailures",0);Et(this,"failStartTime",null);Et(this,"destroyed",!1);Et(this,"gaveUp",!1);Et(this,"reconnectTimer",null);Et(this,"url");Et(this,"callbacks");Et(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,g,w,A,l,h;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>=$2){this.gaveUp||(this.gaveUp=!0,(g=(o=this.callbacks).onGiveUp)==null||g.call(o),(A=(w=this.callbacks).onClose)==null||A.call(w));return}this.consecutiveFailures++;const r=Math.min(P2,1e3*Math.pow(2,this.consecutiveFailures-1));(h=(l=this.callbacks).onReconnecting)==null||h.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 F2="",Jp=["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"];function Z2(i){if(!i)return{};if(i instanceof Headers){const r={};return i.forEach((a,o)=>{r[o]=a}),r}return i}function q2(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(g=>g.message).join(", ")}`)}function G2(i){return!(i.name==="AbortError"||!i.message||i.message.includes("HTTP "))}async function et(i,r={}){const a=localStorage.getItem("aegis_token"),o={"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{},...Z2(r.headers)},{retries:g=0,schema:w,schemaContext:A,...l}=r;let h=null;for(let u=0;u<=g;u++)try{const y=await fetch(`${F2}${i}`,{...l,headers:o});if(!y.ok){const x=await y.json().catch(()=>({error:y.statusText})),E=new Error(x.error??`HTTP ${y.status}`);throw E.statusCode=y.status,E}const d=await y.json();return w?q2(d,w,A??i):d}catch(y){if(h=y,u<g&&G2(h))await new Promise(d=>setTimeout(d,1e3*Math.pow(2,u)));else throw h}throw h}function K2(){return et("/v1/health",{schema:D2,schemaContext:"getHealth"})}function V2(){return et("/v1/metrics",{schema:B2,schemaContext:"getMetrics"})}function sh(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 et(o,{schema:O2,schemaContext:"getSessions"})}async function W2(){const i={all:0},[r,...a]=await Promise.all([sh({page:1,limit:1}),...Jp.map(o=>sh({page:1,limit:1,status:o}))]);return i.all=r.pagination.total,Jp.forEach((o,g)=>{var w;i[o]=((w=a[g])==null?void 0:w.pagination.total)??0}),i}function Y2(i){return et(`/v1/sessions/${encodeURIComponent(i)}`,{schema:Eh,schemaContext:"getSession"})}function X2(i){const{signal:r,...a}=i;return et("/v1/sessions",{method:"POST",body:JSON.stringify(a),signal:r,schema:Eh,schemaContext:"createSession"})}function rh(i){return et(`/v1/sessions/${encodeURIComponent(i)}`,{method:"DELETE",schema:wh,schemaContext:"killSession"})}function J2(i){return et(`/v1/sessions/${encodeURIComponent(i)}/health`,{schema:M2,schemaContext:"getSessionHealth"})}function Q2(){return et("/v1/sessions/health")}function eE(i){return et(`/v1/sessions/${encodeURIComponent(i)}/read`,{schema:j2,schemaContext:"getSessionMessages"})}function tE(i){return et(`/v1/sessions/${encodeURIComponent(i)}/metrics`,{schema:L2,schemaContext:"getSessionMetrics"})}function iE(i){return et(`/v1/sessions/${encodeURIComponent(i)}/pane`)}function sE(i,r){return et(`/v1/sessions/${encodeURIComponent(i)}/send`,{method:"POST",body:JSON.stringify({text:r}),schema:k2,schemaContext:"sendMessage"})}function Tg(i){return et(`/v1/sessions/${encodeURIComponent(i)}/approve`,{method:"POST"})}function rE(i){return et(`/v1/sessions/${encodeURIComponent(i)}/reject`,{method:"POST"})}function nh(i){return et(`/v1/sessions/${encodeURIComponent(i)}/interrupt`,{method:"POST"})}function nE(i){return et(`/v1/sessions/${encodeURIComponent(i)}/escape`,{method:"POST"})}const Qp=3,aE=1e3;async function Ag(i,r){for(let a=0;a<Qp;a++){if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");try{return await pE(r)}catch{if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");if(a<Qp-1){const o=aE*Math.pow(2,a);await new Promise(g=>{const w=setTimeout(g,o);r==null||r.addEventListener("abort",()=>{clearTimeout(w),g(void 0)},{once:!0})})}}}throw i==null||i(),new Error("Real-time updates unavailable")}function Rg(i,r,a,o){const g=`/v1/sessions/${encodeURIComponent(i)}/events`;let w=null,A=!1;const l=new AbortController;return a?Ag(o==null?void 0:o.onGiveUp,l.signal).then(h=>{if(A)return;const u=`${g}?token=${encodeURIComponent(h.token)}`;w=new cl(u,r,o)}).catch(()=>{}):w=new cl(g,r,o),()=>{A=!0,l.abort(),w==null||w.close()}}function oE(i,r,a){const o="/v1/events";let g=null,w=!1;const A=new AbortController,l=h=>{try{const u=I2.safeParse(JSON.parse(h.data));if(!u.success){console.warn("Global SSE event failed validation",u.error.message);return}i(u.data)}catch{}};return r?Ag(a==null?void 0:a.onGiveUp,A.signal).then(h=>{if(w)return;const u=`${o}?token=${encodeURIComponent(h.token)}`;g=new cl(u,l,a)}).catch(()=>{}):g=new cl(o,l,a),()=>{var h;w=!0,A.abort(),(h=a==null?void 0:a.onClose)==null||h.call(a),g==null||g.close()}}function lE(i,r){return et(`/v1/sessions/${encodeURIComponent(i)}/command`,{method:"POST",body:JSON.stringify({command:r})})}function cE(i,r){return et(`/v1/sessions/${encodeURIComponent(i)}/bash`,{method:"POST",body:JSON.stringify({command:r})})}function uE(i){return et(`/v1/sessions/${encodeURIComponent(i)}/screenshot`,{method:"POST"})}function hE(i){const{signal:r,...a}=i;return et("/v1/sessions/batch",{method:"POST",signal:r,body:JSON.stringify(a)})}function fE(i){return et("/v1/pipelines",{method:"POST",body:JSON.stringify(i)})}function dE(){return et("/v1/pipelines")}function mE(i){return et(`/v1/pipelines/${encodeURIComponent(i)}`)}function pE(i){return et("/v1/auth/sse-token",{method:"POST",signal:i})}function _E(i){return et("/v1/auth/keys",{method:"POST",body:JSON.stringify({name:i}),schema:R2,schemaContext:"createAuthKey"})}function gE(){return et("/v1/auth/keys",{schema:Ea(A2),schemaContext:"getAuthKeys"})}function vE(i){return et(`/v1/auth/keys/${encodeURIComponent(i)}`,{method:"DELETE",schema:wh,schemaContext:"revokeAuthKey"})}const Vo=new Map;let yE=0;const bs=W_(i=>({toasts:[],addToast:(r,a,o)=>{const g=`toast-${++yE}`,w=setTimeout(()=>{Vo.delete(g),i(A=>({toasts:A.toasts.filter(l=>l.id!==g)}))},4e3);return Vo.set(g,w),i(A=>({toasts:[...A.toasts,{id:g,type:r,title:a,description:o}]})),g},removeToast:r=>{const a=Vo.get(r);a&&(clearTimeout(a),Vo.delete(r)),i(o=>({toasts:o.toasts.filter(g=>g.id!==r)}))}})),SE={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 bE({id:i,type:r,title:a,description:o}){const g=bs(w=>w.removeToast);return C.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 ${SE[r]}`,children:[C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("p",{className:"text-sm font-medium",children:a}),o&&C.jsx("p",{className:"mt-0.5 text-xs opacity-80",children:o})]}),C.jsx("button",{onClick:()=>g(i),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:C.jsx(dl,{className:"h-3.5 w-3.5"})})]})}function xE(){const i=bs(r=>r.toasts);return i.length===0?null:C.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=>C.jsx("div",{className:"pointer-events-auto",children:C.jsx(bE,{id:r.id,type:r.type,title:r.title,description:r.description})},r.id))})}const CE=[{to:"/",label:"Overview",icon:db},{to:"/pipelines",label:"Pipelines",icon:F_},{to:"/auth/keys",label:"Auth Keys",icon:Ju}],wE=5,EE=1e3;function TE(){const i=dt(u=>u.sseConnected),r=dt(u=>u.setSseConnected),a=dt(u=>u.sseError),o=dt(u=>u.setSseError),g=dt(u=>u.addActivity),w=dt(u=>u.token),A=I.useRef(null),[l,h]=I.useState(0);return I.useEffect(()=>{let u=!1,y,d=null;function x(E){if(!u)try{y=oE(O=>{O.sessionId&&g(O)},w,{onOpen:()=>{A.current&&(clearTimeout(A.current),A.current=null),r(!0),o(null),h(0)},onClose:()=>{A.current=setTimeout(()=>{r(!1)},2e3)},onGiveUp:()=>{o("SSE connection failed — real-time updates unavailable"),r(!1)}})}catch(O){if(console.error("Failed to subscribe to global SSE (attempt %d):",E+1,O),E<wE){const b=EE*Math.pow(2,E);h(E+1),d=setTimeout(()=>x(E+1),b)}else o("SSE subscription failed after retries — real-time updates unavailable"),r(!1)}}return x(0),()=>{u=!0,A.current&&clearTimeout(A.current),d&&clearTimeout(d),y==null||y()}},[r,o,g,w]),C.jsxs("div",{className:"flex h-screen overflow-hidden bg-void",children:[C.jsxs("aside",{className:"flex w-56 flex-col border-r border-void-lighter bg-void-light shrink-0",children:[C.jsxs("div",{className:"flex items-center gap-2 px-4 py-5 border-b border-void-lighter",children:[C.jsx(Ob,{className:"h-6 w-6 text-cyan glow-text-cyan"}),C.jsx("span",{className:"text-lg font-semibold tracking-tight text-gray-100",children:"Aegis"})]}),C.jsxs("nav",{className:"flex flex-col gap-1 px-2 py-4 flex-1",children:[CE.map(({to:u,label:y,icon:d})=>C.jsxs(I_,{to:u,end:u==="/",className:({isActive:x})=>`flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${x?"bg-cyan/10 text-cyan":"text-gray-400 hover:bg-void-lighter hover:text-gray-200"}`,children:[C.jsx(d,{className:"h-4 w-4"}),y]},u)),C.jsx("div",{className:"mt-4 border-t border-void-lighter pt-4 opacity-40",children:C.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:[C.jsx(jb,{className:"h-4 w-4"}),"Sessions"]})})]})]}),C.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[C.jsxs("header",{className:"flex items-center justify-between border-b border-void-lighter bg-void-light px-6 py-3 shrink-0",children:[C.jsx("h1",{className:"text-sm font-medium text-gray-300",children:"Aegis Dashboard"}),C.jsx("div",{className:"flex items-center gap-3",children:C.jsx("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",title:a??void 0,children:a?C.jsxs(C.Fragment,{children:[C.jsx(V_,{className:"h-3 w-3 text-amber-500"}),C.jsxs("span",{className:"text-amber-500",children:["SSE Error",l>0?` (retry ${l})`:""]})]}):C.jsxs(C.Fragment,{children:[C.jsx("span",{className:`status-dot ${i?"status-dot--idle":""}`,style:i?void 0:{backgroundColor:"#666"}}),i?"SSE Live":"SSE Off"]})})})]}),C.jsx("main",{className:"flex-1 overflow-auto p-6",children:C.jsx(iS,{})})]}),C.jsx(xE,{})]})}function AE(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 gr(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 g=Math.floor(o/60);return g<24?`${g}h ago`:`${Math.floor(g/24)}d ago`}function RE(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 g=Math.floor(a/60),w=a%60;return`${g}h ${w.toString().padStart(2,"0")}m`}const kE=15e3,DE=6e4;function OE(i){return new Date(i).toLocaleString()}function ME(i){return i.length<=12?"•".repeat(i.length):`${i.slice(0,8)}${"•".repeat(Math.max(8,i.length-12))}${i.slice(-4)}`}function LE(){const[i,r]=I.useState([]),[a,o]=I.useState(!0),[g,w]=I.useState(null),[A,l]=I.useState(""),[h,u]=I.useState(!1),[y,d]=I.useState(!1),[x,E]=I.useState(null),[O,b]=I.useState(null),[p,v]=I.useState(!1),f=bs(M=>M.addToast),_=I.useCallback(async(M=!1)=>{M?d(!0):o(!0);try{const T=await gE();r(T.slice().sort((N,P)=>P.createdAt-N.createdAt)),w(null)}catch(T){const N=T instanceof Error?T.message:"Failed to load auth keys";w(N),f("error","Failed to load auth keys",N)}finally{M?d(!1):o(!1)}},[f]);I.useEffect(()=>{_();const M=setInterval(()=>{_(!0)},kE);return()=>clearInterval(M)},[_]),I.useEffect(()=>{if(!O)return;const M=setTimeout(()=>{b(null),v(!1)},DE);return()=>clearTimeout(M)},[O]);async function S(M){M.preventDefault();const T=A.trim();if(T){u(!0);try{const N=await _E(T);b(N),v(!1),l(""),f("success","Auth key created","Store the secret now. It is only shown once."),await _(!0)}catch(N){f("error","Failed to create auth key",N instanceof Error?N.message:void 0)}finally{u(!1)}}}async function R(){var M;if(O)try{if(!((M=navigator.clipboard)!=null&&M.writeText))throw new Error("Clipboard access is unavailable in this browser");await navigator.clipboard.writeText(O.key),f("success","Auth key copied")}catch(T){f("warning","Failed to copy auth key",T instanceof Error?T.message:void 0)}}async function k(M,T){if(window.confirm(`Revoke auth key "${T}"? This cannot be undone.`)){E(M);try{await vE(M),r(N=>N.filter(P=>P.id!==M)),(O==null?void 0:O.id)===M&&(b(null),v(!1)),f("success","Auth key revoked")}catch(N){f("error","Failed to revoke auth key",N instanceof Error?N.message:void 0)}finally{E(null)}}}return C.jsxs("div",{className:"flex flex-col gap-6",children:[C.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[C.jsxs("div",{children:[C.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Auth Keys"}),C.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Create, review, and revoke dashboard API keys without exposing stored secrets."})]}),C.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:[C.jsx(K_,{className:`h-3.5 w-3.5 ${y?"animate-spin":""}`}),"Refresh"]})]}),C.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,360px)_minmax(0,1fr)]",children:[C.jsxs("section",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-5",children:[C.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-gray-100",children:[C.jsx(wa,{className:"h-4 w-4 text-[#00e5ff]"}),"Create Key"]}),C.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."}),C.jsxs("form",{className:"mt-4 space-y-4",onSubmit:S,children:[C.jsxs("div",{children:[C.jsx("label",{className:"mb-1.5 block text-xs font-medium text-gray-400",htmlFor:"auth-key-name",children:"Key Name"}),C.jsx("input",{id:"auth-key-name",type:"text",value:A,onChange:M=>l(M.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"})]}),C.jsxs("button",{type:"submit",disabled:h||!A.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:[C.jsx(Ju,{className:"h-4 w-4"}),h?"Creating…":"Create Auth Key"]})]}),O?C.jsxs("div",{className:"mt-5 rounded-lg border border-emerald-500/20 bg-emerald-500/5 p-4",role:"status",children:[C.jsxs("div",{className:"flex items-start justify-between gap-3",children:[C.jsxs("div",{children:[C.jsx("h3",{className:"text-sm font-semibold text-emerald-300",children:"Store this key now"}),C.jsx("p",{className:"mt-1 text-xs text-emerald-200/80",children:"This secret is shown once and is hidden by default."})]}),C.jsx("button",{type:"button",onClick:()=>{b(null),v(!1)},className:"text-xs font-medium text-emerald-200/80 transition-colors hover:text-emerald-200",children:"Dismiss"})]}),C.jsxs("dl",{className:"mt-4 space-y-3 text-sm text-gray-200",children:[C.jsxs("div",{children:[C.jsx("dt",{className:"text-xs uppercase tracking-wide text-gray-500",children:"Name"}),C.jsx("dd",{className:"mt-1 font-medium text-gray-100",children:O.name})]}),C.jsxs("div",{children:[C.jsx("dt",{className:"text-xs uppercase tracking-wide text-gray-500",children:"Secret"}),C.jsx("dd",{className:"mt-1 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 font-mono text-xs text-[#9af5ff]",children:p?O.key:ME(O.key)})]})]}),C.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[C.jsxs("button",{type:"button",onClick:()=>v(M=>!M),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:[p?C.jsx(ab,{className:"h-3.5 w-3.5"}):C.jsx(lb,{className:"h-3.5 w-3.5"}),p?"Hide secret":"Reveal secret"]}),C.jsxs("button",{type:"button",onClick:()=>void R(),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:[C.jsx(ib,{className:"h-3.5 w-3.5"}),"Copy secret"]})]})]}):null]}),C.jsxs("section",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-5",children:[C.jsx("div",{className:"flex items-center justify-between gap-3 border-b border-[#1a1a2e] pb-4",children:C.jsxs("div",{children:[C.jsx("h3",{className:"text-sm font-semibold text-gray-100",children:"Existing Keys"}),C.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[i.length," key",i.length===1?"":"s"," configured"]})]})}),a?C.jsx("div",{className:"flex min-h-[240px] items-center justify-center text-sm text-gray-500",children:C.jsx("div",{className:"animate-pulse",children:"Loading auth keys…"})}):g?C.jsxs("div",{className:"mt-4 rounded-lg border border-amber-500/20 bg-amber-500/5 p-4 text-sm text-amber-200",children:[C.jsx("p",{className:"font-medium",children:"Unable to load auth keys"}),C.jsx("p",{className:"mt-1 text-amber-200/80",children:g}),C.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?C.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:[C.jsx(Ju,{className:"h-8 w-8 text-gray-600"}),C.jsx("p",{className:"mt-4 text-sm font-medium text-gray-300",children:"No auth keys yet"}),C.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."})]}):C.jsx("div",{className:"mt-4 space-y-3",children:i.map(M=>C.jsx("article",{className:"rounded-lg border border-[#1a1a2e] bg-[#0a0a0f] p-4",children:C.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[C.jsxs("div",{className:"min-w-0",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"truncate font-medium text-gray-100",children:M.name}),C.jsx("span",{className:"rounded-full border border-[#1a1a2e] bg-[#111118] px-2 py-0.5 font-mono text-[11px] text-gray-500",children:M.id})]}),C.jsxs("p",{className:"mt-2 text-sm text-gray-400",children:["Created ",C.jsx("span",{title:OE(M.createdAt),children:gr(M.createdAt)})]})]}),C.jsxs("button",{type:"button",onClick:()=>void k(M.id,M.name),disabled:x===M.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:[C.jsx(ph,{className:"h-3.5 w-3.5"}),x===M.id?"Revoking…":"Revoke"]})]})},M.id))})]})]})]})}function Ks({label:i,value:r,icon:a,suffix:o}){return C.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[C.jsxs("div",{className:"mb-2 flex items-center gap-2 text-sm text-[#888]",children:[a,i]}),C.jsxs("div",{className:"font-mono text-2xl text-[#00e5ff]",children:[r,o&&C.jsx("span",{className:"ml-1 text-base text-[#666]",children:o})]})]})}function NE(){const i=dt(y=>y.metrics),r=dt(y=>y.sseConnected),a=dt(y=>y.setMetrics),[o,g]=I.useState(null),w=I.useCallback(async()=>{try{const[y,d]=await Promise.all([V2(),K2()]);a(y),g(d)}catch(y){bs.getState().addToast("error","Failed to load metrics",y instanceof Error?y.message:void 0)}},[a]);I.useEffect(()=>{if(w(),r)return;const y=setInterval(w,1e4);return()=>clearInterval(y)},[w,r]);const A=(i==null?void 0:i.sessions.currently_active)??(o==null?void 0:o.sessions.active)??0,l=(i==null?void 0:i.sessions.total_created)??(o==null?void 0:o.sessions.total)??0,h=i==null?void 0:i.prompt_delivery.success_rate,u=(o==null?void 0:o.uptime)??(i==null?void 0:i.uptime)??0;return C.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:[C.jsx(Ks,{label:"Active Sessions",value:A,icon:C.jsx(F_,{className:"h-4 w-4"})}),C.jsx(Ks,{label:"Total Created",value:l,icon:C.jsx(hb,{className:"h-4 w-4"})}),C.jsx(Ks,{label:"Delivery Rate",value:h!=null?h.toFixed(1):"—",suffix:"%",icon:C.jsx(Zb,{className:"h-4 w-4"})}),C.jsx(Ks,{label:"Uptime",value:AE(u),icon:C.jsx(eb,{className:"h-4 w-4"})})]})}const e_={idle:"#00ff88",working:"#00e5ff",permission_prompt:"#ffaa00",bash_approval:"#ffaa00",plan_mode:"#ff8800",ask_question:"#ff3366",settings:"#00e5ff",error:"#ff0000",compacting:"#ffaa00",context_warning:"#ffaa00",waiting_for_input:"#ffaa00",unknown:"#666666"},jE=new Set(["working","permission_prompt","bash_approval","ask_question"]),t_={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 yl({status:i}){const r=e_[i]??e_.unknown,a=jE.has(i),o=t_[i]??t_.unknown;return C.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 BE=5e3,i_=20,s_=100,zE={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},r_=["all","idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"],kg=i=>i.status==="permission_prompt"||i.status==="bash_approval",Dg=(i,r=40)=>i.length>r?`…${i.slice(i.length-r+1)}`:i;function n_(i){return i==="all"?"All":i.split("_").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function HE(i,r){return r?`${i.windowName} ${i.id} ${i.workDir}`.toLowerCase().includes(r):!0}function UE(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 Og(i,r){return UE(i.session,r.session)&&i.isAlive===r.isAlive&&i.selected===r.selected&&i.currentAction===r.currentAction}const IE=I.memo(function({session:r,isAlive:a,selected:o,currentAction:g,onToggleSelect:w,onApprove:A,onInterrupt:l,onKill:h}){return C.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors active:bg-[#1a1a2e]/50",children:[C.jsxs("div",{className:"mb-2 flex items-start justify-between gap-3",children:[C.jsxs("label",{className:"flex min-w-0 flex-1 items-center gap-3 text-sm text-gray-200",children:[C.jsx("input",{type:"checkbox","aria-label":`Select session ${r.windowName||r.id}`,checked:o,onChange:u=>w(r.id,u.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"}),C.jsxs("div",{className:"min-w-0",children:[C.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[C.jsx(yl,{status:r.status}),C.jsx(Hi,{to:`/sessions/${encodeURIComponent(r.id)}`,className:"truncate font-medium text-gray-200 transition-colors hover:text-cyan",children:r.windowName||r.id}),!a&&C.jsx(sl,{className:"h-3.5 w-3.5 shrink-0 text-red-400"})]}),C.jsx("div",{className:"mt-1 truncate font-mono text-xs text-gray-500",children:Dg(r.workDir,50)})]})]}),C.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[kg(r)&&C.jsx("button",{onClick:u=>A(u,r.id),disabled:g==="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:C.jsx(G_,{className:"h-4 w-4"})}),C.jsx("button",{onClick:u=>l(u,r.id),disabled:g==="interrupt"||g==="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:C.jsx(Z_,{className:"h-4 w-4"})}),C.jsx("button",{onClick:u=>h(u,r.id),disabled:g==="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:C.jsx(sl,{className:"h-4 w-4"})})]})]}),C.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-gray-500",children:[C.jsxs("span",{children:["Age: ",gr(r.createdAt)]}),C.jsxs("span",{children:["Active: ",gr(r.lastActivity)]}),r.permissionMode&&r.permissionMode!=="default"?C.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-900/30 px-2 py-0.5 text-green-400",children:[C.jsx(q_,{className:"h-3 w-3"})," ",r.permissionMode]}):C.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-void-lighter px-2 py-0.5 text-gray-500",children:"default"})]})]})},Og),PE=I.memo(function({session:r,isAlive:a,selected:o,currentAction:g,onToggleSelect:w,onApprove:A,onInterrupt:l,onKill:h}){return C.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[C.jsx("td",{className:"px-4 py-3",children:C.jsx("input",{type:"checkbox","aria-label":`Select session ${r.windowName||r.id}`,checked:o,onChange:u=>w(r.id,u.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"})}),C.jsx("td",{className:"px-4 py-3",children:C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx(yl,{status:r.status}),!a&&C.jsx(sl,{className:"h-3.5 w-3.5 text-red-400"})]})}),C.jsx("td",{className:"px-4 py-3",children:C.jsx(Hi,{to:`/sessions/${encodeURIComponent(r.id)}`,className:"font-medium text-gray-200 transition-colors hover:text-cyan",children:r.windowName||r.id})}),C.jsx("td",{className:"max-w-[200px] truncate px-4 py-3 font-mono text-xs text-gray-400",title:r.workDir,children:Dg(r.workDir)}),C.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:gr(r.createdAt)}),C.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:gr(r.lastActivity)}),C.jsx("td",{className:"px-4 py-3",children:r.permissionMode&&r.permissionMode!=="default"?C.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:[C.jsx(q_,{className:"h-3 w-3"}),r.permissionMode]}):C.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"})}),C.jsx("td",{className:"px-4 py-3",children:C.jsxs("div",{className:"flex items-center gap-1.5",children:[kg(r)&&C.jsx("button",{onClick:u=>A(u,r.id),disabled:g==="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:C.jsx(G_,{className:"h-3 w-3"})}),C.jsx("button",{onClick:u=>l(u,r.id),disabled:g==="interrupt"||g==="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:C.jsx(Z_,{className:"h-3 w-3"})}),C.jsx("button",{onClick:u=>h(u,r.id),disabled:g==="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:C.jsx(sl,{className:"h-3 w-3"})})]})})]})},Og);function $E(){const i=dt(B=>B.sessions),r=dt(B=>B.healthMap),a=dt(B=>B.sseConnected),o=dt(B=>B.setSessionsAndHealth),g=bs(B=>B.addToast),[w,A]=I.useState({}),[l,h]=I.useState([]),[u,y]=I.useState(null),[d,x]=I.useState("all"),[E,O]=I.useState(zE),[b,p]=I.useState(""),v=I.useDeferredValue(b.trim().toLowerCase()),[f,_]=I.useState({page:1,limit:i_,total:0,totalPages:0}),[S,R]=I.useState(1),[k,M]=I.useState(!0),[T,N]=I.useState(!1),P=I.useCallback(async()=>{M(!0);try{const B=v.length>0,L=sh({page:B?1:S,limit:B?s_:i_,status:d==="all"?void 0:d}),[H,W]=await Promise.all([L,W2()]),re=B?H.sessions.filter(pe=>HE(pe,v)):H.sessions;let ue={};try{const pe=await Q2(),V=new Set(re.map(U=>U.id));for(const[U,ce]of Object.entries(pe))V.has(U)&&(ue[U]={alive:ce.alive,loading:!1})}catch{}o(re,ue),O(W),N(B&&H.pagination.total>H.sessions.length),_(B?{page:1,limit:re.length,total:re.length,totalPages:re.length>0?1:0}:H.pagination)}catch(B){g("error","Failed to fetch sessions",B instanceof Error?B.message:void 0)}finally{M(!1)}},[g,v,S,o,d]);I.useEffect(()=>{if(P(),a)return;const B=setInterval(P,BE);return()=>clearInterval(B)},[P,a]),I.useEffect(()=>{const B=new Set(i.map(L=>L.id));h(L=>L.filter(H=>B.has(H)))},[i]);const F=I.useCallback(async(B,L,H)=>{A(W=>({...W,[B]:L}));try{await H()}finally{A(W=>({...W,[B]:null}))}},[]),G=I.useCallback(async(B,L)=>{B.preventDefault(),await F(L,"approve",async()=>{try{await Tg(L),await P()}catch(H){g("error","Approve failed",H instanceof Error?H.message:void 0)}})},[g,P,F]),$=I.useCallback(async(B,L)=>{B.preventDefault(),await F(L,"interrupt",async()=>{try{await nh(L),await P()}catch(H){g("error","Interrupt failed",H instanceof Error?H.message:void 0)}})},[g,P,F]),J=I.useCallback(async(B,L)=>{B.preventDefault(),confirm("Kill this session?")&&await F(L,"kill",async()=>{try{await rh(L),await P()}catch(H){g("error","Failed to kill session",H instanceof Error?H.message:void 0)}})},[g,P,F]),te=I.useCallback((B,L)=>{h(H=>L?H.includes(B)?H:[...H,B]:H.filter(W=>W!==B))},[]),q=I.useCallback(B=>{if(!B){h([]);return}h(i.map(L=>L.id))},[i]),K=I.useCallback(async B=>{if(l.length!==0&&!(B==="kill"&&!confirm(`Kill ${l.length} selected session${l.length===1?"":"s"}?`))){y(B),A(L=>{const H={...L};for(const W of l)H[W]=B;return H});try{const L=await Promise.allSettled(l.map(re=>B==="interrupt"?nh(re):rh(re))),H=L.filter(re=>re.status==="fulfilled").length,W=L.length-H;H>0&&g("success",B==="interrupt"?"Bulk interrupt complete":"Bulk kill complete",`${H} session${H===1?"":"s"} updated.`),W>0&&g("warning",`Some sessions failed to ${B}`,`${W} session${W===1?"":"s"} could not be updated.`),h([]),await P()}finally{y(null),A(L=>{const H={...L};for(const W of l)H[W]=null;return H})}}},[g,P,l]),ee=i.length>0&&i.every(B=>l.includes(B.id)),j=d!=="all"||v.length>0;return k&&i.length===0?C.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:C.jsx("p",{className:"text-gray-500",children:"Loading sessions..."})}):C.jsxs("div",{className:"space-y-4",children:[C.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[C.jsxs("div",{className:"flex flex-col gap-4 xl:flex-row xl:items-start xl:justify-between",children:[C.jsxs("div",{className:"flex-1 space-y-3",children:[C.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center",children:[C.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:[C.jsx(Eb,{className:"h-4 w-4 text-gray-500"}),C.jsx("input",{value:b,onChange:B=>{p(B.target.value),R(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"})]}),C.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-400",children:[C.jsx("span",{children:"Status"}),C.jsx("select",{value:d,onChange:B=>{x(B.target.value),R(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:r_.map(B=>C.jsxs("option",{value:B,children:[n_(B)," (",E[B]??0,")"]},B))})]})]}),C.jsx("div",{className:"flex flex-wrap gap-2",children:r_.filter(B=>B==="all"||(E[B]??0)>0).map(B=>{const L=d===B;return C.jsxs("button",{type:"button",onClick:()=>{x(B),R(1)},className:`rounded-full border px-3 py-1 text-xs transition-colors ${L?"border-cyan bg-cyan/10 text-cyan":"border-void-lighter bg-void text-gray-400 hover:border-cyan/40 hover:text-gray-200"}`,children:[n_(B)," ",C.jsx("span",{className:"text-gray-500",children:E[B]??0})]},B)})})]}),C.jsxs("div",{className:"text-right text-xs text-gray-500",children:[C.jsxs("div",{children:["Showing ",C.jsx("span",{className:"text-gray-300",children:i.length}),v.length>0?` matching session${i.length===1?"":"s"}`:` of ${f.total} session${f.total===1?"":"s"}`]}),T&&C.jsxs("div",{className:"mt-1 text-amber-400",children:["Search scans the first ",s_," sessions in the selected status."]})]})]}),l.length>0&&C.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:[C.jsxs("div",{className:"text-sm text-gray-300",children:[l.length," session",l.length===1?"":"s"," selected"]}),C.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[C.jsx("button",{type:"button",onClick:()=>K("interrupt"),disabled:u!==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"}),C.jsx("button",{type:"button",onClick:()=>K("kill"),disabled:u!==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"}),C.jsx("button",{type:"button",onClick:()=>h([]),disabled:u!==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?C.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:C.jsx("p",{className:"text-gray-400",children:j?"No sessions match the current filter.":"No active sessions"})}):C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"space-y-3 md:hidden",children:[C.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:[C.jsxs("label",{className:"flex items-center gap-2",children:[C.jsx("input",{type:"checkbox","aria-label":"Select all visible sessions",checked:ee,onChange:B=>q(B.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"}),"Select visible"]}),C.jsxs("span",{children:[i.length," visible"]})]}),i.map(B=>{const L=r[B.id],H=L?L.alive:!0;return C.jsx(IE,{session:B,isAlive:H,selected:l.includes(B.id),currentAction:w[B.id]??null,onToggleSelect:te,onApprove:G,onInterrupt:$,onKill:J},B.id)})]}),C.jsx("div",{className:"hidden overflow-x-auto rounded-lg border border-void-lighter bg-[#111118] md:block",children:C.jsxs("table",{className:"w-full text-left text-sm",children:[C.jsx("thead",{children:C.jsxs("tr",{className:"border-b border-void-lighter text-[#666]",children:[C.jsx("th",{className:"px-4 py-3 font-medium",children:C.jsx("input",{type:"checkbox","aria-label":"Select all visible sessions",checked:ee,onChange:B=>q(B.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"})}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"WorkDir"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Age"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Last Activity"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Permission"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Actions"})]})}),C.jsx("tbody",{children:i.map(B=>{const L=r[B.id],H=L?L.alive:!0;return C.jsx(PE,{session:B,isAlive:H,selected:l.includes(B.id),currentAction:w[B.id]??null,onToggleSelect:te,onApprove:G,onInterrupt:$,onKill:J},B.id)})})]})}),v.length===0&&f.totalPages>1&&C.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:[C.jsxs("span",{children:["Page ",f.page," of ",f.totalPages]}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsxs("button",{type:"button",onClick:()=>R(B=>Math.max(1,B-1)),disabled:f.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:[C.jsx(GS,{className:"h-4 w-4"})," Previous"]}),C.jsxs("button",{type:"button",onClick:()=>R(B=>Math.min(f.totalPages,B+1)),disabled:f.page>=f.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 ",C.jsx(VS,{className:"h-4 w-4"})]})]})]})]})]})}const Uu={session_status_change:{icon:K_,label:"Status",color:"#00e5ff"},session_message:{icon:_b,label:"Message",color:"#00ff88"},session_approval:{icon:kb,label:"Approval",color:"#ffaa00"},session_ended:{icon:xb,label:"Ended",color:"#ff3366"},session_created:{icon:XS,label:"Created",color:"#a78bfa"},session_stall:{icon:V_,label:"Stall",color:"#ff6600"},session_dead:{icon:Lb,label:"Dead",color:"#ff0044"},session_subagent_start:{icon:Pb,label:"Subagent",color:"#38bdf8"},session_subagent_stop:{icon:Ub,label:"Subagent Done",color:"#34d399"}};function _r(i,r="unknown"){return typeof i=="string"?i:r}function FE(i){const r=i.data;switch(i.event){case"session_status_change":{const a=_r(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"?r.text:JSON.stringify(r.text??"");return`${a}: ${a_(o,80)}`}case"session_approval":{const a=typeof r.prompt=="string"?r.prompt:JSON.stringify(r.prompt??"");return`Approval needed: ${a_(a,80)}`}case"session_ended":return`Session ended: ${_r(r.reason)}`;case"session_created":return`Created in ${_r(r.workDir,"unknown dir")}`;case"session_stall":return`Session stalled: ${_r(r.stallType)}`;case"session_dead":return`Session dead: ${_r(r.stallType)}`;case"session_subagent_start":return`Subagent started: ${_r(r.name)}`;case"session_subagent_stop":return`Subagent finished: ${_r(r.name)}`;default:return JSON.stringify(r)}}function a_(i,r){return i.length>r?i.slice(0,r)+"...":i}function ZE(i){try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function qE(){const i=dt(u=>u.activities),r=dt(u=>u.activityFilterSession),a=dt(u=>u.activityFilterType),o=dt(u=>u.setActivityFilterSession),g=dt(u=>u.setActivityFilterType),w=dt(u=>u.sessions),A=I.useMemo(()=>i.filter(u=>!(r&&u.sessionId!==r||a&&u.event!==a)),[i,r,a]),l=I.useMemo(()=>{const u=new Map;for(const y of w)u.set(y.id,y.windowName??y.id.slice(0,8));return u},[w]),h=u=>l.get(u)??(u??"unknown").slice(0,8);return C.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg w-full",children:[C.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:[C.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Activity Stream"}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsxs("select",{value:r??"",onChange:u=>o(u.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-[#00e5ff]",children:[C.jsx("option",{value:"",children:"All sessions"}),w.map(u=>C.jsx("option",{value:u.id,children:u.windowName||u.id.slice(0,8)},u.id))]}),C.jsxs("select",{value:a??"",onChange:u=>g(u.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-[#00e5ff]",children:[C.jsx("option",{value:"",children:"All types"}),Object.entries(Uu).map(([u,y])=>C.jsx("option",{value:u,children:y.label},u))]}),(r||a)&&C.jsx("button",{onClick:()=>{o(null),g(null)},className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300",children:C.jsx(dl,{className:"h-4 w-4"})})]})]}),C.jsxs("div",{className:"max-h-[360px] overflow-y-auto divide-y divide-[#1a1a2e]/50",children:[A.length===0&&C.jsx("div",{className:"px-4 py-8 text-center text-sm text-[#555]",children:"No activity yet"}),A.map((u,y)=>{const d=Uu[u.event]??Uu.session_status_change,x=d.icon;return C.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:[C.jsx(x,{className:"h-4 w-4 mt-0.5 shrink-0",style:{color:d.color}}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[C.jsx("span",{className:"text-xs font-medium text-gray-300 truncate",children:h(u.sessionId)}),C.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded hidden sm:inline-block",style:{backgroundColor:`${d.color}15`,color:d.color},children:d.label})]}),C.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:FE(u)})]}),C.jsx("span",{className:"text-[10px] text-[#444] shrink-0 tabular-nums mt-0.5",children:ZE(u.timestamp)})]},`${u.sessionId}-${u.timestamp}-${y}`)})]})]})}let GE=0;function ua(){return{workDir:"",name:"",prompt:"",_key:GE++}}function KE({open:i,onClose:r}){const a=hl(),o=I.useRef(null),g=I.useRef(null),w=I.useCallback(()=>{F(),r()},[r]),A=I.useRef(null);I.useEffect(()=>{if(!i)return;const K=ee=>{var j;ee.key==="Escape"&&((j=g.current)==null||j.abort(),w())};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[i,w]),I.useEffect(()=>{if(!i)return;const K=A.current;if(!K)return;const ee='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',j=B=>{if(B.key!=="Tab")return;const L=Array.from(K.querySelectorAll(ee));if(L.length===0)return;const H=L[0],W=L[L.length-1];B.shiftKey?document.activeElement===H&&(B.preventDefault(),W.focus()):document.activeElement===W&&(B.preventDefault(),H.focus())};return K.addEventListener("keydown",j),()=>K.removeEventListener("keydown",j)},[i]),I.useEffect(()=>{if(i){const K=setTimeout(()=>{var ee;return(ee=o.current)==null?void 0:ee.focus()},50);return()=>clearTimeout(K)}},[i]);const[l,h]=I.useState(""),[u,y]=I.useState(""),[d,x]=I.useState(""),[E,O]=I.useState("default"),[b,p]=I.useState(!1),[v,f]=I.useState(null),[_,S]=I.useState("single"),[R,k]=I.useState([ua(),ua()]),[M,T]=I.useState(""),[N,P]=I.useState(null);function F(){h(""),y(""),x(""),O("default"),p(!1),f(null),k([ua(),ua()]),T(""),P(null),S("single")}function G(){R.length>=10||k([...R,ua()])}function $(K){R.length<=1||k(R.filter((ee,j)=>j!==K))}function J(K,ee,j){k(R.map((B,L)=>L===K?{...B,[ee]:j}:B))}async function te(K){var B;K.preventDefault(),f(null),P(null);const ee=R.filter(L=>L.workDir.trim());if(ee.length===0){f("At least one working directory is required");return}p(!0),(B=g.current)==null||B.abort();const j=new AbortController;g.current=j;try{const L=await hE({sessions:ee.map(H=>({workDir:H.workDir.trim(),name:H.name.trim()||void 0,prompt:H.prompt.trim()||M.trim()||void 0,permissionMode:E})),signal:j.signal});P(L)}catch(L){if(j.signal.aborted)return;f(L instanceof Error?L.message:"Failed to create sessions")}finally{g.current===j&&(g.current=null,p(!1))}}if(!i)return null;async function q(K){var j;if(K.preventDefault(),f(null),!l.trim()){f("Working directory is required");return}p(!0),(j=g.current)==null||j.abort();const ee=new AbortController;g.current=ee;try{const B=await X2({workDir:l.trim(),name:u.trim()||void 0,prompt:d.trim()||void 0,permissionMode:E,signal:ee.signal});F(),r(),a(`/sessions/${B.id}`)}catch(B){if(ee.signal.aborted)return;f(B instanceof Error?B.message:"Failed to create session")}finally{g.current===ee&&(g.current=null,p(!1))}}return C.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[C.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:w}),C.jsxs("div",{ref:A,role:"dialog","aria-modal":"true","aria-label":"Create new session",className:`relative w-full ${_==="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:[C.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[C.jsxs("div",{className:"flex items-center gap-4",children:[C.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Session"}),C.jsxs("div",{className:"flex rounded bg-[#0a0a0f] p-0.5",children:[C.jsx("button",{type:"button",onClick:()=>S("single"),className:`px-3 py-1 text-xs rounded transition-colors ${_==="single"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Single"}),C.jsx("button",{type:"button",onClick:()=>S("batch"),className:`px-3 py-1 text-xs rounded transition-colors ${_==="batch"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Batch"})]})]}),C.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:C.jsx(dl,{className:"h-4 w-4"})})]}),_==="single"&&C.jsxs("form",{onSubmit:q,className:"p-4 sm:p-5 space-y-4",children:[C.jsxs("div",{children:[C.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Working Directory ",C.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),C.jsx("input",{type:"text",ref:o,value:l,onChange:K=>h(K.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-[#00e5ff] font-mono"})]}),C.jsxs("div",{children:[C.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Session Name"}),C.jsx("input",{type:"text",value:u,onChange:K=>y(K.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-[#00e5ff]"})]}),C.jsxs("div",{children:[C.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Initial Prompt"}),C.jsx("textarea",{value:d,onChange:K=>x(K.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-[#00e5ff] resize-none"})]}),C.jsxs("div",{children:[C.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),C.jsxs("select",{value:E,onChange:K=>O(K.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:[C.jsx("option",{value:"default",children:"default — asks for everything"}),C.jsx("option",{value:"plan",children:"plan — auto-reads, asks for writes"}),C.jsx("option",{value:"acceptEdits",children:"acceptEdits — auto-edits, asks for bash"}),C.jsx("option",{value:"bypassPermissions",children:"bypassPermissions — never asks"}),C.jsx("option",{value:"auto",children:"auto — auto-approve in sandbox"})]})]}),v&&C.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:v}),C.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[C.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"}),C.jsxs("button",{type:"submit",disabled:b||!l.trim(),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&&C.jsx(Qu,{className:"h-3 w-3 animate-spin"}),"Create Session"]})]})]}),_==="batch"&&!N&&C.jsxs("form",{onSubmit:te,className:"p-4 sm:p-5 space-y-4",children:[C.jsxs("div",{children:[C.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Shared Prompt"}),C.jsx("textarea",{value:M,onChange:K=>T(K.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-[#00e5ff] resize-none"})]}),C.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[C.jsxs("span",{children:["Working Directory ",C.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),C.jsx("span",{children:"Name"}),C.jsx("span",{children:"Prompt (override)"}),C.jsx("span",{})]}),C.jsx("div",{className:"space-y-2",children:R.map((K,ee)=>C.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[C.jsx("input",{type:"text",value:K.workDir,onChange:j=>J(ee,"workDir",j.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-[#00e5ff] font-mono"}),C.jsx("input",{type:"text",value:K.name,onChange:j=>J(ee,"name",j.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-[#00e5ff]"}),C.jsx("input",{type:"text",value:K.prompt,onChange:j=>J(ee,"prompt",j.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-[#00e5ff]"}),C.jsx("button",{type:"button",onClick:()=>$(ee),disabled:R.length<=1,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ff3366] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:C.jsx(ph,{className:"h-3.5 w-3.5"})})]},K._key))}),R.length<10&&C.jsxs("button",{type:"button",onClick:G,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[C.jsx(wa,{className:"h-3.5 w-3.5"}),"Add session"]}),C.jsxs("div",{children:[C.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),C.jsxs("select",{value:E,onChange:K=>O(K.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:[C.jsx("option",{value:"default",children:"default — asks for everything"}),C.jsx("option",{value:"plan",children:"plan — auto-reads, asks for writes"}),C.jsx("option",{value:"acceptEdits",children:"acceptEdits — auto-edits, asks for bash"}),C.jsx("option",{value:"bypassPermissions",children:"bypassPermissions — never asks"}),C.jsx("option",{value:"auto",children:"auto — auto-approve in sandbox"})]})]}),v&&C.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:v}),C.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[C.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"}),C.jsxs("button",{type:"submit",disabled:b||!R.some(K=>K.workDir.trim()),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&&C.jsx(Qu,{className:"h-3 w-3 animate-spin"}),"Create ",R.filter(K=>K.workDir.trim()).length," Session(s)"]})]})]}),N&&C.jsxs("div",{className:"p-4 sm:p-5 space-y-4",children:[C.jsxs("div",{className:"flex items-center gap-3",children:[N.created>0&&C.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:[N.created," created"]}),N.failed>0&&C.jsxs("span",{className:"text-xs font-medium text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-1.5",children:[N.failed," failed"]})]}),N.sessions.length>0&&C.jsxs("div",{className:"space-y-1",children:[C.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Created sessions"}),C.jsx("ul",{className:"space-y-1",children:N.sessions.map(K=>C.jsx("li",{children:C.jsxs("button",{type:"button",onClick:()=>{w(),a(`/sessions/${K.id}`)},className:"text-xs text-[#00e5ff] hover:underline font-mono",children:[K.id.slice(0,8),"...",K.name?` — ${K.name}`:""]})},K.id))})]}),N.errors.length>0&&C.jsxs("div",{className:"space-y-1",children:[C.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Errors"}),C.jsx("ul",{className:"space-y-1",children:N.errors.map((K,ee)=>C.jsx("li",{className:"text-xs text-[#ff3366]",children:K},ee))})]}),C.jsx("div",{className:"flex justify-end pt-2",children:C.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 VE(){const[i,r]=I.useState(!1);return C.jsxs("div",{className:"flex flex-col gap-6",children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("div",{children:[C.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Overview"}),C.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Aegis session monitoring and metrics"})]}),C.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:[C.jsx(wa,{className:"h-3.5 w-3.5"}),"New Session"]})]}),C.jsx(NE,{}),C.jsxs("div",{children:[C.jsx("h3",{className:"mb-3 text-lg font-semibold text-gray-200",children:"Sessions"}),C.jsx($E,{})]}),C.jsx(qE,{}),C.jsx(KE,{open:i,onClose:()=>r(!1)})]})}function o_(i){return i instanceof Error&&"statusCode"in i}function WE(i){const r=dt(J=>J.token),a=bs(J=>J.addToast),[o,g]=I.useState(null),[w,A]=I.useState(null),[l,h]=I.useState(!1),[u,y]=I.useState(!0),[d,x]=I.useState(""),[E,O]=I.useState(!0),[b,p]=I.useState(null),[v,f]=I.useState(!0),_=I.useRef(i);_.current=i;const S=I.useRef(!1),R=I.useRef(0),k=I.useRef(void 0),M=I.useRef(void 0),T=I.useCallback(async()=>{try{const[J,te]=await Promise.allSettled([Y2(_.current),J2(_.current)]);if(J.status==="rejected"&&o_(J.reason)&&J.reason.statusCode===404||te.status==="rejected"&&o_(te.reason)&&te.reason.statusCode===404){h(!0);return}J.status==="fulfilled"&&g(J.value),te.status==="fulfilled"&&A(te.value)}catch(J){a("error","Failed to load session",J instanceof Error?J.message:void 0)}finally{y(!1)}},[a]);k.current=T;const N=I.useCallback(async()=>{if(S.current)return;const J=_.current;try{const te=await iE(J);S.current||x(te.pane??"")}catch(te){a("warning","Failed to load terminal pane",te instanceof Error?te.message:void 0)}finally{S.current||O(!1)}try{const te=await tE(J);S.current||p(te)}catch(te){a("warning","Failed to load session metrics",te instanceof Error?te.message:void 0)}finally{S.current||f(!1)}},[a]);M.current=N,I.useEffect(()=>(S.current=!1,R.current++,y(!0),O(!0),f(!0),T(),N(),()=>{S.current=!0,P.current&&clearTimeout(P.current),F.current&&clearTimeout(F.current)}),[i,T,N]);const P=I.useRef(void 0),F=I.useRef(void 0),G=I.useCallback(()=>{P.current&&clearTimeout(P.current);const J=R.current;P.current=setTimeout(()=>{var te;R.current===J&&((te=M.current)==null||te.call(M))},1e3)},[]),$=I.useCallback(()=>{F.current&&clearTimeout(F.current);const J=R.current;F.current=setTimeout(()=>{var te;R.current===J&&((te=k.current)==null||te.call(k))},1e3)},[]);return I.useEffect(()=>{if(!i)return;const J=Rg(i,te=>{var q,K;try{const ee=H2.safeParse(JSON.parse(te.data));if(!ee.success){console.warn("SSE event failed validation",ee.error.message);return}switch(ee.data.event){case"status":case"approval":case"stall":case"dead":$(),G();break;case"message":G();break;case"ended":(q=k.current)==null||q.call(k),(K=M.current)==null||K.call(M);break}}catch{}},r);return()=>J()},[i,r,$,G]),{session:o,health:w,notFound:l,loading:u,paneContent:d,paneLoading:E,metrics:b,metricsLoading:v,refetchPaneAndMetrics:N}}const YE={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 l_(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 c_(i){return new Date(i).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function XE({session:i,health:r,onApprove:a,onReject:o,onInterrupt:g,onKill:w}){const[A,l]=I.useState(!1),h=r.status==="permission_prompt"||r.status==="bash_approval";return C.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3 sm:p-4",children:[C.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[C.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[C.jsx(yl,{status:r.status}),C.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:YE[r.status]})]}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("h1",{className:"text-base sm:text-lg font-semibold text-[#e0e0e0] truncate",children:i.windowName||"Untitled Session"}),C.jsx("div",{className:"text-xs text-[#555] font-mono truncate mt-0.5",children:l_(i.workDir,40)})]}),C.jsxs("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[i.permissionMode&&i.permissionMode!=="default"&&C.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#003322] text-[#00ff88] border border-[#00ff88]/30",children:i.permissionMode}),r.alive?C.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"}):C.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#331111] text-[#ff3366] border border-[#ff3366]/30",children:"Dead"})]})]}),C.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 text-[11px] text-[#555] mb-3 flex-wrap",children:[C.jsxs("span",{children:["Created: ",c_(i.createdAt)]}),C.jsxs("span",{className:"hidden sm:inline",children:["Last activity: ",c_(i.lastActivity)]}),C.jsxs("span",{className:"font-mono hidden sm:inline",children:["ID: ",l_(i.id,16)]}),r.details&&C.jsx("span",{className:"text-[#888] italic",children:r.details})]}),C.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h&&C.jsxs(C.Fragment,{children:[C.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#00ff88] border border-[#00ff88]/30 transition-colors",children:"Approve"}),C.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ff3366] border border-[#ff3366]/30 transition-colors",children:"Reject"})]}),C.jsx("button",{onClick:g,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"}),A?C.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[C.jsx("span",{className:"text-xs text-[#ff3366]",children:"Confirm kill?"}),C.jsx("button",{onClick:()=>{w==null||w(),l(!1)},className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] text-[#ff3366] border border-[#ff3366]/30 transition-colors",children:"Yes, Kill"}),C.jsx("button",{onClick:()=>l(!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"})]}):C.jsx("button",{onClick:()=>l(!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"})]})]})}/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:Mg,setPrototypeOf:u_,isFrozen:JE,getPrototypeOf:QE,getOwnPropertyDescriptor:e3}=Object;let{freeze:Vt,seal:Di,create:el}=Object,{apply:ah,construct:oh}=typeof Reflect<"u"&&Reflect;Vt||(Vt=function(r){return r});Di||(Di=function(r){return r});ah||(ah=function(r,a){for(var o=arguments.length,g=new Array(o>2?o-2:0),w=2;w<o;w++)g[w-2]=arguments[w];return r.apply(a,g)});oh||(oh=function(r){for(var a=arguments.length,o=new Array(a>1?a-1:0),g=1;g<a;g++)o[g-1]=arguments[g];return new r(...o)});const Wo=Wt(Array.prototype.forEach),t3=Wt(Array.prototype.lastIndexOf),h_=Wt(Array.prototype.pop),ha=Wt(Array.prototype.push),i3=Wt(Array.prototype.splice),tl=Wt(String.prototype.toLowerCase),Iu=Wt(String.prototype.toString),Pu=Wt(String.prototype.match),fa=Wt(String.prototype.replace),s3=Wt(String.prototype.indexOf),r3=Wt(String.prototype.trim),mi=Wt(Object.prototype.hasOwnProperty),Gt=Wt(RegExp.prototype.test),da=n3(TypeError);function Wt(i){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var a=arguments.length,o=new Array(a>1?a-1:0),g=1;g<a;g++)o[g-1]=arguments[g];return ah(i,r,o)}}function n3(i){return function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return oh(i,a)}}function Le(i,r){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:tl;u_&&u_(i,null);let o=r.length;for(;o--;){let g=r[o];if(typeof g=="string"){const w=a(g);w!==g&&(JE(r)||(r[o]=w),g=w)}i[g]=!0}return i}function a3(i){for(let r=0;r<i.length;r++)mi(i,r)||(i[r]=null);return i}function Gi(i){const r=el(null);for(const[a,o]of Mg(i))mi(i,a)&&(Array.isArray(o)?r[a]=a3(o):o&&typeof o=="object"&&o.constructor===Object?r[a]=Gi(o):r[a]=o);return r}function ma(i,r){for(;i!==null;){const o=e3(i,r);if(o){if(o.get)return Wt(o.get);if(typeof o.value=="function")return Wt(o.value)}i=QE(i)}function a(){return null}return a}const f_=Vt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),$u=Vt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Fu=Vt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),o3=Vt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Zu=Vt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),l3=Vt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),d_=Vt(["#text"]),m_=Vt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),qu=Vt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),p_=Vt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Yo=Vt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),c3=Di(/\{\{[\w\W]*|[\w\W]*\}\}/gm),u3=Di(/<%[\w\W]*|[\w\W]*%>/gm),h3=Di(/\$\{[\w\W]*/gm),f3=Di(/^data-[\-\w.\u00B7-\uFFFF]+$/),d3=Di(/^aria-[\-\w]+$/),Lg=Di(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),m3=Di(/^(?:\w+script|data):/i),p3=Di(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ng=Di(/^html$/i),_3=Di(/^[a-z][.\w]*(-[.\w]+)+$/i);var __=Object.freeze({__proto__:null,ARIA_ATTR:d3,ATTR_WHITESPACE:p3,CUSTOM_ELEMENT:_3,DATA_ATTR:f3,DOCTYPE_NAME:Ng,ERB_EXPR:u3,IS_ALLOWED_URI:Lg,IS_SCRIPT_OR_DATA:m3,MUSTACHE_EXPR:c3,TMPLIT_EXPR:h3});const pa={element:1,text:3,progressingInstruction:7,comment:8,document:9},g3=function(){return typeof window>"u"?null:window},v3=function(r,a){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let o=null;const g="data-tt-policy-suffix";a&&a.hasAttribute(g)&&(o=a.getAttribute(g));const w="dompurify"+(o?"#"+o:"");try{return r.createPolicy(w,{createHTML(A){return A},createScriptURL(A){return A}})}catch{return console.warn("TrustedTypes policy "+w+" could not be created."),null}},g_=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function jg(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g3();const r=be=>jg(be);if(r.version="3.3.3",r.removed=[],!i||!i.document||i.document.nodeType!==pa.document||!i.Element)return r.isSupported=!1,r;let{document:a}=i;const o=a,g=o.currentScript,{DocumentFragment:w,HTMLTemplateElement:A,Node:l,Element:h,NodeFilter:u,NamedNodeMap:y=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:x,trustedTypes:E}=i,O=h.prototype,b=ma(O,"cloneNode"),p=ma(O,"remove"),v=ma(O,"nextSibling"),f=ma(O,"childNodes"),_=ma(O,"parentNode");if(typeof A=="function"){const be=a.createElement("template");be.content&&be.content.ownerDocument&&(a=be.content.ownerDocument)}let S,R="";const{implementation:k,createNodeIterator:M,createDocumentFragment:T,getElementsByTagName:N}=a,{importNode:P}=o;let F=g_();r.isSupported=typeof Mg=="function"&&typeof _=="function"&&k&&k.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:G,ERB_EXPR:$,TMPLIT_EXPR:J,DATA_ATTR:te,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:K,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:j}=__;let{IS_ALLOWED_URI:B}=__,L=null;const H=Le({},[...f_,...$u,...Fu,...Zu,...d_]);let W=null;const re=Le({},[...m_,...qu,...p_,...Yo]);let ue=Object.seal(el(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),pe=null,V=null;const U=Object.seal(el(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ce=!0,oe=!0,ve=!1,ge=!0,me=!1,Re=!0,je=!1,ut=!1,Te=!1,Ft=!1,pi=!1,_i=!1,Ii=!0,Wi=!1;const Pt="user-content-";let at=!0,Dt=!1,Zt={},Nt=null;const jt=Le({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Yi=null;const Yt=Le({},["audio","video","img","source","image","track"]);let Li=null;const We=Le({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),gi="http://www.w3.org/1998/Math/MathML",Ot="http://www.w3.org/2000/svg",Mt="http://www.w3.org/1999/xhtml";let yt=Mt,un=!1,hn=null;const Sl=Le({},[gi,Ot,Mt],Iu);let Xi=Le({},["mi","mo","mn","ms","mtext"]),Ji=Le({},["annotation-xml"]);const yr=Le({},["title","style","font","a","script"]);let ai=null;const Sr=["application/xhtml+xml","text/html"],Qs="text/html";let _t=null,Qi=null;const fn=a.createElement("form"),xs=function(Y){return Y instanceof RegExp||Y instanceof Function},dn=function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Qi&&Qi===Y)){if((!Y||typeof Y!="object")&&(Y={}),Y=Gi(Y),ai=Sr.indexOf(Y.PARSER_MEDIA_TYPE)===-1?Qs:Y.PARSER_MEDIA_TYPE,_t=ai==="application/xhtml+xml"?Iu:tl,L=mi(Y,"ALLOWED_TAGS")?Le({},Y.ALLOWED_TAGS,_t):H,W=mi(Y,"ALLOWED_ATTR")?Le({},Y.ALLOWED_ATTR,_t):re,hn=mi(Y,"ALLOWED_NAMESPACES")?Le({},Y.ALLOWED_NAMESPACES,Iu):Sl,Li=mi(Y,"ADD_URI_SAFE_ATTR")?Le(Gi(We),Y.ADD_URI_SAFE_ATTR,_t):We,Yi=mi(Y,"ADD_DATA_URI_TAGS")?Le(Gi(Yt),Y.ADD_DATA_URI_TAGS,_t):Yt,Nt=mi(Y,"FORBID_CONTENTS")?Le({},Y.FORBID_CONTENTS,_t):jt,pe=mi(Y,"FORBID_TAGS")?Le({},Y.FORBID_TAGS,_t):Gi({}),V=mi(Y,"FORBID_ATTR")?Le({},Y.FORBID_ATTR,_t):Gi({}),Zt=mi(Y,"USE_PROFILES")?Y.USE_PROFILES:!1,ce=Y.ALLOW_ARIA_ATTR!==!1,oe=Y.ALLOW_DATA_ATTR!==!1,ve=Y.ALLOW_UNKNOWN_PROTOCOLS||!1,ge=Y.ALLOW_SELF_CLOSE_IN_ATTR!==!1,me=Y.SAFE_FOR_TEMPLATES||!1,Re=Y.SAFE_FOR_XML!==!1,je=Y.WHOLE_DOCUMENT||!1,Ft=Y.RETURN_DOM||!1,pi=Y.RETURN_DOM_FRAGMENT||!1,_i=Y.RETURN_TRUSTED_TYPE||!1,Te=Y.FORCE_BODY||!1,Ii=Y.SANITIZE_DOM!==!1,Wi=Y.SANITIZE_NAMED_PROPS||!1,at=Y.KEEP_CONTENT!==!1,Dt=Y.IN_PLACE||!1,B=Y.ALLOWED_URI_REGEXP||Lg,yt=Y.NAMESPACE||Mt,Xi=Y.MATHML_TEXT_INTEGRATION_POINTS||Xi,Ji=Y.HTML_INTEGRATION_POINTS||Ji,ue=Y.CUSTOM_ELEMENT_HANDLING||{},Y.CUSTOM_ELEMENT_HANDLING&&xs(Y.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ue.tagNameCheck=Y.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Y.CUSTOM_ELEMENT_HANDLING&&xs(Y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ue.attributeNameCheck=Y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Y.CUSTOM_ELEMENT_HANDLING&&typeof Y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ue.allowCustomizedBuiltInElements=Y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),me&&(oe=!1),pi&&(Ft=!0),Zt&&(L=Le({},d_),W=el(null),Zt.html===!0&&(Le(L,f_),Le(W,m_)),Zt.svg===!0&&(Le(L,$u),Le(W,qu),Le(W,Yo)),Zt.svgFilters===!0&&(Le(L,Fu),Le(W,qu),Le(W,Yo)),Zt.mathMl===!0&&(Le(L,Zu),Le(W,p_),Le(W,Yo))),mi(Y,"ADD_TAGS")||(U.tagCheck=null),mi(Y,"ADD_ATTR")||(U.attributeCheck=null),Y.ADD_TAGS&&(typeof Y.ADD_TAGS=="function"?U.tagCheck=Y.ADD_TAGS:(L===H&&(L=Gi(L)),Le(L,Y.ADD_TAGS,_t))),Y.ADD_ATTR&&(typeof Y.ADD_ATTR=="function"?U.attributeCheck=Y.ADD_ATTR:(W===re&&(W=Gi(W)),Le(W,Y.ADD_ATTR,_t))),Y.ADD_URI_SAFE_ATTR&&Le(Li,Y.ADD_URI_SAFE_ATTR,_t),Y.FORBID_CONTENTS&&(Nt===jt&&(Nt=Gi(Nt)),Le(Nt,Y.FORBID_CONTENTS,_t)),Y.ADD_FORBID_CONTENTS&&(Nt===jt&&(Nt=Gi(Nt)),Le(Nt,Y.ADD_FORBID_CONTENTS,_t)),at&&(L["#text"]=!0),je&&Le(L,["html","head","body"]),L.table&&(Le(L,["tbody"]),delete pe.tbody),Y.TRUSTED_TYPES_POLICY){if(typeof Y.TRUSTED_TYPES_POLICY.createHTML!="function")throw da('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Y.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw da('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=Y.TRUSTED_TYPES_POLICY,R=S.createHTML("")}else S===void 0&&(S=v3(E,g)),S!==null&&typeof R=="string"&&(R=S.createHTML(""));Vt&&Vt(Y),Qi=Y}},mn=Le({},[...$u,...Fu,...o3]),pn=Le({},[...Zu,...l3]),Aa=function(Y){let _e=_(Y);(!_e||!_e.tagName)&&(_e={namespaceURI:yt,tagName:"template"});const ye=tl(Y.tagName),qe=tl(_e.tagName);return hn[Y.namespaceURI]?Y.namespaceURI===Ot?_e.namespaceURI===Mt?ye==="svg":_e.namespaceURI===gi?ye==="svg"&&(qe==="annotation-xml"||Xi[qe]):!!mn[ye]:Y.namespaceURI===gi?_e.namespaceURI===Mt?ye==="math":_e.namespaceURI===Ot?ye==="math"&&Ji[qe]:!!pn[ye]:Y.namespaceURI===Mt?_e.namespaceURI===Ot&&!Ji[qe]||_e.namespaceURI===gi&&!Xi[qe]?!1:!pn[ye]&&(yr[ye]||!mn[ye]):!!(ai==="application/xhtml+xml"&&hn[Y.namespaceURI]):!1},Xt=function(Y){ha(r.removed,{element:Y});try{_(Y).removeChild(Y)}catch{p(Y)}},Ni=function(Y,_e){try{ha(r.removed,{attribute:_e.getAttributeNode(Y),from:_e})}catch{ha(r.removed,{attribute:null,from:_e})}if(_e.removeAttribute(Y),Y==="is")if(Ft||pi)try{Xt(_e)}catch{}else try{_e.setAttribute(Y,"")}catch{}},_n=function(Y){let _e=null,ye=null;if(Te)Y="<remove></remove>"+Y;else{const Me=Pu(Y,/^[\r\n\t ]+/);ye=Me&&Me[0]}ai==="application/xhtml+xml"&&yt===Mt&&(Y='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Y+"</body></html>");const qe=S?S.createHTML(Y):Y;if(yt===Mt)try{_e=new x().parseFromString(qe,ai)}catch{}if(!_e||!_e.documentElement){_e=k.createDocument(yt,"template",null);try{_e.documentElement.innerHTML=un?R:qe}catch{}}const ot=_e.body||_e.documentElement;return Y&&ye&&ot.insertBefore(a.createTextNode(ye),ot.childNodes[0]||null),yt===Mt?N.call(_e,je?"html":"body")[0]:je?_e.documentElement:ot},gn=function(Y){return M.call(Y.ownerDocument||Y,Y,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},vi=function(Y){return Y instanceof d&&(typeof Y.nodeName!="string"||typeof Y.textContent!="string"||typeof Y.removeChild!="function"||!(Y.attributes instanceof y)||typeof Y.removeAttribute!="function"||typeof Y.setAttribute!="function"||typeof Y.namespaceURI!="string"||typeof Y.insertBefore!="function"||typeof Y.hasChildNodes!="function")},St=function(Y){return typeof l=="function"&&Y instanceof l};function st(be,Y,_e){Wo(be,ye=>{ye.call(r,Y,_e,Qi)})}const es=function(Y){let _e=null;if(st(F.beforeSanitizeElements,Y,null),vi(Y))return Xt(Y),!0;const ye=_t(Y.nodeName);if(st(F.uponSanitizeElement,Y,{tagName:ye,allowedTags:L}),Re&&Y.hasChildNodes()&&!St(Y.firstElementChild)&&Gt(/<[/\w!]/g,Y.innerHTML)&&Gt(/<[/\w!]/g,Y.textContent)||Y.nodeType===pa.progressingInstruction||Re&&Y.nodeType===pa.comment&&Gt(/<[/\w]/g,Y.data))return Xt(Y),!0;if(!(U.tagCheck instanceof Function&&U.tagCheck(ye))&&(!L[ye]||pe[ye])){if(!pe[ye]&&Ra(ye)&&(ue.tagNameCheck instanceof RegExp&&Gt(ue.tagNameCheck,ye)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(ye)))return!1;if(at&&!Nt[ye]){const qe=_(Y)||Y.parentNode,ot=f(Y)||Y.childNodes;if(ot&&qe){const Me=ot.length;for(let Bt=Me-1;Bt>=0;--Bt){const yi=b(ot[Bt],!0);yi.__removalCount=(Y.__removalCount||0)+1,qe.insertBefore(yi,v(Y))}}}return Xt(Y),!0}return Y instanceof h&&!Aa(Y)||(ye==="noscript"||ye==="noembed"||ye==="noframes")&&Gt(/<\/no(script|embed|frames)/i,Y.innerHTML)?(Xt(Y),!0):(me&&Y.nodeType===pa.text&&(_e=Y.textContent,Wo([G,$,J],qe=>{_e=fa(_e,qe," ")}),Y.textContent!==_e&&(ha(r.removed,{element:Y.cloneNode()}),Y.textContent=_e)),st(F.afterSanitizeElements,Y,null),!1)},br=function(Y,_e,ye){if(V[_e]||Ii&&(_e==="id"||_e==="name")&&(ye in a||ye in fn))return!1;if(!(oe&&!V[_e]&&Gt(te,_e))){if(!(ce&&Gt(q,_e))){if(!(U.attributeCheck instanceof Function&&U.attributeCheck(_e,Y))){if(!W[_e]||V[_e]){if(!(Ra(Y)&&(ue.tagNameCheck instanceof RegExp&&Gt(ue.tagNameCheck,Y)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(Y))&&(ue.attributeNameCheck instanceof RegExp&&Gt(ue.attributeNameCheck,_e)||ue.attributeNameCheck instanceof Function&&ue.attributeNameCheck(_e,Y))||_e==="is"&&ue.allowCustomizedBuiltInElements&&(ue.tagNameCheck instanceof RegExp&&Gt(ue.tagNameCheck,ye)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(ye))))return!1}else if(!Li[_e]){if(!Gt(B,fa(ye,ee,""))){if(!((_e==="src"||_e==="xlink:href"||_e==="href")&&Y!=="script"&&s3(ye,"data:")===0&&Yi[Y])){if(!(ve&&!Gt(K,fa(ye,ee,"")))){if(ye)return!1}}}}}}}return!0},Ra=function(Y){return Y!=="annotation-xml"&&Pu(Y,j)},ka=function(Y){st(F.beforeSanitizeAttributes,Y,null);const{attributes:_e}=Y;if(!_e||vi(Y))return;const ye={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:W,forceKeepAttr:void 0};let qe=_e.length;for(;qe--;){const ot=_e[qe],{name:Me,namespaceURI:Bt,value:yi}=ot,Jt=_t(Me),Pi=yi;let Rt=Me==="value"?Pi:r3(Pi);if(ye.attrName=Jt,ye.attrValue=Rt,ye.keepAttr=!0,ye.forceKeepAttr=void 0,st(F.uponSanitizeAttribute,Y,ye),Rt=ye.attrValue,Wi&&(Jt==="id"||Jt==="name")&&(Ni(Me,Y),Rt=Pt+Rt),Re&&Gt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Rt)){Ni(Me,Y);continue}if(Jt==="attributename"&&Pu(Rt,"href")){Ni(Me,Y);continue}if(ye.forceKeepAttr)continue;if(!ye.keepAttr){Ni(Me,Y);continue}if(!ge&&Gt(/\/>/i,Rt)){Ni(Me,Y);continue}me&&Wo([G,$,J],yn=>{Rt=fa(Rt,yn," ")});const vn=_t(Y.nodeName);if(!br(vn,Jt,Rt)){Ni(Me,Y);continue}if(S&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!Bt)switch(E.getAttributeType(vn,Jt)){case"TrustedHTML":{Rt=S.createHTML(Rt);break}case"TrustedScriptURL":{Rt=S.createScriptURL(Rt);break}}if(Rt!==Pi)try{Bt?Y.setAttributeNS(Bt,Me,Rt):Y.setAttribute(Me,Rt),vi(Y)?Xt(Y):h_(r.removed)}catch{Ni(Me,Y)}}st(F.afterSanitizeAttributes,Y,null)},Da=function be(Y){let _e=null;const ye=gn(Y);for(st(F.beforeSanitizeShadowDOM,Y,null);_e=ye.nextNode();)st(F.uponSanitizeShadowNode,_e,null),es(_e),ka(_e),_e.content instanceof w&&be(_e.content);st(F.afterSanitizeShadowDOM,Y,null)};return r.sanitize=function(be){let Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_e=null,ye=null,qe=null,ot=null;if(un=!be,un&&(be="<!-->"),typeof be!="string"&&!St(be))if(typeof be.toString=="function"){if(be=be.toString(),typeof be!="string")throw da("dirty is not a string, aborting")}else throw da("toString is not a function");if(!r.isSupported)return be;if(ut||dn(Y),r.removed=[],typeof be=="string"&&(Dt=!1),Dt){if(be.nodeName){const yi=_t(be.nodeName);if(!L[yi]||pe[yi])throw da("root node is forbidden and cannot be sanitized in-place")}}else if(be instanceof l)_e=_n("<!---->"),ye=_e.ownerDocument.importNode(be,!0),ye.nodeType===pa.element&&ye.nodeName==="BODY"||ye.nodeName==="HTML"?_e=ye:_e.appendChild(ye);else{if(!Ft&&!me&&!je&&be.indexOf("<")===-1)return S&&_i?S.createHTML(be):be;if(_e=_n(be),!_e)return Ft?null:_i?R:""}_e&&Te&&Xt(_e.firstChild);const Me=gn(Dt?be:_e);for(;qe=Me.nextNode();)es(qe),ka(qe),qe.content instanceof w&&Da(qe.content);if(Dt)return be;if(Ft){if(pi)for(ot=T.call(_e.ownerDocument);_e.firstChild;)ot.appendChild(_e.firstChild);else ot=_e;return(W.shadowroot||W.shadowrootmode)&&(ot=P.call(o,ot,!0)),ot}let Bt=je?_e.outerHTML:_e.innerHTML;return je&&L["!doctype"]&&_e.ownerDocument&&_e.ownerDocument.doctype&&_e.ownerDocument.doctype.name&&Gt(Ng,_e.ownerDocument.doctype.name)&&(Bt="<!DOCTYPE "+_e.ownerDocument.doctype.name+`>
|
|
294
|
+
`+Bt),me&&Wo([G,$,J],yi=>{Bt=fa(Bt,yi," ")}),S&&_i?S.createHTML(Bt):Bt},r.setConfig=function(){let be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dn(be),ut=!0},r.clearConfig=function(){Qi=null,ut=!1},r.isValidAttribute=function(be,Y,_e){Qi||dn({});const ye=_t(be),qe=_t(Y);return br(ye,qe,_e)},r.addHook=function(be,Y){typeof Y=="function"&&ha(F[be],Y)},r.removeHook=function(be,Y){if(Y!==void 0){const _e=t3(F[be],Y);return _e===-1?void 0:i3(F[be],_e,1)[0]}return h_(F[be])},r.removeHooks=function(be){F[be]=[]},r.removeAllHooks=function(){F=g_()},r}var y3=jg();function Ta(i){return y3.sanitize(i,{ALLOWED_TAGS:[]})}const S3={Read:"📖",Edit:"✏️",Write:"📝",Bash:"💻",Search:"🔍"};function b3(i){return i?S3[i]??"❓":"❓"}function x3(i){if(!i)return"";try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function Gu({entry:i}){const r=i.role==="user";return C.jsx("div",{className:`flex ${r?"justify-end":"justify-start"} mb-3`,children:C.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2.5 text-sm leading-relaxed ${r?"bg-[#1a1a3e] text-[#e0e0e0] rounded-br-sm":"bg-[#111118] text-[#e0e0e0] rounded-bl-sm border border-[#1a1a2e]"}`,children:[C.jsx("div",{className:"whitespace-pre-wrap break-words",children:Ta(i.text)}),i.timestamp&&C.jsx("div",{className:`text-[10px] mt-1 ${r?"text-[#555]":"text-[#444]"}`,children:x3(i.timestamp)})]})})}function C3({entry:i}){const[r,a]=I.useState(!1);return C.jsx("div",{className:"flex justify-start mb-3",children:C.jsxs("div",{className:"max-w-[80%] w-full",children:[C.jsxs("button",{onClick:()=>a(o=>!o),className:"flex items-center gap-2 text-xs text-[#555] hover:text-[#777] transition-colors py-1 group",children:[C.jsx("span",{className:"inline-block transition-transform duration-200",style:{transform:r?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),C.jsx("span",{className:"italic",children:"Thinking…"})]}),r&&C.jsx("div",{className:"bg-[#0d0d12] border border-[#1a1a2e] rounded-lg px-4 py-3 mt-1 text-sm text-[#555] italic leading-relaxed whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:Ta(i.text)})]})})}function w3({entry:i}){const r=Ta(i.text),a=r.length>100?r.slice(0,100)+"…":r;return C.jsx("div",{className:"flex justify-start mb-3",children:C.jsxs("div",{className:"max-w-[80%] w-full bg-[#0d0d12] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[C.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-[#1a1a2e]",children:[C.jsx("span",{className:"text-base",children:b3(i.toolName)}),C.jsx("span",{className:"text-xs font-semibold text-[#00e5ff] font-mono",children:i.toolName??"Tool"}),C.jsx("span",{className:"text-[10px] text-[#555] ml-auto",children:"tool_use"})]}),C.jsx("div",{className:"px-3 py-2 text-xs text-[#888] font-mono whitespace-pre-wrap break-all max-h-32 overflow-y-auto",children:a})]})})}function E3({entry:i}){const r=/^\s*error(?:\s*[:\-]|\s*$)/i.test(i.text)||/^\s*(?:failed|exception)(?:\s*[:\-]|\s*$)/i.test(i.text);return C.jsx("div",{className:"flex justify-start mb-3",children:C.jsxs("div",{className:`max-w-[80%] w-full bg-[#0d0d12] rounded-lg overflow-hidden ${r?"border border-[#ff3366]/40":"border border-[#00ff88]/30"}`,children:[C.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-[#1a1a2e]",children:[C.jsx("span",{className:"text-xs font-semibold text-[#888]",children:r?"✗ Result":"✓ Result"}),i.toolName&&C.jsx("span",{className:"text-[10px] text-[#555] font-mono",children:i.toolName})]}),C.jsx("div",{className:"px-3 py-2 text-xs text-[#666] font-mono whitespace-pre-wrap break-all max-h-32 overflow-y-auto",children:Ta(i.text)||"(empty)"})]})})}function T3({entry:i}){if(i.role==="user")return C.jsx(Gu,{entry:i});switch(i.contentType){case"text":return C.jsx(Gu,{entry:i});case"thinking":return C.jsx(C3,{entry:i});case"tool_use":return C.jsx(w3,{entry:i});case"tool_result":return C.jsx(E3,{entry:i});case"permission_request":return C.jsxs("div",{className:"text-red-400 text-sm font-semibold px-3 py-2",children:["Permission Request: ",Ta(i.text)]});default:return C.jsx(Gu,{entry:i})}}const Xo=1e3;function Ku(i){return`${i.timestamp??""}:${i.role}:${i.contentType}:${i.text.length}:${i.text.slice(0,80)}`}function A3({sessionId:i}){const[r,a]=I.useState([]),[o,g]=I.useState(!0),[w,A]=I.useState(null),l=dt(S=>S.token),[h,u]=I.useState({thinking:!1,tool_use:!0,tool_result:!0}),[y,d]=I.useState(!1),x=I.useRef(null),E=I.useRef(null),O=I.useRef(!1),b=I.useRef(new Set);I.useEffect(()=>{let S=!1;return eE(i).then(R=>{if(!S){const k=R.messages??[],M=k.length>Xo?k.slice(k.length-Xo):k;a(M),b.current=new Set(M.map(Ku))}}).catch(R=>{S||A(R instanceof Error?R.message:"Failed to load")}).finally(()=>{S||g(!1)}),()=>{S=!0}},[i]),I.useEffect(()=>{const S=Rg(i,R=>{try{const k=JSON.parse(R.data);if(k.event!=="message")return;const M=k.data;a(T=>{const N=Ku(M);if(b.current.has(N))return T;b.current.add(N);const P=[...T,M];if(P.length>Xo){const F=P.length-Xo,G=P.slice(F);for(let $=0;$<F;$++)b.current.delete(Ku(P[$]));return G}return P})}catch{}},l);return()=>S()},[i,l]),I.useEffect(()=>{var S;O.current||(S=x.current)==null||S.scrollIntoView({behavior:"smooth"})},[r]);const p=I.useCallback(()=>{const S=E.current;if(!S)return;const R=S.scrollHeight-S.scrollTop-S.clientHeight<60;O.current=!R,d(!R)},[]),v=I.useCallback(()=>{var S;O.current=!1,(S=x.current)==null||S.scrollIntoView({behavior:"smooth"})},[]),f=I.useCallback(S=>{u(R=>({...R,[S]:!R[S]}))},[]),_=I.useMemo(()=>r.filter(S=>S.role==="user"?!0:!(S.contentType==="thinking"&&!h.thinking||S.contentType==="tool_use"&&!h.tool_use||S.contentType==="tool_result"&&!h.tool_result)),[r,h]);return o?C.jsx("div",{className:"flex items-center justify-center h-full text-[#555] text-sm",children:C.jsx("div",{className:"animate-pulse",children:"Loading transcript…"})}):w?C.jsxs("div",{className:"flex items-center justify-center h-full text-[#ff3366] text-sm",children:["⚠ ",w]}):C.jsxs("div",{className:"flex flex-col h-full relative",children:[C.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-[#1a1a2e] bg-[#0a0a0f] shrink-0",children:[C.jsx("span",{className:"text-[10px] text-[#555] uppercase tracking-wider",children:"Filter:"}),["thinking","tool_use","tool_result"].map(S=>C.jsx("button",{onClick:()=>f(S),"aria-pressed":h[S],className:`text-xs px-2 py-0.5 rounded border transition-colors ${h[S]?"border-[#00e5ff]/40 text-[#00e5ff] bg-[#00e5ff]/10":"border-[#1a1a2e] text-[#555] hover:text-[#888]"}`,children:S==="tool_use"?"Tools":S==="tool_result"?"Results":S},S)),C.jsxs("span",{className:"text-[10px] text-[#444] ml-auto",children:[_.length," / ",r.length]})]}),C.jsxs("div",{ref:E,onScroll:p,className:"flex-1 overflow-y-auto px-4 py-3",children:[_.length===0&&C.jsx("div",{className:"flex items-center justify-center h-full text-[#555] text-sm",children:"No messages yet"}),_.map((S,R)=>C.jsx(T3,{entry:S},S.toolUseId??`${S.role}-${S.timestamp??R}`)),C.jsx("div",{ref:x})]}),y&&C.jsx("button",{onClick:v,className:"absolute bottom-4 right-4 bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#00e5ff] rounded-full w-10 h-10 flex items-center justify-center shadow-lg border border-[#1a1a2e] transition-colors z-10",title:"Scroll to bottom",children:"↓"})]})}var Vu={exports:{}},v_;function R3(){return v_||(v_=1,(function(i,r){(function(a,o){i.exports=o()})(globalThis,(()=>(()=>{var a={4567:function(A,l,h){var u=this&&this.__decorate||function(f,_,S,R){var k,M=arguments.length,T=M<3?_:R===null?R=Object.getOwnPropertyDescriptor(_,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(f,_,S,R);else for(var N=f.length-1;N>=0;N--)(k=f[N])&&(T=(M<3?k(T):M>3?k(_,S,T):k(_,S))||T);return M>3&&T&&Object.defineProperty(_,S,T),T},y=this&&this.__param||function(f,_){return function(S,R){_(S,R,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const d=h(9042),x=h(9924),E=h(844),O=h(4725),b=h(2585),p=h(3656);let v=l.AccessibilityManager=class extends E.Disposable{constructor(f,_,S,R){super(),this._terminal=f,this._coreBrowserService=S,this._renderService=R,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 k=0;k<this._terminal.rows;k++)this._rowElements[k]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[k]);if(this._topBoundaryFocusListener=k=>this._handleBoundaryFocus(k,0),this._bottomBoundaryFocusListener=k=>this._handleBoundaryFocus(k,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 x.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((k=>this._handleResize(k.rows)))),this.register(this._terminal.onRender((k=>this._refreshRows(k.start,k.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((k=>this._handleChar(k)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
295
|
+
`)))),this.register(this._terminal.onA11yTab((k=>this._handleTab(k)))),this.register(this._terminal.onKey((k=>this._handleKey(k.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,p.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(f){for(let _=0;_<f;_++)this._handleChar(" ")}_handleChar(f){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==f&&(this._charsToAnnounce+=f):this._charsToAnnounce+=f,f===`
|
|
296
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(f){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(f)||this._charsToConsume.push(f)}_refreshRows(f,_){this._liveRegionDebouncer.refresh(f,_,this._terminal.rows)}_renderRows(f,_){const S=this._terminal.buffer,R=S.lines.length.toString();for(let k=f;k<=_;k++){const M=S.lines.get(S.ydisp+k),T=[],N=(M==null?void 0:M.translateToString(!0,void 0,void 0,T))||"",P=(S.ydisp+k+1).toString(),F=this._rowElements[k];F&&(N.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=N,this._rowColumns.set(F,T)),F.setAttribute("aria-posinset",P),F.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(f,_){const S=f.target,R=this._rowElements[_===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(_===0?"1":`${this._terminal.buffer.lines.length}`)||f.relatedTarget!==R)return;let k,M;if(_===0?(k=S,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(k=this._rowElements.shift(),M=S,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),M.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(),f.preventDefault(),f.stopImmediatePropagation()}_handleSelectionChange(){var N;if(this._rowElements.length===0)return;const f=document.getSelection();if(!f)return;if(f.isCollapsed)return void(this._rowContainer.contains(f.anchorNode)&&this._terminal.clearSelection());if(!f.anchorNode||!f.focusNode)return void console.error("anchorNode and/or focusNode are null");let _={node:f.anchorNode,offset:f.anchorOffset},S={node:f.focusNode,offset:f.focusOffset};if((_.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||_.node===S.node&&_.offset>S.offset)&&([_,S]=[S,_]),_.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 R=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:R,offset:((N=R.textContent)==null?void 0:N.length)??0}),!this._rowContainer.contains(S.node))return;const k=({node:P,offset:F})=>{const G=P instanceof Text?P.parentNode:P;let $=parseInt(G==null?void 0:G.getAttribute("aria-posinset"),10)-1;if(isNaN($))return console.warn("row is invalid. Race condition?"),null;const J=this._rowColumns.get(G);if(!J)return console.warn("columns is null. Race condition?"),null;let te=F<J.length?J[F]:J.slice(-1)[0]+1;return te>=this._terminal.cols&&(++$,te=0),{row:$,column:te}},M=k(_),T=k(S);if(M&&T){if(M.row>T.row||M.row===T.row&&M.column>=T.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(T.row-M.row)*this._terminal.cols-M.column+T.column)}}_handleResize(f){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>f;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const f=this._coreBrowserService.mainDocument.createElement("div");return f.setAttribute("role","listitem"),f.tabIndex=-1,this._refreshRowDimensions(f),f}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let f=0;f<this._terminal.rows;f++)this._refreshRowDimensions(this._rowElements[f])}}_refreshRowDimensions(f){f.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=v=u([y(1,b.IInstantiationService),y(2,O.ICoreBrowserService),y(3,O.IRenderService)],v)},3614:(A,l)=>{function h(x){return x.replace(/\r?\n/g,"\r")}function u(x,E){return E?"\x1B[200~"+x+"\x1B[201~":x}function y(x,E,O,b){x=u(x=h(x),O.decPrivateModes.bracketedPasteMode&&b.rawOptions.ignoreBracketedPasteMode!==!0),O.triggerDataEvent(x,!0),E.value=""}function d(x,E,O){const b=O.getBoundingClientRect(),p=x.clientX-b.left-10,v=x.clientY-b.top-10;E.style.width="20px",E.style.height="20px",E.style.left=`${p}px`,E.style.top=`${v}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=h,l.bracketTextForPaste=u,l.copyHandler=function(x,E){x.clipboardData&&x.clipboardData.setData("text/plain",E.selectionText),x.preventDefault()},l.handlePasteEvent=function(x,E,O,b){x.stopPropagation(),x.clipboardData&&y(x.clipboardData.getData("text/plain"),E,O,b)},l.paste=y,l.moveTextAreaUnderMouseCursor=d,l.rightClickHandler=function(x,E,O,b,p){d(x,E,O),p&&b.rightClickSelect(x),E.value=b.selectionText,E.select()}},7239:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const u=h(1505);l.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(y,d,x){this._css.set(y,d,x)}getCss(y,d){return this._css.get(y,d)}setColor(y,d,x){this._color.set(y,d,x)}getColor(y,d){return this._color.get(y,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(h,u,y,d){h.addEventListener(u,y,d);let x=!1;return{dispose:()=>{x||(x=!0,h.removeEventListener(u,y,d))}}}},3551:function(A,l,h){var u=this&&this.__decorate||function(v,f,_,S){var R,k=arguments.length,M=k<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,f,_,S);else for(var T=v.length-1;T>=0;T--)(R=v[T])&&(M=(k<3?R(M):k>3?R(f,_,M):R(f,_))||M);return k>3&&M&&Object.defineProperty(f,_,M),M},y=this&&this.__param||function(v,f){return function(_,S){f(_,S,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const d=h(3656),x=h(8460),E=h(844),O=h(2585),b=h(4725);let p=l.Linkifier=class extends E.Disposable{get currentLink(){return this._currentLink}constructor(v,f,_,S,R){super(),this._element=v,this._mouseService=f,this._renderService=_,this._bufferService=S,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new x.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new x.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,E.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,E.toDisposable)((()=>{var k;this._lastMouseEvent=void 0,(k=this._activeProviderReplies)==null||k.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(v){this._lastMouseEvent=v;const f=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const _=v.composedPath();for(let S=0;S<_.length;S++){const R=_[S];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_handleHover(v){if(this._activeLine!==v.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(v,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,v)||(this._clearCurrentLink(),this._askForLink(v,!0))}_askForLink(v,f){var S,R;this._activeProviderReplies&&f||((S=this._activeProviderReplies)==null||S.forEach((k=>{k==null||k.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let _=!1;for(const[k,M]of this._linkProviderService.linkProviders.entries())f?(R=this._activeProviderReplies)!=null&&R.get(k)&&(_=this._checkLinkProviderResult(k,v,_)):M.provideLinks(v.y,(T=>{var P,F;if(this._isMouseOut)return;const N=T==null?void 0:T.map((G=>({link:G})));(P=this._activeProviderReplies)==null||P.set(k,N),_=this._checkLinkProviderResult(k,v,_),((F=this._activeProviderReplies)==null?void 0:F.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,f){const _=new Set;for(let S=0;S<f.size;S++){const R=f.get(S);if(R)for(let k=0;k<R.length;k++){const M=R[k],T=M.link.range.start.y<v?0:M.link.range.start.x,N=M.link.range.end.y>v?this._bufferService.cols:M.link.range.end.x;for(let P=T;P<=N;P++){if(_.has(P)){R.splice(k--,1);break}_.add(P)}}}}_checkLinkProviderResult(v,f,_){var k;if(!this._activeProviderReplies)return _;const S=this._activeProviderReplies.get(v);let R=!1;for(let M=0;M<v;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(R=!0);if(!R&&S){const M=S.find((T=>this._linkAtPosition(T.link,f)));M&&(_=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!_)for(let M=0;M<this._activeProviderReplies.size;M++){const T=(k=this._activeProviderReplies.get(M))==null?void 0:k.find((N=>this._linkAtPosition(N.link,f)));if(T){_=!0,this._handleNewLink(T);break}}return _}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const f=this._positionFromMouseEvent(v,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,f){this._currentLink&&this._lastMouseEvent&&(!v||!f||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,E.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(v.link,f)&&(this._currentLink=v,this._currentLink.state={decorations:{underline:v.link.decorations===void 0||v.link.decorations.underline,pointerCursor:v.link.decorations===void 0||v.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,v.link,this._lastMouseEvent),v.link.decorations={},Object.defineProperties(v.link.decorations,{pointerCursor:{get:()=>{var _,S;return(S=(_=this._currentLink)==null?void 0:_.state)==null?void 0:S.decorations.pointerCursor},set:_=>{var S;(S=this._currentLink)!=null&&S.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 _,S;return(S=(_=this._currentLink)==null?void 0:_.state)==null?void 0:S.decorations.underline},set:_=>{var S,R,k;(S=this._currentLink)!=null&&S.state&&((k=(R=this._currentLink)==null?void 0:R.state)==null?void 0:k.decorations.underline)!==_&&(this._currentLink.state.decorations.underline=_,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.link,_))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((_=>{if(!this._currentLink)return;const S=_.start===0?0:_.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+_.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(S,R),this._lastMouseEvent)){const k=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);k&&this._askForLink(k,!1)}}))))}_linkHover(v,f,_){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(_,f.text)}_fireUnderlineEvent(v,f){const _=v.range,S=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(_.start.x-1,_.start.y-S-1,_.end.x,_.end.y-S-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(v,f,_){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(_,f.text)}_linkAtPosition(v,f){const _=v.range.start.y*this._bufferService.cols+v.range.start.x,S=v.range.end.y*this._bufferService.cols+v.range.end.x,R=f.y*this._bufferService.cols+f.x;return _<=R&&R<=S}_positionFromMouseEvent(v,f,_){const S=_.getCoords(v,f,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,f,_,S,R){return{x1:v,y1:f,x2:_,y2:S,cols:this._bufferService.cols,fg:R}}};l.Linkifier=p=u([y(1,b.IMouseService),y(2,b.IRenderService),y(3,O.IBufferService),y(4,b.ILinkProviderService)],p)},9042:(A,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(A,l,h){var u=this&&this.__decorate||function(b,p,v,f){var _,S=arguments.length,R=S<3?p:f===null?f=Object.getOwnPropertyDescriptor(p,v):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,p,v,f);else for(var k=b.length-1;k>=0;k--)(_=b[k])&&(R=(S<3?_(R):S>3?_(p,v,R):_(p,v))||R);return S>3&&R&&Object.defineProperty(p,v,R),R},y=this&&this.__param||function(b,p){return function(v,f){p(v,f,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const d=h(511),x=h(2585);let E=l.OscLinkProvider=class{constructor(b,p,v){this._bufferService=b,this._optionsService=p,this._oscLinkService=v}provideLinks(b,p){var N;const v=this._bufferService.buffer.lines.get(b-1);if(!v)return void p(void 0);const f=[],_=this._optionsService.rawOptions.linkHandler,S=new d.CellData,R=v.getTrimmedLength();let k=-1,M=-1,T=!1;for(let P=0;P<R;P++)if(M!==-1||v.hasContent(P)){if(v.loadCell(P,S),S.hasExtendedAttrs()&&S.extended.urlId){if(M===-1){M=P,k=S.extended.urlId;continue}T=S.extended.urlId!==k}else M!==-1&&(T=!0);if(T||M!==-1&&P===R-1){const F=(N=this._oscLinkService.getLinkData(k))==null?void 0:N.uri;if(F){const G={start:{x:M+1,y:b},end:{x:P+(T||P!==R-1?0:1),y:b}};let $=!1;if(!(_!=null&&_.allowNonHttpProtocols))try{const J=new URL(F);["http:","https:"].includes(J.protocol)||($=!0)}catch{$=!0}$||f.push({text:F,range:G,activate:(J,te)=>_?_.activate(J,te,G):O(0,te),hover:(J,te)=>{var q;return(q=_==null?void 0:_.hover)==null?void 0:q.call(_,J,te,G)},leave:(J,te)=>{var q;return(q=_==null?void 0:_.leave)==null?void 0:q.call(_,J,te,G)}})}T=!1,S.hasExtendedAttrs()&&S.extended.urlId?(M=P,k=S.extended.urlId):(M=-1,k=-1)}}p(f)}};function O(b,p){if(confirm(`Do you want to navigate to ${p}?
|
|
297
|
+
|
|
298
|
+
WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=E=u([y(0,x.IBufferService),y(1,x.IOptionsService),y(2,x.IOscLinkService)],E)},6193:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(h,u){this._renderCallback=h,this._coreBrowserService=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(h){return this._refreshCallbacks.push(h),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(h,u,y){this._rowCount=y,h=h!==void 0?h:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,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 h=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const h of this._refreshCallbacks)h(0);this._refreshCallbacks=[]}}},3236:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const u=h(3614),y=h(3656),d=h(3551),x=h(9042),E=h(3730),O=h(1680),b=h(3107),p=h(5744),v=h(2950),f=h(1296),_=h(428),S=h(4269),R=h(5114),k=h(8934),M=h(3230),T=h(9312),N=h(4725),P=h(6731),F=h(8055),G=h(8969),$=h(8460),J=h(844),te=h(6114),q=h(8437),K=h(2584),ee=h(7399),j=h(5941),B=h(9074),L=h(2585),H=h(5435),W=h(4567),re=h(779);class ue extends G.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(V={}){super(V),this.browser=te,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new J.MutableDisposable),this._onCursorMove=this.register(new $.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new $.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new $.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new $.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new $.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new $.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new $.EventEmitter),this._onBlur=this.register(new $.EventEmitter),this._onA11yCharEmitter=this.register(new $.EventEmitter),this._onA11yTabEmitter=this.register(new $.EventEmitter),this._onWillOpen=this.register(new $.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(N.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(E.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((U,ce)=>this.refresh(U,ce)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((U=>this._reportWindowsOptions(U)))),this.register(this._inputHandler.onColor((U=>this._handleColorEvent(U)))),this.register((0,$.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,$.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,$.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,$.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((U=>this._afterResize(U.cols,U.rows)))),this.register((0,J.toDisposable)((()=>{var U,ce;this._customKeyEventHandler=void 0,(ce=(U=this.element)==null?void 0:U.parentNode)==null||ce.removeChild(this.element)})))}_handleColorEvent(V){if(this._themeService)for(const U of V){let ce,oe="";switch(U.index){case 256:ce="foreground",oe="10";break;case 257:ce="background",oe="11";break;case 258:ce="cursor",oe="12";break;default:ce="ansi",oe="4;"+U.index}switch(U.type){case 0:const ve=F.color.toColorRGB(ce==="ansi"?this._themeService.colors.ansi[U.index]:this._themeService.colors[ce]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${oe};${(0,j.toRgbString)(ve)}${K.C1_ESCAPED.ST}`);break;case 1:if(ce==="ansi")this._themeService.modifyColors((ge=>ge.ansi[U.index]=F.channels.toColor(...U.color)));else{const ge=ce;this._themeService.modifyColors((me=>me[ge]=F.channels.toColor(...U.color)))}break;case 2:this._themeService.restoreColor(U.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(V){V?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(V){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var V;return(V=this.textarea)==null?void 0:V.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.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 V=this.buffer.ybase+this.buffer.y,U=this.buffer.lines.get(V);if(!U)return;const ce=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,ve=U.getWidth(ce),ge=this._renderService.dimensions.css.cell.width*ve,me=this.buffer.y*this._renderService.dimensions.css.cell.height,Re=ce*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Re+"px",this.textarea.style.top=me+"px",this.textarea.style.width=ge+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(U=>{this.hasSelection()&&(0,u.copyHandler)(U,this._selectionService)})));const V=U=>(0,u.handlePasteEvent)(U,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",V)),this.register((0,y.addDisposableDomListener)(this.element,"paste",V)),te.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(U=>{U.button===2&&(0,u.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(U=>{(0,u.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),te.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(U=>{U.button===1&&(0,u.moveTextAreaUnderMouseCursor)(U,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(V=>this._keyUp(V)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(V=>this._keyDown(V)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(V=>this._keyPress(V)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(V=>this._compositionHelper.compositionupdate(V)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(V=>this._inputEvent(V)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(V){var ce;if(!V)throw new Error("Terminal requires a parent element.");if(V.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ce=this.element)==null?void 0:ce.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=V.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"),V.appendChild(this.element);const U=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),U.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,y.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),U.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",x.promptLabel),te.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(R.CoreBrowserService,this.textarea,V.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(N.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),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(N.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(P.ThemeService),this._instantiationService.setService(N.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(N.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(N.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(k.MouseService),this._instantiationService.setService(N.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(U);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(O.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(T.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(N.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(b.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const V=this,U=this.element;function ce(ge){const me=V._mouseService.getMouseReportCoords(ge,V.screenElement);if(!me)return!1;let Re,je;switch(ge.overrideType||ge.type){case"mousemove":je=32,ge.buttons===void 0?(Re=3,ge.button!==void 0&&(Re=ge.button<3?ge.button:3)):Re=1&ge.buttons?0:4&ge.buttons?1:2&ge.buttons?2:3;break;case"mouseup":je=0,Re=ge.button<3?ge.button:3;break;case"mousedown":je=1,Re=ge.button<3?ge.button:3;break;case"wheel":if(V._customWheelEventHandler&&V._customWheelEventHandler(ge)===!1||V.viewport.getLinesScrolled(ge)===0)return!1;je=ge.deltaY<0?0:1,Re=4;break;default:return!1}return!(je===void 0||Re===void 0||Re>4)&&V.coreMouseService.triggerMouseEvent({col:me.col,row:me.row,x:me.x,y:me.y,button:Re,action:je,ctrl:ge.ctrlKey,alt:ge.altKey,shift:ge.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ve={mouseup:ge=>(ce(ge),ge.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(ge)),wheel:ge=>(ce(ge),this.cancel(ge,!0)),mousedrag:ge=>{ge.buttons&&ce(ge)},mousemove:ge=>{ge.buttons||ce(ge)}};this.register(this.coreMouseService.onProtocolChange((ge=>{ge?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ge)),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&ge?oe.mousemove||(U.addEventListener("mousemove",ve.mousemove),oe.mousemove=ve.mousemove):(U.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&ge?oe.wheel||(U.addEventListener("wheel",ve.wheel,{passive:!1}),oe.wheel=ve.wheel):(U.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&ge?oe.mouseup||(oe.mouseup=ve.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&ge?oe.mousedrag||(oe.mousedrag=ve.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(U,"mousedown",(ge=>{if(ge.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ge))return ce(ge),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(ge)}))),this.register((0,y.addDisposableDomListener)(U,"wheel",(ge=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ge)===!1)return!1;if(!this.buffer.hasScrollback){const me=this.viewport.getLinesScrolled(ge);if(me===0)return;const Re=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ge.deltaY<0?"A":"B");let je="";for(let ut=0;ut<Math.abs(me);ut++)je+=Re;return this.coreService.triggerDataEvent(je,!0),this.cancel(ge,!0)}return this.viewport.handleWheel(ge)?this.cancel(ge):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(U,"touchstart",(ge=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ge),this.cancel(ge)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(U,"touchmove",(ge=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ge)?void 0:this.cancel(ge)}),{passive:!1}))}refresh(V,U){var ce;(ce=this._renderService)==null||ce.refreshRows(V,U)}updateCursorStyle(V){var U;(U=this._selectionService)!=null&&U.shouldColumnSelect(V)?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(V,U,ce=0){var oe;ce===1?(super.scrollLines(V,U,ce),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(V)}paste(V){(0,u.paste)(V,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(V){this._customKeyEventHandler=V}attachCustomWheelEventHandler(V){this._customWheelEventHandler=V}registerLinkProvider(V){return this._linkProviderService.registerLinkProvider(V)}registerCharacterJoiner(V){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const U=this._characterJoinerService.register(V);return this.refresh(0,this.rows-1),U}deregisterCharacterJoiner(V){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(V)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(V){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+V)}registerDecoration(V){return this._decorationService.registerDecoration(V)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(V,U,ce){this._selectionService.setSelection(V,U,ce)}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 V;(V=this._selectionService)==null||V.clearSelection()}selectAll(){var V;(V=this._selectionService)==null||V.selectAll()}selectLines(V,U){var ce;(ce=this._selectionService)==null||ce.selectLines(V,U)}_keyDown(V){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(V)===!1)return!1;const U=this.browser.isMac&&this.options.macOptionIsMeta&&V.altKey;if(!U&&!this._compositionHelper.keydown(V))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;U||V.key!=="Dead"&&V.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ce=(0,ee.evaluateKeyboardEvent)(V,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(V),ce.type===3||ce.type===2){const oe=this.rows-1;return this.scrollLines(ce.type===2?-oe:oe),this.cancel(V,!0)}return ce.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,V)||(ce.cancel&&this.cancel(V,!0),!ce.key||!!(V.key&&!V.ctrlKey&&!V.altKey&&!V.metaKey&&V.key.length===1&&V.key.charCodeAt(0)>=65&&V.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ce.key!==K.C0.ETX&&ce.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ce.key,domEvent:V}),this._showCursor(),this.coreService.triggerDataEvent(ce.key,!0),!this.optionsService.rawOptions.screenReaderMode||V.altKey||V.ctrlKey?this.cancel(V,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(V,U){const ce=V.isMac&&!this.options.macOptionIsMeta&&U.altKey&&!U.ctrlKey&&!U.metaKey||V.isWindows&&U.altKey&&U.ctrlKey&&!U.metaKey||V.isWindows&&U.getModifierState("AltGraph");return U.type==="keypress"?ce:ce&&(!U.keyCode||U.keyCode>47)}_keyUp(V){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(V)===!1||((function(U){return U.keyCode===16||U.keyCode===17||U.keyCode===18})(V)||this.focus(),this.updateCursorStyle(V),this._keyPressHandled=!1)}_keyPress(V){let U;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(V)===!1)return!1;if(this.cancel(V),V.charCode)U=V.charCode;else if(V.which===null||V.which===void 0)U=V.keyCode;else{if(V.which===0||V.charCode===0)return!1;U=V.which}return!(!U||(V.altKey||V.ctrlKey||V.metaKey)&&!this._isThirdLevelShift(this.browser,V)||(U=String.fromCharCode(U),this._onKey.fire({key:U,domEvent:V}),this._showCursor(),this.coreService.triggerDataEvent(U,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(V){if(V.data&&V.inputType==="insertText"&&(!V.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const U=V.data;return this.coreService.triggerDataEvent(U,!0),this.cancel(V),!0}return!1}resize(V,U){V!==this.cols||U!==this.rows?super.resize(V,U):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(V,U){var ce,oe;(ce=this._charSizeService)==null||ce.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var V;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 U=1;U<this.rows;U++)this.buffer.lines.push(this.buffer.getBlankLine(q.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(V=this.viewport)==null||V.reset(),this.refresh(0,this.rows-1)}}reset(){var U,ce;this.options.rows=this.rows,this.options.cols=this.cols;const V=this._customKeyEventHandler;this._setup(),super.reset(),(U=this._selectionService)==null||U.reset(),this._decorationService.reset(),(ce=this.viewport)==null||ce.reset(),this._customKeyEventHandler=V,this.refresh(0,this.rows-1)}clearTextureAtlas(){var V;(V=this._renderService)==null||V.clearTextureAtlas()}_reportFocus(){var V;(V=this.element)!=null&&V.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(V){if(this._renderService)switch(V){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const U=this._renderService.dimensions.css.canvas.width.toFixed(0),ce=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${ce};${U}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const oe=this._renderService.dimensions.css.cell.width.toFixed(0),ve=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${ve};${oe}t`)}}cancel(V,U){if(this.options.cancelEvents||U)return V.preventDefault(),V.stopPropagation(),!1}}l.Terminal=ue},9924:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(h,u=1e3){this._renderCallback=h,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(h,u,y){this._rowCount=y,h=h!==void 0?h:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const x=d-this._lastRefreshMs,E=this._debounceThresholdMS-x;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 h=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,u)}}},1680:function(A,l,h){var u=this&&this.__decorate||function(v,f,_,S){var R,k=arguments.length,M=k<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,f,_,S);else for(var T=v.length-1;T>=0;T--)(R=v[T])&&(M=(k<3?R(M):k>3?R(f,_,M):R(f,_))||M);return k>3&&M&&Object.defineProperty(f,_,M),M},y=this&&this.__param||function(v,f){return function(_,S){f(_,S,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const d=h(3656),x=h(4725),E=h(8460),O=h(844),b=h(2585);let p=l.Viewport=class extends O.Disposable{constructor(v,f,_,S,R,k,M,T){super(),this._viewportElement=v,this._scrollArea=f,this._bufferService=_,this._optionsService=S,this._charSizeService=R,this._renderService=k,this._coreBrowserService=M,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((N=>this._activeBuffer=N.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((N=>this._renderDimensions=N))),this._handleThemeChange(T.colors),this.register(T.onChangeColors((N=>this._handleThemeChange(N)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.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(v){if(v)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<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(v,f){const _=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&_<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const f=this._getPixelsScrolled(v);return f!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+f:this._smoothScrollState.target+=f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=f,this._bubbleScroll(v,f))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=v*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!1})}_getPixelsScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let f=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(v,f){var T;let _,S="";const R=[],k=f??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let N=v;N<k;N++){const P=M.get(N);if(!P)continue;const F=(T=M.get(N+1))==null?void 0:T.isWrapped;if(S+=P.translateToString(!F),!F||N===M.length-1){const G=document.createElement("div");G.textContent=S,R.push(G),S.length>0&&(_=G),S=""}}return{bufferElements:R,cursorElement:_}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let f=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(v,f){const _=this._optionsService.rawOptions.fastScrollModifier;return _==="alt"&&f.altKey||_==="ctrl"&&f.ctrlKey||_==="shift"&&f.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const f=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(v,f))}};l.Viewport=p=u([y(2,b.IBufferService),y(3,b.IOptionsService),y(4,x.ICharSizeService),y(5,x.IRenderService),y(6,x.ICoreBrowserService),y(7,x.IThemeService)],p)},3107:function(A,l,h){var u=this&&this.__decorate||function(b,p,v,f){var _,S=arguments.length,R=S<3?p:f===null?f=Object.getOwnPropertyDescriptor(p,v):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,p,v,f);else for(var k=b.length-1;k>=0;k--)(_=b[k])&&(R=(S<3?_(R):S>3?_(p,v,R):_(p,v))||R);return S>3&&R&&Object.defineProperty(p,v,R),R},y=this&&this.__param||function(b,p){return function(v,f){p(v,f,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const d=h(4725),x=h(844),E=h(2585);let O=l.BufferDecorationRenderer=class extends x.Disposable{constructor(b,p,v,f,_){super(),this._screenElement=b,this._bufferService=p,this._coreBrowserService=v,this._decorationService=f,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((S=>this._removeDecoration(S)))),this.register((0,x.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 b of this._decorationService.decorations)this._renderDecoration(b);this._dimensionsChanged=!1}_renderDecoration(b){this._refreshStyle(b),this._dimensionsChanged&&this._refreshXPosition(b)}_createElement(b){var f;const p=this._coreBrowserService.mainDocument.createElement("div");p.classList.add("xterm-decoration"),p.classList.toggle("xterm-decoration-top-layer",((f=b==null?void 0:b.options)==null?void 0:f.layer)==="top"),p.style.width=`${Math.round((b.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,p.style.height=(b.options.height||1)*this._renderService.dimensions.css.cell.height+"px",p.style.top=(b.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",p.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=b.options.x??0;return v&&v>this._bufferService.cols&&(p.style.display="none"),this._refreshXPosition(b,p),p}_refreshStyle(b){const p=b.marker.line-this._bufferService.buffers.active.ydisp;if(p<0||p>=this._bufferService.rows)b.element&&(b.element.style.display="none",b.onRenderEmitter.fire(b.element));else{let v=this._decorationElements.get(b);v||(v=this._createElement(b),b.element=v,this._decorationElements.set(b,v),this._container.appendChild(v),b.onDispose((()=>{this._decorationElements.delete(b),v.remove()}))),v.style.top=p*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",b.onRenderEmitter.fire(v)}}_refreshXPosition(b,p=b.element){if(!p)return;const v=b.options.x??0;(b.options.anchor||"left")==="right"?p.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":p.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(b){var p;(p=this._decorationElements.get(b))==null||p.remove(),this._decorationElements.delete(b),b.dispose()}};l.BufferDecorationRenderer=O=u([y(1,E.IBufferService),y(2,d.ICoreBrowserService),y(3,E.IDecorationService),y(4,d.IRenderService)],O)},5871:(A,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(h){if(h.options.overviewRulerOptions){for(const u of this._zones)if(u.color===h.options.overviewRulerOptions.color&&u.position===h.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,h.marker.line))return;if(this._lineAdjacentToZone(u,h.marker.line,h.options.overviewRulerOptions.position))return void this._addLineToZone(u,h.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=h.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=h.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=h.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=h.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:h.options.overviewRulerOptions.color,position:h.options.overviewRulerOptions.position,startBufferLine:h.marker.line,endBufferLine:h.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(h){this._linePadding=h}_lineIntersectsZone(h,u){return u>=h.startBufferLine&&u<=h.endBufferLine}_lineAdjacentToZone(h,u,y){return u>=h.startBufferLine-this._linePadding[y||"full"]&&u<=h.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(h,u){h.startBufferLine=Math.min(h.startBufferLine,u),h.endBufferLine=Math.max(h.endBufferLine,u)}}},5744:function(A,l,h){var u=this&&this.__decorate||function(_,S,R,k){var M,T=arguments.length,N=T<3?S:k===null?k=Object.getOwnPropertyDescriptor(S,R):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(_,S,R,k);else for(var P=_.length-1;P>=0;P--)(M=_[P])&&(N=(T<3?M(N):T>3?M(S,R,N):M(S,R))||N);return T>3&&N&&Object.defineProperty(S,R,N),N},y=this&&this.__param||function(_,S){return function(R,k){S(R,k,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const d=h(5871),x=h(4725),E=h(844),O=h(2585),b={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let f=l.OverviewRulerRenderer=class extends E.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(_,S,R,k,M,T,N){var F;super(),this._viewportElement=_,this._screenElement=S,this._bufferService=R,this._decorationService=k,this._renderService=M,this._optionsService=T,this._coreBrowserService=N,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(),(F=this._viewportElement.parentElement)==null||F.insertBefore(this._canvas,this._viewportElement);const P=this._canvas.getContext("2d");if(!P)throw new Error("Ctx cannot be null");this._ctx=P,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,E.toDisposable)((()=>{var G;(G=this._canvas)==null||G.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),S=Math.ceil(this._canvas.width/3);p.full=this._canvas.width,p.left=_,p.center=S,p.right=_,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=p.left,v.right=p.left+p.center}_refreshDrawHeightConstants(){b.full=Math.round(2*this._coreBrowserService.dpr);const _=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(_,12),6)*this._coreBrowserService.dpr);b.left=S,b.center=S,b.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const _=this._colorZoneStore.zones;for(const S of _)S.position!=="full"&&this._renderColorZone(S);for(const S of _)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(_){this._ctx.fillStyle=_.color,this._ctx.fillRect(v[_.position||"full"],Math.round((this._canvas.height-1)*(_.startBufferLine/this._bufferService.buffers.active.lines.length)-b[_.position||"full"]/2),p[_.position||"full"],Math.round((this._canvas.height-1)*((_.endBufferLine-_.startBufferLine)/this._bufferService.buffers.active.lines.length)+b[_.position||"full"]))}_queueRefresh(_,S){this._shouldUpdateDimensions=_||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=f=u([y(2,O.IBufferService),y(3,O.IDecorationService),y(4,x.IRenderService),y(5,O.IOptionsService),y(6,x.ICoreBrowserService)],f)},2950:function(A,l,h){var u=this&&this.__decorate||function(b,p,v,f){var _,S=arguments.length,R=S<3?p:f===null?f=Object.getOwnPropertyDescriptor(p,v):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,p,v,f);else for(var k=b.length-1;k>=0;k--)(_=b[k])&&(R=(S<3?_(R):S>3?_(p,v,R):_(p,v))||R);return S>3&&R&&Object.defineProperty(p,v,R),R},y=this&&this.__param||function(b,p){return function(v,f){p(v,f,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const d=h(4725),x=h(2585),E=h(2584);let O=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(b,p,v,f,_,S){this._textarea=b,this._compositionView=p,this._bufferService=v,this._optionsService=f,this._coreService=_,this._renderService=S,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(b){this._compositionView.textContent=b.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(b){if(this._isComposing||this._isSendingComposition){if(b.keyCode===229||b.keyCode===16||b.keyCode===17||b.keyCode===18)return!1;this._finalizeComposition(!1)}return b.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(b){if(this._compositionView.classList.remove("active"),this._isComposing=!1,b){const p={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,p.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(p.start,p.end):this._textarea.value.substring(p.start),v.length>0&&this._coreService.triggerDataEvent(v,!0)}}),0)}else{this._isSendingComposition=!1;const p=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(p,!0)}}_handleAnyTextareaChanges(){const b=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const p=this._textarea.value,v=p.replace(b,"");this._dataAlreadySent=v,p.length>b.length?this._coreService.triggerDataEvent(v,!0):p.length<b.length?this._coreService.triggerDataEvent(`${E.C0.DEL}`,!0):p.length===b.length&&p!==b&&this._coreService.triggerDataEvent(p,!0)}}),0)}updateCompositionElements(b){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const p=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,_=p*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=_+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=v+"px",this._compositionView.style.lineHeight=v+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=_+"px",this._textarea.style.top=f+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}b||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=O=u([y(2,x.IBufferService),y(3,x.IOptionsService),y(4,x.ICoreService),y(5,d.IRenderService)],O)},9806:(A,l)=>{function h(u,y,d){const x=d.getBoundingClientRect(),E=u.getComputedStyle(d),O=parseInt(E.getPropertyValue("padding-left")),b=parseInt(E.getPropertyValue("padding-top"));return[y.clientX-x.left-O,y.clientY-x.top-b]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=h,l.getCoords=function(u,y,d,x,E,O,b,p,v){if(!O)return;const f=h(u,y,d);return f?(f[0]=Math.ceil((f[0]+(v?b/2:0))/b),f[1]=Math.ceil(f[1]/p),f[0]=Math.min(Math.max(f[0],1),x+(v?1:0)),f[1]=Math.min(Math.max(f[1],1),E),f):void 0}},9504:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const u=h(2584);function y(p,v,f,_){const S=p-d(p,f),R=v-d(v,f),k=Math.abs(S-R)-(function(M,T,N){let P=0;const F=M-d(M,N),G=T-d(T,N);for(let $=0;$<Math.abs(F-G);$++){const J=x(M,T)==="A"?-1:1,te=N.buffer.lines.get(F+J*$);te!=null&&te.isWrapped&&P++}return P})(p,v,f);return b(k,O(x(p,v),_))}function d(p,v){let f=0,_=v.buffer.lines.get(p),S=_==null?void 0:_.isWrapped;for(;S&&p>=0&&p<v.rows;)f++,_=v.buffer.lines.get(--p),S=_==null?void 0:_.isWrapped;return f}function x(p,v){return p>v?"A":"B"}function E(p,v,f,_,S,R){let k=p,M=v,T="";for(;k!==f||M!==_;)k+=S?1:-1,S&&k>R.cols-1?(T+=R.buffer.translateBufferLineToString(M,!1,p,k),k=0,p=0,M++):!S&&k<0&&(T+=R.buffer.translateBufferLineToString(M,!1,0,p+1),k=R.cols-1,p=k,M--);return T+R.buffer.translateBufferLineToString(M,!1,p,k)}function O(p,v){const f=v?"O":"[";return u.C0.ESC+f+p}function b(p,v){p=Math.floor(p);let f="";for(let _=0;_<p;_++)f+=v;return f}l.moveToCellSequence=function(p,v,f,_){const S=f.buffer.x,R=f.buffer.y;if(!f.buffer.hasScrollback)return(function(T,N,P,F,G,$){return y(N,F,G,$).length===0?"":b(E(T,N,T,N-d(N,G),!1,G).length,O("D",$))})(S,R,0,v,f,_)+y(R,v,f,_)+(function(T,N,P,F,G,$){let J;J=y(N,F,G,$).length>0?F-d(F,G):N;const te=F,q=(function(K,ee,j,B,L,H){let W;return W=y(j,B,L,H).length>0?B-d(B,L):ee,K<j&&W<=B||K>=j&&W<B?"C":"D"})(T,N,P,F,G,$);return b(E(T,J,P,te,q==="C",G).length,O(q,$))})(S,R,p,v,f,_);let k;if(R===v)return k=S>p?"D":"C",b(Math.abs(S-p),O(k,_));k=R>v?"D":"C";const M=Math.abs(R-v);return b((function(T,N){return N.cols-T})(R>v?p:S,f)+(M-1)*f.cols+1+((R>v?S:p)-1),O(k,_))}},1296:function(A,l,h){var u=this&&this.__decorate||function($,J,te,q){var K,ee=arguments.length,j=ee<3?J:q===null?q=Object.getOwnPropertyDescriptor(J,te):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate($,J,te,q);else for(var B=$.length-1;B>=0;B--)(K=$[B])&&(j=(ee<3?K(j):ee>3?K(J,te,j):K(J,te))||j);return ee>3&&j&&Object.defineProperty(J,te,j),j},y=this&&this.__param||function($,J){return function(te,q){J(te,q,$)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const d=h(3787),x=h(2550),E=h(2223),O=h(6171),b=h(6052),p=h(4725),v=h(8055),f=h(8460),_=h(844),S=h(2585),R="xterm-dom-renderer-owner-",k="xterm-rows",M="xterm-fg-",T="xterm-bg-",N="xterm-focus",P="xterm-selection";let F=1,G=l.DomRenderer=class extends _.Disposable{constructor($,J,te,q,K,ee,j,B,L,H,W,re,ue){super(),this._terminal=$,this._document=J,this._element=te,this._screenElement=q,this._viewportElement=K,this._helperContainer=ee,this._linkifier2=j,this._charSizeService=L,this._optionsService=H,this._bufferService=W,this._coreBrowserService=re,this._themeService=ue,this._terminalClass=F++,this._rowElements=[],this._selectionRenderModel=(0,b.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(k),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(P),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((pe=>this._injectCss(pe)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((pe=>this._handleLinkHover(pe)))),this.register(this._linkifier2.onHideLinkUnderline((pe=>this._handleLinkLeave(pe)))),this.register((0,_.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new x.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 $=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*$,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*$),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/$),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/$),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 te of this._rowElements)te.style.width=`${this.dimensions.css.canvas.width}px`,te.style.height=`${this.dimensions.css.cell.height}px`,te.style.lineHeight=`${this.dimensions.css.cell.height}px`,te.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const J=`${this._terminalSelector} .${k} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=J,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($){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let J=`${this._terminalSelector} .${k} { color: ${$.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;J+=`${this._terminalSelector} .${k} .xterm-dim { color: ${v.color.multiplyOpacity($.foreground,.5).css};}`,J+=`${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 te=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,K=`blink_block_${this._terminalClass}`;J+=`@keyframes ${te} { 50% { border-bottom-style: hidden; }}`,J+=`@keyframes ${q} { 50% { box-shadow: none; }}`,J+=`@keyframes ${K} { 0% { background-color: ${$.cursor.css}; color: ${$.cursorAccent.css}; } 50% { background-color: inherit; color: ${$.cursor.css}; }}`,J+=`${this._terminalSelector} .${k}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${te} 1s step-end infinite;}${this._terminalSelector} .${k}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${k}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block { background-color: ${$.cursor.css}; color: ${$.cursorAccent.css};}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${$.cursor.css} !important; color: ${$.cursorAccent.css} !important;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${$.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${$.cursor.css} inset;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${$.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,J+=`${this._terminalSelector} .${P} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${P} div { position: absolute; background-color: ${$.selectionBackgroundOpaque.css};}${this._terminalSelector} .${P} div { position: absolute; background-color: ${$.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,j]of $.ansi.entries())J+=`${this._terminalSelector} .${M}${ee} { color: ${j.css}; }${this._terminalSelector} .${M}${ee}.xterm-dim { color: ${v.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${T}${ee} { background-color: ${j.css}; }`;J+=`${this._terminalSelector} .${M}${E.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque($.background).css}; }${this._terminalSelector} .${M}${E.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque($.background),.5).css}; }${this._terminalSelector} .${T}${E.INVERTED_DEFAULT_COLOR} { background-color: ${$.foreground.css}; }`,this._themeStyleElement.textContent=J}_setDefaultSpacing(){const $=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${$}px`,this._rowFactory.defaultSpacing=$}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements($,J){for(let te=this._rowElements.length;te<=J;te++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>J;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize($,J){this._refreshRowElements($,J),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(N),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(N),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged($,J,te){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged($,J,te),this.renderRows(0,this._bufferService.rows-1),!$||!J)return;this._selectionRenderModel.update(this._terminal,$,J,te);const q=this._selectionRenderModel.viewportStartRow,K=this._selectionRenderModel.viewportEndRow,ee=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(ee>=this._bufferService.rows||j<0)return;const B=this._document.createDocumentFragment();if(te){const L=$[0]>J[0];B.appendChild(this._createSelectionElement(ee,L?J[0]:$[0],L?$[0]:J[0],j-ee+1))}else{const L=q===ee?$[0]:0,H=ee===K?J[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(ee,L,H));const W=j-ee-1;if(B.appendChild(this._createSelectionElement(ee+1,0,this._bufferService.cols,W)),ee!==j){const re=K===j?J[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(j,0,re))}}this._selectionContainer.appendChild(B)}_createSelectionElement($,J,te,q=1){const K=this._document.createElement("div"),ee=J*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(te-J);return ee+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-ee),K.style.height=q*this.dimensions.css.cell.height+"px",K.style.top=$*this.dimensions.css.cell.height+"px",K.style.left=`${ee}px`,K.style.width=`${j}px`,K}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 $ of this._rowElements)$.replaceChildren()}renderRows($,J){const te=this._bufferService.buffer,q=te.ybase+te.y,K=Math.min(te.x,this._bufferService.cols-1),ee=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=$;L<=J;L++){const H=L+te.ydisp,W=this._rowElements[L],re=te.lines.get(H);if(!W||!re)break;W.replaceChildren(...this._rowFactory.createRow(re,H,H===q,j,B,K,ee,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover($){this._setCellUnderline($.x1,$.x2,$.y1,$.y2,$.cols,!0)}_handleLinkLeave($){this._setCellUnderline($.x1,$.x2,$.y1,$.y2,$.cols,!1)}_setCellUnderline($,J,te,q,K,ee){te<0&&($=0),q<0&&(J=0);const j=this._bufferService.rows-1;te=Math.max(Math.min(te,j),0),q=Math.max(Math.min(q,j),0),K=Math.min(K,this._bufferService.cols);const B=this._bufferService.buffer,L=B.ybase+B.y,H=Math.min(B.x,K-1),W=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,ue=this._optionsService.rawOptions.cursorInactiveStyle;for(let pe=te;pe<=q;++pe){const V=pe+B.ydisp,U=this._rowElements[pe],ce=B.lines.get(V);if(!U||!ce)break;U.replaceChildren(...this._rowFactory.createRow(ce,V,V===L,re,ue,H,W,this.dimensions.css.cell.width,this._widthCache,ee?pe===te?$:0:-1,ee?(pe===q?J:K)-1:-1))}}};l.DomRenderer=G=u([y(7,S.IInstantiationService),y(8,p.ICharSizeService),y(9,S.IOptionsService),y(10,S.IBufferService),y(11,p.ICoreBrowserService),y(12,p.IThemeService)],G)},3787:function(A,l,h){var u=this&&this.__decorate||function(k,M,T,N){var P,F=arguments.length,G=F<3?M:N===null?N=Object.getOwnPropertyDescriptor(M,T):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(k,M,T,N);else for(var $=k.length-1;$>=0;$--)(P=k[$])&&(G=(F<3?P(G):F>3?P(M,T,G):P(M,T))||G);return F>3&&G&&Object.defineProperty(M,T,G),G},y=this&&this.__param||function(k,M){return function(T,N){M(T,N,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const d=h(2223),x=h(643),E=h(511),O=h(2585),b=h(8055),p=h(4725),v=h(4269),f=h(6171),_=h(3734);let S=l.DomRendererRowFactory=class{constructor(k,M,T,N,P,F,G){this._document=k,this._characterJoinerService=M,this._optionsService=T,this._coreBrowserService=N,this._coreService=P,this._decorationService=F,this._themeService=G,this._workCell=new E.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(k,M,T){this._selectionStart=k,this._selectionEnd=M,this._columnSelectMode=T}createRow(k,M,T,N,P,F,G,$,J,te,q){const K=[],ee=this._characterJoinerService.getJoinedCharacters(M),j=this._themeService.colors;let B,L=k.getNoBgTrimmedLength();T&&L<F+1&&(L=F+1);let H=0,W="",re=0,ue=0,pe=0,V=!1,U=0,ce=!1,oe=0;const ve=[],ge=te!==-1&&q!==-1;for(let me=0;me<L;me++){k.loadCell(me,this._workCell);let Re=this._workCell.getWidth();if(Re===0)continue;let je=!1,ut=me,Te=this._workCell;if(ee.length>0&&me===ee[0][0]){je=!0;const We=ee.shift();Te=new v.JoinedCellData(this._workCell,k.translateToString(!0,We[0],We[1]),We[1]-We[0]),ut=We[1]-1,Re=Te.getWidth()}const Ft=this._isCellInSelection(me,M),pi=T&&me===F,_i=ge&&me>=te&&me<=q;let Ii=!1;this._decorationService.forEachDecorationAtCell(me,M,void 0,(We=>{Ii=!0}));let Wi=Te.getChars()||x.WHITESPACE_CELL_CHAR;if(Wi===" "&&(Te.isUnderline()||Te.isOverline())&&(Wi=" "),oe=Re*$-J.get(Wi,Te.isBold(),Te.isItalic()),B){if(H&&(Ft&&ce||!Ft&&!ce&&Te.bg===re)&&(Ft&&ce&&j.selectionForeground||Te.fg===ue)&&Te.extended.ext===pe&&_i===V&&oe===U&&!pi&&!je&&!Ii){Te.isInvisible()?W+=x.WHITESPACE_CELL_CHAR:W+=Wi,H++;continue}H&&(B.textContent=W),B=this._document.createElement("span"),H=0,W=""}else B=this._document.createElement("span");if(re=Te.bg,ue=Te.fg,pe=Te.extended.ext,V=_i,U=oe,ce=Ft,je&&F>=me&&F<=ut&&(F=me),!this._coreService.isCursorHidden&&pi&&this._coreService.isCursorInitialized){if(ve.push("xterm-cursor"),this._coreBrowserService.isFocused)G&&ve.push("xterm-cursor-blink"),ve.push(N==="bar"?"xterm-cursor-bar":N==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(P)switch(P){case"outline":ve.push("xterm-cursor-outline");break;case"block":ve.push("xterm-cursor-block");break;case"bar":ve.push("xterm-cursor-bar");break;case"underline":ve.push("xterm-cursor-underline")}}if(Te.isBold()&&ve.push("xterm-bold"),Te.isItalic()&&ve.push("xterm-italic"),Te.isDim()&&ve.push("xterm-dim"),W=Te.isInvisible()?x.WHITESPACE_CELL_CHAR:Te.getChars()||x.WHITESPACE_CELL_CHAR,Te.isUnderline()&&(ve.push(`xterm-underline-${Te.extended.underlineStyle}`),W===" "&&(W=" "),!Te.isUnderlineColorDefault()))if(Te.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${_.AttributeData.toColorRGB(Te.getUnderlineColor()).join(",")})`;else{let We=Te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Te.isBold()&&We<8&&(We+=8),B.style.textDecorationColor=j.ansi[We].css}Te.isOverline()&&(ve.push("xterm-overline"),W===" "&&(W=" ")),Te.isStrikethrough()&&ve.push("xterm-strikethrough"),_i&&(B.style.textDecoration="underline");let Pt=Te.getFgColor(),at=Te.getFgColorMode(),Dt=Te.getBgColor(),Zt=Te.getBgColorMode();const Nt=!!Te.isInverse();if(Nt){const We=Pt;Pt=Dt,Dt=We;const gi=at;at=Zt,Zt=gi}let jt,Yi,Yt,Li=!1;switch(this._decorationService.forEachDecorationAtCell(me,M,void 0,(We=>{We.options.layer!=="top"&&Li||(We.backgroundColorRGB&&(Zt=50331648,Dt=We.backgroundColorRGB.rgba>>8&16777215,jt=We.backgroundColorRGB),We.foregroundColorRGB&&(at=50331648,Pt=We.foregroundColorRGB.rgba>>8&16777215,Yi=We.foregroundColorRGB),Li=We.options.layer==="top")})),!Li&&Ft&&(jt=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,Dt=jt.rgba>>8&16777215,Zt=50331648,Li=!0,j.selectionForeground&&(at=50331648,Pt=j.selectionForeground.rgba>>8&16777215,Yi=j.selectionForeground)),Li&&ve.push("xterm-decoration-top"),Zt){case 16777216:case 33554432:Yt=j.ansi[Dt],ve.push(`xterm-bg-${Dt}`);break;case 50331648:Yt=b.channels.toColor(Dt>>16,Dt>>8&255,255&Dt),this._addStyle(B,`background-color:#${R((Dt>>>0).toString(16),"0",6)}`);break;default:Nt?(Yt=j.foreground,ve.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):Yt=j.background}switch(jt||Te.isDim()&&(jt=b.color.multiplyOpacity(Yt,.5)),at){case 16777216:case 33554432:Te.isBold()&&Pt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Pt+=8),this._applyMinimumContrast(B,Yt,j.ansi[Pt],Te,jt,void 0)||ve.push(`xterm-fg-${Pt}`);break;case 50331648:const We=b.channels.toColor(Pt>>16&255,Pt>>8&255,255&Pt);this._applyMinimumContrast(B,Yt,We,Te,jt,Yi)||this._addStyle(B,`color:#${R(Pt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,Yt,j.foreground,Te,jt,Yi)||Nt&&ve.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ve.length&&(B.className=ve.join(" "),ve.length=0),pi||je||Ii?B.textContent=W:H++,oe!==this.defaultSpacing&&(B.style.letterSpacing=`${oe}px`),K.push(B),me=ut}return B&&H&&(B.textContent=W),K}_applyMinimumContrast(k,M,T,N,P,F){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(N.getCode()))return!1;const G=this._getContrastCache(N);let $;if(P||F||($=G.getColor(M.rgba,T.rgba)),$===void 0){const J=this._optionsService.rawOptions.minimumContrastRatio/(N.isDim()?2:1);$=b.color.ensureContrastRatio(P||M,F||T,J),G.setColor((P||M).rgba,(F||T).rgba,$??null)}return!!$&&(this._addStyle(k,`color:${$.css}`),!0)}_getContrastCache(k){return k.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(k,M){k.setAttribute("style",`${k.getAttribute("style")||""}${M};`)}_isCellInSelection(k,M){const T=this._selectionStart,N=this._selectionEnd;return!(!T||!N)&&(this._columnSelectMode?T[0]<=N[0]?k>=T[0]&&M>=T[1]&&k<N[0]&&M<=N[1]:k<T[0]&&M>=T[1]&&k>=N[0]&&M<=N[1]:M>T[1]&&M<N[1]||T[1]===N[1]&&M===T[1]&&k>=T[0]&&k<N[0]||T[1]<N[1]&&M===N[1]&&k<N[0]||T[1]<N[1]&&M===T[1]&&k>=T[0])}};function R(k,M,T){for(;k.length<T;)k=M+k;return k}l.DomRendererRowFactory=S=u([y(1,p.ICharacterJoinerService),y(2,O.IOptionsService),y(3,p.ICoreBrowserService),y(4,O.ICoreService),y(5,O.IDecorationService),y(6,p.IThemeService)],S)},2550:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(h,u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=h.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=h.createElement("span");y.classList.add("xterm-char-measure-element");const d=h.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const x=h.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontStyle="italic";const E=h.createElement("span");E.classList.add("xterm-char-measure-element"),E.style.fontWeight="bold",E.style.fontStyle="italic",this._measureElements=[y,d,x,E],this._container.appendChild(y),this._container.appendChild(d),this._container.appendChild(x),this._container.appendChild(E),u.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(h,u,y,d){h===this._font&&u===this._fontSize&&y===this._weight&&d===this._weightBold||(this._font=h,this._fontSize=u,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(h,u,y){let d=0;if(!u&&!y&&h.length===1&&(d=h.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const O=this._measure(h,0);return O>0&&(this._flat[d]=O),O}let x=h;u&&(x+="B"),y&&(x+="I");let E=this._holey.get(x);if(E===void 0){let O=0;u&&(O|=1),y&&(O|=2),E=this._measure(h,O),E>0&&this._holey.set(x,E)}return E}_measure(h,u){const y=this._measureElements[u];return y.textContent=h.repeat(32),y.offsetWidth/32}}},2223:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const u=h(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(A,l)=>{function h(y){return 57508<=y&&y<=57558}function u(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=h,l.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},l.isEmoji=u,l.allowRescaling=function(y,d,x,E){return d===1&&x>Math.ceil(1.5*E)&&y!==void 0&&y>255&&!u(y)&&!h(y)&&!(function(O){return 57344<=O&&O<=63743})(y)},l.treatGlyphAsBackgroundColor=function(y){return h(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,x=0){return(y-(2*Math.round(d)-x))%(2*Math.round(d))}},6052:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class h{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,x,E=!1){if(this.selectionStart=d,this.selectionEnd=x,!d||!x||d[0]===x[0]&&d[1]===x[1])return void this.clear();const O=y.buffers.active.ydisp,b=d[1]-O,p=x[1]-O,v=Math.max(b,0),f=Math.min(p,y.rows-1);v>=y.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=E,this.viewportStartRow=b,this.viewportEndRow=p,this.viewportCappedStartRow=v,this.viewportCappedEndRow=f,this.startCol=d[0],this.endCol=x[0])}isCellSelected(y,d,x){return!!this.hasSelection&&(x-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&x>=this.viewportCappedStartRow&&d<this.endCol&&x<=this.viewportCappedEndRow:d<this.startCol&&x>=this.viewportCappedStartRow&&d>=this.endCol&&x<=this.viewportCappedEndRow:x>this.viewportStartRow&&x<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&x===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&x===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&x===this.viewportStartRow&&d>=this.startCol)}}l.createSelectionRenderModel=function(){return new h}},456:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(h){this._bufferService=h,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 h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?h%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)-1]:[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[h,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[Math.max(h,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const h=this.selectionStart,u=this.selectionEnd;return!(!h||!u)&&(h[1]>u[1]||h[1]===u[1]&&h[0]>u[0])}handleTrim(h){return this.selectionStart&&(this.selectionStart[1]-=h),this.selectionEnd&&(this.selectionEnd[1]-=h),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(A,l,h){var u=this&&this.__decorate||function(f,_,S,R){var k,M=arguments.length,T=M<3?_:R===null?R=Object.getOwnPropertyDescriptor(_,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(f,_,S,R);else for(var N=f.length-1;N>=0;N--)(k=f[N])&&(T=(M<3?k(T):M>3?k(_,S,T):k(_,S))||T);return M>3&&T&&Object.defineProperty(_,S,T),T},y=this&&this.__param||function(f,_){return function(S,R){_(S,R,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const d=h(2585),x=h(8460),E=h(844);let O=l.CharSizeService=class extends E.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,_,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new x.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new p(f,_,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const f=this._measureStrategy.measure();f.width===this.width&&f.height===this.height||(this.width=f.width,this.height=f.height,this._onCharSizeChange.fire())}};l.CharSizeService=O=u([y(2,d.IOptionsService)],O);class b extends E.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(_,S){_!==void 0&&_>0&&S!==void 0&&S>0&&(this._result.width=_,this._result.height=S)}}class p extends b{constructor(_,S,R){super(),this._document=_,this._parentElement=S,this._optionsService=R,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 v extends b{constructor(_){super(),this._optionsService=_,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const _=this._ctx.measureText("W");return this._validateAndSet(_.width,_.fontBoundingBoxAscent+_.fontBoundingBoxDescent),this._result}}},4269:function(A,l,h){var u=this&&this.__decorate||function(v,f,_,S){var R,k=arguments.length,M=k<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,f,_,S);else for(var T=v.length-1;T>=0;T--)(R=v[T])&&(M=(k<3?R(M):k>3?R(f,_,M):R(f,_))||M);return k>3&&M&&Object.defineProperty(f,_,M),M},y=this&&this.__param||function(v,f){return function(_,S){f(_,S,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const d=h(3734),x=h(643),E=h(511),O=h(2585);class b extends d.AttributeData{constructor(f,_,S){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=_,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=b;let p=l.CharacterJoinerService=class Bg{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new E.CellData}register(f){const _={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(_),_.id}deregister(f){for(let _=0;_<this._characterJoiners.length;_++)if(this._characterJoiners[_].id===f)return this._characterJoiners.splice(_,1),!0;return!1}getJoinedCharacters(f){if(this._characterJoiners.length===0)return[];const _=this._bufferService.buffer.lines.get(f);if(!_||_.length===0)return[];const S=[],R=_.translateToString(!0);let k=0,M=0,T=0,N=_.getFg(0),P=_.getBg(0);for(let F=0;F<_.getTrimmedLength();F++)if(_.loadCell(F,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==N||this._workCell.bg!==P){if(F-k>1){const G=this._getJoinedRanges(R,T,M,_,k);for(let $=0;$<G.length;$++)S.push(G[$])}k=F,T=M,N=this._workCell.fg,P=this._workCell.bg}M+=this._workCell.getChars().length||x.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-k>1){const F=this._getJoinedRanges(R,T,M,_,k);for(let G=0;G<F.length;G++)S.push(F[G])}return S}_getJoinedRanges(f,_,S,R,k){const M=f.substring(_,S);let T=[];try{T=this._characterJoiners[0].handler(M)}catch(N){console.error(N)}for(let N=1;N<this._characterJoiners.length;N++)try{const P=this._characterJoiners[N].handler(M);for(let F=0;F<P.length;F++)Bg._mergeRanges(T,P[F])}catch(P){console.error(P)}return this._stringRangesToCellRanges(T,R,k),T}_stringRangesToCellRanges(f,_,S){let R=0,k=!1,M=0,T=f[R];if(T){for(let N=S;N<this._bufferService.cols;N++){const P=_.getWidth(N),F=_.getString(N).length||x.WHITESPACE_CELL_CHAR.length;if(P!==0){if(!k&&T[0]<=M&&(T[0]=N,k=!0),T[1]<=M){if(T[1]=N,T=f[++R],!T)break;T[0]<=M?(T[0]=N,k=!0):k=!1}M+=F}}T&&(T[1]=this._bufferService.cols)}}static _mergeRanges(f,_){let S=!1;for(let R=0;R<f.length;R++){const k=f[R];if(S){if(_[1]<=k[0])return f[R-1][1]=_[1],f;if(_[1]<=k[1])return f[R-1][1]=Math.max(_[1],k[1]),f.splice(R,1),f;f.splice(R,1),R--}else{if(_[1]<=k[0])return f.splice(R,0,_),f;if(_[1]<=k[1])return k[0]=Math.min(_[0],k[0]),f;_[0]<k[1]&&(k[0]=Math.min(_[0],k[0]),S=!0)}}return S?f[f.length-1][1]=_[1]:f.push(_),f}};l.CharacterJoinerService=p=u([y(0,O.IBufferService)],p)},5114:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const u=h(844),y=h(8460),d=h(3656);class x extends u.Disposable{constructor(b,p,v){super(),this._textarea=b,this._window=p,this.mainDocument=v,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((f=>this._screenDprMonitor.setWindow(f)))),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(b){this._window!==b&&(this._window=b,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=x;class E extends u.Disposable{constructor(b){super(),this._parentWindow=b,this._windowResizeListener=this.register(new u.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,u.toDisposable)((()=>this.clearListener())))}setWindow(b){this._parentWindow=b,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 b;this._outerListener&&((b=this._resolutionMediaMatchList)==null||b.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:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const u=h(844);class y extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(x){return this.linkProviders.push(x),{dispose:()=>{const E=this.linkProviders.indexOf(x);E!==-1&&this.linkProviders.splice(E,1)}}}}l.LinkProviderService=y},8934:function(A,l,h){var u=this&&this.__decorate||function(O,b,p,v){var f,_=arguments.length,S=_<3?b:v===null?v=Object.getOwnPropertyDescriptor(b,p):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(O,b,p,v);else for(var R=O.length-1;R>=0;R--)(f=O[R])&&(S=(_<3?f(S):_>3?f(b,p,S):f(b,p))||S);return _>3&&S&&Object.defineProperty(b,p,S),S},y=this&&this.__param||function(O,b){return function(p,v){b(p,v,O)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const d=h(4725),x=h(9806);let E=l.MouseService=class{constructor(O,b){this._renderService=O,this._charSizeService=b}getCoords(O,b,p,v,f){return(0,x.getCoords)(window,O,b,p,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(O,b){const p=(0,x.getCoordsRelativeToElement)(window,O,b);if(this._charSizeService.hasValidSize)return p[0]=Math.min(Math.max(p[0],0),this._renderService.dimensions.css.canvas.width-1),p[1]=Math.min(Math.max(p[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(p[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(p[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(p[0]),y:Math.floor(p[1])}}};l.MouseService=E=u([y(0,d.IRenderService),y(1,d.ICharSizeService)],E)},3230:function(A,l,h){var u=this&&this.__decorate||function(f,_,S,R){var k,M=arguments.length,T=M<3?_:R===null?R=Object.getOwnPropertyDescriptor(_,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(f,_,S,R);else for(var N=f.length-1;N>=0;N--)(k=f[N])&&(T=(M<3?k(T):M>3?k(_,S,T):k(_,S))||T);return M>3&&T&&Object.defineProperty(_,S,T),T},y=this&&this.__param||function(f,_){return function(S,R){_(S,R,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const d=h(6193),x=h(4725),E=h(8460),O=h(844),b=h(7226),p=h(2585);let v=l.RenderService=class extends O.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(f,_,S,R,k,M,T,N){super(),this._rowCount=f,this._charSizeService=R,this._renderer=this.register(new O.MutableDisposable),this._pausedResizeTask=new b.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(((P,F)=>this._renderRows(P,F)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>{var P;return(P=this._renderer.value)==null?void 0:P.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(k.onDecorationRegistered((()=>this._fullRefresh()))),this.register(k.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(N.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,_),this.register(T.onWindowChange((P=>this._registerIntersectionObserver(P,_))))}_registerIntersectionObserver(f,_){if("IntersectionObserver"in f){const S=new f.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});S.observe(_),this._observerDisposable.value=(0,O.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(f){this._isPaused=f.isIntersecting===void 0?f.intersectionRatio===0:!f.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(f,_,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(f,_,this._rowCount))}_renderRows(f,_){this._renderer.value&&(f=Math.min(f,this._rowCount-1),_=Math.min(_,this._rowCount-1),this._renderer.value.renderRows(f,_),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:f,end:_}),this._onRender.fire({start:f,end:_}),this._isNextRenderRedrawOnly=!0)}resize(f,_){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(f){this._renderer.value=f,this._renderer.value&&(this._renderer.value.onRequestRedraw((_=>this.refreshRows(_.start,_.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(f){return this._renderDebouncer.addRefreshCallback(f)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var f,_;this._renderer.value&&((_=(f=this._renderer.value).clearTextureAtlas)==null||_.call(f),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(f,_){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(f,_)})):this._renderer.value.handleResize(f,_),this._fullRefresh())}handleCharSizeChanged(){var f;(f=this._renderer.value)==null||f.handleCharSizeChanged()}handleBlur(){var f;(f=this._renderer.value)==null||f.handleBlur()}handleFocus(){var f;(f=this._renderer.value)==null||f.handleFocus()}handleSelectionChanged(f,_,S){var R;this._selectionState.start=f,this._selectionState.end=_,this._selectionState.columnSelectMode=S,(R=this._renderer.value)==null||R.handleSelectionChanged(f,_,S)}handleCursorMove(){var f;(f=this._renderer.value)==null||f.handleCursorMove()}clear(){var f;(f=this._renderer.value)==null||f.clear()}};l.RenderService=v=u([y(2,p.IOptionsService),y(3,x.ICharSizeService),y(4,p.IDecorationService),y(5,p.IBufferService),y(6,x.ICoreBrowserService),y(7,x.IThemeService)],v)},9312:function(A,l,h){var u=this&&this.__decorate||function(T,N,P,F){var G,$=arguments.length,J=$<3?N:F===null?F=Object.getOwnPropertyDescriptor(N,P):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(T,N,P,F);else for(var te=T.length-1;te>=0;te--)(G=T[te])&&(J=($<3?G(J):$>3?G(N,P,J):G(N,P))||J);return $>3&&J&&Object.defineProperty(N,P,J),J},y=this&&this.__param||function(T,N){return function(P,F){N(P,F,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const d=h(9806),x=h(9504),E=h(456),O=h(4725),b=h(8460),p=h(844),v=h(6114),f=h(4841),_=h(511),S=h(2585),R=" ",k=new RegExp(R,"g");let M=l.SelectionService=class extends p.Disposable{constructor(T,N,P,F,G,$,J,te,q){super(),this._element=T,this._screenElement=N,this._linkifier=P,this._bufferService=F,this._coreService=G,this._mouseService=$,this._optionsService=J,this._renderService=te,this._coreBrowserService=q,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 b.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new b.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new b.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=K=>this._handleMouseMove(K),this._mouseUpListener=K=>this._handleMouseUp(K),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((K=>this._handleTrim(K))),this.register(this._bufferService.buffers.onBufferActivate((K=>this._handleBufferActivate(K)))),this.enable(),this._model=new E.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,p.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,N=this._model.finalSelectionEnd;return!(!T||!N||T[0]===N[0]&&T[1]===N[1])}get selectionText(){const T=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;if(!T||!N)return"";const P=this._bufferService.buffer,F=[];if(this._activeSelectionMode===3){if(T[0]===N[0])return"";const G=T[0]<N[0]?T[0]:N[0],$=T[0]<N[0]?N[0]:T[0];for(let J=T[1];J<=N[1];J++){const te=P.translateBufferLineToString(J,!0,G,$);F.push(te)}}else{const G=T[1]===N[1]?N[0]:void 0;F.push(P.translateBufferLineToString(T[1],!0,T[0],G));for(let $=T[1]+1;$<=N[1]-1;$++){const J=P.lines.get($),te=P.translateBufferLineToString($,!0);J!=null&&J.isWrapped?F[F.length-1]+=te:F.push(te)}if(T[1]!==N[1]){const $=P.lines.get(N[1]),J=P.translateBufferLineToString(N[1],!0,0,N[0]);$&&$.isWrapped?F[F.length-1]+=J:F.push(J)}}return F.map((G=>G.replace(k," "))).join(v.isWindows?`\r
|
|
299
|
+
`:`
|
|
300
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.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 N=this._getMouseBufferCoords(T),P=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!!(P&&F&&N)&&this._areCoordsInSelection(N,P,F)}isCellInSelection(T,N){const P=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!(!P||!F)&&this._areCoordsInSelection([T,N],P,F)}_areCoordsInSelection(T,N,P){return T[1]>N[1]&&T[1]<P[1]||N[1]===P[1]&&T[1]===N[1]&&T[0]>=N[0]&&T[0]<P[0]||N[1]<P[1]&&T[1]===P[1]&&T[0]<P[0]||N[1]<P[1]&&T[1]===N[1]&&T[0]>=N[0]}_selectWordAtCursor(T,N){var G,$;const P=($=(G=this._linkifier.currentLink)==null?void 0:G.link)==null?void 0:$.range;if(P)return this._model.selectionStart=[P.start.x-1,P.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(P,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const F=this._getMouseBufferCoords(T);return!!F&&(this._selectWordAt(F,N),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,N){this._model.clearSelection(),T=Math.max(T,0),N=Math.min(N,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,N],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const N=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(N)return N[0]--,N[1]--,N[1]+=this._bufferService.buffer.ydisp,N}_getMouseEventScrollAmount(T){let N=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const P=this._renderService.dimensions.css.canvas.height;return N>=0&&N<=P?0:(N>P&&(N-=P),N=Math.min(Math.max(N,-50),50),N/=50,N/Math.abs(N)+Math.round(14*N))}shouldForceSelection(T){return v.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 N=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);N&&N.length!==this._model.selectionStart[0]&&N.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const N=this._getMouseBufferCoords(T);N&&(this._activeSelectionMode=2,this._selectLineAt(N[1]))}shouldColumnSelect(T){return T.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.stopImmediatePropagation(),!this._model.selectionStart)return;const N=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 P=this._bufferService.buffer;if(this._model.selectionEnd[1]<P.lines.length){const F=P.lines.get(this._model.selectionEnd[1]);F&&F.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}N&&N[0]===this._model.selectionEnd[0]&&N[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 N=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&N<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const P=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(P&&P[0]!==void 0&&P[1]!==void 0){const F=(0,x.moveToCellSequence)(P[0]-1,P[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(F,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,N=this._model.finalSelectionEnd,P=!(!T||!N||T[0]===N[0]&&T[1]===N[1]);P?T&&N&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&N[0]===this._oldSelectionEnd[0]&&N[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,N,P)):this._oldHasSelection&&this._fireOnSelectionChange(T,N,P)}_fireOnSelectionChange(T,N,P){this._oldSelectionStart=T,this._oldSelectionEnd=N,this._oldHasSelection=P,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((N=>this._handleTrim(N)))}_convertViewportColToCharacterIndex(T,N){let P=N;for(let F=0;N>=F;F++){const G=T.loadCell(F,this._workCell).getChars().length;this._workCell.getWidth()===0?P--:G>1&&N!==F&&(P+=G-1)}return P}setSelection(T,N,P){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,N],this._model.selectionStartLength=P,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,N,P=!0,F=!0){if(T[0]>=this._bufferService.cols)return;const G=this._bufferService.buffer,$=G.lines.get(T[1]);if(!$)return;const J=G.translateBufferLineToString(T[1],!1);let te=this._convertViewportColToCharacterIndex($,T[0]),q=te;const K=T[0]-te;let ee=0,j=0,B=0,L=0;if(J.charAt(te)===" "){for(;te>0&&J.charAt(te-1)===" ";)te--;for(;q<J.length&&J.charAt(q+1)===" ";)q++}else{let re=T[0],ue=T[0];$.getWidth(re)===0&&(ee++,re--),$.getWidth(ue)===2&&(j++,ue++);const pe=$.getString(ue).length;for(pe>1&&(L+=pe-1,q+=pe-1);re>0&&te>0&&!this._isCharWordSeparator($.loadCell(re-1,this._workCell));){$.loadCell(re-1,this._workCell);const V=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,re--):V>1&&(B+=V-1,te-=V-1),te--,re--}for(;ue<$.length&&q+1<J.length&&!this._isCharWordSeparator($.loadCell(ue+1,this._workCell));){$.loadCell(ue+1,this._workCell);const V=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,ue++):V>1&&(L+=V-1,q+=V-1),q++,ue++}}q++;let H=te+K-ee+B,W=Math.min(this._bufferService.cols,q-te+ee+j-B-L);if(N||J.slice(te,q).trim()!==""){if(P&&H===0&&$.getCodePoint(0)!==32){const re=G.lines.get(T[1]-1);if(re&&$.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const ue=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(ue){const pe=this._bufferService.cols-ue.start;H-=pe,W+=pe}}}if(F&&H+W===this._bufferService.cols&&$.getCodePoint(this._bufferService.cols-1)!==32){const re=G.lines.get(T[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const ue=this._getWordAt([0,T[1]+1],!1,!1,!0);ue&&(W+=ue.length)}}return{start:H,length:W}}}_selectWordAt(T,N){const P=this._getWordAt(T,N);if(P){for(;P.start<0;)P.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[P.start,T[1]],this._model.selectionStartLength=P.length}}_selectToWordAt(T){const N=this._getWordAt(T,!0);if(N){let P=T[1];for(;N.start<0;)N.start+=this._bufferService.cols,P--;if(!this._model.areSelectionValuesReversed())for(;N.start+N.length>this._bufferService.cols;)N.length-=this._bufferService.cols,P++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?N.start:N.start+N.length,P]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const N=this._bufferService.buffer.getWrappedRangeForLine(T),P={start:{x:0,y:N.first},end:{x:this._bufferService.cols-1,y:N.last}};this._model.selectionStart=[0,N.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(P,this._bufferService.cols)}};l.SelectionService=M=u([y(3,S.IBufferService),y(4,S.ICoreService),y(5,O.IMouseService),y(6,S.IOptionsService),y(7,O.IRenderService),y(8,O.ICoreBrowserService)],M)},4725:(A,l,h)=>{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 u=h(8343);l.ICharSizeService=(0,u.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),l.IMouseService=(0,u.createDecorator)("MouseService"),l.IRenderService=(0,u.createDecorator)("RenderService"),l.ISelectionService=(0,u.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,u.createDecorator)("ThemeService"),l.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(A,l,h){var u=this&&this.__decorate||function(M,T,N,P){var F,G=arguments.length,$=G<3?T:P===null?P=Object.getOwnPropertyDescriptor(T,N):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(M,T,N,P);else for(var J=M.length-1;J>=0;J--)(F=M[J])&&($=(G<3?F($):G>3?F(T,N,$):F(T,N))||$);return G>3&&$&&Object.defineProperty(T,N,$),$},y=this&&this.__param||function(M,T){return function(N,P){T(N,P,M)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const d=h(7239),x=h(8055),E=h(8460),O=h(844),b=h(2585),p=x.css.toColor("#ffffff"),v=x.css.toColor("#000000"),f=x.css.toColor("#ffffff"),_=x.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[x.css.toColor("#2e3436"),x.css.toColor("#cc0000"),x.css.toColor("#4e9a06"),x.css.toColor("#c4a000"),x.css.toColor("#3465a4"),x.css.toColor("#75507b"),x.css.toColor("#06989a"),x.css.toColor("#d3d7cf"),x.css.toColor("#555753"),x.css.toColor("#ef2929"),x.css.toColor("#8ae234"),x.css.toColor("#fce94f"),x.css.toColor("#729fcf"),x.css.toColor("#ad7fa8"),x.css.toColor("#34e2e2"),x.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let N=0;N<216;N++){const P=T[N/36%6|0],F=T[N/6%6|0],G=T[N%6];M.push({css:x.channels.toCss(P,F,G),rgba:x.channels.toRgba(P,F,G)})}for(let N=0;N<24;N++){const P=8+10*N;M.push({css:x.channels.toCss(P,P,P),rgba:x.channels.toRgba(P,P,P)})}return M})());let R=l.ThemeService=class extends O.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,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:p,background:v,cursor:f,cursorAccent:_,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:x.color.blend(v,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:x.color.blend(v,S),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(M={}){const T=this._colors;if(T.foreground=k(M.foreground,p),T.background=k(M.background,v),T.cursor=k(M.cursor,f),T.cursorAccent=k(M.cursorAccent,_),T.selectionBackgroundTransparent=k(M.selectionBackground,S),T.selectionBackgroundOpaque=x.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=k(M.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=x.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=M.selectionForeground?k(M.selectionForeground,x.NULL_COLOR):void 0,T.selectionForeground===x.NULL_COLOR&&(T.selectionForeground=void 0),x.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=x.color.opacity(T.selectionBackgroundTransparent,.3)),x.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=x.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=l.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=k(M.black,l.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=k(M.red,l.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=k(M.green,l.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=k(M.yellow,l.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=k(M.blue,l.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=k(M.magenta,l.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=k(M.cyan,l.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=k(M.white,l.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=k(M.brightBlack,l.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=k(M.brightRed,l.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=k(M.brightGreen,l.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=k(M.brightYellow,l.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=k(M.brightBlue,l.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=k(M.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=k(M.brightCyan,l.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=k(M.brightWhite,l.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const N=Math.min(T.ansi.length-16,M.extendedAnsi.length);for(let P=0;P<N;P++)T.ansi[P+16]=k(M.extendedAnsi[P],l.DEFAULT_ANSI_COLORS[P+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){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[M]=this._restoreColors.ansi[M]}else for(let T=0;T<this._restoreColors.ansi.length;++T)this._colors.ansi[T]=this._restoreColors.ansi[T]}modifyColors(M){M(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 k(M,T){if(M!==void 0)try{return x.css.toColor(M)}catch{}return T}l.ThemeService=R=u([y(0,b.IOptionsService)],R)},6349:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const u=h(8460),y=h(844);class d extends y.Disposable{constructor(E){super(),this._maxLength=E,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.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 b=0;b<Math.min(E,this.length);b++)O[b]=this._array[this._getCyclicIndex(b)];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,...b){if(O){for(let p=E;p<this._length-O;p++)this._array[this._getCyclicIndex(p)]=this._array[this._getCyclicIndex(p+O)];this._length-=O,this.onDeleteEmitter.fire({index:E,amount:O})}for(let p=this._length-1;p>=E;p--)this._array[this._getCyclicIndex(p+b.length)]=this._array[this._getCyclicIndex(p)];for(let p=0;p<b.length;p++)this._array[this._getCyclicIndex(E+p)]=b[p];if(b.length&&this.onInsertEmitter.fire({index:E,amount:b.length}),this._length+b.length>this._maxLength){const p=this._length+b.length-this._maxLength;this._startIndex+=p,this._length=this._maxLength,this.onTrimEmitter.fire(p)}else this._length+=b.length}trimStart(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)}shiftElements(E,O,b){if(!(O<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+b<0)throw new Error("Cannot shift elements in list beyond index 0");if(b>0){for(let v=O-1;v>=0;v--)this.set(E+v+b,this.get(E+v));const p=E+O+b-this._length;if(p>0)for(this._length+=p;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let p=0;p<O;p++)this.set(E+p+b,this.get(E+p))}}_getCyclicIndex(E){return(this._startIndex+E)%this._maxLength}}l.CircularList=d},1439:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function h(u,y=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const x in u)d[x]=y<=1?u[x]:u[x]&&h(u[x],y-1);return d}},8055:(A,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 h=0,u=0,y=0,d=0;var x,E,O,b,p;function v(_){const S=_.toString(16);return S.length<2?"0"+S:S}function f(_,S){return _<S?(S+.05)/(_+.05):(_+.05)/(S+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(_){_.toCss=function(S,R,k,M){return M!==void 0?`#${v(S)}${v(R)}${v(k)}${v(M)}`:`#${v(S)}${v(R)}${v(k)}`},_.toRgba=function(S,R,k,M=255){return(S<<24|R<<16|k<<8|M)>>>0},_.toColor=function(S,R,k,M){return{css:_.toCss(S,R,k,M),rgba:_.toRgba(S,R,k,M)}}})(x||(l.channels=x={})),(function(_){function S(R,k){return d=Math.round(255*k),[h,u,y]=p.toChannels(R.rgba),{css:x.toCss(h,u,y,d),rgba:x.toRgba(h,u,y,d)}}_.blend=function(R,k){if(d=(255&k.rgba)/255,d===1)return{css:k.css,rgba:k.rgba};const M=k.rgba>>24&255,T=k.rgba>>16&255,N=k.rgba>>8&255,P=R.rgba>>24&255,F=R.rgba>>16&255,G=R.rgba>>8&255;return h=P+Math.round((M-P)*d),u=F+Math.round((T-F)*d),y=G+Math.round((N-G)*d),{css:x.toCss(h,u,y),rgba:x.toRgba(h,u,y)}},_.isOpaque=function(R){return(255&R.rgba)==255},_.ensureContrastRatio=function(R,k,M){const T=p.ensureContrastRatio(R.rgba,k.rgba,M);if(T)return x.toColor(T>>24&255,T>>16&255,T>>8&255)},_.opaque=function(R){const k=(255|R.rgba)>>>0;return[h,u,y]=p.toChannels(k),{css:x.toCss(h,u,y),rgba:k}},_.opacity=S,_.multiplyOpacity=function(R,k){return d=255&R.rgba,S(R,d*k/255)},_.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(E||(l.color=E={})),(function(_){let S,R;try{const k=document.createElement("canvas");k.width=1,k.height=1;const M=k.getContext("2d",{willReadFrequently:!0});M&&(S=M,S.globalCompositeOperation="copy",R=S.createLinearGradient(0,0,1,1))}catch{}_.toColor=function(k){if(k.match(/#[\da-f]{3,8}/i))switch(k.length){case 4:return h=parseInt(k.slice(1,2).repeat(2),16),u=parseInt(k.slice(2,3).repeat(2),16),y=parseInt(k.slice(3,4).repeat(2),16),x.toColor(h,u,y);case 5:return h=parseInt(k.slice(1,2).repeat(2),16),u=parseInt(k.slice(2,3).repeat(2),16),y=parseInt(k.slice(3,4).repeat(2),16),d=parseInt(k.slice(4,5).repeat(2),16),x.toColor(h,u,y,d);case 7:return{css:k,rgba:(parseInt(k.slice(1),16)<<8|255)>>>0};case 9:return{css:k,rgba:parseInt(k.slice(1),16)>>>0}}const M=k.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return h=parseInt(M[1]),u=parseInt(M[2]),y=parseInt(M[3]),d=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),x.toColor(h,u,y,d);if(!S||!R)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=R,S.fillStyle=k,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[h,u,y,d]=S.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:x.toRgba(h,u,y,d),css:k}}})(O||(l.css=O={})),(function(_){function S(R,k,M){const T=R/255,N=k/255,P=M/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.0722*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))}_.relativeLuminance=function(R){return S(R>>16&255,R>>8&255,255&R)},_.relativeLuminance2=S})(b||(l.rgb=b={})),(function(_){function S(k,M,T){const N=k>>24&255,P=k>>16&255,F=k>>8&255;let G=M>>24&255,$=M>>16&255,J=M>>8&255,te=f(b.relativeLuminance2(G,$,J),b.relativeLuminance2(N,P,F));for(;te<T&&(G>0||$>0||J>0);)G-=Math.max(0,Math.ceil(.1*G)),$-=Math.max(0,Math.ceil(.1*$)),J-=Math.max(0,Math.ceil(.1*J)),te=f(b.relativeLuminance2(G,$,J),b.relativeLuminance2(N,P,F));return(G<<24|$<<16|J<<8|255)>>>0}function R(k,M,T){const N=k>>24&255,P=k>>16&255,F=k>>8&255;let G=M>>24&255,$=M>>16&255,J=M>>8&255,te=f(b.relativeLuminance2(G,$,J),b.relativeLuminance2(N,P,F));for(;te<T&&(G<255||$<255||J<255);)G=Math.min(255,G+Math.ceil(.1*(255-G))),$=Math.min(255,$+Math.ceil(.1*(255-$))),J=Math.min(255,J+Math.ceil(.1*(255-J))),te=f(b.relativeLuminance2(G,$,J),b.relativeLuminance2(N,P,F));return(G<<24|$<<16|J<<8|255)>>>0}_.blend=function(k,M){if(d=(255&M)/255,d===1)return M;const T=M>>24&255,N=M>>16&255,P=M>>8&255,F=k>>24&255,G=k>>16&255,$=k>>8&255;return h=F+Math.round((T-F)*d),u=G+Math.round((N-G)*d),y=$+Math.round((P-$)*d),x.toRgba(h,u,y)},_.ensureContrastRatio=function(k,M,T){const N=b.relativeLuminance(k>>8),P=b.relativeLuminance(M>>8);if(f(N,P)<T){if(P<N){const $=S(k,M,T),J=f(N,b.relativeLuminance($>>8));if(J<T){const te=R(k,M,T);return J>f(N,b.relativeLuminance(te>>8))?$:te}return $}const F=R(k,M,T),G=f(N,b.relativeLuminance(F>>8));if(G<T){const $=S(k,M,T);return G>f(N,b.relativeLuminance($>>8))?F:$}return F}},_.reduceLuminance=S,_.increaseLuminance=R,_.toChannels=function(k){return[k>>24&255,k>>16&255,k>>8&255,255&k]}})(p||(l.rgba=p={})),l.toPaddedHex=v,l.contrastRatio=f},8969:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const u=h(844),y=h(2585),d=h(4348),x=h(7866),E=h(744),O=h(7302),b=h(6975),p=h(8460),v=h(1753),f=h(1480),_=h(7994),S=h(9282),R=h(5435),k=h(5981),M=h(2660);let T=!1;class N extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new p.EventEmitter),this._onScroll.event((F=>{var G;(G=this._onScrollApi)==null||G.fire(F.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(F){for(const G in F)this.optionsService.options[G]=F[G]}constructor(F){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new p.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new p.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new O.OptionsService(F)),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(x.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(b.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.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(M.OscLinkService),this._instantiationService.setService(y.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,p.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,p.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,p.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,p.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((G=>{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((G=>{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 k.WriteBuffer(((G,$)=>this._inputHandler.parse(G,$)))),this.register((0,p.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(F,G){this._writeBuffer.write(F,G)}writeSync(F,G){this._logService.logLevel<=y.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(F,G)}input(F,G=!0){this.coreService.triggerDataEvent(F,G)}resize(F,G){isNaN(F)||isNaN(G)||(F=Math.max(F,E.MINIMUM_COLS),G=Math.max(G,E.MINIMUM_ROWS),this._bufferService.resize(F,G))}scroll(F,G=!1){this._bufferService.scroll(F,G)}scrollLines(F,G,$){this._bufferService.scrollLines(F,G,$)}scrollPages(F){this.scrollLines(F*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(F){const G=F-this._bufferService.buffer.ydisp;G!==0&&this.scrollLines(G)}registerEscHandler(F,G){return this._inputHandler.registerEscHandler(F,G)}registerDcsHandler(F,G){return this._inputHandler.registerDcsHandler(F,G)}registerCsiHandler(F,G){return this._inputHandler.registerCsiHandler(F,G)}registerOscHandler(F,G){return this._inputHandler.registerOscHandler(F,G)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let F=!1;const G=this.optionsService.rawOptions.windowsPty;G&&G.buildNumber!==void 0&&G.buildNumber!==void 0?F=G.backend==="conpty"&&G.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(F=!0),F?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const F=[];F.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),F.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const G of F)G.dispose()}))}}}l.CoreTerminal=N},8460:(A,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=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===h)return void this._listeners.splice(u,1)}}})),this._event}fire(h,u){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,h,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(h,u){return h((y=>u.fire(y)))},l.runAndSubscribe=function(h,u){return u(void 0),h((y=>u(y)))}},5435:function(A,l,h){var u=this&&this.__decorate||function(ee,j,B,L){var H,W=arguments.length,re=W<3?j:L===null?L=Object.getOwnPropertyDescriptor(j,B):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(ee,j,B,L);else for(var ue=ee.length-1;ue>=0;ue--)(H=ee[ue])&&(re=(W<3?H(re):W>3?H(j,B,re):H(j,B))||re);return W>3&&re&&Object.defineProperty(j,B,re),re},y=this&&this.__param||function(ee,j){return function(B,L){j(B,L,ee)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const d=h(2584),x=h(7116),E=h(2015),O=h(844),b=h(482),p=h(8437),v=h(8460),f=h(643),_=h(511),S=h(3734),R=h(2585),k=h(1480),M=h(6242),T=h(6351),N=h(5941),P={"(":0,")":1,"*":2,"+":3,"-":1,".":2},F=131072;function G(ee,j){if(ee>24)return j.setWinLines||!1;switch(ee){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 $;(function(ee){ee[ee.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ee[ee.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})($||(l.WindowsOptionsReportType=$={}));let J=0;class te extends O.Disposable{getAttrData(){return this._curAttrData}constructor(j,B,L,H,W,re,ue,pe,V=new E.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=B,this._coreService=L,this._logService=H,this._optionsService=W,this._oscLinkService=re,this._coreMouseService=ue,this._unicodeService=pe,this._parser=V,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new b.StringToUtf32,this._utf8Decoder=new b.Utf8ToUtf32,this._workCell=new _.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=p.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=p.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.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 q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((U=>this._activeBuffer=U.activeBuffer))),this._parser.setCsiHandlerFallback(((U,ce)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(U),params:ce.toArray()})})),this._parser.setEscHandlerFallback((U=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(U)})})),this._parser.setExecuteHandlerFallback((U=>{this._logService.debug("Unknown EXECUTE code: ",{code:U})})),this._parser.setOscHandlerFallback(((U,ce,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:U,action:ce,data:oe})})),this._parser.setDcsHandlerFallback(((U,ce,oe)=>{ce==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(U),action:ce,payload:oe})})),this._parser.setPrintHandler(((U,ce,oe)=>this.print(U,ce,oe))),this._parser.registerCsiHandler({final:"@"},(U=>this.insertChars(U))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(U=>this.scrollLeft(U))),this._parser.registerCsiHandler({final:"A"},(U=>this.cursorUp(U))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(U=>this.scrollRight(U))),this._parser.registerCsiHandler({final:"B"},(U=>this.cursorDown(U))),this._parser.registerCsiHandler({final:"C"},(U=>this.cursorForward(U))),this._parser.registerCsiHandler({final:"D"},(U=>this.cursorBackward(U))),this._parser.registerCsiHandler({final:"E"},(U=>this.cursorNextLine(U))),this._parser.registerCsiHandler({final:"F"},(U=>this.cursorPrecedingLine(U))),this._parser.registerCsiHandler({final:"G"},(U=>this.cursorCharAbsolute(U))),this._parser.registerCsiHandler({final:"H"},(U=>this.cursorPosition(U))),this._parser.registerCsiHandler({final:"I"},(U=>this.cursorForwardTab(U))),this._parser.registerCsiHandler({final:"J"},(U=>this.eraseInDisplay(U,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(U=>this.eraseInDisplay(U,!0))),this._parser.registerCsiHandler({final:"K"},(U=>this.eraseInLine(U,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(U=>this.eraseInLine(U,!0))),this._parser.registerCsiHandler({final:"L"},(U=>this.insertLines(U))),this._parser.registerCsiHandler({final:"M"},(U=>this.deleteLines(U))),this._parser.registerCsiHandler({final:"P"},(U=>this.deleteChars(U))),this._parser.registerCsiHandler({final:"S"},(U=>this.scrollUp(U))),this._parser.registerCsiHandler({final:"T"},(U=>this.scrollDown(U))),this._parser.registerCsiHandler({final:"X"},(U=>this.eraseChars(U))),this._parser.registerCsiHandler({final:"Z"},(U=>this.cursorBackwardTab(U))),this._parser.registerCsiHandler({final:"`"},(U=>this.charPosAbsolute(U))),this._parser.registerCsiHandler({final:"a"},(U=>this.hPositionRelative(U))),this._parser.registerCsiHandler({final:"b"},(U=>this.repeatPrecedingCharacter(U))),this._parser.registerCsiHandler({final:"c"},(U=>this.sendDeviceAttributesPrimary(U))),this._parser.registerCsiHandler({prefix:">",final:"c"},(U=>this.sendDeviceAttributesSecondary(U))),this._parser.registerCsiHandler({final:"d"},(U=>this.linePosAbsolute(U))),this._parser.registerCsiHandler({final:"e"},(U=>this.vPositionRelative(U))),this._parser.registerCsiHandler({final:"f"},(U=>this.hVPosition(U))),this._parser.registerCsiHandler({final:"g"},(U=>this.tabClear(U))),this._parser.registerCsiHandler({final:"h"},(U=>this.setMode(U))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(U=>this.setModePrivate(U))),this._parser.registerCsiHandler({final:"l"},(U=>this.resetMode(U))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(U=>this.resetModePrivate(U))),this._parser.registerCsiHandler({final:"m"},(U=>this.charAttributes(U))),this._parser.registerCsiHandler({final:"n"},(U=>this.deviceStatus(U))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(U=>this.deviceStatusPrivate(U))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(U=>this.softReset(U))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(U=>this.setCursorStyle(U))),this._parser.registerCsiHandler({final:"r"},(U=>this.setScrollRegion(U))),this._parser.registerCsiHandler({final:"s"},(U=>this.saveCursor(U))),this._parser.registerCsiHandler({final:"t"},(U=>this.windowOptions(U))),this._parser.registerCsiHandler({final:"u"},(U=>this.restoreCursor(U))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(U=>this.insertColumns(U))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(U=>this.deleteColumns(U))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(U=>this.selectProtected(U))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(U=>this.requestMode(U,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(U=>this.requestMode(U,!1))),this._parser.setExecuteHandler(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 M.OscHandler((U=>(this.setTitle(U),this.setIconName(U),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((U=>this.setIconName(U)))),this._parser.registerOscHandler(2,new M.OscHandler((U=>this.setTitle(U)))),this._parser.registerOscHandler(4,new M.OscHandler((U=>this.setOrReportIndexedColor(U)))),this._parser.registerOscHandler(8,new M.OscHandler((U=>this.setHyperlink(U)))),this._parser.registerOscHandler(10,new M.OscHandler((U=>this.setOrReportFgColor(U)))),this._parser.registerOscHandler(11,new M.OscHandler((U=>this.setOrReportBgColor(U)))),this._parser.registerOscHandler(12,new M.OscHandler((U=>this.setOrReportCursorColor(U)))),this._parser.registerOscHandler(104,new M.OscHandler((U=>this.restoreIndexedColor(U)))),this._parser.registerOscHandler(110,new M.OscHandler((U=>this.restoreFgColor(U)))),this._parser.registerOscHandler(111,new M.OscHandler((U=>this.restoreBgColor(U)))),this._parser.registerOscHandler(112,new M.OscHandler((U=>this.restoreCursorColor(U)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const U in x.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:U},(()=>this.selectCharset("("+U))),this._parser.registerEscHandler({intermediates:")",final:U},(()=>this.selectCharset(")"+U))),this._parser.registerEscHandler({intermediates:"*",final:U},(()=>this.selectCharset("*"+U))),this._parser.registerEscHandler({intermediates:"+",final:U},(()=>this.selectCharset("+"+U))),this._parser.registerEscHandler({intermediates:"-",final:U},(()=>this.selectCharset("-"+U))),this._parser.registerEscHandler({intermediates:".",final:U},(()=>this.selectCharset("."+U))),this._parser.registerEscHandler({intermediates:"/",final:U},(()=>this.selectCharset("/"+U)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((U=>(this._logService.error("Parsing error: ",U),U))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler(((U,ce)=>this.requestStatusString(U,ce))))}_preserveStack(j,B,L,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=L,this._parseStack.position=H}_logSlowResolvingAsync(j){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([j,new Promise(((B,L)=>setTimeout((()=>L("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,B){let L,H=this._activeBuffer.x,W=this._activeBuffer.y,re=0;const ue=this._parseStack.paused;if(ue){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(L),L;H=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>F&&(re=this._parseStack.position+F)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,(U=>String.fromCharCode(U))).join("")}"`),typeof j=="string"?j.split("").map((U=>U.charCodeAt(0))):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<F&&(this._parseBuffer=new Uint32Array(Math.min(j.length,F))),ue||this._dirtyRowTracker.clearRange(),j.length>F)for(let U=re;U<j.length;U+=F){const ce=U+F<j.length?U+F:j.length,oe=typeof j=="string"?this._stringDecoder.decode(j.substring(U,ce),this._parseBuffer):this._utf8Decoder.decode(j.subarray(U,ce),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,oe))return this._preserveStack(H,W,oe,U),this._logSlowResolvingAsync(L),L}else if(!ue){const U=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,U))return this._preserveStack(H,W,U,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===H&&this._activeBuffer.y===W||this._onCursorMove.fire();const pe=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),V=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);V<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(V,this._bufferService.rows-1),Math.min(pe,this._bufferService.rows-1))}print(j,B,L){let H,W;const re=this._charsetService.charset,ue=this._optionsService.rawOptions.screenReaderMode,pe=this._bufferService.cols,V=this._coreService.decPrivateModes.wraparound,U=this._coreService.modes.insertMode,ce=this._curAttrData;let oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-B>0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ce);let ve=this._parser.precedingJoinState;for(let ge=B;ge<L;++ge){if(H=j[ge],H<127&&re){const ut=re[String.fromCharCode(H)];ut&&(H=ut.charCodeAt(0))}const me=this._unicodeService.charProperties(H,ve);W=k.UnicodeService.extractWidth(me);const Re=k.UnicodeService.extractShouldJoin(me),je=Re?k.UnicodeService.extractWidth(ve):0;if(ve=me,ue&&this._onA11yChar.fire((0,b.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-je>pe){if(V){const ut=oe;let Te=this._activeBuffer.x-je;for(this._activeBuffer.x=je,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),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),je>0&&oe instanceof p.BufferLine&&oe.copyCellsFrom(ut,Te,0,je,!1);Te<pe;)ut.setCellFromCodepoint(Te++,0,1,ce)}else if(this._activeBuffer.x=pe-1,W===2)continue}if(Re&&this._activeBuffer.x){const ut=oe.getWidth(this._activeBuffer.x-1)?1:2;oe.addCodepointToCell(this._activeBuffer.x-ut,H,W);for(let Te=W-je;--Te>=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}else if(U&&(oe.insertCells(this._activeBuffer.x,W-je,this._activeBuffer.getNullCell(ce)),oe.getWidth(pe-1)===2&&oe.setCellFromCodepoint(pe-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,ce)),oe.setCellFromCodepoint(this._activeBuffer.x++,H,W,ce),W>0)for(;--W;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}this._parser.precedingJoinState=ve,this._activeBuffer.x<pe&&L-B>0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,ce),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,B){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,B):this._parser.registerCsiHandler(j,(L=>!G(L.params[0],this._optionsService.rawOptions.windowOptions)||B(L)))}registerDcsHandler(j,B){return this._parser.registerDcsHandler(j,new T.DcsHandler(B))}registerEscHandler(j,B){return this._parser.registerEscHandler(j,B)}registerOscHandler(j,B){return this._parser.registerOscHandler(j,new M.OscHandler(B))}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 B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.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,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=j,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+B)}cursorUp(j){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,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 B=j.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=j.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=j.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const B=j.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,B,L,H=!1,W=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);re.replaceCells(B,L,this._activeBuffer.getNullCell(this._eraseAttrData()),W),H&&(re.isWrapped=!1)}_resetBufferLine(j,B=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),L.isWrapped=!1)}eraseInDisplay(j,B=!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,B);L<this._bufferService.rows;L++)this._resetBufferLine(L,B);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,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,B);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,B=!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,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let B=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,W=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;B--;)this._activeBuffer.lines.splice(W-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 B=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;B--;)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 B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.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 B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let B=j.params[0]||1;for(;B--;)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 B=j.params[0]||1;for(;B--;)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(p.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 B=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,B,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 B=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,B,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 B=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,B,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 B=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,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.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 B=this._parser.precedingJoinState;if(!B)return!0;const L=j.params[0]||1,H=k.UnicodeService.extractWidth(B),W=this._activeBuffer.x-H,re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),ue=new Uint32Array(re.length*L);let pe=0;for(let U=0;U<re.length;){const ce=re.codePointAt(U)||0;ue[pe++]=ce,U+=ce>65535?2:1}let V=pe;for(let U=1;U<L;++U)ue.copyWithin(V,0,pe),V+=pe;return this.print(ue,0,V),!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 B=0;B<j.length;B++)switch(j.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let B=0;B<j.length;B++)switch(j.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,x.DEFAULT_CHARSET),this._charsetService.setgCharset(1,x.DEFAULT_CHARSET),this._charsetService.setgCharset(2,x.DEFAULT_CHARSET),this._charsetService.setgCharset(3,x.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 B=0;B<j.length;B++)switch(j.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let B=0;B<j.length;B++)switch(j.params[B]){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[B]===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,B){const L=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:W}=this._coreMouseService,re=this._coreService,{buffers:ue,cols:pe}=this._bufferService,{active:V,alt:U}=ue,ce=this._optionsService.rawOptions,oe=Re=>Re?1:2,ve=j.params[0];return ge=ve,me=B?ve===2?4:ve===4?oe(re.modes.insertMode):ve===12?3:ve===20?oe(ce.convertEol):0:ve===1?oe(L.applicationCursorKeys):ve===3?ce.windowOptions.setWinLines?pe===80?2:pe===132?1:0:0:ve===6?oe(L.origin):ve===7?oe(L.wraparound):ve===8?3:ve===9?oe(H==="X10"):ve===12?oe(ce.cursorBlink):ve===25?oe(!re.isCursorHidden):ve===45?oe(L.reverseWraparound):ve===66?oe(L.applicationKeypad):ve===67?4:ve===1e3?oe(H==="VT200"):ve===1002?oe(H==="DRAG"):ve===1003?oe(H==="ANY"):ve===1004?oe(L.sendFocus):ve===1005?4:ve===1006?oe(W==="SGR"):ve===1015?4:ve===1016?oe(W==="SGR_PIXELS"):ve===1048?1:ve===47||ve===1047||ve===1049?oe(V===U):ve===2004?oe(L.bracketedPasteMode):0,re.triggerDataEvent(`${d.C0.ESC}[${B?"":"?"}${ge};${me}$y`),!0;var ge,me}_updateAttrColor(j,B,L,H,W){return B===2?(j|=50331648,j&=-16777216,j|=S.AttributeData.fromColorRGB([L,H,W])):B===5&&(j&=-50331904,j|=33554432|255&L),j}_extractColor(j,B,L){const H=[0,0,-1,0,0,0];let W=0,re=0;do{if(H[re+W]=j.params[B+re],j.hasSubParams(B+re)){const ue=j.getSubParams(B+re);let pe=0;do H[1]===5&&(W=1),H[re+pe+1+W]=ue[pe];while(++pe<ue.length&&pe+re+1+W<H.length);break}if(H[1]===5&&re+W>=2||H[1]===2&&re+W>=5)break;H[1]&&(W=1)}while(++re+B<j.length&&re+W<H.length);for(let ue=2;ue<H.length;++ue)H[ue]===-1&&(H[ue]=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 re}_processUnderline(j,B){B.extended=B.extended.clone(),(!~j||j>5)&&(j=1),B.extended.underlineStyle=j,B.fg|=268435456,j===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(j){j.fg=p.DEFAULT_ATTR_DATA.fg,j.bg=p.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 B=j.length;let L;const H=this._curAttrData;for(let W=0;W<B;W++)L=j.params[W],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(W)?j.getSubParams(W)[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&p.DEFAULT_ATTR_DATA.fg):L===49?(H.bg&=-67108864,H.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?W+=this._extractColor(j,W,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&p.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&p.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 B=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${B};${L}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const B=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${B};${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=p.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 B=j.params[0]||1;switch(B){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=B%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(j){const B=j.params[0]||1;let L;return(j.length<2||(L=j.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(j){if(!G(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire($.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire($.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:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==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 B=[],L=j.split(";");for(;L.length>1;){const H=L.shift(),W=L.shift();if(/^\d+$/.exec(H)){const re=parseInt(H);if(K(re))if(W==="?")B.push({type:0,index:re});else{const ue=(0,N.parseColor)(W);ue&&B.push({type:1,index:re,color:ue})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(j){const B=j.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(j,B){this._getCurrentLinkId()&&this._finishHyperlink();const L=j.split(":");let H;const W=L.findIndex((re=>re.startsWith("id=")));return W!==-1&&(H=L[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,B){const L=j.split(";");for(let H=0;H<L.length&&!(B>=this._specialColors.length);++H,++B)if(L[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const W=(0,N.parseColor)(L[H]);W&&this._onColor.fire([{type:1,index:this._specialColors[B],color:W}])}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 B=[],L=j.split(";");for(let H=0;H<L.length;++H)if(/^\d+$/.exec(L[H])){const W=parseInt(L[H]);K(W)&&B.push({type:2,index:W})}return B.length&&this._onColor.fire(B),!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,x.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(P[j[0]],x.CHARSETS[j[1]]||x.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=p.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=p.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 B=0;B<this._bufferService.rows;++B){const L=this._activeBuffer.ybase+this._activeBuffer.y+B,H=this._activeBuffer.lines.get(L);H&&(H.fill(j),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,B){const L=this._bufferService.buffer,H=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${W}${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,B){this._dirtyRowTracker.markRangeDirty(j,B)}}l.InputHandler=te;let q=class{constructor(ee){this._bufferService=ee,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ee){ee<this.start?this.start=ee:ee>this.end&&(this.end=ee)}markRangeDirty(ee,j){ee>j&&(J=ee,ee=j,j=J),ee<this.start&&(this.start=ee),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(ee){return 0<=ee&&ee<256}q=u([y(0,R.IBufferService)],q)},844:(A,l)=>{function h(u){for(const y of u)y.dispose();u.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 u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const y=this._disposables.indexOf(u);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(u){var y;this._isDisposed||u===this._value||((y=this._value)==null||y.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},l.toDisposable=function(u){return{dispose:u}},l.disposeArray=h,l.getDisposeArrayDisposable=function(u){return{dispose:()=>h(u)}}},1505:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class h{constructor(){this._data={}}set(y,d,x){this._data[y]||(this._data[y]={}),this._data[y][d]=x}get(y,d){return this._data[y]?this._data[y][d]:void 0}clear(){this._data={}}}l.TwoKeyMap=h,l.FourKeyMap=class{constructor(){this._data=new h}set(u,y,d,x,E){this._data.get(u,y)||this._data.set(u,y,new h),this._data.get(u,y).set(d,x,E)}get(u,y,d,x){var E;return(E=this._data.get(u,y))==null?void 0:E.get(d,x)}clear(){this._data.clear()}}},6114:(A,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 h=l.isNode?"node":navigator.userAgent,u=l.isNode?"node":navigator.platform;l.isFirefox=h.includes("Firefox"),l.isLegacyEdge=h.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(h),l.getSafariVersion=function(){if(!l.isSafari)return 0;const y=h.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),l.isIpad=u==="iPad",l.isIphone=u==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),l.isLinux=u.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(h)},6106:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let h=0;l.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(h=this._search(this._getKey(u)),this._array.splice(h,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const y=this._getKey(u);if(y===void 0||(h=this._search(y),h===-1)||this._getKey(this._array[h])!==y)return!1;do if(this._array[h]===u)return this._array.splice(h,1),!0;while(++h<this._array.length&&this._getKey(this._array[h])===y);return!1}*getKeyIterator(u){if(this._array.length!==0&&(h=this._search(u),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===u))do yield this._array[h];while(++h<this._array.length&&this._getKey(this._array[h])===u)}forEachByKey(u,y){if(this._array.length!==0&&(h=this._search(u),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===u))do y(this._array[h]);while(++h<this._array.length&&this._getKey(this._array[h])===u)}values(){return[...this._array].values()}_search(u){let y=0,d=this._array.length-1;for(;d>=y;){let x=y+d>>1;const E=this._getKey(this._array[x]);if(E>u)d=x-1;else{if(!(E<u)){for(;x>0&&this._getKey(this._array[x-1])===u;)x--;return x}y=x+1}}return y}}},7226:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const u=h(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,b=0,p=E.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(O=Date.now(),this._tasks[this._i]()||this._i++,O=Math.max(1,Date.now()-O),b=Math.max(O,b),v=E.timeRemaining(),1.5*b>v)return p-O<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(p-O))}ms`),void this._start();p=v}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=!u.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(x){return requestIdleCallback(x)}_cancelCallback(x){cancelIdleCallback(x)}}:d,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(x){this._queue.clear(),this._queue.enqueue(x)}flush(){this._queue.flush()}}},9282:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const u=h(643);l.updateWindowsModeWrappedState=function(y){const d=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),x=d==null?void 0:d.get(y.cols-1),E=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);E&&x&&(E.isWrapped=x[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&x[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class h{constructor(){this.fg=0,this.bg=0,this.extended=new u}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 h;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=h;class u{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,x=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=x}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=u},9092:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const u=h(6349),y=h(7226),d=h(3734),x=h(8437),E=h(4634),O=h(511),b=h(643),p=h(4863),v=h(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(f,_,S){this._hasScrollback=f,this._optionsService=_,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=x.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=O.CellData.fromCharData([0,b.NULL_CELL_CHAR,b.NULL_CELL_WIDTH,b.NULL_CELL_CODE]),this._whitespaceCell=O.CellData.fromCharData([0,b.WHITESPACE_CELL_CHAR,b.WHITESPACE_CELL_WIDTH,b.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 u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(f){return f?(this._whitespaceCell.fg=f.fg,this._whitespaceCell.bg=f.bg,this._whitespaceCell.extended=f.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,_){return new x.BufferLine(this._bufferService.cols,this.getNullCell(f),_)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const f=this.ybase+this.y-this.ydisp;return f>=0&&f<this._rows}_getCorrectBufferLength(f){if(!this._hasScrollback)return f;const _=f+this._optionsService.rawOptions.scrollback;return _>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:_}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=x.DEFAULT_ATTR_DATA);let _=this._rows;for(;_--;)this.lines.push(this.getBlankLine(f))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(f,_){const S=this.getNullCell(x.DEFAULT_ATTR_DATA);let R=0;const k=this._getCorrectBufferLength(_);if(k>this.lines.maxLength&&(this.lines.maxLength=k),this.lines.length>0){if(this._cols<f)for(let T=0;T<this.lines.length;T++)R+=+this.lines.get(T).resize(f,S);let M=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 x.BufferLine(f,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new x.BufferLine(f,S)));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(k<this.lines.maxLength){const T=this.lines.length-k;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=k}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,_-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=_-1,this._isReflowEnabled&&(this._reflow(f,_),this._cols>f))for(let M=0;M<this.lines.length;M++)R+=+this.lines.get(M).resize(f,S);this._cols=f,this._rows=_,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let f=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,f=!1);let _=0;for(;this._memoryCleanupPosition<this.lines.length;)if(_+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),_>100)return!0;return f}get _isReflowEnabled(){const f=this._optionsService.rawOptions.windowsPty;return f&&f.buildNumber?this._hasScrollback&&f.backend==="conpty"&&f.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(f,_){this._cols!==f&&(f>this._cols?this._reflowLarger(f,_):this._reflowSmaller(f,_))}_reflowLarger(f,_){const S=(0,E.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(x.DEFAULT_ATTR_DATA));if(S.length>0){const R=(0,E.reflowLargerCreateNewLayout)(this.lines,S);(0,E.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(f,_,R.countRemoved)}}_reflowLargerAdjustViewport(f,_,S){const R=this.getNullCell(x.DEFAULT_ATTR_DATA);let k=S;for(;k-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<_&&this.lines.push(new x.BufferLine(f,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(f,_){const S=this.getNullCell(x.DEFAULT_ATTR_DATA),R=[];let k=0;for(let M=this.lines.length-1;M>=0;M--){let T=this.lines.get(M);if(!T||!T.isWrapped&&T.getTrimmedLength()<=f)continue;const N=[T];for(;T.isWrapped&&M>0;)T=this.lines.get(--M),N.unshift(T);const P=this.ybase+this.y;if(P>=M&&P<M+N.length)continue;const F=N[N.length-1].getTrimmedLength(),G=(0,E.reflowSmallerGetNewLineLengths)(N,this._cols,f),$=G.length-N.length;let J;J=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+$):Math.max(0,this.lines.length-this.lines.maxLength+$);const te=[];for(let L=0;L<$;L++){const H=this.getBlankLine(x.DEFAULT_ATTR_DATA,!0);te.push(H)}te.length>0&&(R.push({start:M+N.length+k,newLines:te}),k+=te.length),N.push(...te);let q=G.length-1,K=G[q];K===0&&(q--,K=G[q]);let ee=N.length-$-1,j=F;for(;ee>=0;){const L=Math.min(j,K);if(N[q]===void 0)break;if(N[q].copyCellsFrom(N[ee],j-L,K-L,L,!0),K-=L,K===0&&(q--,K=G[q]),j-=L,j===0){ee--;const H=Math.max(ee,0);j=(0,E.getWrappedLineTrimmedLength)(N,H,this._cols)}}for(let L=0;L<N.length;L++)G[L]<f&&N[L].setCell(G[L],S);let B=$-J;for(;B-- >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+k)-_&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+$,this.ybase+_-1)}if(R.length>0){const M=[],T=[];for(let q=0;q<this.lines.length;q++)T.push(this.lines.get(q));const N=this.lines.length;let P=N-1,F=0,G=R[F];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+k);let $=0;for(let q=Math.min(this.lines.maxLength-1,N+k-1);q>=0;q--)if(G&&G.start>P+$){for(let K=G.newLines.length-1;K>=0;K--)this.lines.set(q--,G.newLines[K]);q++,M.push({index:P+1,amount:G.newLines.length}),$+=G.newLines.length,G=R[++F]}else this.lines.set(q,T[P--]);let J=0;for(let q=M.length-1;q>=0;q--)M[q].index+=J,this.lines.onInsertEmitter.fire(M[q]),J+=M[q].amount;const te=Math.max(0,N+k-this.lines.maxLength);te>0&&this.lines.onTrimEmitter.fire(te)}}translateBufferLineToString(f,_,S=0,R){const k=this.lines.get(f);return k?k.translateToString(_,S,R):""}getWrappedRangeForLine(f){let _=f,S=f;for(;_>0&&this.lines.get(_).isWrapped;)_--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:_,last:S}}setupTabStops(f){for(f!=null?this.tabs[f]||(f=this.prevStop(f)):(this.tabs={},f=0);f<this._cols;f+=this._optionsService.rawOptions.tabStopWidth)this.tabs[f]=!0}prevStop(f){for(f==null&&(f=this.x);!this.tabs[--f]&&f>0;);return f>=this._cols?this._cols-1:f<0?0:f}nextStop(f){for(f==null&&(f=this.x);!this.tabs[++f]&&f<this._cols;);return f>=this._cols?this._cols-1:f<0?0:f}clearMarkers(f){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].line===f&&(this.markers[_].dispose(),this.markers.splice(_--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].dispose(),this.markers.splice(f--,1);this._isClearing=!1}addMarker(f){const _=new p.Marker(f);return this.markers.push(_),_.register(this.lines.onTrim((S=>{_.line-=S,_.line<0&&_.dispose()}))),_.register(this.lines.onInsert((S=>{_.line>=S.index&&(_.line+=S.amount)}))),_.register(this.lines.onDelete((S=>{_.line>=S.index&&_.line<S.index+S.amount&&_.dispose(),_.line>S.index&&(_.line-=S.amount)}))),_.register(_.onDispose((()=>this._removeMarker(_)))),_}_removeMarker(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const u=h(3734),y=h(511),d=h(643),x=h(482);l.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let E=0;class O{constructor(p,v,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*p);const _=v||y.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let S=0;S<p;++S)this.setCell(S,_);this.length=p}get(p){const v=this._data[3*p+0],f=2097151&v;return[this._data[3*p+1],2097152&v?this._combined[p]:f?(0,x.stringFromCodePoint)(f):"",v>>22,2097152&v?this._combined[p].charCodeAt(this._combined[p].length-1):f]}set(p,v){this._data[3*p+1]=v[d.CHAR_DATA_ATTR_INDEX],v[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[p]=v[1],this._data[3*p+0]=2097152|p|v[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*p+0]=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(p){return this._data[3*p+0]>>22}hasWidth(p){return 12582912&this._data[3*p+0]}getFg(p){return this._data[3*p+1]}getBg(p){return this._data[3*p+2]}hasContent(p){return 4194303&this._data[3*p+0]}getCodePoint(p){const v=this._data[3*p+0];return 2097152&v?this._combined[p].charCodeAt(this._combined[p].length-1):2097151&v}isCombined(p){return 2097152&this._data[3*p+0]}getString(p){const v=this._data[3*p+0];return 2097152&v?this._combined[p]:2097151&v?(0,x.stringFromCodePoint)(2097151&v):""}isProtected(p){return 536870912&this._data[3*p+2]}loadCell(p,v){return E=3*p,v.content=this._data[E+0],v.fg=this._data[E+1],v.bg=this._data[E+2],2097152&v.content&&(v.combinedData=this._combined[p]),268435456&v.bg&&(v.extended=this._extendedAttrs[p]),v}setCell(p,v){2097152&v.content&&(this._combined[p]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[p]=v.extended),this._data[3*p+0]=v.content,this._data[3*p+1]=v.fg,this._data[3*p+2]=v.bg}setCellFromCodepoint(p,v,f,_){268435456&_.bg&&(this._extendedAttrs[p]=_.extended),this._data[3*p+0]=v|f<<22,this._data[3*p+1]=_.fg,this._data[3*p+2]=_.bg}addCodepointToCell(p,v,f){let _=this._data[3*p+0];2097152&_?this._combined[p]+=(0,x.stringFromCodePoint)(v):2097151&_?(this._combined[p]=(0,x.stringFromCodePoint)(2097151&_)+(0,x.stringFromCodePoint)(v),_&=-2097152,_|=2097152):_=v|4194304,f&&(_&=-12582913,_|=f<<22),this._data[3*p+0]=_}insertCells(p,v,f){if((p%=this.length)&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,f),v<this.length-p){const _=new y.CellData;for(let S=this.length-p-v-1;S>=0;--S)this.setCell(p+v+S,this.loadCell(p+S,_));for(let S=0;S<v;++S)this.setCell(p+S,f)}else for(let _=p;_<this.length;++_)this.setCell(_,f);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,f)}deleteCells(p,v,f){if(p%=this.length,v<this.length-p){const _=new y.CellData;for(let S=0;S<this.length-p-v;++S)this.setCell(p+S,this.loadCell(p+v+S,_));for(let S=this.length-v;S<this.length;++S)this.setCell(S,f)}else for(let _=p;_<this.length;++_)this.setCell(_,f);p&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,f),this.getWidth(p)!==0||this.hasContent(p)||this.setCellFromCodepoint(p,0,1,f)}replaceCells(p,v,f,_=!1){if(_)for(p&&this.getWidth(p-1)===2&&!this.isProtected(p-1)&&this.setCellFromCodepoint(p-1,0,1,f),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,f);p<v&&p<this.length;)this.isProtected(p)||this.setCell(p,f),p++;else for(p&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,f),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,f);p<v&&p<this.length;)this.setCell(p++,f)}resize(p,v){if(p===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*p;if(p>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const _=new Uint32Array(f);_.set(this._data),this._data=_}for(let _=this.length;_<p;++_)this.setCell(_,v)}else{this._data=this._data.subarray(0,f);const _=Object.keys(this._combined);for(let R=0;R<_.length;R++){const k=parseInt(_[R],10);k>=p&&delete this._combined[k]}const S=Object.keys(this._extendedAttrs);for(let R=0;R<S.length;R++){const k=parseInt(S[R],10);k>=p&&delete this._extendedAttrs[k]}}return this.length=p,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const p=new Uint32Array(this._data.length);return p.set(this._data),this._data=p,1}return 0}fill(p,v=!1){if(v)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,p);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,p)}}copyFrom(p){this.length!==p.length?this._data=new Uint32Array(p._data):this._data.set(p._data),this.length=p.length,this._combined={};for(const v in p._combined)this._combined[v]=p._combined[v];this._extendedAttrs={};for(const v in p._extendedAttrs)this._extendedAttrs[v]=p._extendedAttrs[v];this.isWrapped=p.isWrapped}clone(){const p=new O(0);p._data=new Uint32Array(this._data),p.length=this.length;for(const v in this._combined)p._combined[v]=this._combined[v];for(const v in this._extendedAttrs)p._extendedAttrs[v]=this._extendedAttrs[v];return p.isWrapped=this.isWrapped,p}getTrimmedLength(){for(let p=this.length-1;p>=0;--p)if(4194303&this._data[3*p+0])return p+(this._data[3*p+0]>>22);return 0}getNoBgTrimmedLength(){for(let p=this.length-1;p>=0;--p)if(4194303&this._data[3*p+0]||50331648&this._data[3*p+2])return p+(this._data[3*p+0]>>22);return 0}copyCellsFrom(p,v,f,_,S){const R=p._data;if(S)for(let M=_-1;M>=0;M--){for(let T=0;T<3;T++)this._data[3*(f+M)+T]=R[3*(v+M)+T];268435456&R[3*(v+M)+2]&&(this._extendedAttrs[f+M]=p._extendedAttrs[v+M])}else for(let M=0;M<_;M++){for(let T=0;T<3;T++)this._data[3*(f+M)+T]=R[3*(v+M)+T];268435456&R[3*(v+M)+2]&&(this._extendedAttrs[f+M]=p._extendedAttrs[v+M])}const k=Object.keys(p._combined);for(let M=0;M<k.length;M++){const T=parseInt(k[M],10);T>=v&&(this._combined[T-v+f]=p._combined[T])}}translateToString(p,v,f,_){v=v??0,f=f??this.length,p&&(f=Math.min(f,this.getTrimmedLength())),_&&(_.length=0);let S="";for(;v<f;){const R=this._data[3*v+0],k=2097151&R,M=2097152&R?this._combined[v]:k?(0,x.stringFromCodePoint)(k):d.WHITESPACE_CELL_CHAR;if(S+=M,_)for(let T=0;T<M.length;++T)_.push(v);v+=R>>22||1}return _&&_.push(v),S}}l.BufferLine=O},4841:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(h,u){if(h.start.y>h.end.y)throw new Error(`Buffer range end (${h.end.x}, ${h.end.y}) cannot be before start (${h.start.x}, ${h.start.y})`);return u*(h.end.y-h.start.y)+(h.end.x-h.start.x+1)}},4634:(A,l)=>{function h(u,y,d){if(y===u.length-1)return u[y].getTrimmedLength();const x=!u[y].hasContent(d-1)&&u[y].getWidth(d-1)===1,E=u[y+1].getWidth(0)===2;return x&&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(u,y,d,x,E){const O=[];for(let b=0;b<u.length-1;b++){let p=b,v=u.get(++p);if(!v.isWrapped)continue;const f=[u.get(b)];for(;p<u.length&&v.isWrapped;)f.push(v),v=u.get(++p);if(x>=b&&x<p){b+=f.length-1;continue}let _=0,S=h(f,_,y),R=1,k=0;for(;R<f.length;){const T=h(f,R,y),N=T-k,P=d-S,F=Math.min(N,P);f[_].copyCellsFrom(f[R],k,S,F,!1),S+=F,S===d&&(_++,S=0),k+=F,k===T&&(R++,k=0),S===0&&_!==0&&f[_-1].getWidth(d-1)===2&&(f[_].copyCellsFrom(f[_-1],d-1,S++,1,!1),f[_-1].setCell(d-1,E))}f[_].replaceCells(S,d,E);let M=0;for(let T=f.length-1;T>0&&(T>_||f[T].getTrimmedLength()===0);T--)M++;M>0&&(O.push(b+f.length-M),O.push(M)),b+=f.length-1}return O},l.reflowLargerCreateNewLayout=function(u,y){const d=[];let x=0,E=y[x],O=0;for(let b=0;b<u.length;b++)if(E===b){const p=y[++x];u.onDeleteEmitter.fire({index:b-O,amount:p}),b+=p-1,O+=p,E=y[++x]}else d.push(b);return{layout:d,countRemoved:O}},l.reflowLargerApplyNewLayout=function(u,y){const d=[];for(let x=0;x<y.length;x++)d.push(u.get(y[x]));for(let x=0;x<d.length;x++)u.set(x,d[x]);u.length=y.length},l.reflowSmallerGetNewLineLengths=function(u,y,d){const x=[],E=u.map(((v,f)=>h(u,f,y))).reduce(((v,f)=>v+f));let O=0,b=0,p=0;for(;p<E;){if(E-p<d){x.push(E-p);break}O+=d;const v=h(u,b,y);O>v&&(O-=v,b++);const f=u[b].getWidth(O-1)===2;f&&O--;const _=f?d-1:d;x.push(_),p+=_}return x},l.getWrappedLineTrimmedLength=h},5295:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const u=h(8460),y=h(844),d=h(9092);class x extends y.Disposable{constructor(O,b){super(),this._optionsService=O,this._bufferService=b,this._onBufferActivate=this.register(new u.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,b){this._normal.resize(O,b),this._alt.resize(O,b),this.setupTabStops(O)}setupTabStops(O){this._normal.setupTabStops(O),this._alt.setupTabStops(O)}}l.BufferSet=x},511:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const u=h(482),y=h(643),d=h(3734);class x 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 b=new x;return b.setFromCharData(O),b}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.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 b=!1;if(O[y.CHAR_DATA_CHAR_INDEX].length>2)b=!0;else if(O[y.CHAR_DATA_CHAR_INDEX].length===2){const p=O[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=p&&p<=56319){const v=O[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(p-55296)+v-56320+65536|O[y.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=O[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|O[y.CHAR_DATA_WIDTH_INDEX]<<22;b&&(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=x},643:(A,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:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const u=h(8460),y=h(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 u.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:(A,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:(A,l)=>{var h,u,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=`
|
|
301
|
+
`,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=""})(h||(l.C0=h={})),(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=""})(u||(l.C1=u={})),(function(d){d.ST=`${h.ESC}\\`})(y||(l.C1_ESCAPED=y={}))},7399:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const u=h(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,x,E,O){const b={type:0,cancel:!1,key:void 0},p=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?b.key=x?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?b.key=x?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?b.key=x?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(b.key=x?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:b.key=d.ctrlKey?"\b":u.C0.DEL,d.altKey&&(b.key=u.C0.ESC+b.key);break;case 9:if(d.shiftKey){b.key=u.C0.ESC+"[Z";break}b.key=u.C0.HT,b.cancel=!0;break;case 13:b.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,b.cancel=!0;break;case 27:b.key=u.C0.ESC,d.altKey&&(b.key=u.C0.ESC+u.C0.ESC),b.cancel=!0;break;case 37:if(d.metaKey)break;p?(b.key=u.C0.ESC+"[1;"+(p+1)+"D",b.key===u.C0.ESC+"[1;3D"&&(b.key=u.C0.ESC+(E?"b":"[1;5D"))):b.key=x?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;p?(b.key=u.C0.ESC+"[1;"+(p+1)+"C",b.key===u.C0.ESC+"[1;3C"&&(b.key=u.C0.ESC+(E?"f":"[1;5C"))):b.key=x?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;p?(b.key=u.C0.ESC+"[1;"+(p+1)+"A",E||b.key!==u.C0.ESC+"[1;3A"||(b.key=u.C0.ESC+"[1;5A")):b.key=x?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;p?(b.key=u.C0.ESC+"[1;"+(p+1)+"B",E||b.key!==u.C0.ESC+"[1;3B"||(b.key=u.C0.ESC+"[1;5B")):b.key=x?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(b.key=u.C0.ESC+"[2~");break;case 46:b.key=p?u.C0.ESC+"[3;"+(p+1)+"~":u.C0.ESC+"[3~";break;case 36:b.key=p?u.C0.ESC+"[1;"+(p+1)+"H":x?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:b.key=p?u.C0.ESC+"[1;"+(p+1)+"F":x?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?b.type=2:d.ctrlKey?b.key=u.C0.ESC+"[5;"+(p+1)+"~":b.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?b.type=3:d.ctrlKey?b.key=u.C0.ESC+"[6;"+(p+1)+"~":b.key=u.C0.ESC+"[6~";break;case 112:b.key=p?u.C0.ESC+"[1;"+(p+1)+"P":u.C0.ESC+"OP";break;case 113:b.key=p?u.C0.ESC+"[1;"+(p+1)+"Q":u.C0.ESC+"OQ";break;case 114:b.key=p?u.C0.ESC+"[1;"+(p+1)+"R":u.C0.ESC+"OR";break;case 115:b.key=p?u.C0.ESC+"[1;"+(p+1)+"S":u.C0.ESC+"OS";break;case 116:b.key=p?u.C0.ESC+"[15;"+(p+1)+"~":u.C0.ESC+"[15~";break;case 117:b.key=p?u.C0.ESC+"[17;"+(p+1)+"~":u.C0.ESC+"[17~";break;case 118:b.key=p?u.C0.ESC+"[18;"+(p+1)+"~":u.C0.ESC+"[18~";break;case 119:b.key=p?u.C0.ESC+"[19;"+(p+1)+"~":u.C0.ESC+"[19~";break;case 120:b.key=p?u.C0.ESC+"[20;"+(p+1)+"~":u.C0.ESC+"[20~";break;case 121:b.key=p?u.C0.ESC+"[21;"+(p+1)+"~":u.C0.ESC+"[21~";break;case 122:b.key=p?u.C0.ESC+"[23;"+(p+1)+"~":u.C0.ESC+"[23~";break;case 123:b.key=p?u.C0.ESC+"[24;"+(p+1)+"~":u.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?b.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(b.key=u.C0.US),d.key==="@"&&(b.key=u.C0.NUL)):d.keyCode===65&&(b.type=1);else{const v=y[d.keyCode],f=v==null?void 0:v[d.shiftKey?1:0];if(f)b.key=u.C0.ESC+f;else if(d.keyCode>=65&&d.keyCode<=90){const _=d.ctrlKey?d.keyCode-64:d.keyCode+32;let S=String.fromCharCode(_);d.shiftKey&&(S=S.toUpperCase()),b.key=u.C0.ESC+S}else if(d.keyCode===32)b.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let _=d.code.slice(3,4);d.shiftKey||(_=_.toLowerCase()),b.key=u.C0.ESC+_,b.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?b.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?b.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?b.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?b.key=u.C0.DEL:d.keyCode===219?b.key=u.C0.ESC:d.keyCode===220?b.key=u.C0.FS:d.keyCode===221&&(b.key=u.C0.GS)}return b}},482:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},l.utf32ToString=function(h,u=0,y=h.length){let d="";for(let x=u;x<y;++x){let E=h[x];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(h,u){const y=h.length;if(!y)return 0;let d=0,x=0;if(this._interim){const E=h.charCodeAt(x++);56320<=E&&E<=57343?u[d++]=1024*(this._interim-55296)+E-56320+65536:(u[d++]=this._interim,u[d++]=E),this._interim=0}for(let E=x;E<y;++E){const O=h.charCodeAt(E);if(55296<=O&&O<=56319){if(++E>=y)return this._interim=O,d;const b=h.charCodeAt(E);56320<=b&&b<=57343?u[d++]=1024*(O-55296)+b-56320+65536:(u[d++]=O,u[d++]=b)}else O!==65279&&(u[d++]=O)}return d}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(h,u){const y=h.length;if(!y)return 0;let d,x,E,O,b=0,p=0,v=0;if(this.interim[0]){let S=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let k,M=0;for(;(k=63&this.interim[++M])&&M<4;)R<<=6,R|=k;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,N=T-M;for(;v<N;){if(v>=y)return 0;if(k=h[v++],(192&k)!=128){v--,S=!0;break}this.interim[M++]=k,R<<=6,R|=63&k}S||(T===2?R<128?v--:u[b++]=R:T===3?R<2048||R>=55296&&R<=57343||R===65279||(u[b++]=R):R<65536||R>1114111||(u[b++]=R)),this.interim.fill(0)}const f=y-4;let _=v;for(;_<y;){for(;!(!(_<f)||128&(d=h[_])||128&(x=h[_+1])||128&(E=h[_+2])||128&(O=h[_+3]));)u[b++]=d,u[b++]=x,u[b++]=E,u[b++]=O,_+=4;if(d=h[_++],d<128)u[b++]=d;else if((224&d)==192){if(_>=y)return this.interim[0]=d,b;if(x=h[_++],(192&x)!=128){_--;continue}if(p=(31&d)<<6|63&x,p<128){_--;continue}u[b++]=p}else if((240&d)==224){if(_>=y)return this.interim[0]=d,b;if(x=h[_++],(192&x)!=128){_--;continue}if(_>=y)return this.interim[0]=d,this.interim[1]=x,b;if(E=h[_++],(192&E)!=128){_--;continue}if(p=(15&d)<<12|(63&x)<<6|63&E,p<2048||p>=55296&&p<=57343||p===65279)continue;u[b++]=p}else if((248&d)==240){if(_>=y)return this.interim[0]=d,b;if(x=h[_++],(192&x)!=128){_--;continue}if(_>=y)return this.interim[0]=d,this.interim[1]=x,b;if(E=h[_++],(192&E)!=128){_--;continue}if(_>=y)return this.interim[0]=d,this.interim[1]=x,this.interim[2]=E,b;if(O=h[_++],(192&O)!=128){_--;continue}if(p=(7&d)<<18|(63&x)<<12|(63&E)<<6|63&O,p<65536||p>1114111)continue;u[b++]=p}}return b}}},225:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const u=h(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 x;l.UnicodeV6=class{constructor(){if(this.version="6",!x){x=new Uint8Array(65536),x.fill(1),x[0]=0,x.fill(0,1,32),x.fill(0,127,160),x.fill(2,4352,4448),x[9001]=2,x[9002]=2,x.fill(2,11904,42192),x[12351]=1,x.fill(2,44032,55204),x.fill(2,63744,64256),x.fill(2,65040,65050),x.fill(2,65072,65136),x.fill(2,65280,65377),x.fill(2,65504,65511);for(let E=0;E<y.length;++E)x.fill(0,y[E][0],y[E][1]+1)}}wcwidth(E){return E<32?0:E<127?1:E<65536?x[E]:(function(O,b){let p,v=0,f=b.length-1;if(O<b[0][0]||O>b[f][1])return!1;for(;f>=v;)if(p=v+f>>1,O>b[p][1])v=p+1;else{if(!(O<b[p][0]))return!0;f=p-1}return!1})(E,d)?0:E>=131072&&E<=196605||E>=196608&&E<=262141?2:1}charProperties(E,O){let b=this.wcwidth(E),p=b===0&&O!==0;if(p){const v=u.UnicodeService.extractWidth(O);v===0?p=!1:v>b&&(b=v)}return u.UnicodeService.createPropertyValue(0,b,p)}}},5981:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const u=h(8460),y=h(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 u.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 b;for(this._isSyncWriting=!0;b=this._writeBuffer.shift();){this._action(b);const p=this._callbacks.shift();p&&p()}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 b=E||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const p=this._writeBuffer[this._bufferOffset],v=this._action(p,O);if(v){const _=S=>Date.now()-b>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(b,S);return void v.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(_)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=p.length,Date.now()-b>=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:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const h=/^([\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})$/,u=/^[\da-f]+$/;function y(d,x){const E=d.toString(16),O=E.length<2?"0"+E:E;switch(x){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 x=d.toLowerCase();if(x.indexOf("rgb:")===0){x=x.slice(4);const E=h.exec(x);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(x.indexOf("#")===0&&(x=x.slice(1),u.exec(x)&&[3,6,9,12].includes(x.length))){const E=x.length/3,O=[0,0,0];for(let b=0;b<3;++b){const p=parseInt(x.slice(E*b,E*b+E),16);O[b]=E===1?p<<4:E===2?p:E===3?p>>4:p>>8}return O}},l.toRgbString=function(d,x=16){const[E,O,b]=d;return`rgb:${y(E,x)}/${y(O,x)}/${y(b,x)}`}},5770:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const u=h(482),y=h(8742),d=h(5770),x=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=x,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=x}registerHandler(O,b){this._handlers[O]===void 0&&(this._handlers[O]=[]);const p=this._handlers[O];return p.push(b),{dispose:()=>{const v=p.indexOf(b);v!==-1&&p.splice(v,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=x,this._ident=0}hook(O,b){if(this.reset(),this._ident=O,this._active=this._handlers[O]||x,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].hook(b);else this._handlerFb(this._ident,"HOOK",b)}put(O,b,p){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(O,b,p);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(O,b,p))}unhook(O,b=!0){if(this._active.length){let p=!1,v=this._active.length-1,f=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,p=b,f=this._stack.fallThrough,this._stack.paused=!1),!f&&p===!1){for(;v>=0&&(p=this._active[v].unhook(O),p!==!0);v--)if(p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,p;v--}for(;v>=0;v--)if(p=this._active[v].unhook(!1),p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,p}else this._handlerFb(this._ident,"UNHOOK",O);this._active=x,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,b,p){this._hitLimit||(this._data+=(0,u.utf32ToString)(O,b,p),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(O){let b=!1;if(this._hitLimit)b=!1;else if(O&&(b=this._handler(this._data,this._params),b instanceof Promise))return b.then((p=>(this._params=E,this._data="",this._hitLimit=!1,p)));return this._params=E,this._data="",this._hitLimit=!1,b}}},2015:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const u=h(844),y=h(8742),d=h(6242),x=h(6351);class E{constructor(v){this.table=new Uint8Array(v)}setDefault(v,f){this.table.fill(v<<4|f)}add(v,f,_,S){this.table[f<<8|v]=_<<4|S}addMany(v,f,_,S){for(let R=0;R<v.length;R++)this.table[f<<8|v[R]]=_<<4|S}}l.TransitionTable=E;const O=160;l.VT500_TRANSITION_TABLE=(function(){const p=new E(4095),v=Array.apply(null,Array(256)).map(((M,T)=>T)),f=(M,T)=>v.slice(M,T),_=f(32,127),S=f(0,24);S.push(25),S.push.apply(S,f(28,32));const R=f(0,14);let k;for(k in p.setDefault(1,0),p.addMany(_,0,2,0),R)p.addMany([24,26,153,154],k,3,0),p.addMany(f(128,144),k,3,0),p.addMany(f(144,152),k,3,0),p.add(156,k,0,0),p.add(27,k,11,1),p.add(157,k,4,8),p.addMany([152,158,159],k,0,7),p.add(155,k,11,3),p.add(144,k,11,9);return p.addMany(S,0,3,0),p.addMany(S,1,3,1),p.add(127,1,0,1),p.addMany(S,8,0,8),p.addMany(S,3,3,3),p.add(127,3,0,3),p.addMany(S,4,3,4),p.add(127,4,0,4),p.addMany(S,6,3,6),p.addMany(S,5,3,5),p.add(127,5,0,5),p.addMany(S,2,3,2),p.add(127,2,0,2),p.add(93,1,4,8),p.addMany(_,8,5,8),p.add(127,8,5,8),p.addMany([156,27,24,26,7],8,6,0),p.addMany(f(28,32),8,0,8),p.addMany([88,94,95],1,0,7),p.addMany(_,7,0,7),p.addMany(S,7,0,7),p.add(156,7,0,0),p.add(127,7,0,7),p.add(91,1,11,3),p.addMany(f(64,127),3,7,0),p.addMany(f(48,60),3,8,4),p.addMany([60,61,62,63],3,9,4),p.addMany(f(48,60),4,8,4),p.addMany(f(64,127),4,7,0),p.addMany([60,61,62,63],4,0,6),p.addMany(f(32,64),6,0,6),p.add(127,6,0,6),p.addMany(f(64,127),6,0,0),p.addMany(f(32,48),3,9,5),p.addMany(f(32,48),5,9,5),p.addMany(f(48,64),5,0,6),p.addMany(f(64,127),5,7,0),p.addMany(f(32,48),4,9,5),p.addMany(f(32,48),1,9,2),p.addMany(f(32,48),2,9,2),p.addMany(f(48,127),2,10,0),p.addMany(f(48,80),1,10,0),p.addMany(f(81,88),1,10,0),p.addMany([89,90,92],1,10,0),p.addMany(f(96,127),1,10,0),p.add(80,1,11,9),p.addMany(S,9,0,9),p.add(127,9,0,9),p.addMany(f(28,32),9,0,9),p.addMany(f(32,48),9,9,12),p.addMany(f(48,60),9,8,10),p.addMany([60,61,62,63],9,9,10),p.addMany(S,11,0,11),p.addMany(f(32,128),11,0,11),p.addMany(f(28,32),11,0,11),p.addMany(S,10,0,10),p.add(127,10,0,10),p.addMany(f(28,32),10,0,10),p.addMany(f(48,60),10,8,10),p.addMany([60,61,62,63],10,0,11),p.addMany(f(32,48),10,9,12),p.addMany(S,12,0,12),p.add(127,12,0,12),p.addMany(f(28,32),12,0,12),p.addMany(f(32,48),12,9,12),p.addMany(f(48,64),12,0,11),p.addMany(f(64,127),12,12,13),p.addMany(f(64,127),10,12,13),p.addMany(f(64,127),9,12,13),p.addMany(S,13,13,13),p.addMany(_,13,13,13),p.add(127,13,0,13),p.addMany([27,156,24,26],13,14,0),p.add(O,0,2,0),p.add(O,8,5,8),p.add(O,6,0,6),p.add(O,11,0,11),p.add(O,13,13,13),p})();class b extends u.Disposable{constructor(v=l.VT500_TRANSITION_TABLE){super(),this._transitions=v,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=(f,_,S)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,_)=>{},this._escHandlerFb=f=>{},this._errorHandlerFb=f=>f,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.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 x.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,f=[64,126]){let _=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(_=v.prefix.charCodeAt(0),_&&60>_||_>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<v.intermediates.length;++R){const k=v.intermediates.charCodeAt(R);if(32>k||k>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");_<<=8,_|=k}}if(v.final.length!==1)throw new Error("final must be a single byte");const S=v.final.charCodeAt(0);if(f[0]>S||S>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return _<<=8,_|=S,_}identToString(v){const f=[];for(;v;)f.push(String.fromCharCode(255&v)),v>>=8;return f.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,f){const _=this._identifier(v,[48,126]);this._escHandlers[_]===void 0&&(this._escHandlers[_]=[]);const S=this._escHandlers[_];return S.push(f),{dispose:()=>{const R=S.indexOf(f);R!==-1&&S.splice(R,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,f){this._executeHandlers[v.charCodeAt(0)]=f}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,f){const _=this._identifier(v);this._csiHandlers[_]===void 0&&(this._csiHandlers[_]=[]);const S=this._csiHandlers[_];return S.push(f),{dispose:()=>{const R=S.indexOf(f);R!==-1&&S.splice(R,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,f){return this._dcsParser.registerHandler(this._identifier(v),f)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,f){return this._oscParser.registerHandler(v,f)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}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(v,f,_,S,R){this._parseStack.state=v,this._parseStack.handlers=f,this._parseStack.handlerPos=_,this._parseStack.transition=S,this._parseStack.chunkPos=R}parse(v,f,_){let S,R=0,k=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=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 N=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(_===!1&&N>-1){for(;N>=0&&(S=T[N](this._params),S!==!0);N--)if(S instanceof Promise)return this._parseStack.handlerPos=N,S}this._parseStack.handlers=[];break;case 4:if(_===!1&&N>-1){for(;N>=0&&(S=T[N](),S!==!0);N--)if(S instanceof Promise)return this._parseStack.handlerPos=N,S}this._parseStack.handlers=[];break;case 6:if(R=v[this._parseStack.chunkPos],S=this._dcsParser.unhook(R!==24&&R!==26,_),S)return S;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=v[this._parseStack.chunkPos],S=this._oscParser.end(R!==24&&R!==26,_),S)return S;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let T=M;T<f;++T){switch(R=v[T],k=this._transitions.table[this.currentState<<8|(R<160?R:O)],k>>4){case 2:for(let $=T+1;;++$){if($>=f||(R=v[$])<32||R>126&&R<O){this._printHandler(v,T,$),T=$-1;break}if(++$>=f||(R=v[$])<32||R>126&&R<O){this._printHandler(v,T,$),T=$-1;break}if(++$>=f||(R=v[$])<32||R>126&&R<O){this._printHandler(v,T,$),T=$-1;break}if(++$>=f||(R=v[$])<32||R>126&&R<O){this._printHandler(v,T,$),T=$-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:T,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const N=this._csiHandlers[this._collect<<8|R];let P=N?N.length-1:-1;for(;P>=0&&(S=N[P](this._params),S!==!0);P--)if(S instanceof Promise)return this._preserveStack(3,N,P,k,T),S;P<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++T<f&&(R=v[T])>47&&R<60);T--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const F=this._escHandlers[this._collect<<8|R];let G=F?F.length-1:-1;for(;G>=0&&(S=F[G](),S!==!0);G--)if(S instanceof Promise)return this._preserveStack(4,F,G,k,T),S;G<0&&this._escHandlerFb(this._collect<<8|R),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|R,this._params);break;case 13:for(let $=T+1;;++$)if($>=f||(R=v[$])===24||R===26||R===27||R>127&&R<O){this._dcsParser.put(v,T,$),T=$-1;break}break;case 14:if(S=this._dcsParser.unhook(R!==24&&R!==26),S)return this._preserveStack(6,[],0,k,T),S;R===27&&(k|=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 $=T+1;;$++)if($>=f||(R=v[$])<32||R>127&&R<O){this._oscParser.put(v,T,$),T=$-1;break}break;case 6:if(S=this._oscParser.end(R!==24&&R!==26),S)return this._preserveStack(5,[],0,k,T),S;R===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&k}}}l.EscapeSequenceParser=b},6242:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const u=h(5770),y=h(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(x,E){this._handlers[x]===void 0&&(this._handlers[x]=[]);const O=this._handlers[x];return O.push(E),{dispose:()=>{const b=O.indexOf(E);b!==-1&&O.splice(b,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].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 x=this._active.length-1;x>=0;x--)this._active[x].start();else this._handlerFb(this._id,"START")}_put(x,E,O){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(x,E,O);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(x,E,O))}start(){this.reset(),this._state=1}put(x,E,O){if(this._state!==3){if(this._state===1)for(;E<O;){const b=x[E++];if(b===59){this._state=2,this._start();break}if(b<48||57<b)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+b-48}this._state===2&&O-E>0&&this._put(x,E,O)}}end(x,E=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let O=!1,b=this._active.length-1,p=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,O=E,p=this._stack.fallThrough,this._stack.paused=!1),!p&&O===!1){for(;b>=0&&(O=this._active[b].end(x),O!==!0);b--)if(O instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,O;b--}for(;b>=0;b--)if(O=this._active[b].end(!1),O instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,O}else this._handlerFb(this._id,"END",x);this._active=d,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(x){this._handler=x,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(x,E,O){this._hitLimit||(this._data+=(0,y.utf32ToString)(x,E,O),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(x){let E=!1;if(this._hitLimit)E=!1;else if(x&&(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:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const h=2147483647;class u{static fromArray(d){const x=new u;if(!d.length)return x;for(let E=Array.isArray(d[0])?1:0;E<d.length;++E){const O=d[E];if(Array.isArray(O))for(let b=0;b<O.length;++b)x.addSubParam(O[b]);else x.addParam(O)}return x}constructor(d=32,x=32){if(this.maxLength=d,this.maxSubParamsLength=x,x>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(x),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(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 x=0;x<this.length;++x){d.push(this.params[x]);const E=this._subParamsIdx[x]>>8,O=255&this._subParamsIdx[x];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>h?h: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>h?h:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const x=this._subParamsIdx[d]>>8,E=255&this._subParamsIdx[d];return E-x>0?this._subParams.subarray(x,E):null}getSubParamsAll(){const d={};for(let x=0;x<this.length;++x){const E=this._subParamsIdx[x]>>8,O=255&this._subParamsIdx[x];O-E>0&&(d[x]=this._subParams.slice(E,O))}return d}addDigit(d){let x;if(this._rejectDigits||!(x=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const E=this._digitIsSub?this._subParams:this.params,O=E[x-1];E[x-1]=~O?Math.min(10*O+d,h):d}}l.Params=u},5741:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let h=this._addons.length-1;h>=0;h--)this._addons[h].instance.dispose()}loadAddon(h,u){const y={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(y),u.dispose=()=>this._wrappedAddonDispose(y),u.activate(h)}_wrappedAddonDispose(h){if(h.isDisposed)return;let u=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===h){u=y;break}if(u===-1)throw new Error("Could not dispose an addon that has not been loaded");h.isDisposed=!0,h.dispose.apply(h.instance),this._addons.splice(u,1)}}},8771:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const u=h(3785),y=h(511);l.BufferApiView=class{constructor(d,x){this._buffer=d,this.type=x}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 x=this._buffer.lines.get(d);if(x)return new u.BufferLineApiView(x)}getNullCell(){return new y.CellData}}},3785:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const u=h(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 u.CellData)}translateToString(y,d,x){return this._line.translateToString(y,d,x)}}},8285:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const u=h(8771),y=h(8460),d=h(844);class x extends d.Disposable{constructor(O){super(),this._core=O,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.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=x},7975:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(h){this._core=h}registerCsiHandler(h,u){return this._core.registerCsiHandler(h,(y=>u(y.toArray())))}addCsiHandler(h,u){return this.registerCsiHandler(h,u)}registerDcsHandler(h,u){return this._core.registerDcsHandler(h,((y,d)=>u(y,d.toArray())))}addDcsHandler(h,u){return this.registerDcsHandler(h,u)}registerEscHandler(h,u){return this._core.registerEscHandler(h,u)}addEscHandler(h,u){return this.registerEscHandler(h,u)}registerOscHandler(h,u){return this._core.registerOscHandler(h,u)}addOscHandler(h,u){return this.registerOscHandler(h,u)}}},7090:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(h){this._core=h}register(h){this._core.unicodeService.register(h)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(h){this._core.unicodeService.activeVersion=h}}},744:function(A,l,h){var u=this&&this.__decorate||function(p,v,f,_){var S,R=arguments.length,k=R<3?v:_===null?_=Object.getOwnPropertyDescriptor(v,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,v,f,_);else for(var M=p.length-1;M>=0;M--)(S=p[M])&&(k=(R<3?S(k):R>3?S(v,f,k):S(v,f))||k);return R>3&&k&&Object.defineProperty(v,f,k),k},y=this&&this.__param||function(p,v){return function(f,_){v(f,_,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const d=h(8460),x=h(844),E=h(5295),O=h(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let b=l.BufferService=class extends x.Disposable{get buffer(){return this.buffers.active}constructor(p){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(p.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(p.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new E.BufferSet(p,this))}resize(p,v){this.cols=p,this.rows=v,this.buffers.resize(p,v),this._onResize.fire({cols:p,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(p,v=!1){const f=this.buffer;let _;_=this._cachedBlankLine,_&&_.length===this.cols&&_.getFg(0)===p.fg&&_.getBg(0)===p.bg||(_=f.getBlankLine(p,v),this._cachedBlankLine=_),_.isWrapped=v;const S=f.ybase+f.scrollTop,R=f.ybase+f.scrollBottom;if(f.scrollTop===0){const k=f.lines.isFull;R===f.lines.length-1?k?f.lines.recycle().copyFrom(_):f.lines.push(_.clone()):f.lines.splice(R+1,0,_.clone()),k?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const k=R-S+1;f.lines.shiftElements(S+1,k-1,-1),f.lines.set(R,_.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(p,v,f){const _=this.buffer;if(p<0){if(_.ydisp===0)return;this.isUserScrolling=!0}else p+_.ydisp>=_.ybase&&(this.isUserScrolling=!1);const S=_.ydisp;_.ydisp=Math.max(Math.min(_.ydisp+p,_.ybase),0),S!==_.ydisp&&(v||this._onScroll.fire(_.ydisp))}};l.BufferService=b=u([y(0,O.IOptionsService)],b)},7994:(A,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(h){this.glevel=h,this.charset=this._charsets[h]}setgCharset(h,u){this._charsets[h]=u,this.glevel===h&&(this.charset=u)}}},1753:function(A,l,h){var u=this&&this.__decorate||function(_,S,R,k){var M,T=arguments.length,N=T<3?S:k===null?k=Object.getOwnPropertyDescriptor(S,R):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(_,S,R,k);else for(var P=_.length-1;P>=0;P--)(M=_[P])&&(N=(T<3?M(N):T>3?M(S,R,N):M(S,R))||N);return T>3&&N&&Object.defineProperty(S,R,N),N},y=this&&this.__param||function(_,S){return function(R,k){S(R,k,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const d=h(2585),x=h(8460),E=h(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 b(_,S){let R=(_.ctrl?16:0)|(_.shift?4:0)|(_.alt?8:0);return _.button===4?(R|=64,R|=_.action):(R|=3&_.button,4&_.button&&(R|=64),8&_.button&&(R|=128),_.action===32?R|=32:_.action!==0||S||(R|=3)),R}const p=String.fromCharCode,v={DEFAULT:_=>{const S=[b(_,!1)+32,_.col+32,_.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${p(S[0])}${p(S[1])}${p(S[2])}`},SGR:_=>{const S=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${b(_,!0)};${_.col};${_.row}${S}`},SGR_PIXELS:_=>{const S=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${b(_,!0)};${_.x};${_.y}${S}`}};let f=l.CoreMouseService=class extends E.Disposable{constructor(_,S){super(),this._bufferService=_,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new x.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(O))this.addProtocol(R,O[R]);for(const R of Object.keys(v))this.addEncoding(R,v[R]);this.reset()}addProtocol(_,S){this._protocols[_]=S}addEncoding(_,S){this._encodings[_]=S}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 S=this._encodings[this._activeEncoding](_);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=_,!0}explainEvents(_){return{down:!!(1&_),up:!!(2&_),drag:!!(4&_),move:!!(8&_),wheel:!!(16&_)}}_equalEvents(_,S,R){if(R){if(_.x!==S.x||_.y!==S.y)return!1}else if(_.col!==S.col||_.row!==S.row)return!1;return _.button===S.button&&_.action===S.action&&_.ctrl===S.ctrl&&_.alt===S.alt&&_.shift===S.shift}};l.CoreMouseService=f=u([y(0,d.IBufferService),y(1,d.ICoreService)],f)},6975:function(A,l,h){var u=this&&this.__decorate||function(f,_,S,R){var k,M=arguments.length,T=M<3?_:R===null?R=Object.getOwnPropertyDescriptor(_,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(f,_,S,R);else for(var N=f.length-1;N>=0;N--)(k=f[N])&&(T=(M<3?k(T):M>3?k(_,S,T):k(_,S))||T);return M>3&&T&&Object.defineProperty(_,S,T),T},y=this&&this.__param||function(f,_){return function(S,R){_(S,R,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const d=h(1439),x=h(8460),E=h(844),O=h(2585),b=Object.freeze({insertMode:!1}),p=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=l.CoreService=class extends E.Disposable{constructor(f,_,S){super(),this._bufferService=f,this._logService=_,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new x.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new x.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new x.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new x.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(b),this.decPrivateModes=(0,d.clone)(p)}reset(){this.modes=(0,d.clone)(b),this.decPrivateModes=(0,d.clone)(p)}triggerDataEvent(f,_=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;_&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),_&&this._onUserInput.fire(),this._logService.debug(`sending data "${f}"`,(()=>f.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,(()=>f.split("").map((_=>_.charCodeAt(0))))),this._onBinary.fire(f))}};l.CoreService=v=u([y(0,O.IBufferService),y(1,O.ILogService),y(2,O.IOptionsService)],v)},9074:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const u=h(8055),y=h(8460),d=h(844),x=h(6106);let E=0,O=0;class b extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new x.SortedList((f=>f==null?void 0:f.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(f){if(f.marker.isDisposed)return;const _=new p(f);if(_){const S=_.marker.onDispose((()=>_.dispose()));_.onDispose((()=>{_&&(this._decorations.delete(_)&&this._onDecorationRemoved.fire(_),S.dispose())})),this._decorations.insert(_),this._onDecorationRegistered.fire(_)}return _}reset(){for(const f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,_,S){let R=0,k=0;for(const M of this._decorations.getKeyIterator(_))R=M.options.x??0,k=R+(M.options.width??1),f>=R&&f<k&&(!S||(M.options.layer??"bottom")===S)&&(yield M)}forEachDecorationAtCell(f,_,S,R){this._decorations.forEachByKey(_,(k=>{E=k.options.x??0,O=E+(k.options.width??1),f>=E&&f<O&&(!S||(k.options.layer??"bottom")===S)&&R(k)}))}}l.DecorationService=b;class p extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=u.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=u.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(f){super(),this.options=f,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=f.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const u=h(2585),y=h(8343);class d{constructor(...E){this._entries=new Map;for(const[O,b]of E)this.set(O,b)}set(E,O){const b=this._entries.get(E);return this._entries.set(E,O),b}forEach(E){for(const[O,b]of this._entries.entries())E(O,b)}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(u.IInstantiationService,this)}setService(x,E){this._services.set(x,E)}getService(x){return this._services.get(x)}createInstance(x,...E){const O=(0,y.getServiceDependencies)(x).sort(((v,f)=>v.index-f.index)),b=[];for(const v of O){const f=this._services.get(v.id);if(!f)throw new Error(`[createInstance] ${x.name} depends on UNKNOWN service ${v.id}.`);b.push(f)}const p=O.length>0?O[0].index:E.length;if(E.length!==p)throw new Error(`[createInstance] First service dependency of ${x.name} at position ${p+1} conflicts with ${E.length} static arguments`);return new x(...E,...b)}}},7866:function(A,l,h){var u=this&&this.__decorate||function(p,v,f,_){var S,R=arguments.length,k=R<3?v:_===null?_=Object.getOwnPropertyDescriptor(v,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,v,f,_);else for(var M=p.length-1;M>=0;M--)(S=p[M])&&(k=(R<3?S(k):R>3?S(v,f,k):S(v,f))||k);return R>3&&k&&Object.defineProperty(v,f,k),k},y=this&&this.__param||function(p,v){return function(f,_){v(f,_,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const d=h(844),x=h(2585),E={trace:x.LogLevelEnum.TRACE,debug:x.LogLevelEnum.DEBUG,info:x.LogLevelEnum.INFO,warn:x.LogLevelEnum.WARN,error:x.LogLevelEnum.ERROR,off:x.LogLevelEnum.OFF};let O,b=l.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(p){super(),this._optionsService=p,this._logLevel=x.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),O=this}_updateLogLevel(){this._logLevel=E[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(p){for(let v=0;v<p.length;v++)typeof p[v]=="function"&&(p[v]=p[v]())}_log(p,v,f){this._evalLazyOptionalParams(f),p.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,...f)}trace(p,...v){var f;this._logLevel<=x.LogLevelEnum.TRACE&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.trace.bind(this._optionsService.options.logger))??console.log,p,v)}debug(p,...v){var f;this._logLevel<=x.LogLevelEnum.DEBUG&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.debug.bind(this._optionsService.options.logger))??console.log,p,v)}info(p,...v){var f;this._logLevel<=x.LogLevelEnum.INFO&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.info.bind(this._optionsService.options.logger))??console.info,p,v)}warn(p,...v){var f;this._logLevel<=x.LogLevelEnum.WARN&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.warn.bind(this._optionsService.options.logger))??console.warn,p,v)}error(p,...v){var f;this._logLevel<=x.LogLevelEnum.ERROR&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.error.bind(this._optionsService.options.logger))??console.error,p,v)}};l.LogService=b=u([y(0,x.IOptionsService)],b),l.setTraceLogger=function(p){O=p},l.traceCall=function(p,v,f){if(typeof f.value!="function")throw new Error("not supported");const _=f.value;f.value=function(...S){if(O.logLevel!==x.LogLevelEnum.TRACE)return _.apply(this,S);O.trace(`GlyphRenderer#${_.name}(${S.map((k=>JSON.stringify(k))).join(", ")})`);const R=_.apply(this,S);return O.trace(`GlyphRenderer#${_.name} return`,R),R}}},7302:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const u=h(8460),y=h(844),d=h(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 x=["normal","bold","100","200","300","400","500","600","700","800","900"];class E extends y.Disposable{constructor(b){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const p={...l.DEFAULT_OPTIONS};for(const v in b)if(v in p)try{const f=b[v];p[v]=this._sanitizeAndValidateOption(v,f)}catch(f){console.error(f)}this.rawOptions=p,this.options={...p},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(b,p){return this.onOptionChange((v=>{v===b&&p(this.rawOptions[b])}))}onMultipleOptionChange(b,p){return this.onOptionChange((v=>{b.indexOf(v)!==-1&&p()}))}_setupOptions(){const b=v=>{if(!(v in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},p=(v,f)=>{if(!(v in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);f=this._sanitizeAndValidateOption(v,f),this.rawOptions[v]!==f&&(this.rawOptions[v]=f,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const f={get:b.bind(this,v),set:p.bind(this,v)};Object.defineProperty(this.options,v,f)}}_sanitizeAndValidateOption(b,p){switch(b){case"cursorStyle":if(p||(p=l.DEFAULT_OPTIONS[b]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(p))throw new Error(`"${p}" is not a valid value for ${b}`);break;case"wordSeparator":p||(p=l.DEFAULT_OPTIONS[b]);break;case"fontWeight":case"fontWeightBold":if(typeof p=="number"&&1<=p&&p<=1e3)break;p=x.includes(p)?p:l.DEFAULT_OPTIONS[b];break;case"cursorWidth":p=Math.floor(p);case"lineHeight":case"tabStopWidth":if(p<1)throw new Error(`${b} cannot be less than 1, value: ${p}`);break;case"minimumContrastRatio":p=Math.max(1,Math.min(21,Math.round(10*p)/10));break;case"scrollback":if((p=Math.min(p,4294967295))<0)throw new Error(`${b} cannot be less than 0, value: ${p}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(p<=0)throw new Error(`${b} cannot be less than or equal to 0, value: ${p}`);break;case"rows":case"cols":if(!p&&p!==0)throw new Error(`${b} must be numeric, value: ${p}`);break;case"windowsPty":p=p??{}}return p}}l.OptionsService=E},2660:function(A,l,h){var u=this&&this.__decorate||function(E,O,b,p){var v,f=arguments.length,_=f<3?O:p===null?p=Object.getOwnPropertyDescriptor(O,b):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(E,O,b,p);else for(var S=E.length-1;S>=0;S--)(v=E[S])&&(_=(f<3?v(_):f>3?v(O,b,_):v(O,b))||_);return f>3&&_&&Object.defineProperty(O,b,_),_},y=this&&this.__param||function(E,O){return function(b,p){O(b,p,E)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const d=h(2585);let x=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 S=O.addMarker(O.ybase+O.y),R={data:E,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(R,S))),this._dataByLinkId.set(R.id,R),R.id}const b=E,p=this._getEntryIdKey(b),v=this._entriesWithId.get(p);if(v)return this.addLineToLink(v.id,O.ybase+O.y),v.id;const f=O.addMarker(O.ybase+O.y),_={id:this._nextId++,key:this._getEntryIdKey(b),data:b,lines:[f]};return f.onDispose((()=>this._removeMarkerFromLink(_,f))),this._entriesWithId.set(_.key,_),this._dataByLinkId.set(_.id,_),_.id}addLineToLink(E,O){const b=this._dataByLinkId.get(E);if(b&&b.lines.every((p=>p.line!==O))){const p=this._bufferService.buffer.addMarker(O);b.lines.push(p),p.onDispose((()=>this._removeMarkerFromLink(b,p)))}}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 b=E.lines.indexOf(O);b!==-1&&(E.lines.splice(b,1),E.lines.length===0&&(E.data.id!==void 0&&this._entriesWithId.delete(E.key),this._dataByLinkId.delete(E.id)))}};l.OscLinkService=x=u([y(0,d.IBufferService)],x)},8343:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const h="di$target",u="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(y){return y[u]||[]},l.createDecorator=function(y){if(l.serviceRegistry.has(y))return l.serviceRegistry.get(y);const d=function(x,E,O){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(b,p,v){p[h]===p?p[u].push({id:b,index:v}):(p[u]=[{id:b,index:v}],p[h]=p)})(d,x,O)};return d.toString=()=>y,l.serviceRegistry.set(y,d),d}},2585:(A,l,h)=>{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 u=h(8343);var y;l.IBufferService=(0,u.createDecorator)("BufferService"),l.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),l.ICoreService=(0,u.createDecorator)("CoreService"),l.ICharsetService=(0,u.createDecorator)("CharsetService"),l.IInstantiationService=(0,u.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,u.createDecorator)("LogService"),l.IOptionsService=(0,u.createDecorator)("OptionsService"),l.IOscLinkService=(0,u.createDecorator)("OscLinkService"),l.IUnicodeService=(0,u.createDecorator)("UnicodeService"),l.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const u=h(8460),y=h(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,b=!1){return(16777215&E)<<3|(3&O)<<1|(b?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.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,b=0;const p=E.length;for(let v=0;v<p;++v){let f=E.charCodeAt(v);if(55296<=f&&f<=56319){if(++v>=p)return O+this.wcwidth(f);const R=E.charCodeAt(v);56320<=R&&R<=57343?f=1024*(f-55296)+R-56320+65536:O+=this.wcwidth(R)}const _=this.charProperties(f,b);let S=d.extractWidth(_);d.extractShouldJoin(_)&&(S-=d.extractWidth(b)),O+=S,b=_}return O}charProperties(E,O){return this._activeProvider.charProperties(E,O)}}l.UnicodeService=d}},o={};function g(A){var l=o[A];if(l!==void 0)return l.exports;var h=o[A]={exports:{}};return a[A].call(h.exports,h,h.exports,g),h.exports}var w={};return(()=>{var A=w;Object.defineProperty(A,"__esModule",{value:!0}),A.Terminal=void 0;const l=g(9042),h=g(3236),u=g(844),y=g(5741),d=g(8285),x=g(7975),E=g(7090),O=["cols","rows"];class b extends u.Disposable{constructor(v){super(),this._core=this.register(new h.Terminal(v)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const f=S=>this._core.options[S],_=(S,R)=>{this._checkReadonlyOptions(S),this._core.options[S]=R};for(const S in this._core.options){const R={get:f.bind(this,S),set:_.bind(this,S)};Object.defineProperty(this._publicOptions,S,R)}}_checkReadonlyOptions(v){if(O.includes(v))throw new Error(`Option "${v}" 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 x.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 v=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const f in v)this._publicOptions[f]=v[f]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,f=!0){this._core.input(v,f)}resize(v,f){this._verifyIntegers(v,f),this._core.resize(v,f)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,f,_){this._verifyIntegers(v,f,_),this._core.select(v,f,_)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,f){this._verifyIntegers(v,f),this._core.selectLines(v,f)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,f){this._core.write(v,f)}writeln(v,f){this._core.write(v),this._core.write(`\r
|
|
302
|
+
`,f)}paste(v){this._core.paste(v)}refresh(v,f){this._verifyIntegers(v,f),this._core.refresh(v,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return l}_verifyIntegers(...v){for(const f of v)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const f of v)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}A.Terminal=b})(),w})()))})(Vu)),Vu.exports}var k3=R3(),Wu={exports:{}},y_;function D3(){return y_||(y_=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(g){this._terminal=g}dispose(){}fit(){const g=this.proposeDimensions();if(!g||!this._terminal||isNaN(g.cols)||isNaN(g.rows))return;const w=this._terminal._core;this._terminal.rows===g.rows&&this._terminal.cols===g.cols||(w._renderService.clear(),this._terminal.resize(g.cols,g.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const g=this._terminal._core,w=g._renderService.dimensions;if(w.css.cell.width===0||w.css.cell.height===0)return;const A=this._terminal.options.scrollback===0?0:g.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),h=parseInt(l.getPropertyValue("height")),u=Math.max(0,parseInt(l.getPropertyValue("width"))),y=window.getComputedStyle(this._terminal.element),d=h-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),x=u-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-A;return{cols:Math.max(2,Math.floor(x/w.css.cell.width)),rows:Math.max(1,Math.floor(d/w.css.cell.height))}}}})(),a})()))})(Wu)),Wu.exports}var O3=D3();const M3=3e4,L3=300*1e3;class N3{constructor(r,a,o){Et(this,"ws",null);Et(this,"consecutiveFailures",0);Et(this,"failStartTime",null);Et(this,"destroyed",!1);Et(this,"reconnectTimer",null);Et(this,"url");Et(this,"authToken");Et(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,g,w,A,l;if(this.destroyed)return;if(this.failStartTime===null&&(this.failStartTime=Date.now()),Date.now()-this.failStartTime>=L3){(o=(a=this.callbacks).onGiveUp)==null||o.call(a),(w=(g=this.callbacks).onClose)==null||w.call(g);return}this.consecutiveFailures++;const r=Math.min(M3,1e3*Math.pow(2,this.consecutiveFailures-1));(l=(A=this.callbacks).onReconnecting)==null||l.call(A,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}}function j3({sessionId:i,status:r}){const a=dt(p=>p.token),o=I.useRef(null),g=I.useRef(null),w=I.useRef(null),A=I.useRef(null),l=I.useRef(r),h=I.useRef("");I.useEffect(()=>{l.current=r},[r]);const[u,y]=I.useState("connecting"),[d,x]=I.useState(null),E=I.useCallback(()=>{const p=window.location.origin,v=`/v1/sessions/${encodeURIComponent(i)}/terminal`;return`${p.replace(/^http/,"ws")}${v}`},[i]);I.useEffect(()=>{if(!o.current)return;const p=new k3.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:1e3}),v=new O3.FitAddon;p.loadAddon(v),p.open(o.current),v.fit(),g.current=p,w.current=v;const f=new ResizeObserver(()=>{var R;v.fit();const{cols:_,rows:S}=p;(R=A.current)==null||R.send({type:"resize",cols:_,rows:S})});return f.observe(o.current),()=>{f.disconnect(),p.dispose(),g.current=null,w.current=null}},[]),I.useEffect(()=>{const p=E(),v=new N3(p,{onMessage:f=>{const _=f,S=g.current;if(S)switch(_.type){case"pane":{const R=h.current,k=_.content;R&&k.startsWith(R)?S.write(k.slice(R.length)):(S.reset(),S.write(k)),h.current=k,x(null);break}case"status":break;case"error":x(_.message);break}},onOpen:()=>{var _;y("connected"),x(null);const f=g.current;w.current&&f&&((_=A.current)==null||_.send({type:"resize",cols:f.cols,rows:f.rows}))},onReconnecting:()=>{y("reconnecting")},onGiveUp:()=>{y("disconnected")},onClose:()=>{y("disconnected")}},a??void 0);return A.current=v,()=>{A.current=null,v.close()}},[E,a]),I.useEffect(()=>{const p=g.current;if(!p)return;const v=p.onData(f=>{var _;(_=A.current)==null||_.send({type:"input",text:f})});return()=>{v.dispose()}},[]);const O=r==="working",b=u==="connected";return C.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[C.jsxs("div",{className:"flex items-center justify-between px-4 py-2 text-xs border-b border-[#1a1a2e]",children:[C.jsx("div",{className:"flex items-center gap-2",children:C.jsx("span",{className:"font-mono text-[#888]",children:"Terminal"})}),C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:b?"#00e5ff":u==="reconnecting"?"#ffaa00":"#666",boxShadow:b?"0 0 4px #00e5ff40":"none",animation:u==="reconnecting"?"pulse 1s ease-in-out infinite":"none"}}),C.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:u==="connecting"?"connecting…":u==="reconnecting"?"reconnecting…":u==="connected"?"ws live":"disconnected"})]}),C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:O?"#00ff88":"#888",boxShadow:O?"0 0 4px #00ff88":"none"}}),C.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:O?"active":"idle"})]})]})]}),d&&C.jsx("div",{className:"px-4 py-2 text-xs text-[#ff3366] bg-[#ff336610] border-b border-[#ff336620]",children:d}),C.jsx("div",{ref:o,className:"h-[calc(100vh-420px)] sm:h-[calc(100vh-460px)] min-h-[250px] sm:min-h-[300px]"})]})}function B3({metrics:i,loading:r}){if(r||!i)return C.jsx("div",{className:"flex items-center justify-center h-48 text-[#555] text-sm animate-pulse",children:"Loading metrics…"});const a=[{label:"Duration",value:RE(i.durationSec*1e3),icon:"⏱",color:"#00e5ff"},{label:"Messages",value:i.messages.toString(),icon:"💬",color:"#00e5ff"},{label:"Tool Calls",value:i.toolCalls.toString(),icon:"🔧",color:"#00e5ff"},{label:"Approvals",value:i.approvals.toString(),icon:"✅",color:"#00ff88"},{label:"Auto-approvals",value:i.autoApprovals.toString(),icon:"⚡",color:"#ffaa00"},{label:"Status Changes",value:i.statusChanges.length.toString(),icon:"🔄",color:"#8888ff"}];return C.jsxs("div",{className:"space-y-4",children:[C.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:a.map(o=>C.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors duration-150 hover:border-[#00e5ff]/30",children:[C.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[C.jsx("span",{className:"text-base",children:o.icon}),C.jsx("span",{className:"text-[10px] text-[#888] uppercase tracking-wider",children:o.label})]}),C.jsx("div",{className:"text-2xl font-semibold font-mono tabular-nums",style:{color:o.color},children:o.value})]},o.label))}),i.statusChanges.length>0&&C.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-4",children:[C.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider mb-3",children:"Status Changes"}),C.jsx("div",{className:"flex flex-wrap gap-2",children:i.statusChanges.map((o,g)=>C.jsx("div",{className:"text-xs font-mono text-[#555] bg-[#0a0a0f] px-2 py-1 rounded border border-[#1a1a2e]",children:o},g))})]})]})}const z3=new Set(["bypassPermissions","dontAsk","acceptEdits","plan","auto"]);function H3({prompt:i,permissionMode:r,onApprove:a,onReject:o}){const[g,w]=I.useState(!1);return r&&r!=="default"&&z3.has(r)?C.jsx("div",{className:"flex items-center gap-2 px-4 py-2 bg-[#003322]/50 border border-[#00ff88]/30 rounded-lg text-sm",children:C.jsxs("span",{className:"text-[#00ff88] font-semibold text-xs uppercase tracking-wider",children:["AUTO-APPROVED (",r,")"]})}):C.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-[#ffaa00]/40 rounded-lg",children:[C.jsxs("div",{className:"flex items-center gap-3 sm:gap-2 min-w-0",children:[C.jsx("span",{className:"text-[#ffaa00] text-lg shrink-0",children:"⚠"}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("div",{className:"text-xs text-[#ffaa00] font-semibold uppercase tracking-wider mb-0.5",children:"Permission Required"}),C.jsxs("div",{className:`text-sm text-[#e0e0e0] font-mono cursor-pointer ${g?"":"truncate"}`,onClick:()=>w(!g),title:g?void 0:"Click to expand",children:[i,!g&&i.length>60&&C.jsx("span",{className:"text-[#888] ml-1",children:"..."})]})]})]}),C.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[C.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#00ff88] border border-[#00ff88]/30 transition-colors",children:"Approve"}),C.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ff3366] border border-[#ff3366]/30 transition-colors",children:"Reject"})]})]})}const U3=[{id:"transcript",label:"Transcript"},{id:"terminal",label:"Terminal"},{id:"metrics",label:"Metrics"}],S_=["/clear","/compact","/cost","/config"];function I3(){const{id:i}=L_(),r=hl(),[a,o]=I.useState("transcript"),{session:g,health:w,notFound:A,loading:l,metrics:h,metricsLoading:u}=WE(i??""),[y,d]=I.useState(""),[x,E]=I.useState(!1),[O,b]=I.useState(S_[0]),[p,v]=I.useState(!1),[f,_]=I.useState(""),[S,R]=I.useState(!1),[k,M]=I.useState(!1),[T,N]=I.useState(!1),[P,F]=I.useState(!1),[G,$]=I.useState(null),J=I.useRef(null),te=I.useRef(!1),q=bs(me=>me.addToast);if(l)return C.jsx("div",{className:"min-h-screen bg-[#0a0a0f] flex items-center justify-center text-[#555] text-sm",children:C.jsx("div",{className:"animate-pulse",children:"Loading session…"})});if(A||!g||!w)return C.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-[#555]",children:[C.jsx("div",{className:"text-6xl mb-4",children:"404"}),C.jsx("div",{className:"text-lg mb-6 text-[#e0e0e0]",children:"Session not found"}),C.jsx(Hi,{to:"/",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Overview"})]});const K=g,ee=w,j=ee.status==="permission_prompt"||ee.status==="bash_approval";function B(){Tg(K.id).catch(me=>q("error","Approve failed",me instanceof Error?me.message:void 0))}function L(){rE(K.id).catch(me=>q("error","Reject failed",me instanceof Error?me.message:void 0))}function H(){nh(K.id).catch(me=>q("error","Interrupt failed",me instanceof Error?me.message:void 0))}function W(){nE(K.id).catch(me=>q("error","Escape failed",me instanceof Error?me.message:void 0))}async function re(){try{await rh(K.id),r("/")}catch(me){q("error","Failed to kill session",me instanceof Error?me.message:void 0)}}async function ue(){if(!T){N(!0);try{const me=await uE(K.id);$({image:me.image,mimeType:me.mimeType,capturedAt:Date.now()}),q("success","Screenshot captured")}catch(me){(typeof me=="object"&&me!==null&&"statusCode"in me?me.statusCode:void 0)===501?(F(!0),q("warning","Screenshot unavailable","Playwright is not installed on the server.")):q("error","Screenshot failed",me instanceof Error?me.message:void 0)}finally{N(!1)}}}async function pe(){var Re;const me=y.trim();if(me&&!te.current){te.current=!0,E(!0);try{await sE(K.id,me),d("")}catch(je){q("error","Failed to send message",je instanceof Error?je.message:void 0)}finally{E(!1),te.current=!1,(Re=J.current)==null||Re.focus()}}}function V(){var me;d(O),(me=J.current)==null||me.focus()}async function U(){if(!(!O||p)){v(!0);try{await lE(K.id,O),d("")}catch(me){q("error","Failed to send slash command",me instanceof Error?me.message:void 0)}finally{v(!1)}}}async function ce(){const me=f.trim();if(!(!me||k)){M(!0);try{await cE(K.id,me),_(""),R(!1)}catch(Re){q("error","Failed to send bash command",Re instanceof Error?Re.message:void 0)}finally{M(!1)}}}function oe(){f.trim()&&R(!0)}function ve(me){_(me),S&&R(!1)}function ge(me){me.key==="Enter"&&!me.shiftKey&&(me.preventDefault(),pe())}return C.jsx("div",{className:"min-h-screen bg-[#0a0a0f]",children:C.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:[C.jsxs("nav",{className:"text-xs text-[#555] flex items-center gap-1",children:[C.jsx(Hi,{to:"/",className:"hover:text-[#00e5ff] transition-colors",children:"Overview"}),C.jsx("span",{className:"text-[#333]",children:"/"}),C.jsx("span",{className:"text-[#e0e0e0] truncate max-w-[160px] sm:max-w-xs",children:K.windowName||K.id})]}),C.jsx(XE,{session:K,health:ee,onApprove:B,onReject:L,onInterrupt:H,onKill:re}),C.jsx("div",{className:"flex border-b border-[#1a1a2e]",role:"tablist",children:U3.map(me=>C.jsxs("button",{id:`tab-${me.id}`,onClick:()=>o(me.id),role:"tab","aria-selected":a===me.id,"aria-controls":`panel-${me.id}`,tabIndex:a===me.id?0:-1,className:`flex-1 min-h-[44px] text-sm font-medium transition-colors relative ${a===me.id?"text-[#00e5ff]":"text-[#555] hover:text-[#888]"}`,children:[me.label,a===me.id&&C.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-[#00e5ff]"})]},me.id))}),C.jsxs("div",{className:"bg-[#0a0a0f] rounded-lg min-h-[300px] sm:min-h-[400px]",children:[j&&C.jsx("div",{className:"p-3 sm:p-4 pb-0",children:C.jsx(H3,{prompt:ee.details,permissionMode:K.permissionMode,onApprove:B,onReject:L})}),a==="transcript"&&C.jsx("div",{id:"panel-transcript",role:"tabpanel","aria-labelledby":"tab-transcript",tabIndex:0,className:"h-[calc(100vh-380px)] sm:h-[calc(100vh-420px)] min-h-[250px] sm:min-h-[300px]",children:C.jsx(A3,{sessionId:K.id})}),a==="terminal"&&C.jsx("div",{id:"panel-terminal",role:"tabpanel","aria-labelledby":"tab-terminal",tabIndex:0,children:C.jsx(j3,{sessionId:K.id,status:ee.status})}),a==="metrics"&&C.jsx("div",{id:"panel-metrics",role:"tabpanel","aria-labelledby":"tab-metrics",tabIndex:0,className:"p-3 sm:p-4",children:C.jsx(B3,{metrics:h,loading:u})})]}),C.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("label",{htmlFor:"session-message-input",className:"sr-only",children:"Session message input"}),C.jsx("input",{id:"session-message-input",ref:J,type:"text",value:y,onChange:me=>d(me.target.value),onKeyDown:ge,placeholder:"Send a message to Claude…",disabled:x||!ee.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"}),C.jsx("button",{onClick:pe,disabled:x||!y.trim()||!ee.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:C.jsx(Ab,{className:"h-4 w-4"})})]}),C.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#1a1a2e]/50",children:[C.jsx("label",{className:"sr-only",htmlFor:"slash-command-select",children:"Common slash command"}),C.jsx("select",{id:"slash-command-select",value:O,onChange:me=>b(me.target.value),disabled:p||!ee.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:S_.map(me=>C.jsx("option",{value:me,children:me},me))}),C.jsx("button",{onClick:V,disabled:p||!ee.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"}),C.jsx("button",{onClick:U,disabled:p||!ee.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:p?"Sending Slash…":"Run Slash"}),C.jsx("label",{className:"sr-only",htmlFor:"bash-command-input",children:"Bash command"}),C.jsx("input",{id:"bash-command-input",type:"text",value:f,onChange:me=>ve(me.target.value),placeholder:"Bash command (requires confirmation)…",disabled:k||!ee.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"}),S?C.jsxs(C.Fragment,{children:[C.jsx("span",{className:"text-[11px] text-[#ffaa00] italic",children:"Confirm bash command execution."}),C.jsx("button",{onClick:ce,disabled:k||!f.trim()||!ee.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:k?"Sending Bash…":"Confirm Bash"}),C.jsx("button",{onClick:()=>R(!1),disabled:k,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"})]}):C.jsx("button",{onClick:oe,disabled:k||!f.trim()||!ee.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"}),!P&&C.jsxs("button",{onClick:ue,disabled:T||!ee.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:[C.jsx(ZS,{className:"h-3.5 w-3.5"}),T?"Capturing…":"Screenshot"]}),C.jsxs("button",{onClick:H,"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:[C.jsx(vb,{className:"h-3.5 w-3.5"}),"Interrupt"]}),C.jsxs("button",{onClick:W,"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:[C.jsx(rb,{className:"h-3.5 w-3.5"}),"Escape"]})]}),G&&C.jsxs("div",{className:"mt-3 rounded-lg border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[C.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[C.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:"Latest screenshot"}),C.jsx("span",{className:"text-[11px] text-gray-500",children:new Date(G.capturedAt).toLocaleTimeString()})]}),C.jsx("img",{src:G.image,alt:"Session screenshot preview",className:"max-h-[420px] w-full rounded border border-[#1a1a2e] object-contain bg-black"}),C.jsx("div",{className:"mt-2 text-[11px] text-gray-500",children:G.mimeType??"image/png"})]})]})]})})}const P3={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"},$3=new Set(["running"]);function zg({status:i}){const r=P3[i]??"bg-gray-500/10 text-gray-500 border-gray-500/30",a=$3.has(i);return C.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&&C.jsxs("span",{className:"relative flex h-2 w-2",children:[C.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75 bg-current"}),C.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]}),i]})}let F3=0;function _a(){return{workDir:"",name:"",prompt:"",_key:F3++}}function Z3({open:i,onClose:r}){const a=hl(),o=I.useRef(null),g=I.useRef(null),[w,A]=I.useState(""),[l,h]=I.useState([_a(),_a()]),[u,y]=I.useState(!1),[d,x]=I.useState(null),E=I.useCallback(()=>{O(),r()},[r]);function O(){A(""),h([_a(),_a()]),y(!1),x(null)}I.useEffect(()=>{if(!i)return;const S=R=>{R.key==="Escape"&&E()};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[i,E]),I.useEffect(()=>{if(!i)return;const S=o.current;if(!S)return;const R='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',k=M=>{if(M.key!=="Tab")return;const T=Array.from(S.querySelectorAll(R));if(T.length===0)return;const N=T[0],P=T[T.length-1];M.shiftKey?document.activeElement===N&&(M.preventDefault(),P.focus()):document.activeElement===P&&(M.preventDefault(),N.focus())};return S.addEventListener("keydown",k),()=>S.removeEventListener("keydown",k)},[i]),I.useEffect(()=>{if(i){const S=setTimeout(()=>{var R;return(R=g.current)==null?void 0:R.focus()},50);return()=>clearTimeout(S)}},[i]);function b(){l.length>=10||h([...l,_a()])}function p(S){l.length<=1||h(l.filter((R,k)=>k!==S))}function v(S,R,k){h(l.map((M,T)=>T===S?{...M,[R]:k}:M))}async function f(S){S.preventDefault(),x(null);const R=l.filter(k=>k.workDir.trim());if(!w.trim()){x("Pipeline name is required");return}if(R.length===0){x("At least one step with a working directory is required");return}y(!0);try{const k=await fE({name:w.trim(),workDir:R[0].workDir.trim(),stages:R.map(M=>({workDir:M.workDir.trim(),name:M.name.trim()||void 0,prompt:M.prompt.trim()||void 0}))});O(),r(),a(`/pipelines/${k.id}`)}catch(k){x(k instanceof Error?k.message:"Failed to create pipeline")}finally{y(!1)}}if(!i)return null;const _=w.trim()&&l.some(S=>S.workDir.trim());return C.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[C.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:E}),C.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:[C.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[C.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Pipeline"}),C.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:C.jsx(dl,{className:"h-4 w-4"})})]}),C.jsxs("form",{onSubmit:f,className:"p-4 sm:p-5 space-y-4",children:[C.jsxs("div",{children:[C.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Pipeline Name ",C.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),C.jsx("input",{type:"text",ref:g,value:w,onChange:S=>A(S.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-[#00e5ff]"})]}),C.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[C.jsxs("span",{children:["Working Directory ",C.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),C.jsx("span",{children:"Name"}),C.jsx("span",{children:"Prompt"}),C.jsx("span",{})]}),C.jsx("div",{className:"space-y-2",children:l.map((S,R)=>C.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[C.jsx("input",{type:"text",value:S.workDir,onChange:k=>v(R,"workDir",k.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-[#00e5ff] font-mono"}),C.jsx("input",{type:"text",value:S.name,onChange:k=>v(R,"name",k.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-[#00e5ff]"}),C.jsx("input",{type:"text",value:S.prompt,onChange:k=>v(R,"prompt",k.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-[#00e5ff]"}),C.jsx("button",{type:"button",onClick:()=>p(R),disabled:l.length<=1,"aria-label":`Remove step ${R+1}`,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ff3366] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:C.jsx(ph,{className:"h-3.5 w-3.5"})})]},S._key))}),l.length<10&&C.jsxs("button",{type:"button",onClick:b,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[C.jsx(wa,{className:"h-3.5 w-3.5"}),"Add Step"]}),d&&C.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:d}),C.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[C.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"}),C.jsxs("button",{type:"submit",disabled:u||!_,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:[u&&C.jsx(Qu,{className:"h-3 w-3 animate-spin"}),"Create Pipeline"]})]})]})]})]})}const q3=5e3,G3=6e4;function K3(){const[i,r]=I.useState([]),[a,o]=I.useState(!0),[g,w]=I.useState(!1),A=bs(u=>u.addToast),l=I.useCallback(async()=>{try{const u=await dE();return r(u),!0}catch(u){return A("error","Failed to fetch pipelines",u instanceof Error?u.message:void 0),!1}finally{o(!1)}},[A]);I.useEffect(()=>{let u,y=!1,d=0;const x=async()=>{if(y||(await l()?d=0:d+=1,y))return;const O=d>0?2**d:1,b=Math.min(q3*O,G3);u=setTimeout(()=>{x()},b)};return x(),()=>{y=!0,u&&clearTimeout(u)}},[l]);const h={total:i.length,running:i.filter(u=>u.status==="running").length,completed:i.filter(u=>u.status==="completed").length,failed:i.filter(u=>u.status==="failed").length};return a?C.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:C.jsx("div",{className:"animate-pulse",children:"Loading pipelines…"})}):C.jsxs("div",{className:"flex flex-col gap-6",children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("div",{children:[C.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Pipelines"}),C.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Manage and monitor session pipelines"})]}),C.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:[C.jsx(wa,{className:"h-3.5 w-3.5"}),"New Pipeline"]})]}),C.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[C.jsx(Ks,{label:"Total",value:h.total}),C.jsx(Ks,{label:"Running",value:h.running}),C.jsx(Ks,{label:"Completed",value:h.completed}),C.jsx(Ks,{label:"Failed",value:h.failed})]}),i.length===0?C.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:[C.jsx("p",{className:"text-gray-500",children:"No pipelines yet"}),C.jsx("p",{className:"mt-1 text-xs text-gray-600",children:"Create a pipeline to run sessions in sequence"})]}):C.jsx("div",{className:"space-y-3",children:i.map(u=>C.jsx(Hi,{to:`/pipelines/${u.id}`,className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 hover:border-[#00e5ff]/30 transition-colors",children:C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[C.jsx("span",{className:"font-medium text-gray-200 truncate",children:u.name}),C.jsx(zg,{status:u.status})]}),C.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 shrink-0 ml-4",children:[C.jsxs("span",{children:[u.stages.length," step",u.stages.length!==1?"s":""]}),C.jsx("span",{children:gr(u.createdAt)})]})]})},u.id))}),C.jsx(Z3,{open:g,onClose:()=>w(!1)})]})}const V3=3e3,W3=6e4;function Y3(){const{id:i}=L_(),[r,a]=I.useState(null),[o,g]=I.useState(!0),[w,A]=I.useState(!1),l=bs(u=>u.addToast),h=I.useCallback(async()=>{if(!i)return!1;try{const u=await mE(i);return a(u),A(!1),!0}catch(u){const y=u;return y.statusCode===404?A(!0):l("error","Failed to fetch pipeline",y.message),!1}finally{g(!1)}},[i,l]);return I.useEffect(()=>{let u,y=!1,d=0;const x=async()=>{if(y||(await h()?d=0:d+=1,y))return;const O=d>0?2**d:1,b=Math.min(V3*O,W3);u=setTimeout(()=>{x()},b)};return x(),()=>{y=!0,u&&clearTimeout(u)}},[h]),o?C.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:C.jsx("div",{className:"animate-pulse",children:"Loading pipeline…"})}):w||!r?C.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[50vh] text-gray-500",children:[C.jsx("div",{className:"text-6xl mb-4",children:"404"}),C.jsx("div",{className:"text-lg mb-6 text-gray-200",children:"Pipeline not found"}),C.jsx(Hi,{to:"/pipelines",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Pipelines"})]}):C.jsxs("div",{className:"flex flex-col gap-6",children:[C.jsxs("nav",{className:"text-xs text-gray-500 flex items-center gap-1",children:[C.jsx(Hi,{to:"/pipelines",className:"hover:text-[#00e5ff] transition-colors",children:"Pipelines"}),C.jsx("span",{className:"text-gray-700",children:"/"}),C.jsx("span",{className:"text-gray-200 truncate max-w-xs",children:r.name})]}),C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:r.name}),C.jsx(zg,{status:r.status})]}),C.jsxs("div",{className:"text-xs text-gray-500",children:["Created ",gr(r.createdAt)]})]}),C.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118]",children:[C.jsx("div",{className:"px-4 py-3 border-b border-void-lighter",children:C.jsxs("h3",{className:"text-sm font-semibold text-gray-200",children:["Steps (",r.stages.length,")"]})}),r.stages.length===0?C.jsx("div",{className:"p-8 text-center text-gray-500 text-sm",children:"No steps yet"}):C.jsxs("table",{className:"w-full text-left text-sm",children:[C.jsx("thead",{children:C.jsxs("tr",{className:"border-b border-void-lighter text-gray-600",children:[C.jsx("th",{className:"px-4 py-3 font-medium w-16",children:"#"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Session"})]})}),C.jsx("tbody",{children:r.stages.map((u,y)=>C.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[C.jsxs("td",{className:"px-4 py-3 text-gray-500 font-mono text-xs",children:["#",y+1]}),C.jsx("td",{className:"px-4 py-3",children:C.jsx(yl,{status:u.status})}),C.jsx("td",{className:"px-4 py-3",children:u.sessionId?C.jsx(Hi,{to:`/sessions/${encodeURIComponent(u.sessionId)}`,className:"font-medium text-gray-200 hover:text-cyan transition-colors",children:u.name}):C.jsx("span",{className:"font-medium text-gray-200",children:u.name})}),C.jsx("td",{className:"px-4 py-3 font-mono text-xs text-gray-400",children:u.sessionId??"—"})]},u.name))})]})]})]})}function X3(){return C.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 text-center",children:[C.jsx("h1",{className:"text-6xl font-bold text-gray-500",children:"404"}),C.jsx("p",{className:"text-lg text-gray-400",children:"Page not found"}),C.jsx(Hi,{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 J3(){return C.jsx(zS,{children:C.jsx(rS,{children:C.jsxs(Gs,{element:C.jsx(TE,{}),children:[C.jsx(Gs,{path:"/",element:C.jsx(VE,{})}),C.jsx(Gs,{path:"/auth/keys",element:C.jsx(LE,{})}),C.jsx(Gs,{path:"/sessions/:id",element:C.jsx(I3,{})}),C.jsx(Gs,{path:"/pipelines",element:C.jsx(K3,{})}),C.jsx(Gs,{path:"/pipelines/:id",element:C.jsx(Y3,{})}),C.jsx(Gs,{path:"*",element:C.jsx(X3,{})})]})})})}ry.createRoot(document.getElementById("root")).render(C.jsx(ga.StrictMode,{children:C.jsx(RS,{basename:"/dashboard",children:C.jsx(J3,{})})}));
|