aegis-bridge 2.9.0 → 2.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
var I0=Object.defineProperty;var P0=(i,r,a)=>r in i?I0(i,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[r]=a;var Et=(i,r,a)=>P0(i,typeof r!="symbol"?r+"":r,a);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const v of document.querySelectorAll('link[rel="modulepreload"]'))o(v);new MutationObserver(v=>{for(const w of v)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(v){const w={};return v.integrity&&(w.integrity=v.integrity),v.referrerPolicy&&(w.referrerPolicy=v.referrerPolicy),v.crossOrigin==="use-credentials"?w.credentials="include":v.crossOrigin==="anonymous"?w.credentials="omit":w.credentials="same-origin",w}function o(v){if(v.ep)return;v.ep=!0;const w=a(v);fetch(v.href,w)}})();function dp(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 c_;function $0(){if(c_)return oa;c_=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(o,v,w){var A=null;if(w!==void 0&&(A=""+w),v.key!==void 0&&(A=""+v.key),"key"in v){w={};for(var l in v)l!=="key"&&(w[l]=v[l])}else w=v;return v=w.ref,{$$typeof:i,type:o,key:A,ref:v!==void 0?v:null,props:w}}return oa.Fragment=r,oa.jsx=a,oa.jsxs=a,oa}var u_;function F0(){return u_||(u_=1,Ru.exports=$0()),Ru.exports}var E=F0(),Du={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 h_;function Z0(){if(h_)return Ae;h_=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),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"),b=Symbol.iterator;function C(L){return L===null||typeof L!="object"?null:(L=b&&L[b]||L["@@iterator"],typeof L=="function"?L:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,m={};function g(L,H,X){this.props=L,this.context=H,this.refs=m,this.updater=X||k}g.prototype.isReactComponent={},g.prototype.setState=function(L,H){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,H,"setState")},g.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function f(){}f.prototype=g.prototype;function p(L,H,X){this.props=L,this.context=H,this.refs=m,this.updater=X||k}var S=p.prototype=new f;S.constructor=p,x(S,g.prototype),S.isPureReactComponent=!0;var R=Array.isArray;function D(){}var M={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function N(L,H,X){var ae=X.ref;return{$$typeof:i,type:L,key:H,ref:ae!==void 0?ae:null,props:X}}function I(L,H){return N(L.type,H,L.props)}function $(L){return typeof L=="object"&&L!==null&&L.$$typeof===i}function q(L){var H={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(X){return H[X]})}var P=/\/+/g;function Q(L,H){return typeof L=="object"&&L!==null&&L.key!=null?q(""+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(D,D):(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 G(L,H,X,ae,he){var ne=typeof L;(ne==="undefined"||ne==="boolean")&&(L=null);var K=!1;if(L===null)K=!0;else switch(ne){case"bigint":case"string":case"number":K=!0;break;case"object":switch(L.$$typeof){case i:case r:K=!0;break;case y:return K=L._init,G(K(L._payload),H,X,ae,he)}}if(K)return he=he(L),K=ae===""?"."+Q(L,0):ae,R(he)?(X="",K!=null&&(X=K.replace(P,"$&/")+"/"),G(he,H,X,"",function(le){return le})):he!=null&&($(he)&&(he=I(he,X+(he.key==null||L&&L.key===he.key?"":(""+he.key).replace(P,"$&/")+"/")+K)),H.push(he)),1;K=0;var z=ae===""?".":ae+":";if(R(L))for(var ue=0;ue<L.length;ue++)ae=L[ue],ne=z+Q(ae,ue),K+=G(ae,H,X,ne,he);else if(ue=C(L),typeof ue=="function")for(L=ue.call(L),ue=0;!(ae=L.next()).done;)ae=ae.value,ne=z+Q(ae,ue++),K+=G(ae,H,X,ne,he);else if(ne==="object"){if(typeof L.then=="function")return G(te(L),H,X,ae,he);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 K}function Y(L,H,X){if(L==null)return L;var ae=[],he=0;return G(L,ae,"","",function(ne){return H.call(X,ne,he++)}),ae}function ee(L){if(L._status===-1){var H=L._result;H=H(),H.then(function(X){(L._status===0||L._status===-1)&&(L._status=1,L._result=X)},function(X){(L._status===0||L._status===-1)&&(L._status=2,L._result=X)}),L._status===-1&&(L._status=0,L._result=H)}if(L._status===1)return L._result.default;throw L._result}var B=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)},U={map:Y,forEach:function(L,H,X){Y(L,function(){H.apply(this,arguments)},X)},count:function(L){var H=0;return Y(L,function(){H++}),H},toArray:function(L){return Y(L,function(H){return H})||[]},only:function(L){if(!$(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Ae.Activity=d,Ae.Children=U,Ae.Component=g,Ae.Fragment=a,Ae.Profiler=v,Ae.PureComponent=p,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,X){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var ae=x({},L.props),he=L.key;if(H!=null)for(ne in H.key!==void 0&&(he=""+H.key),H)!T.call(H,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&H.ref===void 0||(ae[ne]=H[ne]);var ne=arguments.length-2;if(ne===1)ae.children=X;else if(1<ne){for(var K=Array(ne),z=0;z<ne;z++)K[z]=arguments[z+2];ae.children=K}return N(L.type,he,ae)},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,X){var ae,he={},ne=null;if(H!=null)for(ae in H.key!==void 0&&(ne=""+H.key),H)T.call(H,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(he[ae]=H[ae]);var K=arguments.length-2;if(K===1)he.children=X;else if(1<K){for(var z=Array(K),ue=0;ue<K;ue++)z[ue]=arguments[ue+2];he.children=z}if(L&&L.defaultProps)for(ae in K=L.defaultProps,K)he[ae]===void 0&&(he[ae]=K[ae]);return N(L,ne,he)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(L){return{$$typeof:l,render:L}},Ae.isValidElement=$,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,X={};M.T=X;try{var ae=L(),he=M.S;he!==null&&he(X,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(D,B)}catch(ne){B(ne)}finally{H!==null&&X.types!==null&&(H.types=X.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,X){return M.H.useActionState(L,H,X)},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,X){return M.H.useImperativeHandle(L,H,X)},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,X){return M.H.useReducer(L,H,X)},Ae.useRef=function(L){return M.H.useRef(L)},Ae.useState=function(L){return M.H.useState(L)},Ae.useSyncExternalStore=function(L,H,X){return M.H.useSyncExternalStore(L,H,X)},Ae.useTransition=function(){return M.H.useTransition()},Ae.version="19.2.4",Ae}var f_;function nh(){return f_||(f_=1,Du.exports=Z0()),Du.exports}var F=nh();const va=dp(F);var ku={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 d_;function q0(){return d_||(d_=1,(function(i){function r(G,Y){var ee=G.length;G.push(Y);e:for(;0<ee;){var B=ee-1>>>1,U=G[B];if(0<v(U,Y))G[B]=Y,G[ee]=U,ee=B;else break e}}function a(G){return G.length===0?null:G[0]}function o(G){if(G.length===0)return null;var Y=G[0],ee=G.pop();if(ee!==Y){G[0]=ee;e:for(var B=0,U=G.length,L=U>>>1;B<L;){var H=2*(B+1)-1,X=G[H],ae=H+1,he=G[ae];if(0>v(X,ee))ae<U&&0>v(he,X)?(G[B]=he,G[ae]=ee,B=ae):(G[B]=X,G[H]=ee,B=H);else if(ae<U&&0>v(he,ee))G[B]=he,G[ae]=ee,B=ae;else break e}}return Y}function v(G,Y){var ee=G.sortIndex-Y.sortIndex;return ee!==0?ee:G.id-Y.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,b=3,C=!1,k=!1,x=!1,m=!1,g=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;function S(G){for(var Y=a(u);Y!==null;){if(Y.callback===null)o(u);else if(Y.startTime<=G)o(u),Y.sortIndex=Y.expirationTime,r(h,Y);else break;Y=a(u)}}function R(G){if(x=!1,S(G),!k)if(a(h)!==null)k=!0,D||(D=!0,q());else{var Y=a(u);Y!==null&&te(R,Y.startTime-G)}}var D=!1,M=-1,T=5,N=-1;function I(){return m?!0:!(i.unstable_now()-N<T)}function $(){if(m=!1,D){var G=i.unstable_now();N=G;var Y=!0;try{e:{k=!1,x&&(x=!1,f(M),M=-1),C=!0;var ee=b;try{t:{for(S(G),d=a(h);d!==null&&!(d.expirationTime>G&&I());){var B=d.callback;if(typeof B=="function"){d.callback=null,b=d.priorityLevel;var U=B(d.expirationTime<=G);if(G=i.unstable_now(),typeof U=="function"){d.callback=U,S(G),Y=!0;break t}d===a(h)&&o(h),S(G)}else o(h);d=a(h)}if(d!==null)Y=!0;else{var L=a(u);L!==null&&te(R,L.startTime-G),Y=!1}}break e}finally{d=null,b=ee,C=!1}Y=void 0}}finally{Y?q():D=!1}}}var q;if(typeof p=="function")q=function(){p($)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,Q=P.port2;P.port1.onmessage=$,q=function(){Q.postMessage(null)}}else q=function(){g($,0)};function te(G,Y){M=g(function(){G(i.unstable_now())},Y)}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(G){G.callback=null},i.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<G?Math.floor(1e3/G):5},i.unstable_getCurrentPriorityLevel=function(){return b},i.unstable_next=function(G){switch(b){case 1:case 2:case 3:var Y=3;break;default:Y=b}var ee=b;b=Y;try{return G()}finally{b=ee}},i.unstable_requestPaint=function(){m=!0},i.unstable_runWithPriority=function(G,Y){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var ee=b;b=G;try{return Y()}finally{b=ee}},i.unstable_scheduleCallback=function(G,Y,ee){var B=i.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?B+ee:B):ee=B,G){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=ee+U,G={id:y++,callback:Y,priorityLevel:G,startTime:ee,expirationTime:U,sortIndex:-1},ee>B?(G.sortIndex=ee,r(u,G),a(h)===null&&G===a(u)&&(x?(f(M),M=-1):x=!0,te(R,ee-B))):(G.sortIndex=U,r(h,G),k||C||(k=!0,D||(D=!0,q()))),G},i.unstable_shouldYield=I,i.unstable_wrapCallback=function(G){var Y=b;return function(){var ee=b;b=Y;try{return G.apply(this,arguments)}finally{b=ee}}}})(Mu)),Mu}var m_;function G0(){return m_||(m_=1,Ou.exports=q0()),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 __;function K0(){if(__)return $t;__=1;var i=nh();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},v=Symbol.for("react.portal");function w(h,u,y){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:v,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),b=typeof u.integrity=="string"?u.integrity:void 0,C=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:b,fetchPriority:C}):y==="script"&&o.d.X(h,{crossOrigin:d,integrity:b,fetchPriority:C,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 p_;function W0(){if(p_)return Lu.exports;p_=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=K0(),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 v_;function V0(){if(v_)return la;v_=1;var i=G0(),r=nh(),a=W0();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function v(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function w(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function 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 _=c.alternate;if(_===null){if(n=c.return,n!==null){s=n;continue}break}if(c.child===_.child){for(_=c.child;_;){if(_===s)return h(c),e;if(_===n)return h(c),t;_=_.sibling}throw Error(o(188))}if(s.return!==n.return)s=c,n=_;else{for(var O=!1,j=c.child;j;){if(j===s){O=!0,s=c,n=_;break}if(j===n){O=!0,n=c,s=_;break}j=j.sibling}if(!O){for(j=_.child;j;){if(j===s){O=!0,s=_,n=c;break}if(j===n){O=!0,n=_,s=c;break}j=j.sibling}if(!O)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,b=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),p=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=$&&e[$]||e["@@iterator"],typeof e=="function"?e:null)}var P=Symbol.for("react.client.reference");function Q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===P?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case g:return"Profiler";case m:return"StrictMode";case R:return"Suspense";case D:return"SuspenseList";case N:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case p: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:Q(e.type)||"Memo";case T:t=e._payload,e=e._init;try{return Q(e(t))}catch{}}return null}var te=Array.isArray,G=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},B=[],U=-1;function L(e){return{current:e}}function H(e){0>U||(e.current=B[U],B[U]=null,U--)}function X(e,t){U++,B[U]=e.current,e.current=t}var ae=L(null),he=L(null),ne=L(null),K=L(null);function z(e,t){switch(X(ne,t),X(he,e),X(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Mm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Mm(t),e=Lm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(ae),X(ae,e)}function ue(){H(ae),H(he),H(ne)}function le(e){e.memoizedState!==null&&X(K,e);var t=ae.current,s=Lm(t,e.type);t!==s&&(X(he,e),X(ae,s))}function ve(e){he.current===e&&(H(ae),H(he)),K.current===e&&(H(K),sa._currentValue=ee)}var pe,Te;function He(e){if(pe===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||"",Te=-1<s.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+pe+e+Te}var Ie=!1;function ut(e,t){if(!e||Ie)return"";Ie=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(oe){var re=oe}Reflect.construct(e,[],me)}else{try{me.call()}catch(oe){re=oe}e.call(me.prototype)}}else{try{throw Error()}catch(oe){re=oe}(me=e())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(oe){if(oe&&re&&typeof oe.stack=="string")return[oe.stack,re.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=n.DetermineComponentFrameRoot(),O=_[0],j=_[1];if(O&&j){var Z=O.split(`
|
|
44
|
+
`),se=j.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 ce=`
|
|
46
|
+
`+Z[n].replace(" at new "," at ");return e.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",e.displayName)),ce}while(1<=n&&0<=c);break}}}finally{Ie=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?He(s):""}function Ee(e,t){switch(e.tag){case 26:case 27:case 5:return He(e.type);case 16:return He("Lazy");case 13:return e.child!==t&&t!==null?He("Suspense Fallback"):He("Suspense");case 19:return He("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 He("Activity");default:return""}}function Ft(e){try{var t="",s=null;do t+=Ee(e,s),s=e,e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}var _i=Object.prototype.hasOwnProperty,pi=i.unstable_scheduleCallback,Ii=i.unstable_cancelCallback,Vi=i.unstable_shouldYield,Pt=i.unstable_requestPaint,at=i.unstable_now,kt=i.unstable_getCurrentPriorityLevel,Zt=i.unstable_ImmediatePriority,Nt=i.unstable_UserBlockingPriority,Bt=i.unstable_NormalPriority,Yi=i.unstable_LowPriority,Yt=i.unstable_IdlePriority,Li=i.log,Ve=i.unstable_setDisableYieldValue,vi=null,Ot=null;function Mt(e){if(typeof Li=="function"&&Ve(e),Ot&&typeof Ot.setStrictMode=="function")try{Ot.setStrictMode(vi,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,_=e.suspendedLanes,O=e.pingedLanes;e=e.warmLanes;var j=n&134217727;return j!==0?(n=j&~_,n!==0?c=ai(n):(O&=j,O!==0?c=ai(O):s||(s=j&~e,s!==0&&(c=ai(s))))):(j=n&~_,j!==0?c=ai(j):O!==0?c=ai(O):s||(s=n&~e,s!==0&&(c=ai(s)))),c===0?0:t!==0&&t!==c&&(t&_)===0&&(_=c&-c,s=t&-t,_>=s||_===32&&(s&4194048)!==0)?t:c}function Qs(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function pt(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,_){var O=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 j=e.entanglements,Z=e.expirationTimes,se=e.hiddenUpdates;for(s=O&~s;0<s;){var ce=31-yt(s),me=1<<ce;j[ce]=0,Z[ce]=-1;var re=se[ce];if(re!==null)for(se[ce]=null,ce=0;ce<re.length;ce++){var oe=re[ce];oe!==null&&(oe.lane&=-536870913)}s&=~me}n!==0&&mn(e,n,0),_!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=_&~(O&~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 _n(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 pn(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:i_(e.type))}function vn(e,t){var s=Y.p;try{return Y.p=e,t()}finally{Y.p=s}}var gi=Math.random().toString(36).slice(2),St="__reactFiber$"+gi,st="__reactProps$"+gi,es="__reactContainer$"+gi,br="__reactEvents$"+gi,Ra="__reactListeners$"+gi,Da="__reactHandles$"+gi,ka="__reactResources$"+gi,Se="__reactMarker$"+gi;function W(e){delete e[St],delete e[st],delete e[br],delete e[Ra],delete e[Da]}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=Im(e);e!==null;){if(s=e[St])return s;e=Im(e)}return t}e=s,s=e.parentNode}return null}function ge(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[ka];return t||(t=e[ka]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Oe(e){e[Se]=!0}var jt=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++)jt.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]*$"),gn={},yn={};function Mv(e){return _i.call(yn,e)?!0:_i.call(gn,e)?!1:Rt.test(e)?yn[e]=!0:(gn[e]=!0,!1)}function Oa(e,t,s){if(Mv(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 Ch(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Lv(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,_=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(O){s=""+O,_.call(this,O)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(O){s=""+O},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bl(e){if(!e._valueTracker){var t=Ch(e)?"checked":"value";e._valueTracker=Lv(e,t,""+e[t])}}function wh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),n="";return e&&(n=Ch(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 Nv=/[\n"\\]/g;function bi(e){return e.replace(Nv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function xl(e,t,s,n,c,_,O,j){e.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?e.type=O:e.removeAttribute("type"),t!=null?O==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Si(t)):e.value!==""+Si(t)&&(e.value=""+Si(t)):O!=="submit"&&O!=="reset"||e.removeAttribute("value"),t!=null?Cl(e,O,Si(t)):s!=null?Cl(e,O,Si(s)):n!=null&&e.removeAttribute("value"),c==null&&_!=null&&(e.defaultChecked=!!_),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+Si(j):e.removeAttribute("name")}function Eh(e,t,s,n,c,_,O,j){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.type=_),t!=null||s!=null){if(!(_!=="submit"&&_!=="reset"||t!=null)){bl(e);return}s=s!=null?""+Si(s):"",t=t!=null?""+Si(t):s,j||t===e.value||(e.value=t),e.defaultValue=t}n=n??c,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=j?e.checked:!!n,e.defaultChecked=!!n,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(e.name=O),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 Th(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 Ah(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 Bv=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 Rh(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||Bv.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Dh(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&&Rh(e,c,n)}else for(var _ in t)t.hasOwnProperty(_)&&Rh(e,_,t[_])}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 jv=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"]]),zv=/^[\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 zv.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 kh(e){var t=ge(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&&wh(n)}break e;case"textarea":Th(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&xr(e,!!s.multiple,t,!1)}}}var Al=!1;function Oh(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,kh(t),e)))for(t=0;t<e.length;t++)kh(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,Dl=null,Ba=null;function Mh(){if(Ba)return Ba;var e,t=Dl,s=t.length,n,c="value"in Cs?Cs.value:Cs.textContent,_=c.length;for(e=0;e<s&&t[e]===c[e];e++);var O=s-e;for(n=1;n<=O&&t[s-n]===c[_-n];n++);return Ba=c.slice(e,1<n?1-n:void 0)}function ja(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 Lh(){return!1}function Qt(e){function t(s,n,c,_,O){this._reactName=s,this._targetInst=c,this.type=n,this.nativeEvent=_,this.target=O,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(s=e[j],this[j]=s?s(_):_[j]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?za:Lh,this.isPropagationStopped=Lh,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}),Hv=Qt(xn),kl,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"?(kl=e.screenX-Cn.screenX,Ol=e.screenY-Cn.screenY):Ol=kl=0,Cn=e),kl)},movementY:function(e){return"movementY"in e?e.movementY:Ol}}),Nh=Qt(Ua),Uv=d({},Ua,{dataTransfer:0}),Iv=Qt(Uv),Pv=d({},xn,{relatedTarget:0}),Ml=Qt(Pv),$v=d({},er,{animationName:0,elapsedTime:0,pseudoElement:0}),Fv=Qt($v),Zv=d({},er,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qv=Qt(Zv),Gv=d({},er,{data:0}),Bh=Qt(Gv),Kv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Wv={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"},Vv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vv[e])?!!t[e]:!1}function Ll(){return Yv}var Xv=d({},xn,{key:function(e){if(e.key){var t=Kv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ja(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Wv[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"?ja(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ja(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jv=Qt(Xv),Qv=d({},Ua,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jh=Qt(Qv),eg=d({},xn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ll}),tg=Qt(eg),ig=d({},er,{propertyName:0,elapsedTime:0,pseudoElement:0}),sg=Qt(ig),rg=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}),ng=Qt(rg),ag=d({},er,{newState:0,oldState:0}),og=Qt(ag),lg=[9,13,27,32],Nl=ss&&"CompositionEvent"in window,wn=null;ss&&"documentMode"in document&&(wn=document.documentMode);var cg=ss&&"TextEvent"in window&&!wn,zh=ss&&(!Nl||wn&&8<wn&&11>=wn),Hh=" ",Uh=!1;function Ih(e,t){switch(e){case"keyup":return lg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ph(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Tr=!1;function ug(e,t){switch(e){case"compositionend":return Ph(t);case"keypress":return t.which!==32?null:(Uh=!0,Hh);case"textInput":return e=t.data,e===Hh&&Uh?null:e;default:return null}}function hg(e,t){if(Tr)return e==="compositionend"||!Nl&&Ih(e,t)?(e=Mh(),Ba=Dl=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 zh&&t.locale!=="ko"?null:t.data;default:return null}}var fg={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 $h(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fg[e.type]:t==="textarea"}function Fh(e,t,s,n){wr?Er?Er.push(n):Er=[n]:wr=n,t=Do(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 dg(e){Tm(e,0)}function Ia(e){var t=qe(e);if(wh(t))return e}function Zh(e,t){if(e==="change")return t}var qh=!1;if(ss){var Bl;if(ss){var jl="oninput"in document;if(!jl){var Gh=document.createElement("div");Gh.setAttribute("oninput","return;"),jl=typeof Gh.oninput=="function"}Bl=jl}else Bl=!1;qh=Bl&&(!document.documentMode||9<document.documentMode)}function Kh(){En&&(En.detachEvent("onpropertychange",Wh),Tn=En=null)}function Wh(e){if(e.propertyName==="value"&&Ia(Tn)){var t=[];Fh(t,Tn,e,Tl(e)),Oh(dg,t)}}function mg(e,t,s){e==="focusin"?(Kh(),En=t,Tn=s,En.attachEvent("onpropertychange",Wh)):e==="focusout"&&Kh()}function _g(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ia(Tn)}function pg(e,t){if(e==="click")return Ia(t)}function vg(e,t){if(e==="input"||e==="change")return Ia(t)}function gg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oi=typeof Object.is=="function"?Object.is:gg;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(!_i.call(t,c)||!oi(e[c],t[c]))return!1}return!0}function Vh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yh(e,t){var s=Vh(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=Vh(s)}}function Xh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jh(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 yg=ss&&"documentMode"in document&&11>=document.documentMode,Ar=null,Hl=null,Rn=null,Ul=!1;function Qh(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=Do(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={},ef={};ss&&(ef=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 ef)return Il[e]=t[s];return e}var tf=ir("animationend"),sf=ir("animationiteration"),rf=ir("animationstart"),Sg=ir("transitionrun"),bg=ir("transitionstart"),xg=ir("transitioncancel"),nf=ir("transitionend"),af=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 Bi(e,t){af.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=[],Dr=0,$l=0;function $a(){for(var e=Dr,t=$l=Dr=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 _=xi[t];if(xi[t++]=null,n!==null&&c!==null){var O=n.pending;O===null?c.next=c:(c.next=O.next,O.next=c),n.pending=c}_!==0&&of(s,c,_)}}function Fa(e,t,s,n){xi[Dr++]=e,xi[Dr++]=t,xi[Dr++]=s,xi[Dr++]=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 of(e,t,s){e.lanes|=s;var n=e.alternate;n!==null&&(n.lanes|=s);for(var c=!1,_=e.return;_!==null;)_.childLanes|=s,n=_.alternate,n!==null&&(n.childLanes|=s),_.tag===22&&(e=_.stateNode,e===null||e._visibility&1||(c=!0)),e=_,_=_.return;return e.tag===3?(_=e.stateNode,c&&t!==null&&(c=31-yt(s),e=_.hiddenUpdates,n=e[c],n===null?e[c]=[t]:n.push(t),t.lane=s|536870912),_):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 kr={};function Cg(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 Cg(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 lf(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,_){var O=0;if(n=e,typeof e=="function")Zl(e)&&(O=1);else if(typeof e=="string")O=R0(e,s,ae.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=_,e;case x:return rr(s.children,c,_,t);case m:O=8,c|=24;break;case g:return e=li(12,s,t,c|2),e.elementType=g,e.lanes=_,e;case R:return e=li(13,s,t,c),e.elementType=R,e.lanes=_,e;case D:return e=li(19,s,t,c),e.elementType=D,e.lanes=_,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case p:O=10;break e;case f:O=9;break e;case S:O=11;break e;case M:O=14;break e;case T:O=16,n=null;break e}O=29,s=Error(o(130,e===null?"null":typeof e,"")),n=null}return t=li(O,s,t,c),t.elementType=e,t.type=n,t.lanes=_,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 cf(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 uf=new WeakMap;function Ci(e,t){if(typeof e=="object"&&e!==null){var s=uf.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Ft(t)},uf.set(e,t),t)}return{value:e,source:t,stack:Ft(t)}}var Or=[],Mr=0,Ga=null,Dn=0,wi=[],Ei=0,ws=null,$i=1,Fi="";function ns(e,t){Or[Mr++]=Dn,Or[Mr++]=Ga,Ga=e,Dn=t}function hf(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 _=32-yt(t)+c;if(30<_){var O=c-c%5;_=(n&(1<<O)-1).toString(32),n>>=O,c-=O,$i=1<<32-yt(t)+c|s<<c|n,Fi=_+e}else $i=1<<_|s<<c|n,Fi=e}function Kl(e){e.return!==null&&(ns(e,1),hf(e,1,0))}function Wl(e){for(;e===Ga;)Ga=Or[--Mr],Or[Mr]=null,Dn=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 ff(e,t){wi[Ei++]=$i,wi[Ei++]=Fi,wi[Ei++]=ws,$i=t.id,Fi=t.overflow,ws=e}var zt=null,tt=null,Ue=!1,Es=null,Ti=!1,Vl=Error(o(519));function Ts(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw kn(Ci(t,e)),Vl}function df(e){var t=e.stateNode,s=e.type,n=e.memoizedProps;switch(t[St]=e,t[st]=n,s){case"dialog":Be("cancel",t),Be("close",t);break;case"iframe":case"object":case"embed":Be("load",t);break;case"video":case"audio":for(s=0;s<Jn.length;s++)Be(Jn[s],t);break;case"source":Be("error",t);break;case"img":case"image":case"link":Be("error",t),Be("load",t);break;case"details":Be("toggle",t);break;case"input":Be("invalid",t),Eh(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Be("invalid",t);break;case"textarea":Be("invalid",t),Ah(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||km(t.textContent,s)?(n.popover!=null&&(Be("beforetoggle",t),Be("toggle",t)),n.onScroll!=null&&Be("scroll",t),n.onScrollEnd!=null&&Be("scrollend",t),n.onClick!=null&&(t.onclick=is),t=!0):t=!1,t||Ts(e,!0)}function mf(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(!Ue)return mf(e),Ue=!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),mf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));tt=Um(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));tt=Um(e)}else t===27?(t=tt,Is(e.type)?(e=gu,gu=null,tt=e):tt=t):tt=zt?Ri(e.stateNode.nextSibling):null;return!0}function nr(){tt=zt=null,Ue=!1}function Yl(){var e=Es;return e!==null&&(si===null?si=e:si.push.apply(si,e),Es=null),e}function kn(e){Es===null?Es=[e]:Es.push(e)}var Xl=L(null),ar=null,as=null;function As(e,t,s){X(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 _=c.dependencies;if(_!==null){var O=c.child;_=_.firstContext;e:for(;_!==null;){var j=_;_=c;for(var Z=0;Z<t.length;Z++)if(j.context===t[Z]){_.lanes|=s,j=_.alternate,j!==null&&(j.lanes|=s),Jl(_.return,s,e),n||(O=null);break e}_=j.next}}else if(c.tag===18){if(O=c.return,O===null)throw Error(o(341));O.lanes|=s,_=O.alternate,_!==null&&(_.lanes|=s),Jl(O,s,e),O=null}else O=c.child;if(O!==null)O.return=c;else for(O=c;O!==null;){if(O===e){O=null;break}if(c=O.sibling,c!==null){c.return=O.return,O=c;break}O=O.return}c=O}}function Nr(e,t,s,n){e=null;for(var c=t,_=!1;c!==null;){if(!_){if((c.flags&524288)!==0)_=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var O=c.alternate;if(O===null)throw Error(o(387));if(O=O.memoizedProps,O!==null){var j=c.type;oi(c.pendingProps.value,O.value)||(e!==null?e.push(j):e=[j])}}else if(c===K.current){if(O=c.alternate,O===null)throw Error(o(387));O.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 _f(ar,e)}function Wa(e,t){return ar===null&&or(e),_f(e,t)}function _f(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 wg=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()})}},Eg=i.unstable_scheduleCallback,Tg=i.unstable_NormalPriority,bt={$$typeof:p,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ec(){return{controller:new wg,data:new Map,refCount:0}}function On(e){e.refCount--,e.refCount===0&&Eg(Tg,function(){e.controller.abort()})}var Mn=null,tc=0,Br=0,jr=null;function Ag(e,t){if(Mn===null){var s=Mn=[];tc=0,Br=ru(),jr={status:"pending",value:void 0,then:function(n){s.push(n)}}}return tc++,t.then(pf,pf),t}function pf(){if(--tc===0&&Mn!==null){jr!==null&&(jr.status="fulfilled");var e=Mn;Mn=null,Br=0,jr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Rg(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 vf=G.S;G.S=function(e,t){em=at(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ag(e,t),vf!==null&&vf(e,t)};var lr=L(null);function ic(){var e=lr.current;return e!==null?e:Qe.pooledCache}function Va(e,t){t===null?X(lr,lr.current):X(lr,t.pool)}function gf(){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 yf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Sf(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,xf(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,xf(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 bf(){if(ur===null)throw Error(o(459));var e=ur;return ur=null,e}function xf(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=[]),Sf(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===b?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Cf(e){function t(J,V){if(e){var ie=J.deletions;ie===null?(J.deletions=[V],J.flags|=16):ie.push(V)}}function s(J,V){if(!e)return null;for(;V!==null;)t(J,V),V=V.sibling;return null}function n(J){for(var V=new Map;J!==null;)J.key!==null?V.set(J.key,J):V.set(J.index,J),J=J.sibling;return V}function c(J,V){return J=rs(J,V),J.index=0,J.sibling=null,J}function _(J,V,ie){return J.index=ie,e?(ie=J.alternate,ie!==null?(ie=ie.index,ie<V?(J.flags|=67108866,V):ie):(J.flags|=67108866,V)):(J.flags|=1048576,V)}function O(J){return e&&J.alternate===null&&(J.flags|=67108866),J}function j(J,V,ie,fe){return V===null||V.tag!==6?(V=ql(ie,J.mode,fe),V.return=J,V):(V=c(V,ie),V.return=J,V)}function Z(J,V,ie,fe){var xe=ie.type;return xe===x?ce(J,V,ie.props.children,fe,ie.key):V!==null&&(V.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===T&&cr(xe)===V.type)?(V=c(V,ie.props),Nn(V,ie),V.return=J,V):(V=qa(ie.type,ie.key,ie.props,null,J.mode,fe),Nn(V,ie),V.return=J,V)}function se(J,V,ie,fe){return V===null||V.tag!==4||V.stateNode.containerInfo!==ie.containerInfo||V.stateNode.implementation!==ie.implementation?(V=Gl(ie,J.mode,fe),V.return=J,V):(V=c(V,ie.children||[]),V.return=J,V)}function ce(J,V,ie,fe,xe){return V===null||V.tag!==7?(V=rr(ie,J.mode,fe,xe),V.return=J,V):(V=c(V,ie),V.return=J,V)}function me(J,V,ie){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=ql(""+V,J.mode,ie),V.return=J,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case C:return ie=qa(V.type,V.key,V.props,null,J.mode,ie),Nn(ie,V),ie.return=J,ie;case k:return V=Gl(V,J.mode,ie),V.return=J,V;case T:return V=cr(V),me(J,V,ie)}if(te(V)||q(V))return V=rr(V,J.mode,ie,null),V.return=J,V;if(typeof V.then=="function")return me(J,Ja(V),ie);if(V.$$typeof===p)return me(J,Wa(J,V),ie);Qa(J,V)}return null}function re(J,V,ie,fe){var xe=V!==null?V.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return xe!==null?null:j(J,V,""+ie,fe);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case C:return ie.key===xe?Z(J,V,ie,fe):null;case k:return ie.key===xe?se(J,V,ie,fe):null;case T:return ie=cr(ie),re(J,V,ie,fe)}if(te(ie)||q(ie))return xe!==null?null:ce(J,V,ie,fe,null);if(typeof ie.then=="function")return re(J,V,Ja(ie),fe);if(ie.$$typeof===p)return re(J,V,Wa(J,ie),fe);Qa(J,ie)}return null}function oe(J,V,ie,fe,xe){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return J=J.get(ie)||null,j(V,J,""+fe,xe);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case C:return J=J.get(fe.key===null?ie:fe.key)||null,Z(V,J,fe,xe);case k:return J=J.get(fe.key===null?ie:fe.key)||null,se(V,J,fe,xe);case T:return fe=cr(fe),oe(J,V,ie,fe,xe)}if(te(fe)||q(fe))return J=J.get(ie)||null,ce(V,J,fe,xe,null);if(typeof fe.then=="function")return oe(J,V,ie,Ja(fe),xe);if(fe.$$typeof===p)return oe(J,V,ie,Wa(V,fe),xe);Qa(V,fe)}return null}function ye(J,V,ie,fe){for(var xe=null,Pe=null,be=V,ke=V=0,ze=null;be!==null&&ke<ie.length;ke++){be.index>ke?(ze=be,be=null):ze=be.sibling;var $e=re(J,be,ie[ke],fe);if($e===null){be===null&&(be=ze);break}e&&be&&$e.alternate===null&&t(J,be),V=_($e,V,ke),Pe===null?xe=$e:Pe.sibling=$e,Pe=$e,be=ze}if(ke===ie.length)return s(J,be),Ue&&ns(J,ke),xe;if(be===null){for(;ke<ie.length;ke++)be=me(J,ie[ke],fe),be!==null&&(V=_(be,V,ke),Pe===null?xe=be:Pe.sibling=be,Pe=be);return Ue&&ns(J,ke),xe}for(be=n(be);ke<ie.length;ke++)ze=oe(be,J,ke,ie[ke],fe),ze!==null&&(e&&ze.alternate!==null&&be.delete(ze.key===null?ke:ze.key),V=_(ze,V,ke),Pe===null?xe=ze:Pe.sibling=ze,Pe=ze);return e&&be.forEach(function(qs){return t(J,qs)}),Ue&&ns(J,ke),xe}function we(J,V,ie,fe){if(ie==null)throw Error(o(151));for(var xe=null,Pe=null,be=V,ke=V=0,ze=null,$e=ie.next();be!==null&&!$e.done;ke++,$e=ie.next()){be.index>ke?(ze=be,be=null):ze=be.sibling;var qs=re(J,be,$e.value,fe);if(qs===null){be===null&&(be=ze);break}e&&be&&qs.alternate===null&&t(J,be),V=_(qs,V,ke),Pe===null?xe=qs:Pe.sibling=qs,Pe=qs,be=ze}if($e.done)return s(J,be),Ue&&ns(J,ke),xe;if(be===null){for(;!$e.done;ke++,$e=ie.next())$e=me(J,$e.value,fe),$e!==null&&(V=_($e,V,ke),Pe===null?xe=$e:Pe.sibling=$e,Pe=$e);return Ue&&ns(J,ke),xe}for(be=n(be);!$e.done;ke++,$e=ie.next())$e=oe(be,J,ke,$e.value,fe),$e!==null&&(e&&$e.alternate!==null&&be.delete($e.key===null?ke:$e.key),V=_($e,V,ke),Pe===null?xe=$e:Pe.sibling=$e,Pe=$e);return e&&be.forEach(function(U0){return t(J,U0)}),Ue&&ns(J,ke),xe}function Je(J,V,ie,fe){if(typeof ie=="object"&&ie!==null&&ie.type===x&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case C:e:{for(var xe=ie.key;V!==null;){if(V.key===xe){if(xe=ie.type,xe===x){if(V.tag===7){s(J,V.sibling),fe=c(V,ie.props.children),fe.return=J,J=fe;break e}}else if(V.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===T&&cr(xe)===V.type){s(J,V.sibling),fe=c(V,ie.props),Nn(fe,ie),fe.return=J,J=fe;break e}s(J,V);break}else t(J,V);V=V.sibling}ie.type===x?(fe=rr(ie.props.children,J.mode,fe,ie.key),fe.return=J,J=fe):(fe=qa(ie.type,ie.key,ie.props,null,J.mode,fe),Nn(fe,ie),fe.return=J,J=fe)}return O(J);case k:e:{for(xe=ie.key;V!==null;){if(V.key===xe)if(V.tag===4&&V.stateNode.containerInfo===ie.containerInfo&&V.stateNode.implementation===ie.implementation){s(J,V.sibling),fe=c(V,ie.children||[]),fe.return=J,J=fe;break e}else{s(J,V);break}else t(J,V);V=V.sibling}fe=Gl(ie,J.mode,fe),fe.return=J,J=fe}return O(J);case T:return ie=cr(ie),Je(J,V,ie,fe)}if(te(ie))return ye(J,V,ie,fe);if(q(ie)){if(xe=q(ie),typeof xe!="function")throw Error(o(150));return ie=xe.call(ie),we(J,V,ie,fe)}if(typeof ie.then=="function")return Je(J,V,Ja(ie),fe);if(ie.$$typeof===p)return Je(J,V,Wa(J,ie),fe);Qa(J,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,V!==null&&V.tag===6?(s(J,V.sibling),fe=c(V,ie),fe.return=J,J=fe):(s(J,V),fe=ql(ie,J.mode,fe),fe.return=J,J=fe),O(J)):s(J,V)}return function(J,V,ie,fe){try{Ln=0;var xe=Je(J,V,ie,fe);return Hr=null,xe}catch(be){if(be===zr||be===Ya)throw be;var Pe=li(29,be,null,J.mode);return Pe.lanes=fe,Pe.return=J,Pe}finally{}}}var hr=Cf(!0),wf=Cf(!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 Ds(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ks(e,t,s){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Fe&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),of(e,null,s),t}return Fa(e,n,t,s),Za(e)}function Bn(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,_n(e,s)}}function ac(e,t){var s=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,s===n)){var c=null,_=null;if(s=s.firstBaseUpdate,s!==null){do{var O={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};_===null?c=_=O:_=_.next=O,s=s.next}while(s!==null);_===null?c=_=t:_=_.next=t}else c=_=t;s={baseState:n.baseState,firstBaseUpdate:c,lastBaseUpdate:_,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 jn(){if(oc){var e=jr;if(e!==null)throw e}}function zn(e,t,s,n){oc=!1;var c=e.updateQueue;Rs=!1;var _=c.firstBaseUpdate,O=c.lastBaseUpdate,j=c.shared.pending;if(j!==null){c.shared.pending=null;var Z=j,se=Z.next;Z.next=null,O===null?_=se:O.next=se,O=Z;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,j=ce.lastBaseUpdate,j!==O&&(j===null?ce.firstBaseUpdate=se:j.next=se,ce.lastBaseUpdate=Z))}if(_!==null){var me=c.baseState;O=0,ce=se=Z=null,j=_;do{var re=j.lane&-536870913,oe=re!==j.lane;if(oe?(je&re)===re:(n&re)===re){re!==0&&re===Br&&(oc=!0),ce!==null&&(ce=ce.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var ye=e,we=j;re=t;var Je=s;switch(we.tag){case 1:if(ye=we.payload,typeof ye=="function"){me=ye.call(Je,me,re);break e}me=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=we.payload,re=typeof ye=="function"?ye.call(Je,me,re):ye,re==null)break e;me=d({},me,re);break e;case 2:Rs=!0}}re=j.callback,re!==null&&(e.flags|=64,oe&&(e.flags|=8192),oe=c.callbacks,oe===null?c.callbacks=[re]:oe.push(re))}else oe={lane:re,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ce===null?(se=ce=oe,Z=me):ce=ce.next=oe,O|=re;if(j=j.next,j===null){if(j=c.shared.pending,j===null)break;oe=j,j=oe.next,oe.next=null,c.lastBaseUpdate=oe,c.shared.pending=null}}while(!0);ce===null&&(Z=me),c.baseState=Z,c.firstBaseUpdate=se,c.lastBaseUpdate=ce,_===null&&(c.shared.lanes=0),Bs|=O,e.lanes=O,e.memoizedState=me}}function Ef(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Tf(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Ef(s[e],t)}var Ur=L(null),eo=L(0);function Af(e,t){e=ps,X(eo,e),X(Ur,t),ps=e|t.baseLanes}function lc(){X(eo,ps),X(Ur,Ur.current)}function cc(){ps=eo.current,H(Ur),H(eo)}var ci=L(null),Ai=null;function Os(e){var t=e.alternate;X(vt,vt.current&1),X(ci,e),Ai===null&&(t===null||Ur.current!==null||t.memoizedState!==null)&&(Ai=e)}function uc(e){X(vt,vt.current),X(ci,e),Ai===null&&(Ai=e)}function Rf(e){e.tag===22?(X(vt,vt.current),X(ci,e),Ai===null&&(Ai=e)):Ms()}function Ms(){X(vt,vt.current),X(ci,ci.current)}function ui(e){H(ci),Ai===e&&(Ai=null),H(vt)}var vt=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||pu(s)||vu(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,Re=null,Ye=null,xt=null,io=!1,Ir=!1,fr=!1,so=0,Hn=0,Pr=null,Dg=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,_){return ls=_,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?hd:Ac,fr=!1,_=s(n,c),fr=!1,Ir&&(_=kf(t,s,n,c)),Df(e),_}function Df(e){G.H=Pn;var t=Ye!==null&&Ye.next!==null;if(ls=0,xt=Ye=Re=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 kf(e,t,s,n){Re=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 _=e.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}G.H=fd,_=t(s,n)}while(Ir);return _}function kg(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?Un(t):t,e=e.useState()[0],(Ye!==null?Ye.memoizedState:null)!==e&&(Re.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 _c(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=Re=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?Re.memoizedState=xt=e:xt=xt.next=e,xt}function gt(){if(Ye===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var t=xt===null?Re.memoizedState:xt.next;if(t!==null)xt=t,Ye=e;else{if(e===null)throw Re.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?Re.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=Sf(Pr,e,t),t=Re,(xt===null?t.memoizedState:xt.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?hd:Ac),e}function no(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Un(e);if(e.$$typeof===p)return Ht(e)}throw Error(o(438,String(e)))}function pc(e){var t=null,s=Re.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var n=Re.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(),Re.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]=I;return t.index++,s}function cs(e,t){return typeof t=="function"?t(e):t}function ao(e){var t=gt();return vc(t,Ye,e)}function vc(e,t,s){var n=e.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=s;var c=e.baseQueue,_=n.pending;if(_!==null){if(c!==null){var O=c.next;c.next=_.next,_.next=O}t.baseQueue=c=_,n.pending=null}if(_=e.baseState,c===null)e.memoizedState=_;else{t=c.next;var j=O=null,Z=null,se=t,ce=!1;do{var me=se.lane&-536870913;if(me!==se.lane?(je&me)===me:(ls&me)===me){var re=se.revertLane;if(re===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),me===Br&&(ce=!0);else if((ls&re)===re){se=se.next,re===Br&&(ce=!0);continue}else me={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},Z===null?(j=Z=me,O=_):Z=Z.next=me,Re.lanes|=re,Bs|=re;me=se.action,fr&&s(_,me),_=se.hasEagerState?se.eagerState:s(_,me)}else re={lane:me,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},Z===null?(j=Z=re,O=_):Z=Z.next=re,Re.lanes|=me,Bs|=me;se=se.next}while(se!==null&&se!==t);if(Z===null?O=_:Z.next=j,!oi(_,e.memoizedState)&&(Ct=!0,ce&&(s=jr,s!==null)))throw s;e.memoizedState=_,e.baseState=O,e.baseQueue=Z,n.lastRenderedState=_}return c===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function gc(e){var t=gt(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var n=s.dispatch,c=s.pending,_=t.memoizedState;if(c!==null){s.pending=null;var O=c=c.next;do _=e(_,O.action),O=O.next;while(O!==c);oi(_,t.memoizedState)||(Ct=!0),t.memoizedState=_,t.baseQueue===null&&(t.baseState=_),s.lastRenderedState=_}return[_,n]}function Of(e,t,s){var n=Re,c=gt(),_=Ue;if(_){if(s===void 0)throw Error(o(407));s=s()}else s=t();var O=!oi((Ye||c).memoizedState,s);if(O&&(c.memoizedState=s,Ct=!0),c=c.queue,bc(Nf.bind(null,n,c,e),[e]),c.getSnapshot!==t||O||xt!==null&&xt.memoizedState.tag&1){if(n.flags|=2048,$r(9,{destroy:void 0},Lf.bind(null,n,c,s,t),null),Qe===null)throw Error(o(349));_||(ls&127)!==0||Mf(n,t,s)}return s}function Mf(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Re.updateQueue,t===null?(t=ro(),Re.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Lf(e,t,s,n){t.value=s,t.getSnapshot=n,Bf(t)&&jf(e)}function Nf(e,t,s){return s(function(){Bf(t)&&jf(e)})}function Bf(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!oi(e,s)}catch{return!0}}function jf(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 zf(e,t,s,n){return e.baseState=s,vc(e,Ye,typeof n=="function"?n:cs)}function Og(e,t,s,n,c){if(co(e))throw Error(o(485));if(e=t.action,e!==null){var _={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){_.listeners.push(O)}};G.T!==null?s(!0):_.isTransition=!1,n(_),s=t.pending,s===null?(_.next=t.pending=_,Hf(t,_)):(_.next=s.next,t.pending=s.next=_)}}function Hf(e,t){var s=t.action,n=t.payload,c=e.state;if(t.isTransition){var _=G.T,O={};G.T=O;try{var j=s(c,n),Z=G.S;Z!==null&&Z(O,j),Uf(e,t,j)}catch(se){Sc(e,t,se)}finally{_!==null&&O.types!==null&&(_.types=O.types),G.T=_}}else try{_=s(c,n),Uf(e,t,_)}catch(se){Sc(e,t,se)}}function Uf(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(n){If(e,t,n)},function(n){return Sc(e,t,n)}):If(e,t,s)}function If(e,t,s){t.status="fulfilled",t.value=s,Pf(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Hf(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,Pf(t),t=t.next;while(t!==n)}e.action=null}function Pf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $f(e,t){return t}function Ff(e,t){if(Ue){var s=Qe.formState;if(s!==null){e:{var n=Re;if(Ue){if(tt){t:{for(var c=tt,_=Ti;c.nodeType!==8;){if(!_){c=null;break t}if(c=Ri(c.nextSibling),c===null){c=null;break t}}_=c.data,c=_==="F!"||_==="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:$f,lastRenderedState:t},s.queue=n,s=ld.bind(null,Re,n),n.dispatch=s,n=yc(!1),_=Tc.bind(null,Re,!1,n.queue),n=qt(),c={state:t,dispatch:null,action:e,pending:null},n.queue=c,s=Og.bind(null,Re,c,_,s),c.dispatch=s,n.memoizedState=e,[t,s,!1]}function Zf(e){var t=gt();return qf(t,Ye,e)}function qf(e,t,s){if(t=vc(e,t,$f)[0],e=ao(cs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Un(t)}catch(O){throw O===zr?Ya:O}else n=t;t=gt();var c=t.queue,_=c.dispatch;return s!==t.memoizedState&&(Re.flags|=2048,$r(9,{destroy:void 0},Mg.bind(null,c,s),null)),[n,_,e]}function Mg(e,t){e.action=t}function Gf(e){var t=gt(),s=Ye;if(s!==null)return qf(t,s,e);gt(),t=t.memoizedState,s=gt();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=Re.updateQueue,t===null&&(t=ro(),Re.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 Kf(){return gt().memoizedState}function oo(e,t,s,n){var c=qt();Re.flags|=e,c.memoizedState=$r(1|t,{destroy:void 0},s,n===void 0?null:n)}function lo(e,t,s,n){var c=gt();n=n===void 0?null:n;var _=c.memoizedState.inst;Ye!==null&&n!==null&&hc(n,Ye.memoizedState.deps)?c.memoizedState=$r(t,_,s,n):(Re.flags|=e,c.memoizedState=$r(1|t,_,s,n))}function Wf(e,t){oo(8390656,8,e,t)}function bc(e,t){lo(2048,8,e,t)}function Lg(e){Re.flags|=4;var t=Re.updateQueue;if(t===null)t=ro(),Re.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Vf(e){var t=gt().memoizedState;return Lg({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Yf(e,t){return lo(4,2,e,t)}function Xf(e,t){return lo(4,4,e,t)}function Jf(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 Qf(e,t,s){s=s!=null?s.concat([e]):null,lo(4,4,Jf.bind(null,t,e),s)}function xc(){}function ed(e,t){var s=gt();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 td(e,t){var s=gt();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&&(je&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=im(),Re.lanes|=e,Bs|=e,s)}function id(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&&(je&261930)===0?(Ct=!0,e.memoizedState=s):(e=im(),Re.lanes|=e,Bs|=e,t)}function sd(e,t,s,n,c){var _=Y.p;Y.p=_!==0&&8>_?_:8;var O=G.T,j={};G.T=j,Tc(e,!1,t,s);try{var Z=c(),se=G.S;if(se!==null&&se(j,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var ce=Rg(Z,n);In(e,t,ce,di(e))}else In(e,t,n,di(e))}catch(me){In(e,t,{then:function(){},status:"rejected",reason:me},di())}finally{Y.p=_,O!==null&&j.types!==null&&(O.types=j.types),G.T=O}}function Ng(){}function wc(e,t,s,n){if(e.tag!==5)throw Error(o(476));var c=rd(e).queue;sd(e,c,t,ee,s===null?Ng:function(){return nd(e),s(n)})}function rd(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 nd(e){var t=rd(e);t.next===null&&(t=e.alternate.memoizedState),In(e,t.next.queue,{},di())}function Ec(){return Ht(sa)}function ad(){return gt().memoizedState}function od(){return gt().memoizedState}function Bg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=di();e=Ds(s);var n=ks(t,e,s);n!==null&&(ri(n,t,s),Bn(n,t,s)),t={cache:ec()},e.payload=t;return}t=t.return}}function jg(e,t,s){var n=di();s={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},co(e)?cd(t,s):(s=Fl(e,t,s,n),s!==null&&(ri(s,e,n),ud(s,t,n)))}function ld(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))cd(t,c);else{var _=e.alternate;if(e.lanes===0&&(_===null||_.lanes===0)&&(_=t.lastRenderedReducer,_!==null))try{var O=t.lastRenderedState,j=_(O,s);if(c.hasEagerState=!0,c.eagerState=j,oi(j,O))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),ud(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===Re||t!==null&&t===Re}function cd(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 ud(e,t,s){if((s&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,s|=n,t.lanes=s,_n(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 hd={readContext:Ht,use:no,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:Wf,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,oo(4194308,4,Jf.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=jg.bind(null,Re,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=ld.bind(null,Re,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=sd.bind(null,Re,e.queue,!0,!1),qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var n=Re,c=qt();if(Ue){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),Qe===null)throw Error(o(349));(je&127)!==0||Mf(n,t,s)}c.memoizedState=s;var _={value:s,getSnapshot:t};return c.queue=_,Wf(Nf.bind(null,n,_,e),[e]),n.flags|=2048,$r(9,{destroy:void 0},Lf.bind(null,n,_,s,t),null),s},useId:function(){var e=qt(),t=Qe.identifierPrefix;if(Ue){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=Dg++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ec,useFormState:Ff,useActionState:Ff,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,Re,!0,s),s.dispatch=t,[e,t]},useMemoCache:pc,useCacheRefresh:function(){return qt().memoizedState=Bg.bind(null,Re)},useEffectEvent:function(e){var t=qt(),s={impl:e};return t.memoizedState=s,function(){if((Fe&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Ac={readContext:Ht,use:no,useCallback:ed,useContext:Ht,useEffect:bc,useImperativeHandle:Qf,useInsertionEffect:Yf,useLayoutEffect:Xf,useMemo:td,useReducer:ao,useRef:Kf,useState:function(){return ao(cs)},useDebugValue:xc,useDeferredValue:function(e,t){var s=gt();return id(s,Ye.memoizedState,e,t)},useTransition:function(){var e=ao(cs)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:Un(e),t]},useSyncExternalStore:Of,useId:ad,useHostTransitionStatus:Ec,useFormState:Zf,useActionState:Zf,useOptimistic:function(e,t){var s=gt();return zf(s,Ye,e,t)},useMemoCache:pc,useCacheRefresh:od};Ac.useEffectEvent=Vf;var fd={readContext:Ht,use:no,useCallback:ed,useContext:Ht,useEffect:bc,useImperativeHandle:Qf,useInsertionEffect:Yf,useLayoutEffect:Xf,useMemo:td,useReducer:gc,useRef:Kf,useState:function(){return gc(cs)},useDebugValue:xc,useDeferredValue:function(e,t){var s=gt();return Ye===null?Cc(s,e,t):id(s,Ye.memoizedState,e,t)},useTransition:function(){var e=gc(cs)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:Un(e),t]},useSyncExternalStore:Of,useId:ad,useHostTransitionStatus:Ec,useFormState:Gf,useActionState:Gf,useOptimistic:function(e,t){var s=gt();return Ye!==null?zf(s,Ye,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:pc,useCacheRefresh:od};fd.useEffectEvent=Vf;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 Dc={enqueueSetState:function(e,t,s){e=e._reactInternals;var n=di(),c=Ds(n);c.payload=t,s!=null&&(c.callback=s),t=ks(e,c,n),t!==null&&(ri(t,e,n),Bn(t,e,n))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var n=di(),c=Ds(n);c.tag=1,c.payload=t,s!=null&&(c.callback=s),t=ks(e,c,n),t!==null&&(ri(t,e,n),Bn(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=di(),n=Ds(s);n.tag=2,t!=null&&(n.callback=t),t=ks(e,n,s),t!==null&&(ri(t,e,s),Bn(t,e,s))}};function dd(e,t,s,n,c,_,O){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,_,O):t.prototype&&t.prototype.isPureReactComponent?!An(s,n)||!An(c,_):!0}function md(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&&Dc.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 _d(e){Pa(e)}function pd(e){console.error(e)}function vd(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 gd(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 kc(e,t,s){return s=Ds(s),s.tag=3,s.payload={element:null},s.callback=function(){uo(e,t)},s}function yd(e){return e=Ds(e),e.tag=3,e}function Sd(e,t,s,n){var c=s.type.getDerivedStateFromError;if(typeof c=="function"){var _=n.value;e.payload=function(){return c(_)},e.callback=function(){gd(t,s,n)}}var O=s.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(e.callback=function(){gd(t,s,n),typeof c!="function"&&(js===null?js=new Set([this]):js.add(this));var j=n.stack;this.componentDidCatch(n.value,{componentStack:j!==null?j:""})})}function zg(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(Ue)return t=ci.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,n!==Vl&&(e=Error(o(422),{cause:n}),kn(Ci(e,s)))):(n!==Vl&&(t=Error(o(423),{cause:n}),kn(Ci(t,s))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,n=Ci(n,s),c=kc(e.stateNode,n,c),ac(e,c),ft!==4&&(ft=2)),!1;var _=Error(o(520),{cause:n});if(_=Ci(_,s),Vn===null?Vn=[_]:Vn.push(_),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=kc(s.stateNode,n,e),ac(s,e),!1;case 1:if(t=s.type,_=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(js===null||!js.has(_))))return s.flags|=65536,c&=-c,s.lanes|=c,c=yd(c),Sd(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?wf(t,null,s,n):hr(t,e.child,s,n)}function bd(e,t,s,n,c){s=s.render;var _=t.ref;if("ref"in n){var O={};for(var j in n)j!=="ref"&&(O[j]=n[j])}else O=n;return or(t),n=fc(e,t,s,O,_,c),j=dc(),e!==null&&!Ct?(mc(e,t,c),us(e,t,c)):(Ue&&j&&Kl(t),t.flags|=1,Ut(e,t,n,c),t.child)}function xd(e,t,s,n,c){if(e===null){var _=s.type;return typeof _=="function"&&!Zl(_)&&_.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=_,Cd(e,t,_,n,c)):(e=qa(s.type,null,n,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(_=e.child,!Uc(e,c)){var O=_.memoizedProps;if(s=s.compare,s=s!==null?s:An,s(O,n)&&e.ref===t.ref)return us(e,t,c)}return t.flags|=1,e=rs(_,n),e.ref=t.ref,e.return=t,t.child=e}function Cd(e,t,s,n,c){if(e!==null){var _=e.memoizedProps;if(An(_,n)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=n=_,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 wd(e,t,s,n){var c=n.children,_=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(_=_!==null?_.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&~_}else n=0,t.child=null;return Ed(e,t,_,s,n)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Va(t,_!==null?_.cachePool:null),_!==null?Af(t,_):lc(),Rf(t);else return n=t.lanes=536870912,Ed(e,t,_!==null?_.baseLanes|s:s,s,n)}else _!==null?(Va(t,_.cachePool),Af(t,_),Ms(),t.memoizedState=null):(e!==null&&Va(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 Ed(e,t,s,n,c){var _=ic();return _=_===null?null:{parent:bt._currentValue,pool:_},t.memoizedState={baseLanes:s,cachePool:_},e!==null&&Va(t,null),lc(),Rf(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 Td(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 Hg(e,t,s){var n=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ue){if(n.mode==="hidden")return e=ho(t,n),t.lanes=536870912,$n(null,e);if(uc(t),(e=tt)?(e=Hm(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=cf(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 _=e.memoizedState;if(_!==null){var O=_.dehydrated;if(uc(t),c)if(t.flags&256)t.flags&=-257,t=Td(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&&(O=Aa(n,s),O!==0&&O!==_.retryLane))throw _.retryLane=O,sr(e,O),ri(n,e,O),Oc;Co(),t=Td(e,t,s)}else e=_.treeContext,tt=Ri(O.nextSibling),zt=t,Ue=!0,Es=null,Ti=!1,e!==null&&ff(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)):(Ue&&n&&Kl(t),t.flags|=1,Ut(e,t,s,c),t.child)}function Ad(e,t,s,n,c,_){return or(t),t.updateQueue=null,s=kf(t,n,s,c),Df(e),n=dc(),e!==null&&!Ct?(mc(e,t,_),us(e,t,_)):(Ue&&n&&Kl(t),t.flags|=1,Ut(e,t,s,_),t.child)}function Rd(e,t,s,n,c){if(or(t),t.stateNode===null){var _=kr,O=s.contextType;typeof O=="object"&&O!==null&&(_=Ht(O)),_=new s(n,_),t.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Dc,t.stateNode=_,_._reactInternals=t,_=t.stateNode,_.props=n,_.state=t.memoizedState,_.refs={},rc(t),O=s.contextType,_.context=typeof O=="object"&&O!==null?Ht(O):kr,_.state=t.memoizedState,O=s.getDerivedStateFromProps,typeof O=="function"&&(Rc(t,s,O,n),_.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(O=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),O!==_.state&&Dc.enqueueReplaceState(_,_.state,null),zn(t,n,_,c),jn(),_.state=t.memoizedState),typeof _.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){_=t.stateNode;var j=t.memoizedProps,Z=dr(s,j);_.props=Z;var se=_.context,ce=s.contextType;O=kr,typeof ce=="object"&&ce!==null&&(O=Ht(ce));var me=s.getDerivedStateFromProps;ce=typeof me=="function"||typeof _.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,ce||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(j||se!==O)&&md(t,_,n,O),Rs=!1;var re=t.memoizedState;_.state=re,zn(t,n,_,c),jn(),se=t.memoizedState,j||re!==se||Rs?(typeof me=="function"&&(Rc(t,s,me,n),se=t.memoizedState),(Z=Rs||dd(t,s,Z,n,re,se,O))?(ce||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(t.flags|=4194308)):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=se),_.props=n,_.state=se,_.context=O,n=Z):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{_=t.stateNode,nc(e,t),O=t.memoizedProps,ce=dr(s,O),_.props=ce,me=t.pendingProps,re=_.context,se=s.contextType,Z=kr,typeof se=="object"&&se!==null&&(Z=Ht(se)),j=s.getDerivedStateFromProps,(se=typeof j=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(O!==me||re!==Z)&&md(t,_,n,Z),Rs=!1,re=t.memoizedState,_.state=re,zn(t,n,_,c),jn();var oe=t.memoizedState;O!==me||re!==oe||Rs||e!==null&&e.dependencies!==null&&Ka(e.dependencies)?(typeof j=="function"&&(Rc(t,s,j,n),oe=t.memoizedState),(ce=Rs||dd(t,s,ce,n,re,oe,Z)||e!==null&&e.dependencies!==null&&Ka(e.dependencies))?(se||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(n,oe,Z),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(n,oe,Z)),typeof _.componentDidUpdate=="function"&&(t.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof _.componentDidUpdate!="function"||O===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=oe),_.props=n,_.state=oe,_.context=Z,n=ce):(typeof _.componentDidUpdate!="function"||O===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),n=!1)}return _=n,fo(e,t),n=(t.flags&128)!==0,_||n?(_=t.stateNode,s=n&&typeof s.getDerivedStateFromError!="function"?null:_.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=_.state,e=t.child):e=us(e,t,c),e}function Dd(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:gf()}}function Bc(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=fi),e}function kd(e,t,s){var n=t.pendingProps,c=!1,_=(t.flags&128)!==0,O;if((O=_)||(O=e!==null&&e.memoizedState===null?!1:(vt.current&2)!==0),O&&(c=!0,t.flags&=-129),O=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(c?Os(t):Ms(),(e=tt)?(e=Hm(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=cf(e),s.return=t,t.child=s,zt=t,tt=null)):e=null,e===null)throw Ts(t);return vu(e)?t.lanes=32:t.lanes=536870912,null}var j=n.children;return n=n.fallback,c?(Ms(),c=t.mode,j=mo({mode:"hidden",children:j},c),n=rr(n,c,s,null),j.return=t,n.return=t,j.sibling=n,t.child=j,n=t.child,n.memoizedState=Nc(s),n.childLanes=Bc(e,O,s),t.memoizedState=Lc,$n(null,n)):(Os(t),jc(t,j))}var Z=e.memoizedState;if(Z!==null&&(j=Z.dehydrated,j!==null)){if(_)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(),j=n.fallback,c=t.mode,n=mo({mode:"visible",children:n.children},c),j=rr(j,c,s,null),j.flags|=2,n.return=t,j.return=t,n.sibling=j,t.child=n,hr(t,e.child,null,s),n=t.child,n.memoizedState=Nc(s),n.childLanes=Bc(e,O,s),t.memoizedState=Lc,t=$n(null,n));else if(Os(t),vu(j)){if(O=j.nextSibling&&j.nextSibling.dataset,O)var se=O.dgst;O=se,n=Error(o(419)),n.stack="",n.digest=O,kn({value:n,source:null,stack:null}),t=zc(e,t,s)}else if(Ct||Nr(e,t,s,!1),O=(s&e.childLanes)!==0,Ct||O){if(O=Qe,O!==null&&(n=Aa(O,s),n!==0&&n!==Z.retryLane))throw Z.retryLane=n,sr(e,n),ri(O,e,n),Oc;pu(j)||Co(),t=zc(e,t,s)}else pu(j)?(t.flags|=192,t.child=e.child,t=null):(e=Z.treeContext,tt=Ri(j.nextSibling),zt=t,Ue=!0,Es=null,Ti=!1,e!==null&&ff(t,e),t=jc(t,n.children),t.flags|=4096);return t}return c?(Ms(),j=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?j=rs(se,j):(j=rr(j,c,s,null),j.flags|=2),j.return=t,n.return=t,n.sibling=j,t.child=n,$n(null,n),n=t.child,j=e.child.memoizedState,j===null?j=Nc(s):(c=j.cachePool,c!==null?(Z=bt._currentValue,c=c.parent!==Z?{parent:Z,pool:Z}:c):c=gf(),j={baseLanes:j.baseLanes|s,cachePool:c}),n.memoizedState=j,n.childLanes=Bc(e,O,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&&(O=t.deletions,O===null?(t.deletions=[e],t.flags|=16):O.push(e)),t.child=s,t.memoizedState=null,s)}function jc(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=jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Od(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,_){var O=e.memoizedState;O===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:s,tailMode:c,treeForkCount:_}:(O.isBackwards=t,O.rendering=null,O.renderingStartTime=0,O.last=n,O.tail=s,O.tailMode=c,O.treeForkCount=_)}function Md(e,t,s){var n=t.pendingProps,c=n.revealOrder,_=n.tail;n=n.children;var O=vt.current,j=(O&2)!==0;if(j?(O=O&1|2,t.flags|=128):O&=1,X(vt,O),Ut(e,t,n,s),n=Ue?Dn:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Od(e,s,t);else if(e.tag===19)Od(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,_,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,_,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),Bs|=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 Ug(e,t,s){switch(t.tag){case 3:z(t,t.stateNode.containerInfo),As(t,bt,e.memoizedState.cache),nr();break;case 27:case 5:le(t);break;case 4:z(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?kd(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 Md(e,t,s);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),X(vt,vt.current),n)break;return null;case 22:return t.lanes=0,wd(e,t,s,t.pendingProps);case 24:As(t,bt,e.memoizedState.cache)}return us(e,t,s)}function Ld(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,Ug(e,t,s);Ct=(e.flags&131072)!==0}else Ct=!1,Ue&&(t.flags&1048576)!==0&&hf(t,Dn,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=Rd(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=bd(null,t,e,n,s);break e}else if(c===M){t.tag=14,t=xd(null,t,e,n,s);break e}}throw t=Q(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),Rd(e,t,n,c,s);case 3:e:{if(z(t,t.stateNode.containerInfo),e===null)throw Error(o(387));n=t.pendingProps;var _=t.memoizedState;c=_.element,nc(e,t),zn(t,n,null,s);var O=t.memoizedState;if(n=O.cache,As(t,bt,n),n!==_.cache&&Ql(t,[bt],s,!0),jn(),n=O.element,_.isDehydrated)if(_={element:n,isDehydrated:!1,cache:O.cache},t.updateQueue.baseState=_,t.memoizedState=_,t.flags&256){t=Dd(e,t,n,s);break e}else if(n!==c){c=Ci(Error(o(424)),t),kn(c),t=Dd(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,Ue=!0,Es=null,Ti=!0,s=wf(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=Zm(t.type,null,t.pendingProps,null))?t.memoizedState=s:Ue||(s=t.type,e=t.pendingProps,n=ko(ne.current).createElement(s),n[St]=t,n[st]=e,It(n,s,e),Oe(n),t.stateNode=n):t.memoizedState=Zm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return le(t),e===null&&Ue&&(n=t.stateNode=Pm(t.type,t.pendingProps,ne.current),zt=t,Ti=!0,c=tt,Is(t.type)?(gu=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&&Ue&&((c=n=tt)&&(n=_0(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)),le(t),c=t.type,_=t.pendingProps,O=e!==null?e.memoizedProps:null,n=_.children,du(c,_)?n=null:O!==null&&du(c,O)&&(t.flags|=32),t.memoizedState!==null&&(c=fc(e,t,kg,null,null,s),sa._currentValue=c),fo(e,t),Ut(e,t,n,s),t.child;case 6:return e===null&&Ue&&((e=s=tt)&&(s=p0(s,t.pendingProps,Ti),s!==null?(t.stateNode=s,zt=t,tt=null,e=!0):e=!1),e||Ts(t)),null;case 13:return kd(e,t,s);case 4:return z(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 bd(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 xd(e,t,t.type,t.pendingProps,s);case 15:return Cd(e,t,t.type,t.pendingProps,s);case 19:return Md(e,t,s);case 31:return Hg(e,t,s);case 22:return wd(e,t,s,t.pendingProps);case 24:return or(t),n=Ht(bt),e===null?(c=ic(),c===null&&(c=Qe,_=ec(),c.pooledCache=_,_.refCount++,_!==null&&(c.pooledCacheLanes|=s),c=_),t.memoizedState={parent:n,cache:c},rc(t),As(t,bt,c)):((e.lanes&s)!==0&&(nc(e,t),zn(t,null,null,s),jn()),c=e.memoizedState,_=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=_.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(am())e.flags|=8192;else throw ur=Xa,sc}else e.flags&=-16777217}function Nd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Vm(t))if(am())e.flags|=8192;else throw ur=Xa,sc}function _o(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(!Ue)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 Ig(e,t,s){var n=t.pendingProps;switch(Wl(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),ue(),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,_=t.memoizedState;return e===null?(hs(t),_!==null?(it(t),Nd(t,_)):(it(t),Ic(t,c,null,n,s))):_?_!==e.memoizedState?(hs(t),it(t),Nd(t,_)):(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=ne.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=ae.current,Lr(t)?df(t):(e=Pm(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(_=ae.current,Lr(t))df(t);else{var O=ko(ne.current);switch(_){case 1:_=O.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:_=O.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":_=O.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":_=O.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":_=O.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof n.is=="string"?O.createElement("select",{is:n.is}):O.createElement("select"),n.multiple?_.multiple=!0:n.size&&(_.size=n.size);break;default:_=typeof n.is=="string"?O.createElement(c,{is:n.is}):O.createElement(c)}}_[St]=t,_[st]=n;e:for(O=t.child;O!==null;){if(O.tag===5||O.tag===6)_.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===t)break e;for(;O.sibling===null;){if(O.return===null||O.return===t)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}t.stateNode=_;e:switch(It(_,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=ne.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||km(e.nodeValue,s)),e||Ts(t,!0)}else e=ko(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),_=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(_=n.memoizedState.cachePool.pool),_!==c&&(n.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),_o(t,t.updateQueue),it(t),null);case 4:return ue(),e===null&&lu(t.stateNode.containerInfo),it(t),null;case 10:return os(t.type),it(t),null;case 19:if(H(vt),n=t.memoizedState,n===null)return it(t),null;if(c=(t.flags&128)!==0,_=n.rendering,_===null)if(c)Fn(n,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(_=to(e),_!==null){for(t.flags|=128,Fn(n,!1),e=_.updateQueue,t.updateQueue=e,_o(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)lf(s,e),s=s.sibling;return X(vt,vt.current&1|2),Ue&&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(_),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,_o(t,e),Fn(n,!0),n.tail===null&&n.tailMode==="hidden"&&!_.alternate&&!Ue)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?(_.sibling=t.child,t.child=_):(e=n.last,e!==null?e.sibling=_:t.child=_,n.last=_)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=at(),e.sibling=null,s=vt.current,X(vt,c?s&1|2:s&1),Ue&&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&&_o(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 Pg(e,t){switch(Wl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return os(bt),ue(),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(vt),null;case 4:return ue(),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 Bd(e,t){switch(Wl(t),t.tag){case 3:os(bt),ue();break;case 26:case 27:case 5:ve(t);break;case 4:ue();break;case 31:t.memoizedState!==null&&ui(t);break;case 13:ui(t);break;case 19:H(vt);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 _=s.create,O=s.inst;n=_(),O.destroy=n}s=s.next}while(s!==c)}}catch(j){Ke(t,t.return,j)}}function Ls(e,t,s){try{var n=t.updateQueue,c=n!==null?n.lastEffect:null;if(c!==null){var _=c.next;n=_;do{if((n.tag&e)===e){var O=n.inst,j=O.destroy;if(j!==void 0){O.destroy=void 0,c=t;var Z=s,se=j;try{se()}catch(ce){Ke(c,Z,ce)}}}n=n.next}while(n!==_)}}catch(ce){Ke(t,t.return,ce)}}function jd(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Tf(t,s)}catch(n){Ke(e,e.return,n)}}}function zd(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 Hd(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;c0(n,e.type,s,t),n[st]=t}catch(c){Ke(e,e.return,c)}}function Ud(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||Ud(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 po(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(po(e,t,s),e=e.sibling;e!==null;)po(e,t,s),e=e.sibling}function Id(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(_){Ke(e,e.return,_)}}var fs=!1,wt=!1,Zc=!1,Pd=typeof WeakSet=="function"?WeakSet:Set,Lt=null;function $g(e,t){if(e=e.containerInfo,hu=zo,e=Jh(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,_=n.focusNode;n=n.focusOffset;try{s.nodeType,_.nodeType}catch{s=null;break e}var O=0,j=-1,Z=-1,se=0,ce=0,me=e,re=null;t:for(;;){for(var oe;me!==s||c!==0&&me.nodeType!==3||(j=O+c),me!==_||n!==0&&me.nodeType!==3||(Z=O+n),me.nodeType===3&&(O+=me.nodeValue.length),(oe=me.firstChild)!==null;)re=me,me=oe;for(;;){if(me===e)break t;if(re===s&&++se===c&&(j=O),re===_&&++ce===n&&(Z=O),(oe=me.nextSibling)!==null)break;me=re,re=me.parentNode}me=oe}s=j===-1||Z===-1?null:{start:j,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,_=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&&_!==null){e=void 0,s=t,c=_.memoizedProps,_=_.memoizedState,n=s.stateNode;try{var ye=dr(s.type,c);e=n.getSnapshotBeforeUpdate(ye,_),n.__reactInternalSnapshotBeforeUpdate=e}catch(we){Ke(s,s.return,we)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)_u(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":_u(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 $d(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(O){Ke(s,s.return,O)}else{var c=dr(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(O){Ke(s,s.return,O)}}n&64&&jd(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{Tf(e,t)}catch(O){Ke(s,s.return,O)}}break;case 27:t===null&&n&4&&Id(s);case 26:case 5:ms(e,s),t===null&&n&4&&Hd(s),n&512&&qn(s,s.return);break;case 12:ms(e,s);break;case 31:ms(e,s),n&4&&qd(e,s);break;case 13:ms(e,s),n&4&&Gd(e,s),n&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=Xg.bind(null,s),v0(e,s))));break;case 22:if(n=s.memoizedState!==null||fs,!n){t=t!==null&&t.memoizedState!==null||wt,c=fs;var _=wt;fs=n,(wt=t)&&!_?_s(e,s,(s.subtreeFlags&8772)!==0):ms(e,s),fs=c,wt=_}break;case 30:break;default:ms(e,s)}}function Fd(e){var t=e.alternate;t!==null&&(e.alternate=null,Fd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&W(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;)Zd(e,t,s),s=s.sibling}function Zd(e,t,s){if(Ot&&typeof Ot.onCommitFiberUnmount=="function")try{Ot.onCommitFiberUnmount(vi,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(_){Ke(s,t,_)}else try{rt.removeChild(s.stateNode)}catch(_){Ke(s,t,_)}break;case 18:rt!==null&&(ei?(e=rt,jm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),en(e)):jm(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"&&zd(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 qd(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 Gd(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 Fg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Pd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Pd),t;default:throw Error(o(435,e.tag))}}function vo(e,t){var s=Fg(e);t.forEach(function(n){if(!s.has(n)){s.add(n);var c=Jg.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],_=e,O=t,j=O;e:for(;j!==null;){switch(j.tag){case 27:if(Is(j.type)){rt=j.stateNode,ei=!1;break e}break;case 5:rt=j.stateNode,ei=!1;break e;case 3:case 4:rt=j.stateNode.containerInfo,ei=!0;break e}j=j.return}if(rt===null)throw Error(o(160));Zd(_,O,c),rt=null,ei=!1,_=c.alternate,_!==null&&(_.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Kd(t,e),t=t.sibling}var ji=null;function Kd(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=ji;if(ti(t,e),ii(e),n&512&&(wt||s===null||Zi(s,s.return)),n&4){var _=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":_=c.getElementsByTagName("title")[0],(!_||_[Se]||_[St]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=c.createElement(n),c.head.insertBefore(_,c.querySelector("head > title"))),It(_,n,s),_[St]=e,Oe(_),n=_;break e;case"link":var O=Km("link","href",c).get(n+(s.href||""));if(O){for(var j=0;j<O.length;j++)if(_=O[j],_.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&_.getAttribute("rel")===(s.rel==null?null:s.rel)&&_.getAttribute("title")===(s.title==null?null:s.title)&&_.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){O.splice(j,1);break t}}_=c.createElement(n),It(_,n,s),c.head.appendChild(_);break;case"meta":if(O=Km("meta","content",c).get(n+(s.content||""))){for(j=0;j<O.length;j++)if(_=O[j],_.getAttribute("content")===(s.content==null?null:""+s.content)&&_.getAttribute("name")===(s.name==null?null:s.name)&&_.getAttribute("property")===(s.property==null?null:s.property)&&_.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&_.getAttribute("charset")===(s.charSet==null?null:s.charSet)){O.splice(j,1);break t}}_=c.createElement(n),It(_,n,s),c.head.appendChild(_);break;default:throw Error(o(468,n))}_[St]=e,Oe(_),n=_}e.stateNode=n}else Wm(c,e.type,e.stateNode);else e.stateNode=Gm(c,n,e.memoizedProps);else _!==n?(_===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):_.count--,n===null?Wm(c,e.type,e.stateNode):Gm(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(ye){Ke(e,e.return,ye)}}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(ye){Ke(e,e.return,ye)}}break;case 3:if(Lo=null,c=ji,ji=Oo(t.containerInfo),ti(t,e),ji=c,ii(e),n&4&&s!==null&&s.memoizedState.isDehydrated)try{en(t.containerInfo)}catch(ye){Ke(e,e.return,ye)}Zc&&(Zc=!1,Wd(e));break;case 4:n=ji,ji=Oo(e.stateNode.containerInfo),ti(t,e),ii(e),ji=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,vo(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,vo(e,n)));break;case 22:c=e.memoizedState!==null;var Z=s!==null&&s.memoizedState!==null,se=fs,ce=wt;if(fs=se||c,wt=ce||Z,ti(t,e),wt=ce,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(_=Z.stateNode,c)O=_.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{j=Z.stateNode;var me=Z.memoizedProps.style,re=me!=null&&me.hasOwnProperty("display")?me.display:null;j.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(ye){Ke(Z,Z.return,ye)}}}else if(t.tag===6){if(s===null){Z=t;try{Z.stateNode.nodeValue=c?"":Z.memoizedProps}catch(ye){Ke(Z,Z.return,ye)}}}else if(t.tag===18){if(s===null){Z=t;try{var oe=Z.stateNode;c?zm(oe,!0):zm(Z.stateNode,!1)}catch(ye){Ke(Z,Z.return,ye)}}}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,vo(e,s))));break;case 19:ti(t,e),ii(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,vo(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(Ud(n)){s=n;break}n=n.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var c=s.stateNode,_=$c(e);po(e,_,c);break;case 5:var O=s.stateNode;s.flags&32&&(Cr(O,""),s.flags&=-33);var j=$c(e);po(e,j,O);break;case 3:case 4:var Z=s.stateNode.containerInfo,se=$c(e);Fc(e,se,Z);break;default:throw Error(o(161))}}catch(ce){Ke(e,e.return,ce)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Wd(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;)$d(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"&&zd(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 _s(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,c=e,_=t,O=_.flags;switch(_.tag){case 0:case 11:case 15:_s(c,_,s),Zn(4,_);break;case 1:if(_s(c,_,s),n=_,c=n.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(se){Ke(n,n.return,se)}if(n=_,c=n.updateQueue,c!==null){var j=n.stateNode;try{var Z=c.shared.hiddenCallbacks;if(Z!==null)for(c.shared.hiddenCallbacks=null,c=0;c<Z.length;c++)Ef(Z[c],j)}catch(se){Ke(n,n.return,se)}}s&&O&64&&jd(_),qn(_,_.return);break;case 27:Id(_);case 26:case 5:_s(c,_,s),s&&n===null&&O&4&&Hd(_),qn(_,_.return);break;case 12:_s(c,_,s);break;case 31:_s(c,_,s),s&&O&4&&qd(c,_);break;case 13:_s(c,_,s),s&&O&4&&Gd(c,_);break;case 22:_.memoizedState===null&&_s(c,_,s),qn(_,_.return);break;case 30:break;default:_s(c,_,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;)Vd(e,t,s,n),t=t.sibling}function Vd(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 _=t.memoizedProps,O=_.id,j=_.onPostCommit;typeof j=="function"&&j(O,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:_=t.stateNode,O=t.alternate,t.memoizedState!==null?_._visibility&2?zi(e,t,s,n):Gn(e,t):_._visibility&2?zi(e,t,s,n):(_._visibility|=2,Fr(e,t,s,n,(t.subtreeFlags&10256)!==0||!1)),c&2048&&qc(O,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 _=e,O=t,j=s,Z=n,se=O.flags;switch(O.tag){case 0:case 11:case 15:Fr(_,O,j,Z,c),Zn(8,O);break;case 23:break;case 22:var ce=O.stateNode;O.memoizedState!==null?ce._visibility&2?Fr(_,O,j,Z,c):Gn(_,O):(ce._visibility|=2,Fr(_,O,j,Z,c)),c&&se&2048&&qc(O.alternate,O);break;case 24:Fr(_,O,j,Z,c),c&&se&2048&&Gc(O.alternate,O);break;default:Fr(_,O,j,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;)Yd(e,t,s),e=e.sibling}function Yd(e,t,s){switch(e.tag){case 26:Zr(e,t,s),e.flags&Kn&&e.memoizedState!==null&&D0(s,ji,e.memoizedState,e.memoizedProps);break;case 5:Zr(e,t,s);break;case 3:case 4:var n=ji;ji=Oo(e.stateNode.containerInfo),Zr(e,t,s),ji=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 Xd(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 Wn(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,Qd(n,e)}Xd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Jd(e),e=e.sibling}function Jd(e){switch(e.tag){case 0:case 11:case 15:Wn(e),e.flags&2048&&Ls(9,e,e.return);break;case 3:Wn(e);break;case 12:Wn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,go(e)):Wn(e);break;default:Wn(e)}}function go(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,Qd(n,e)}Xd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ls(8,t,t.return),go(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,go(t));break;default:go(t)}e=e.sibling}}function Qd(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,_=n.return;if(Fd(n),n===s){Lt=null;break e}if(c!==null){c.return=_,Lt=c;break e}Lt=_}}}var Zg={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}},qg=typeof WeakMap=="function"?WeakMap:Map,Fe=0,Qe=null,Ne=null,je=0,Ge=0,hi=null,Ns=!1,qr=!1,Kc=!1,ps=0,ft=0,Bs=0,_r=0,Wc=0,fi=0,Gr=0,Vn=null,si=null,Vc=!1,yo=0,em=0,So=1/0,bo=null,js=null,Dt=0,zs=null,Kr=null,vs=0,Yc=0,Xc=null,tm=null,Yn=0,Jc=null;function di(){return(Fe&2)!==0&&je!==0?je&-je:G.T!==null?ru():pn()}function im(){if(fi===0)if((je&536870912)===0||Ue){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)&&(Wr(e,0),Hs(e,je,fi,!1)),xs(e,s),((Fe&2)===0||e!==Qe)&&(e===Qe&&((Fe&2)===0&&(_r|=s),ft===4&&Hs(e,je,fi,!1)),qi(e))}function sm(e,t,s){if((Fe&6)!==0)throw Error(o(327));var n=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Qs(e,t),c=n?Wg(e,t):eu(e,t,!0),_=n;do{if(c===0){qr&&!n&&Hs(e,t,0,!1);break}else{if(s=e.current.alternate,_&&!Gg(s)){c=eu(e,t,!1),_=!1;continue}if(c===2){if(_=t,e.errorRecoveryDisabledLanes&_)var O=0;else O=e.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){t=O;e:{var j=e;c=Vn;var Z=j.current.memoizedState.isDehydrated;if(Z&&(Wr(j,O).flags|=256),O=eu(j,O,!1),O!==2){if(Kc&&!Z){j.errorRecoveryDisabledLanes|=_,_r|=_,c=4;break e}_=si,si=c,_!==null&&(si===null?si=_:si.push.apply(si,_))}c=O}if(_=!1,c!==2)continue}}if(c===1){Wr(e,0),Hs(e,t,0,!0);break}e:{switch(n=e,_=c,_){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;vs=t,n.timeoutHandle=Nm(rm.bind(null,n,s,si,bo,Vc,t,fi,_r,Gr,Ns,_,"Throttled",-0,0),c);break e}rm(n,s,si,bo,Vc,t,fi,_r,Gr,Ns,_,null,-0,0)}}break}while(!0);qi(e)}function rm(e,t,s,n,c,_,O,j,Z,se,ce,me,re,oe){if(e.timeoutHandle=-1,me=t.subtreeFlags,me&8192||(me&16785408)===16785408){me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:is},Yd(t,_,me);var ye=(_&62914560)===_?yo-at():(_&4194048)===_?em-at():0;if(ye=k0(me,ye),ye!==null){vs=_,e.cancelPendingCommit=ye(fm.bind(null,e,t,_,s,n,c,O,j,Z,ce,me,null,re,oe)),Hs(e,_,O,!se);return}}fm(e,t,_,s,n,c,O,j,Z)}function Gg(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],_=c.getSnapshot;c=c.value;try{if(!oi(_(),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&=~Wc,t&=~_r,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var c=t;0<c;){var _=31-yt(c),O=1<<_;n[_]=-1,c&=~O}s!==0&&mn(e,s,t)}function xo(){return(Fe&6)===0?(Xn(0),!1):!0}function Qc(){if(Ne!==null){if(Ge===0)var e=Ne.return;else e=Ne,as=ar=null,_c(e),Hr=null,Ln=0,e=Ne;for(;e!==null;)Bd(e.alternate,e),e=e.return;Ne=null}}function Wr(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,f0(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),vs=0,Qc(),Qe=e,Ne=s=rs(e.current,null),je=t,Ge=0,hi=null,Ns=!1,qr=Qs(e,t),Kc=!1,Gr=fi=Wc=_r=Bs=ft=0,si=Vn=null,Vc=!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),_=1<<c;t|=e[c],n&=~_}return ps=t,$a(),s}function nm(e,t){Re=null,G.H=Pn,t===zr||t===Ya?(t=bf(),Ge=3):t===sc?(t=bf(),Ge=4):Ge=t===Oc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hi=t,Ne===null&&(ft=1,uo(e,Ci(t,e.current)))}function am(){var e=ci.current;return e===null?!0:(je&4194048)===je?Ai===null:(je&62914560)===je||(je&536870912)!==0?e===Ai:!1}function om(){var e=G.H;return G.H=Pn,e===null?Pn:e}function lm(){var e=G.A;return G.A=Zg,e}function Co(){ft=4,Ns||(je&4194048)!==je&&ci.current!==null||(qr=!0),(Bs&134217727)===0&&(_r&134217727)===0||Qe===null||Hs(Qe,je,fi,!1)}function eu(e,t,s){var n=Fe;Fe|=2;var c=om(),_=lm();(Qe!==e||je!==t)&&(bo=null,Wr(e,t)),t=!1;var O=ft;e:do try{if(Ge!==0&&Ne!==null){var j=Ne,Z=hi;switch(Ge){case 8:Qc(),O=6;break e;case 3:case 2:case 9:case 6:ci.current===null&&(t=!0);var se=Ge;if(Ge=0,hi=null,Vr(e,j,Z,se),s&&qr){O=0;break e}break;default:se=Ge,Ge=0,hi=null,Vr(e,j,Z,se)}}Kg(),O=ft;break}catch(ce){nm(e,ce)}while(!0);return t&&e.shellSuspendCounter++,as=ar=null,Fe=n,G.H=c,G.A=_,Ne===null&&(Qe=null,je=0,$a()),O}function Kg(){for(;Ne!==null;)cm(Ne)}function Wg(e,t){var s=Fe;Fe|=2;var n=om(),c=lm();Qe!==e||je!==t?(bo=null,So=at()+500,Wr(e,t)):qr=Qs(e,t);e:do try{if(Ge!==0&&Ne!==null){t=Ne;var _=hi;t:switch(Ge){case 1:Ge=0,hi=null,Vr(e,t,_,1);break;case 2:case 9:if(yf(_)){Ge=0,hi=null,um(t);break}t=function(){Ge!==2&&Ge!==9||Qe!==e||(Ge=7),qi(e)},_.then(t,t);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:yf(_)?(Ge=0,hi=null,um(t)):(Ge=0,hi=null,Vr(e,t,_,7));break;case 5:var O=null;switch(Ne.tag){case 26:O=Ne.memoizedState;case 5:case 27:var j=Ne;if(O?Vm(O):j.stateNode.complete){Ge=0,hi=null;var Z=j.sibling;if(Z!==null)Ne=Z;else{var se=j.return;se!==null?(Ne=se,wo(se)):Ne=null}break t}}Ge=0,hi=null,Vr(e,t,_,5);break;case 6:Ge=0,hi=null,Vr(e,t,_,6);break;case 8:Qc(),ft=6;break e;default:throw Error(o(462))}}Vg();break}catch(ce){nm(e,ce)}while(!0);return as=ar=null,G.H=n,G.A=c,Fe=s,Ne!==null?0:(Qe=null,je=0,$a(),ft)}function Vg(){for(;Ne!==null&&!Vi();)cm(Ne)}function cm(e){var t=Ld(e.alternate,e,ps);e.memoizedProps=e.pendingProps,t===null?wo(e):Ne=t}function um(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Ad(s,t,t.pendingProps,t.type,void 0,je);break;case 11:t=Ad(s,t,t.pendingProps,t.type.render,t.ref,je);break;case 5:_c(t);default:Bd(s,t),t=Ne=lf(t,ps),t=Ld(s,t,ps)}e.memoizedProps=e.pendingProps,t===null?wo(e):Ne=t}function Vr(e,t,s,n){as=ar=null,_c(t),Hr=null,Ln=0;var c=t.return;try{if(zg(e,c,t,s,je)){ft=1,uo(e,Ci(s,e.current)),Ne=null;return}}catch(_){if(c!==null)throw Ne=c,_;ft=1,uo(e,Ci(s,e.current)),Ne=null;return}t.flags&32768?(Ue||n===1?e=!0:qr||(je&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))),hm(t,e)):wo(t)}function wo(e){var t=e;do{if((t.flags&32768)!==0){hm(t,Ns);return}e=t.return;var s=Ig(t.alternate,t,ps);if(s!==null){Ne=s;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);ft===0&&(ft=5)}function hm(e,t){do{var s=Pg(e.alternate,e);if(s!==null){s.flags&=32767,Ne=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Ne=e;return}Ne=e=s}while(e!==null);ft=6,Ne=null}function fm(e,t,s,n,c,_,O,j,Z){e.cancelPendingCommit=null;do Eo();while(Dt!==0);if((Fe&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(_=t.lanes|t.childLanes,_|=$l,dn(e,s,_,O,j,Z),e===Qe&&(Ne=Qe=null,je=0),Kr=t,zs=e,vs=s,Yc=_,Xc=c,tm=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Qg(Bt,function(){return vm(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=G.T,G.T=null,c=Y.p,Y.p=2,O=Fe,Fe|=4;try{$g(e,t,s)}finally{Fe=O,Y.p=c,G.T=n}}Dt=1,dm(),mm(),_m()}}function dm(){if(Dt===1){Dt=0;var e=zs,t=Kr,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=G.T,G.T=null;var n=Y.p;Y.p=2;var c=Fe;Fe|=4;try{Kd(t,e);var _=fu,O=Jh(e.containerInfo),j=_.focusedElem,Z=_.selectionRange;if(O!==j&&j&&j.ownerDocument&&Xh(j.ownerDocument.documentElement,j)){if(Z!==null&&zl(j)){var se=Z.start,ce=Z.end;if(ce===void 0&&(ce=se),"selectionStart"in j)j.selectionStart=se,j.selectionEnd=Math.min(ce,j.value.length);else{var me=j.ownerDocument||document,re=me&&me.defaultView||window;if(re.getSelection){var oe=re.getSelection(),ye=j.textContent.length,we=Math.min(Z.start,ye),Je=Z.end===void 0?we:Math.min(Z.end,ye);!oe.extend&&we>Je&&(O=Je,Je=we,we=O);var J=Yh(j,we),V=Yh(j,Je);if(J&&V&&(oe.rangeCount!==1||oe.anchorNode!==J.node||oe.anchorOffset!==J.offset||oe.focusNode!==V.node||oe.focusOffset!==V.offset)){var ie=me.createRange();ie.setStart(J.node,J.offset),oe.removeAllRanges(),we>Je?(oe.addRange(ie),oe.extend(V.node,V.offset)):(ie.setEnd(V.node,V.offset),oe.addRange(ie))}}}}for(me=[],oe=j;oe=oe.parentNode;)oe.nodeType===1&&me.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<me.length;j++){var fe=me[j];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}zo=!!hu,fu=hu=null}finally{Fe=c,Y.p=n,G.T=s}}e.current=t,Dt=2}}function mm(){if(Dt===2){Dt=0;var e=zs,t=Kr,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=G.T,G.T=null;var n=Y.p;Y.p=2;var c=Fe;Fe|=4;try{$d(e,t.alternate,t)}finally{Fe=c,Y.p=n,G.T=s}}Dt=3}}function _m(){if(Dt===4||Dt===3){Dt=0,Pt();var e=zs,t=Kr,s=vs,n=tm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Dt=5:(Dt=0,Kr=zs=null,pm(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(js=null),Ni(s),t=t.stateNode,Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(vi,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=G.T,c=Y.p,Y.p=2,G.T=null;try{for(var _=e.onRecoverableError,O=0;O<n.length;O++){var j=n[O];_(j.value,{componentStack:j.stack})}}finally{G.T=t,Y.p=c}}(vs&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 pm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,On(t)))}function Eo(){return dm(),mm(),_m(),vm()}function vm(){if(Dt!==5)return!1;var e=zs,t=Yc;Yc=0;var s=Ni(vs),n=G.T,c=Y.p;try{Y.p=32>s?32:s,G.T=null,s=Xc,Xc=null;var _=zs,O=vs;if(Dt=0,Kr=zs=null,vs=0,(Fe&6)!==0)throw Error(o(331));var j=Fe;if(Fe|=4,Jd(_.current),Vd(_,_.current,O,s),Fe=j,Xn(0,!1),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(vi,_)}catch{}return!0}finally{Y.p=c,G.T=n,pm(e,t)}}function gm(e,t,s){t=Ci(s,t),t=kc(e.stateNode,t,2),e=ks(e,t,2),e!==null&&(xs(e,2),qi(e))}function Ke(e,t,s){if(e.tag===3)gm(e,e,s);else for(;t!==null;){if(t.tag===3){gm(t,e,s);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(js===null||!js.has(n))){e=Ci(s,e),s=yd(2),n=ks(t,s,2),n!==null&&(Sd(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 qg;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=Yg.bind(null,e,t,s),t.then(e,e))}function Yg(e,t,s){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Qe===e&&(je&s)===s&&(ft===4||ft===3&&(je&62914560)===je&&300>at()-yo?(Fe&2)===0&&Wr(e,0):Wc|=s,Gr===je&&(Gr=0)),qi(e)}function ym(e,t){t===0&&(t=Qi()),e=sr(e,t),e!==null&&(xs(e,t),qi(e))}function Xg(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),ym(e,s)}function Jg(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),ym(e,s)}function Qg(e,t){return pi(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,t0())}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 _=0;else{var O=n.suspendedLanes,j=n.pingedLanes;_=(1<<31-yt(42|e)+1)-1,_&=c&~(O&~j),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(s=!0,Cm(n,_))}else _=je,_=Sr(n,n===Qe?_:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(_&3)===0||Qs(n,_)||(s=!0,Cm(n,_));n=n.next}while(s);su=!1}}function e0(){Sm()}function Sm(){Ao=iu=!1;var e=0;Us!==0&&h0()&&(e=Us);for(var t=at(),s=null,n=To;n!==null;){var c=n.next,_=bm(n,t);_===0?(n.next=null,s===null?To=c:s.next=c,c===null&&(Yr=s)):(s=n,(e!==0||(_&3)!==0)&&(Ao=!0)),n=c}Dt!==0&&Dt!==5||Xn(e),Us!==0&&(Us=0)}function bm(e,t){for(var s=e.suspendedLanes,n=e.pingedLanes,c=e.expirationTimes,_=e.pendingLanes&-62914561;0<_;){var O=31-yt(_),j=1<<O,Z=c[O];Z===-1?((j&s)===0||(j&n)!==0)&&(c[O]=pt(j,t)):Z<=t&&(e.expiredLanes|=j),_&=~j}if(t=Qe,s=je,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=Bt;break;case 268435456:s=Yt;break;default:s=Bt}return n=xm.bind(null,e),s=pi(s,n),e.callbackPriority=t,e.callbackNode=s,t}return n!==null&&n!==null&&Ii(n),e.callbackPriority=2,e.callbackNode=null,2}function xm(e,t){if(Dt!==0&&Dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Eo()&&e.callbackNode!==s)return null;var n=je;return n=Sr(e,e===Qe?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(sm(e,n,t),bm(e,at()),e.callbackNode!=null&&e.callbackNode===s?xm.bind(null,e):null)}function Cm(e,t){if(Eo())return null;sm(e,t,!0)}function t0(){d0(function(){(Fe&6)!==0?pi(Zt,e0):Sm()})}function ru(){if(Us===0){var e=Br;e===0&&(e=Xi,Xi<<=1,(Xi&261888)===0&&(Xi=256)),Us=e}return Us}function wm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Na(""+e)}function Em(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 i0(e,t,s,n,c){if(t==="submit"&&s&&s.stateNode===c){var _=wm((c[st]||null).action),O=n.submitter;O&&(t=(t=O[st]||null)?wm(t.formAction):O.getAttribute("formAction"),t!==null&&(_=t,O=null));var j=new Ha("action","action",null,n,c);e.push({event:j,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Us!==0){var Z=O?Em(c,O):new FormData(c);wc(s,{pending:!0,data:Z,method:c.method,action:_},null,Z)}}else typeof _=="function"&&(j.preventDefault(),Z=O?Em(c,O):new FormData(c),wc(s,{pending:!0,data:Z,method:c.method,action:_},_,Z))},currentTarget:c}]})}}for(var nu=0;nu<Pl.length;nu++){var au=Pl[nu],s0=au.toLowerCase(),r0=au[0].toUpperCase()+au.slice(1);Bi(s0,"on"+r0)}Bi(tf,"onAnimationEnd"),Bi(sf,"onAnimationIteration"),Bi(rf,"onAnimationStart"),Bi("dblclick","onDoubleClick"),Bi("focusin","onFocus"),Bi("focusout","onBlur"),Bi(Sg,"onTransitionRun"),Bi(bg,"onTransitionStart"),Bi(xg,"onTransitionCancel"),Bi(nf,"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(" "),n0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jn));function Tm(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 _=void 0;if(t)for(var O=n.length-1;0<=O;O--){var j=n[O],Z=j.instance,se=j.currentTarget;if(j=j.listener,Z!==_&&c.isPropagationStopped())break e;_=j,c.currentTarget=se;try{_(c)}catch(ce){Pa(ce)}c.currentTarget=null,_=Z}else for(O=0;O<n.length;O++){if(j=n[O],Z=j.instance,se=j.currentTarget,j=j.listener,Z!==_&&c.isPropagationStopped())break e;_=j,c.currentTarget=se;try{_(c)}catch(ce){Pa(ce)}c.currentTarget=null,_=Z}}}}function Be(e,t){var s=t[br];s===void 0&&(s=t[br]=new Set);var n=e+"__bubble";s.has(n)||(Am(t,e,2,!1),s.add(n))}function ou(e,t,s){var n=0;t&&(n|=4),Am(s,e,n,t)}var Ro="_reactListening"+Math.random().toString(36).slice(2);function lu(e){if(!e[Ro]){e[Ro]=!0,jt.forEach(function(s){s!=="selectionchange"&&(n0.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 Am(e,t,s,n){switch(i_(t)){case 2:var c=L0;break;case 8:c=N0;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 _=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var O=n.tag;if(O===3||O===4){var j=n.stateNode.containerInfo;if(j===c)break;if(O===4)for(O=n.return;O!==null;){var Z=O.tag;if((Z===3||Z===4)&&O.stateNode.containerInfo===c)return;O=O.return}for(;j!==null;){if(O=_e(j),O===null)return;if(Z=O.tag,Z===5||Z===6||Z===26||Z===27){n=_=O;continue e}j=j.parentNode}}n=n.return}Oh(function(){var se=_,ce=Tl(s),me=[];e:{var re=af.get(e);if(re!==void 0){var oe=Ha,ye=e;switch(e){case"keypress":if(ja(s)===0)break e;case"keydown":case"keyup":oe=Jv;break;case"focusin":ye="focus",oe=Ml;break;case"focusout":ye="blur",oe=Ml;break;case"beforeblur":case"afterblur":oe=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":oe=Nh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=Iv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=tg;break;case tf:case sf:case rf:oe=Fv;break;case nf:oe=sg;break;case"scroll":case"scrollend":oe=Hv;break;case"wheel":oe=ng;break;case"copy":case"cut":case"paste":oe=qv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=jh;break;case"toggle":case"beforetoggle":oe=og}var we=(t&4)!==0,Je=!we&&(e==="scroll"||e==="scrollend"),J=we?re!==null?re+"Capture":null:re;we=[];for(var V=se,ie;V!==null;){var fe=V;if(ie=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||ie===null||J===null||(fe=Sn(V,J),fe!=null&&we.push(Qn(V,fe,ie))),Je)break;V=V.return}0<we.length&&(re=new oe(re,ye,null,s,ce),me.push({event:re,listeners:we}))}}if((t&7)===0){e:{if(re=e==="mouseover"||e==="pointerover",oe=e==="mouseout"||e==="pointerout",re&&s!==El&&(ye=s.relatedTarget||s.fromElement)&&(_e(ye)||ye[es]))break e;if((oe||re)&&(re=ce.window===ce?ce:(re=ce.ownerDocument)?re.defaultView||re.parentWindow:window,oe?(ye=s.relatedTarget||s.toElement,oe=se,ye=ye?_e(ye):null,ye!==null&&(Je=w(ye),we=ye.tag,ye!==Je||we!==5&&we!==27&&we!==6)&&(ye=null)):(oe=null,ye=se),oe!==ye)){if(we=Nh,fe="onMouseLeave",J="onMouseEnter",V="mouse",(e==="pointerout"||e==="pointerover")&&(we=jh,fe="onPointerLeave",J="onPointerEnter",V="pointer"),Je=oe==null?re:qe(oe),ie=ye==null?re:qe(ye),re=new we(fe,V+"leave",oe,s,ce),re.target=Je,re.relatedTarget=ie,fe=null,_e(ce)===se&&(we=new we(J,V+"enter",ye,s,ce),we.target=ie,we.relatedTarget=Je,fe=we),Je=fe,oe&&ye)t:{for(we=a0,J=oe,V=ye,ie=0,fe=J;fe;fe=we(fe))ie++;fe=0;for(var xe=V;xe;xe=we(xe))fe++;for(;0<ie-fe;)J=we(J),ie--;for(;0<fe-ie;)V=we(V),fe--;for(;ie--;){if(J===V||V!==null&&J===V.alternate){we=J;break t}J=we(J),V=we(V)}we=null}else we=null;oe!==null&&Rm(me,re,oe,we,!1),ye!==null&&Je!==null&&Rm(me,Je,ye,we,!0)}}e:{if(re=se?qe(se):window,oe=re.nodeName&&re.nodeName.toLowerCase(),oe==="select"||oe==="input"&&re.type==="file")var Pe=Zh;else if($h(re))if(qh)Pe=vg;else{Pe=_g;var be=mg}else oe=re.nodeName,!oe||oe.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?se&&wl(se.elementType)&&(Pe=Zh):Pe=pg;if(Pe&&(Pe=Pe(e,se))){Fh(me,Pe,s,ce);break e}be&&be(e,re,se),e==="focusout"&&se&&re.type==="number"&&se.memoizedProps.value!=null&&Cl(re,"number",re.value)}switch(be=se?qe(se):window,e){case"focusin":($h(be)||be.contentEditable==="true")&&(Ar=be,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,Qh(me,s,ce);break;case"selectionchange":if(yg)break;case"keydown":case"keyup":Qh(me,s,ce)}var ke;if(Nl)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Tr?Ih(e,s)&&(ze="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(ze="onCompositionStart");ze&&(zh&&s.locale!=="ko"&&(Tr||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Tr&&(ke=Mh()):(Cs=ce,Dl="value"in Cs?Cs.value:Cs.textContent,Tr=!0)),be=Do(se,ze),0<be.length&&(ze=new Bh(ze,e,null,s,ce),me.push({event:ze,listeners:be}),ke?ze.data=ke:(ke=Ph(s),ke!==null&&(ze.data=ke)))),(ke=cg?ug(e,s):hg(e,s))&&(ze=Do(se,"onBeforeInput"),0<ze.length&&(be=new Bh("onBeforeInput","beforeinput",null,s,ce),me.push({event:be,listeners:ze}),be.data=ke)),i0(me,e,se,s,ce)}Tm(me,t)})}function Qn(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Do(e,t){for(var s=t+"Capture",n=[];e!==null;){var c=e,_=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||_===null||(c=Sn(e,s),c!=null&&n.unshift(Qn(e,c,_)),c=Sn(e,t),c!=null&&n.push(Qn(e,c,_))),e.tag===3)return n;e=e.return}return[]}function a0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Rm(e,t,s,n,c){for(var _=t._reactName,O=[];s!==null&&s!==n;){var j=s,Z=j.alternate,se=j.stateNode;if(j=j.tag,Z!==null&&Z===n)break;j!==5&&j!==26&&j!==27||se===null||(Z=se,c?(se=Sn(s,_),se!=null&&O.unshift(Qn(s,se,Z))):c||(se=Sn(s,_),se!=null&&O.push(Qn(s,se,Z)))),s=s.return}O.length!==0&&e.push({event:t,listeners:O})}var o0=/\r\n?/g,l0=/\u0000|\uFFFD/g;function Dm(e){return(typeof e=="string"?e:""+e).replace(o0,`
|
|
49
|
+
`).replace(l0,"")}function km(e,t){return t=Dm(t),Dm(e)===t}function Xe(e,t,s,n,c,_){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":Dh(e,n,_);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 _=="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&&Be("scroll",e);break;case"onScrollEnd":n!=null&&Be("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":Be("beforetoggle",e),Be("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=jv.get(s)||s,Oa(e,s,n))}}function uu(e,t,s,n,c,_){switch(s){case"style":Dh(e,n,_);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&&Be("scroll",e);break;case"onScrollEnd":n!=null&&Be("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),_=e[st]||null,_=_!=null?_[s]:null,typeof _=="function"&&e.removeEventListener(t,_,c),typeof n=="function")){typeof _!="function"&&_!==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":Be("error",e),Be("load",e);var n=!1,c=!1,_;for(_ in s)if(s.hasOwnProperty(_)){var O=s[_];if(O!=null)switch(_){case"src":n=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Xe(e,t,_,O,s,null)}}c&&Xe(e,t,"srcSet",s.srcSet,s,null),n&&Xe(e,t,"src",s.src,s,null);return;case"input":Be("invalid",e);var j=_=O=c=null,Z=null,se=null;for(n in s)if(s.hasOwnProperty(n)){var ce=s[n];if(ce!=null)switch(n){case"name":c=ce;break;case"type":O=ce;break;case"checked":Z=ce;break;case"defaultChecked":se=ce;break;case"value":_=ce;break;case"defaultValue":j=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(o(137,t));break;default:Xe(e,t,n,ce,s,null)}}Eh(e,_,j,Z,se,O,c,!1);return;case"select":Be("invalid",e),n=O=_=null;for(c in s)if(s.hasOwnProperty(c)&&(j=s[c],j!=null))switch(c){case"value":_=j;break;case"defaultValue":O=j;break;case"multiple":n=j;default:Xe(e,t,c,j,s,null)}t=_,s=O,e.multiple=!!n,t!=null?xr(e,!!n,t,!1):s!=null&&xr(e,!!n,s,!0);return;case"textarea":Be("invalid",e),_=c=n=null;for(O in s)if(s.hasOwnProperty(O)&&(j=s[O],j!=null))switch(O){case"value":n=j;break;case"defaultValue":c=j;break;case"children":_=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(o(91));break;default:Xe(e,t,O,j,s,null)}Ah(e,n,c,_);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":Be("beforetoggle",e),Be("toggle",e),Be("cancel",e),Be("close",e);break;case"iframe":case"object":Be("load",e);break;case"video":case"audio":for(n=0;n<Jn.length;n++)Be(Jn[n],e);break;case"image":Be("error",e),Be("load",e);break;case"details":Be("toggle",e);break;case"embed":case"source":case"link":Be("error",e),Be("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(ce in s)s.hasOwnProperty(ce)&&(n=s[ce],n!==void 0&&uu(e,t,ce,n,s,void 0));return}}for(j in s)s.hasOwnProperty(j)&&(n=s[j],n!=null&&Xe(e,t,j,n,s,null))}function c0(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,_=null,O=null,j=null,Z=null,se=null,ce=null;for(oe in s){var me=s[oe];if(s.hasOwnProperty(oe)&&me!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":Z=me;default:n.hasOwnProperty(oe)||Xe(e,t,oe,null,n,me)}}for(var re in n){var oe=n[re];if(me=s[re],n.hasOwnProperty(re)&&(oe!=null||me!=null))switch(re){case"type":_=oe;break;case"name":c=oe;break;case"checked":se=oe;break;case"defaultChecked":ce=oe;break;case"value":O=oe;break;case"defaultValue":j=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(o(137,t));break;default:oe!==me&&Xe(e,t,re,oe,n,me)}}xl(e,O,j,Z,se,ce,_,c);return;case"select":oe=O=j=re=null;for(_ in s)if(Z=s[_],s.hasOwnProperty(_)&&Z!=null)switch(_){case"value":break;case"multiple":oe=Z;default:n.hasOwnProperty(_)||Xe(e,t,_,null,n,Z)}for(c in n)if(_=n[c],Z=s[c],n.hasOwnProperty(c)&&(_!=null||Z!=null))switch(c){case"value":re=_;break;case"defaultValue":j=_;break;case"multiple":O=_;default:_!==Z&&Xe(e,t,c,_,n,Z)}t=j,s=O,n=oe,re!=null?xr(e,!!s,re,!1):!!n!=!!s&&(t!=null?xr(e,!!s,t,!0):xr(e,!!s,s?[]:"",!1));return;case"textarea":oe=re=null;for(j in s)if(c=s[j],s.hasOwnProperty(j)&&c!=null&&!n.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Xe(e,t,j,null,n,c)}for(O in n)if(c=n[O],_=s[O],n.hasOwnProperty(O)&&(c!=null||_!=null))switch(O){case"value":re=c;break;case"defaultValue":oe=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==_&&Xe(e,t,O,c,n,_)}Th(e,re,oe);return;case"option":for(var ye in s)if(re=s[ye],s.hasOwnProperty(ye)&&re!=null&&!n.hasOwnProperty(ye))switch(ye){case"selected":e.selected=!1;break;default:Xe(e,t,ye,null,n,re)}for(Z in n)if(re=n[Z],oe=s[Z],n.hasOwnProperty(Z)&&re!==oe&&(re!=null||oe!=null))switch(Z){case"selected":e.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:Xe(e,t,Z,re,n,oe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var we in s)re=s[we],s.hasOwnProperty(we)&&re!=null&&!n.hasOwnProperty(we)&&Xe(e,t,we,null,n,re);for(se in n)if(re=n[se],oe=s[se],n.hasOwnProperty(se)&&re!==oe&&(re!=null||oe!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(o(137,t));break;default:Xe(e,t,se,re,n,oe)}return;default:if(wl(t)){for(var Je in s)re=s[Je],s.hasOwnProperty(Je)&&re!==void 0&&!n.hasOwnProperty(Je)&&uu(e,t,Je,void 0,n,re);for(ce in n)re=n[ce],oe=s[ce],!n.hasOwnProperty(ce)||re===oe||re===void 0&&oe===void 0||uu(e,t,ce,re,n,oe);return}}for(var J in s)re=s[J],s.hasOwnProperty(J)&&re!=null&&!n.hasOwnProperty(J)&&Xe(e,t,J,null,n,re);for(me in n)re=n[me],oe=s[me],!n.hasOwnProperty(me)||re===oe||re==null&&oe==null||Xe(e,t,me,re,n,oe)}function Om(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function u0(){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],_=c.transferSize,O=c.initiatorType,j=c.duration;if(_&&j&&Om(O)){for(O=0,j=c.responseEnd,n+=1;n<s.length;n++){var Z=s[n],se=Z.startTime;if(se>j)break;var ce=Z.transferSize,me=Z.initiatorType;ce&&Om(me)&&(Z=Z.responseEnd,O+=ce*(Z<j?1:(j-se)/(Z-se)))}if(--n,t+=8*(_+O)/(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 ko(e){return e.nodeType===9?e:e.ownerDocument}function Mm(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 Lm(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 h0(){var e=window.event;return e&&e.type==="popstate"?e===mu?!1:(mu=e,!0):(mu=null,!1)}var Nm=typeof setTimeout=="function"?setTimeout:void 0,f0=typeof clearTimeout=="function"?clearTimeout:void 0,Bm=typeof Promise=="function"?Promise:void 0,d0=typeof queueMicrotask=="function"?queueMicrotask:typeof Bm<"u"?function(e){return Bm.resolve(null).then(e).catch(m0)}:Nm;function m0(e){setTimeout(function(){throw e})}function Is(e){return e==="head"}function jm(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 _=s.firstChild;_;){var O=_.nextSibling,j=_.nodeName;_[Se]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&_.rel.toLowerCase()==="stylesheet"||s.removeChild(_),_=O}}else s==="body"&&ea(e.ownerDocument.body);s=c}while(s);en(t)}function zm(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 _u(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":_u(s),W(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function _0(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[Se])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(_=e.getAttribute("rel"),_==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(_!==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(_=e.getAttribute("src"),(_!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&_&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var _=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===_)return e}else return e;if(e=Ri(e.nextSibling),e===null)break}return null}function p0(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 Hm(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 pu(e){return e.data==="$?"||e.data==="$~"}function vu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function v0(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 gu=null;function Um(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 Im(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 Pm(e,t,s){switch(t=ko(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]);W(e)}var Di=new Map,$m=new Set;function Oo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var gs=Y.d;Y.d={f:g0,r:y0,D:S0,C:b0,L:x0,m:C0,X:E0,S:w0,M:T0};function g0(){var e=gs.f(),t=xo();return e||t}function y0(e){var t=ge(e);t!==null&&t.tag===5&&t.type==="form"?nd(t):gs.r(e)}var Xr=typeof document>"u"?null:document;function Fm(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+'"]'),$m.has(c)||($m.add(c),e={rel:e,crossOrigin:s,href:t},n.querySelector(c)===null&&(t=n.createElement("link"),It(t,"link",e),Oe(t),n.head.appendChild(t)))}}function S0(e){gs.D(e),Fm("dns-prefetch",e,null)}function b0(e,t){gs.C(e,t),Fm("preconnect",e,t)}function x0(e,t,s){gs.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 _=c;switch(t){case"style":_=Jr(e);break;case"script":_=Qr(e)}Di.has(_)||(e=d({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Di.set(_,e),n.querySelector(c)!==null||t==="style"&&n.querySelector(ta(_))||t==="script"&&n.querySelector(ia(_))||(t=n.createElement("link"),It(t,"link",e),Oe(t),n.head.appendChild(t)))}}function C0(e,t){gs.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)+'"]',_=c;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Qr(e)}if(!Di.has(_)&&(e=d({rel:"modulepreload",href:e},t),Di.set(_,e),s.querySelector(c)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ia(_)))return}n=s.createElement("link"),It(n,"link",e),Oe(n),s.head.appendChild(n)}}}function w0(e,t,s){gs.S(e,t,s);var n=Xr;if(n&&e){var c=ot(n).hoistableStyles,_=Jr(e);t=t||"default";var O=c.get(_);if(!O){var j={loading:0,preload:null};if(O=n.querySelector(ta(_)))j.loading=5;else{e=d({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Di.get(_))&&yu(e,s);var Z=O=n.createElement("link");Oe(Z),It(Z,"link",e),Z._p=new Promise(function(se,ce){Z.onload=se,Z.onerror=ce}),Z.addEventListener("load",function(){j.loading|=1}),Z.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Mo(O,t,n)}O={type:"stylesheet",instance:O,count:1,state:j},c.set(_,O)}}}function E0(e,t){gs.X(e,t);var s=Xr;if(s&&e){var n=ot(s).hoistableScripts,c=Qr(e),_=n.get(c);_||(_=s.querySelector(ia(c)),_||(e=d({src:e,async:!0},t),(t=Di.get(c))&&Su(e,t),_=s.createElement("script"),Oe(_),It(_,"link",e),s.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},n.set(c,_))}}function T0(e,t){gs.M(e,t);var s=Xr;if(s&&e){var n=ot(s).hoistableScripts,c=Qr(e),_=n.get(c);_||(_=s.querySelector(ia(c)),_||(e=d({src:e,async:!0,type:"module"},t),(t=Di.get(c))&&Su(e,t),_=s.createElement("script"),Oe(_),It(_,"link",e),s.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},n.set(c,_))}}function Zm(e,t,s,n){var c=(c=ne.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 _=ot(c).hoistableStyles,O=_.get(e);if(O||(c=c.ownerDocument||c,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(e,O),(_=c.querySelector(ta(e)))&&!_._p&&(O.instance=_,O.state.loading=5),Di.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},Di.set(e,s),_||A0(c,e,s,O.state))),t&&n===null)throw Error(o(528,""));return O}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 qm(e){return d({},e,{"data-precedence":e.precedence,precedence:null})}function A0(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),Oe(t),e.head.appendChild(t))}function Qr(e){return'[src="'+bi(e)+'"]'}function ia(e){return"script[async]"+e}function Gm(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,Oe(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"),Oe(n),It(n,"style",c),Mo(n,s.precedence,e),t.instance=n;case"stylesheet":c=Jr(s.href);var _=e.querySelector(ta(c));if(_)return t.state.loading|=4,t.instance=_,Oe(_),_;n=qm(s),(c=Di.get(c))&&yu(n,c),_=(e.ownerDocument||e).createElement("link"),Oe(_);var O=_;return O._p=new Promise(function(j,Z){O.onload=j,O.onerror=Z}),It(_,"link",n),t.state.loading|=4,Mo(_,s.precedence,e),t.instance=_;case"script":return _=Qr(s.src),(c=e.querySelector(ia(_)))?(t.instance=c,Oe(c),c):(n=s,(c=Di.get(_))&&(n=d({},s),Su(n,c)),e=e.ownerDocument||e,c=e.createElement("script"),Oe(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,_=c,O=0;O<n.length;O++){var j=n[O];if(j.dataset.precedence===t)_=j;else if(_!==c)break}_?_.parentNode.insertBefore(e,_.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 Km(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 _=s[c];if(!(_[Se]||_[St]||e==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var O=_.getAttribute(t)||"";O=e+O;var j=n.get(O);j?j.push(_):n.set(O,[_])}}return n}function Wm(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function R0(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 Vm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function D0(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),_=t.querySelector(ta(c));if(_){t=_._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=_,Oe(_);return}_=t.ownerDocument||t,n=qm(n),(c=Di.get(c))&&yu(n,c),_=_.createElement("link"),Oe(_);var O=_;O._p=new Promise(function(j,Z){O.onload=j,O.onerror=Z}),It(_,"link",n),s.instance=_}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 k0(e,t){return e.stylesheets&&e.count===0&&jo(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var n=setTimeout(function(){if(e.stylesheets&&jo(e,e.stylesheets),e.unsuspend){var _=e.unsuspend;e.unsuspend=null,_()}},6e4+t);0<e.imgBytes&&bu===0&&(bu=62500*u0());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&jo(e,e.stylesheets),e.unsuspend)){var _=e.unsuspend;e.unsuspend=null,_()}},(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)jo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Bo=null;function jo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Bo=new Map,t.forEach(O0,e),Bo=null,No.call(e))}function O0(e,t){if(!(t.state.loading&4)){var s=Bo.get(e);if(s)var n=s.get(null);else{s=new Map,Bo.set(e,s);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<c.length;_++){var O=c[_];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(s.set(O.dataset.precedence,O),n=O)}n&&s.set(null,n)}c=t.instance,O=c.getAttribute("data-precedence"),_=s.get(O)||n,_===n&&s.set(null,c),s.set(O,c),this.count++,n=No.bind(this),c.addEventListener("load",n),c.addEventListener("error",n),_?_.parentNode.insertBefore(c,_.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var sa={$$typeof:p,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function M0(e,t,s,n,c,_,O,j,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=_,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function Ym(e,t,s,n,c,_,O,j,Z,se,ce,me){return e=new M0(e,t,s,O,Z,se,ce,me,j),t=1,_===!0&&(t|=24),_=li(3,null,null,t),e.current=_,_.stateNode=e,t=ec(),t.refCount++,e.pooledCache=t,t.refCount++,_.memoizedState={element:n,isDehydrated:s,cache:t},rc(_),e}function Xm(e){return e?(e=kr,e):kr}function Jm(e,t,s,n,c,_){c=Xm(c),n.context===null?n.context=c:n.pendingContext=c,n=Ds(t),n.payload={element:s},_=_===void 0?null:_,_!==null&&(n.callback=_),s=ks(e,n,t),s!==null&&(ri(s,e,t),Bn(s,e,t))}function Qm(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){Qm(e,t),(e=e.alternate)&&Qm(e,t)}function e_(e){if(e.tag===13||e.tag===31){var t=sr(e,67108864);t!==null&&ri(t,e,67108864),xu(e,67108864)}}function t_(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 L0(e,t,s,n){var c=G.T;G.T=null;var _=Y.p;try{Y.p=2,Cu(e,t,s,n)}finally{Y.p=_,G.T=c}}function N0(e,t,s,n){var c=G.T;G.T=null;var _=Y.p;try{Y.p=8,Cu(e,t,s,n)}finally{Y.p=_,G.T=c}}function Cu(e,t,s,n){if(zo){var c=wu(n);if(c===null)cu(e,t,n,Ho,s),s_(e,n);else if(j0(c,e,t,s,n))n.stopPropagation();else if(s_(e,n),t&4&&-1<B0.indexOf(e)){for(;c!==null;){var _=ge(c);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var O=ai(_.pendingLanes);if(O!==0){var j=_;for(j.pendingLanes|=2,j.entangledLanes|=2;O;){var Z=1<<31-yt(O);j.entanglements[1]|=Z,O&=~Z}qi(_),(Fe&6)===0&&(So=at()+500,Xn(0))}}break;case 31:case 13:j=sr(_,2),j!==null&&ri(j,_,2),xo(),xu(_,2)}if(_=wu(n),_===null&&cu(e,t,n,Ho,s),_===c)break;c=_}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 i_(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(kt()){case Zt:return 2;case Nt:return 8;case Bt: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=[],B0="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 s_(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,_){return e===null||e.nativeEvent!==_?(e={blockedOn:t,domEventName:s,eventSystemFlags:n,nativeEvent:_,targetContainers:[c]},t!==null&&(t=ge(t),t!==null&&e_(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function j0(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 _=c.pointerId;return ra.set(_,aa(ra.get(_)||null,e,t,s,n,c)),!0;case"gotpointercapture":return _=c.pointerId,na.set(_,aa(na.get(_)||null,e,t,s,n,c)),!0}return!1}function r_(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,vn(e.priority,function(){t_(s)});return}}else if(t===31){if(t=l(s),t!==null){e.blockedOn=t,vn(e.priority,function(){t_(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=ge(s),t!==null&&e_(t),e.blockedOn=s,!1;t.shift()}return!0}function n_(e,t,s){Uo(e)&&s.delete(t)}function z0(){Tu=!1,Ps!==null&&Uo(Ps)&&(Ps=null),$s!==null&&Uo($s)&&($s=null),Fs!==null&&Uo(Fs)&&(Fs=null),ra.forEach(n_),na.forEach(n_)}function Io(e,t){e.blockedOn===t&&(e.blockedOn=null,Tu||(Tu=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,z0)))}var Po=null;function a_(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 _=ge(s);_!==null&&(e.splice(t,3),t-=3,wc(_,{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);)r_(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],_=s[n+1],O=c[st]||null;if(typeof _=="function")O||a_(s);else if(O){var j=null;if(_&&_.hasAttribute("formAction")){if(c=_,O=_[st]||null)j=O.formAction;else if(Eu(c)!==null)continue}else j=O.action;typeof j=="function"?s[n+1]=j:(s.splice(n,3),n-=3),a_(s)}}}function o_(){function e(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(O){return c=O})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),n||setTimeout(s,20)}function s(){if(!n&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.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();Jm(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;Jm(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=pn();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&&r_(e)}};var l_=r.version;if(l_!=="19.2.4")throw Error(o(527,l_,"19.2.4"));Y.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 H0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fo.isDisabled&&Fo.supportsFiber)try{vi=Fo.inject(H0),Ot=Fo}catch{}}return la.createRoot=function(e,t){if(!v(e))throw Error(o(299));var s=!1,n="",c=_d,_=pd,O=vd;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&&(_=t.onCaughtError),t.onRecoverableError!==void 0&&(O=t.onRecoverableError)),t=Ym(e,1,!1,null,null,s,n,null,c,_,O,o_),e[es]=t.current,lu(e),new Au(t)},la.hydrateRoot=function(e,t,s){if(!v(e))throw Error(o(299));var n=!1,c="",_=_d,O=pd,j=vd,Z=null;return s!=null&&(s.unstable_strictMode===!0&&(n=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(_=s.onUncaughtError),s.onCaughtError!==void 0&&(O=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError),s.formState!==void 0&&(Z=s.formState)),t=Ym(e,1,!0,t,s??null,n,c,Z,_,O,j,o_),t.context=Xm(null),s=t.current,n=di(),n=Xt(n),c=Ds(n),c.callback=null,ks(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 g_;function Y0(){if(g_)return ku.exports;g_=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(),ku.exports=V0(),ku.exports}var X0=Y0();const J0=dp(X0);/**
|
|
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 y_="popstate";function S_(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function Q0(i={}){function r(o,v){var u;let w=(u=v.state)==null?void 0:u.masked,{pathname:A,search:l,hash:h}=w||o.location;return Yu("",{pathname:A,search:l,hash:h},v.state&&v.state.usr||null,v.state&&v.state.key||"default",w?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,v){return typeof v=="string"?v:ya(v)}return ty(r,a,null,i)}function lt(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function Wi(i,r){if(!i){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function ey(){return Math.random().toString(36).substring(2,10)}function b_(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,v){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof r=="string"?on(r):r,state:a,key:r&&r.key||o||ey(),unstable_mask:v}}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 ty(i,r,a,o={}){let{window:v=document.defaultView,v5Compat:w=!1}=o,A=v.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 m=y(),g=m==null?null:m-u;u=m,h&&h({action:l,location:x.location,delta:g})}function b(m,g){l="PUSH";let f=S_(m)?m:Yu(x.location,m,g);u=y()+1;let p=b_(f,u),S=x.createHref(f.unstable_mask||f);try{A.pushState(p,"",S)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;v.location.assign(S)}w&&h&&h({action:l,location:x.location,delta:1})}function C(m,g){l="REPLACE";let f=S_(m)?m:Yu(x.location,m,g);u=y();let p=b_(f,u),S=x.createHref(f.unstable_mask||f);A.replaceState(p,"",S),w&&h&&h({action:l,location:x.location,delta:0})}function k(m){return iy(m)}let x={get action(){return l},get location(){return i(v,A)},listen(m){if(h)throw new Error("A history only accepts one active listener");return v.addEventListener(y_,d),h=m,()=>{v.removeEventListener(y_,d),h=null}},createHref(m){return r(v,m)},createURL:k,encodeLocation(m){let g=k(m);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:b,replace:C,go(m){return A.go(m)}};return x}function iy(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 mp(i,r,a="/"){return sy(i,r,a,!1)}function sy(i,r,a,o){let v=typeof r=="string"?on(r):r,w=Ss(v.pathname||"/",a);if(w==null)return null;let A=_p(i);ry(A);let l=null;for(let h=0;l==null&&h<A.length;++h){let u=_y(w);l=dy(A[h],u,o)}return l}function _p(i,r=[],a=[],o="",v=!1){let w=(A,l,h=v,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]),b=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}".`),_p(A.children,r,b,d,h)),!(A.path==null&&!A.index)&&r.push({path:d,score:hy(d,A.index),routesMeta:b})};return i.forEach((A,l)=>{var h;if(A.path===""||!((h=A.path)!=null&&h.includes("?")))w(A,l);else for(let u of pp(A.path))w(A,l,!0,u)}),r}function pp(i){let r=i.split("/");if(r.length===0)return[];let[a,...o]=r,v=a.endsWith("?"),w=a.replace(/\?$/,"");if(o.length===0)return v?[w,""]:[w];let A=pp(o.join("/")),l=[];return l.push(...A.map(h=>h===""?w:[w,h].join("/"))),v&&l.push(...A),l.map(h=>i.startsWith("/")&&h===""?"/":h)}function ry(i){i.sort((r,a)=>r.score!==a.score?a.score-r.score:fy(r.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var ny=/^:[\w-]+$/,ay=3,oy=2,ly=1,cy=10,uy=-2,x_=i=>i==="*";function hy(i,r){let a=i.split("/"),o=a.length;return a.some(x_)&&(o+=uy),r&&(o+=oy),a.filter(v=>!x_(v)).reduce((v,w)=>v+(ny.test(w)?ay:w===""?ly:cy),o)}function fy(i,r){return i.length===r.length&&i.slice(0,-1).every((o,v)=>o===r[v])?i[i.length-1]-r[r.length-1]:0}function dy(i,r,a=!1){let{routesMeta:o}=i,v={},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),b=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(v,d.params),A.push({params:v,pathname:Ki([w,d.pathname]),pathnameBase:yy(Ki([w,d.pathnameBase])),route:b}),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]=my(i.path,i.caseSensitive,i.end),v=r.match(a);if(!v)return null;let w=v[0],A=w.replace(/(.)\/+$/,"$1"),l=v.slice(1);return{params:o.reduce((u,{paramName:y,isOptional:d},b)=>{if(y==="*"){let k=l[b]||"";A=w.slice(0,w.length-k.length).replace(/(.)\/+$/,"$1")}const C=l[b];return d&&!C?u[y]=void 0:u[y]=(C||"").replace(/%2F/g,"/"),u},{}),pathname:w,pathnameBase:A,pattern:i}}function my(i,r=!1,a=!0){Wi(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=[],v="^"+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:"*"}),v+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?v+="\\/*$":i!==""&&i!=="/"&&(v+="(?:(?=\\/|$))"),[new RegExp(v,r?void 0:"i"),o]}function _y(i){try{return i.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Wi(!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 py=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function vy(i,r="/"){let{pathname:a,search:o="",hash:v=""}=typeof i=="string"?on(i):i,w;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?w=C_(a.substring(1),"/"):w=C_(a,r)):w=r,{pathname:w,search:Sy(o),hash:by(v)}}function C_(i,r){let a=r.replace(/\/+$/,"").split("/");return i.split("/").forEach(v=>{v===".."?a.length>1&&a.pop():v!=="."&&a.push(v)}),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 gy(i){return i.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function vp(i){let r=gy(i);return r.map((a,o)=>o===r.length-1?a.pathname:a.pathnameBase)}function ah(i,r,a,o=!1){let v;typeof i=="string"?v=on(i):(v={...i},lt(!v.pathname||!v.pathname.includes("?"),Nu("?","pathname","search",v)),lt(!v.pathname||!v.pathname.includes("#"),Nu("#","pathname","hash",v)),lt(!v.search||!v.search.includes("#"),Nu("#","search","hash",v)));let w=i===""||v.pathname==="",A=w?"/":v.pathname,l;if(A==null)l=a;else{let d=r.length-1;if(!o&&A.startsWith("..")){let b=A.split("/");for(;b[0]==="..";)b.shift(),d-=1;v.pathname=b.join("/")}l=d>=0?r[d]:"/"}let h=vy(v,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,"/"),yy=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),Sy=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,by=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,xy=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 Cy(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function wy(i){return i.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var gp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function yp(i,r){let a=i;if(typeof a!="string"||!py.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,v=!1;if(gp)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:v=!0}catch{Wi(!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:v,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Sp=["POST","PUT","PATCH","DELETE"];new Set(Sp);var Ey=["GET",...Sp];new Set(Ey);var ln=F.createContext(null);ln.displayName="DataRouter";var ul=F.createContext(null);ul.displayName="DataRouterState";var Ty=F.createContext(!1),bp=F.createContext({isTransitioning:!1});bp.displayName="ViewTransition";var Ay=F.createContext(new Map);Ay.displayName="Fetchers";var Ry=F.createContext(null);Ry.displayName="Await";var Oi=F.createContext(null);Oi.displayName="Navigation";var ba=F.createContext(null);ba.displayName="Location";var Ui=F.createContext({outlet:null,matches:[],isDataRoute:!1});Ui.displayName="Route";var oh=F.createContext(null);oh.displayName="RouteError";var xp="REACT_ROUTER_ERROR",Dy="REDIRECT",ky="ROUTE_ERROR_RESPONSE";function Oy(i){if(i.startsWith(`${xp}:${Dy}:{`))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 My(i){if(i.startsWith(`${xp}:${ky}:{`))try{let r=JSON.parse(i.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new xy(r.status,r.statusText,r.data)}catch{}}function Ly(i,{relative:r}={}){lt(xa(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:o}=F.useContext(Oi),{hash:v,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:v})}function xa(){return F.useContext(ba)!=null}function Ys(){return lt(xa(),"useLocation() may be used only in the context of a <Router> component."),F.useContext(ba).location}var Cp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wp(i){F.useContext(Oi).static||F.useLayoutEffect(i)}function hl(){let{isDataRoute:i}=F.useContext(Ui);return i?Wy():Ny()}function Ny(){lt(xa(),"useNavigate() may be used only in the context of a <Router> component.");let i=F.useContext(ln),{basename:r,navigator:a}=F.useContext(Oi),{matches:o}=F.useContext(Ui),{pathname:v}=Ys(),w=JSON.stringify(vp(o)),A=F.useRef(!1);return wp(()=>{A.current=!0}),F.useCallback((h,u={})=>{if(Wi(A.current,Cp),!A.current)return;if(typeof h=="number"){a.go(h);return}let y=ah(h,JSON.parse(w),v,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,v,i])}var By=F.createContext(null);function jy(i){let r=F.useContext(Ui).outlet;return F.useMemo(()=>r&&F.createElement(By.Provider,{value:i},r),[r,i])}function Ep(){let{matches:i}=F.useContext(Ui),r=i[i.length-1];return r?r.params:{}}function Ca(i,{relative:r}={}){let{matches:a}=F.useContext(Ui),{pathname:o}=Ys(),v=JSON.stringify(vp(a));return F.useMemo(()=>ah(i,JSON.parse(v),o,r==="path"),[i,v,o,r])}function zy(i,r){return Tp(i,r)}function Tp(i,r,a){var m;lt(xa(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=F.useContext(Oi),{matches:v}=F.useContext(Ui),w=v[v.length-1],A=w?w.params:{},l=w?w.pathname:"/",h=w?w.pathnameBase:"/",u=w&&w.route;{let g=u&&u.path||"";Rp(l,!u||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${g}">) 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="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let y=Ys(),d;if(r){let g=typeof r=="string"?on(r):r;lt(h==="/"||((m=g.pathname)==null?void 0:m.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 "${g.pathname}" was given in the \`location\` prop.`),d=g}else d=y;let b=d.pathname||"/",C=b;if(h!=="/"){let g=h.replace(/^\//,"").split("/");C="/"+b.replace(/^\//,"").split("/").slice(g.length).join("/")}let k=mp(i,{pathname:C});Wi(u||k!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Wi(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.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 x=$y(k&&k.map(g=>Object.assign({},g,{params:Object.assign({},A,g.params),pathname:Ki([h,o.encodeLocation?o.encodeLocation(g.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?h:Ki([h,o.encodeLocation?o.encodeLocation(g.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),v,a);return r&&x?F.createElement(ba.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...d},navigationType:"POP"}},x):x}function Hy(){let i=Ky(),r=Cy(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)",v={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=F.createElement(F.Fragment,null,F.createElement("p",null,"💿 Hey developer 👋"),F.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",F.createElement("code",{style:w},"ErrorBoundary")," or"," ",F.createElement("code",{style:w},"errorElement")," prop on your route.")),F.createElement(F.Fragment,null,F.createElement("h2",null,"Unexpected Application Error!"),F.createElement("h3",{style:{fontStyle:"italic"}},r),a?F.createElement("pre",{style:v},a):null,A)}var Uy=F.createElement(Hy,null),Ap=class extends F.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=My(i.digest);a&&(i=a)}let r=i!==void 0?F.createElement(Ui.Provider,{value:this.props.routeContext},F.createElement(oh.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?F.createElement(Iy,{error:i},r):r}};Ap.contextType=Ty;var Bu=new WeakMap;function Iy({children:i,error:r}){let{basename:a}=F.useContext(Oi);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let o=Oy(r.digest);if(o){let v=Bu.get(r);if(v)throw v;let w=yp(o.location,a);if(gp&&!Bu.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 Bu.set(r,A),A}return F.createElement("meta",{httpEquiv:"refresh",content:`0;url=${w.absoluteURL||w.to}`})}}return i}function Py({routeContext:i,match:r,children:a}){let o=F.useContext(ln);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),F.createElement(Ui.Provider,{value:i},a)}function $y(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 v=i,w=o==null?void 0:o.errors;if(w!=null){let y=v.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(",")}`),v=v.slice(0,Math.min(v.length,y+1))}let A=!1,l=-1;if(a&&o){A=o.renderFallback;for(let y=0;y<v.length;y++){let d=v[y];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=y),d.route.id){let{loaderData:b,errors:C}=o,k=d.route.loader&&!b.hasOwnProperty(d.route.id)&&(!C||C[d.route.id]===void 0);if(d.route.lazy||k){a.isStatic&&(A=!0),l>=0?v=v.slice(0,l+1):v=[v[0]];break}}}}let h=a==null?void 0:a.onError,u=o&&h?(y,d)=>{var b,C;h(y,{location:o.location,params:((C=(b=o.matches)==null?void 0:b[0])==null?void 0:C.params)??{},unstable_pattern:wy(o.matches),errorInfo:d})}:void 0;return v.reduceRight((y,d,b)=>{let C,k=!1,x=null,m=null;o&&(C=w&&d.route.id?w[d.route.id]:void 0,x=d.route.errorElement||Uy,A&&(l<0&&b===0?(Rp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,m=null):l===b&&(k=!0,m=d.route.hydrateFallbackElement||null)));let g=r.concat(v.slice(0,b+1)),f=()=>{let p;return C?p=x:k?p=m:d.route.Component?p=F.createElement(d.route.Component,null):d.route.element?p=d.route.element:p=y,F.createElement(Py,{match:d,routeContext:{outlet:y,matches:g,isDataRoute:o!=null},children:p})};return o&&(d.route.ErrorBoundary||d.route.errorElement||b===0)?F.createElement(Ap,{location:o.location,revalidation:o.revalidation,component:x,error:C,children:f(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:u}):f()},null)}function lh(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Fy(i){let r=F.useContext(ln);return lt(r,lh(i)),r}function Zy(i){let r=F.useContext(ul);return lt(r,lh(i)),r}function qy(i){let r=F.useContext(Ui);return lt(r,lh(i)),r}function ch(i){let r=qy(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 Gy(){return ch("useRouteId")}function Ky(){var o;let i=F.useContext(oh),r=Zy("useRouteError"),a=ch("useRouteError");return i!==void 0?i:(o=r.errors)==null?void 0:o[a]}function Wy(){let{router:i}=Fy("useNavigate"),r=ch("useNavigate"),a=F.useRef(!1);return wp(()=>{a.current=!0}),F.useCallback(async(v,w={})=>{Wi(a.current,Cp),a.current&&(typeof v=="number"?await i.navigate(v):await i.navigate(v,{fromRouteId:r,...w}))},[i,r])}var w_={};function Rp(i,r,a){!r&&!w_[i]&&(w_[i]=!0,Wi(!1,a))}F.memo(Vy);function Vy({routes:i,future:r,state:a,isStatic:o,onError:v}){return Tp(i,void 0,{state:a,isStatic:o,onError:v})}function Yy(i){return jy(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 Xy({basename:i="/",children:r=null,location:a,navigationType:o="POP",navigator:v,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=F.useMemo(()=>({basename:l,navigator:v,static:w,unstable_useTransitions:A,future:{}}),[l,v,w,A]);typeof a=="string"&&(a=on(a));let{pathname:u="/",search:y="",hash:d="",state:b=null,key:C="default",unstable_mask:k}=a,x=F.useMemo(()=>{let m=Ss(u,l);return m==null?null:{location:{pathname:m,search:y,hash:d,state:b,key:C,unstable_mask:k},navigationType:o}},[l,u,y,d,b,C,o,k]);return Wi(x!=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.`),x==null?null:F.createElement(Oi.Provider,{value:h},F.createElement(ba.Provider,{children:r,value:x}))}function Jy({children:i,location:r}){return zy(Xu(i),r)}function Xu(i,r=[]){let a=[];return F.Children.forEach(i,(o,v)=>{if(!F.isValidElement(o))return;let w=[...r,v];if(o.type===F.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 Qy(i){return fl(i)&&i.tagName.toLowerCase()==="button"}function eS(i){return fl(i)&&i.tagName.toLowerCase()==="form"}function tS(i){return fl(i)&&i.tagName.toLowerCase()==="input"}function iS(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function sS(i,r){return i.button===0&&(!r||r==="_self")&&!iS(i)}var Zo=null;function rS(){if(Zo===null)try{new FormData(document.createElement("form"),0),Zo=!1}catch{Zo=!0}return Zo}var nS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ju(i){return i!=null&&!nS.has(i)?(Wi(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Qo}"`),null):i}function aS(i,r){let a,o,v,w,A;if(eS(i)){let l=i.getAttribute("action");o=l?Ss(l,r):null,a=i.getAttribute("method")||Jo,v=ju(i.getAttribute("enctype"))||Qo,w=new FormData(i)}else if(Qy(i)||tS(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,v=ju(i.getAttribute("formenctype"))||ju(l.getAttribute("enctype"))||Qo,w=new FormData(l,i),!rS()){let{name:u,type:y,value:d}=i;if(y==="image"){let b=u?`${u}.`:"";w.append(`${b}x`,"0"),w.append(`${b}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,v=Qo,A=i}return w&&v==="text/plain"&&(A=w,w=void 0),{action:o,method:a.toLowerCase(),encType:v,formData:w,body:A}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function uh(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function oS(i,r,a,o){let v=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return a?v.pathname.endsWith("/")?v.pathname=`${v.pathname}_.${o}`:v.pathname=`${v.pathname}.${o}`:v.pathname==="/"?v.pathname=`_root.${o}`:r&&Ss(v.pathname,r)==="/"?v.pathname=`${r.replace(/\/$/,"")}/_root.${o}`:v.pathname=`${v.pathname.replace(/\/$/,"")}.${o}`,v}async function lS(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 cS(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 uS(i,r,a){let o=await Promise.all(i.map(async v=>{let w=r.routes[v.route.id];if(w){let A=await lS(w,a);return A.links?A.links():[]}return[]}));return mS(o.flat(1).filter(cS).filter(v=>v.rel==="stylesheet"||v.rel==="preload").map(v=>v.rel==="stylesheet"?{...v,rel:"prefetch",as:"style"}:{...v,rel:"prefetch"}))}function E_(i,r,a,o,v,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 b=h.route.shouldRevalidate({currentUrl:new URL(v.pathname+v.search+v.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 b=="boolean")return b}return!0}):[]}function hS(i,r,{includeHydrateFallback:a}={}){return fS(i.map(o=>{let v=r.routes[o.route.id];if(!v)return[];let w=[v.module];return v.clientActionModule&&(w=w.concat(v.clientActionModule)),v.clientLoaderModule&&(w=w.concat(v.clientLoaderModule)),a&&v.hydrateFallbackModule&&(w=w.concat(v.hydrateFallbackModule)),v.imports&&(w=w.concat(v.imports)),w}).flat(1))}function fS(i){return[...new Set(i)]}function dS(i){let r={},a=Object.keys(i).sort();for(let o of a)r[o]=i[o];return r}function mS(i,r){let a=new Set;return new Set(r),i.reduce((o,v)=>{let w=JSON.stringify(dS(v));return a.has(w)||(a.add(w),o.push({key:w,link:v})),o},[])}function Dp(){let i=F.useContext(ln);return uh(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function _S(){let i=F.useContext(ul);return uh(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var hh=F.createContext(void 0);hh.displayName="FrameworkContext";function kp(){let i=F.useContext(hh);return uh(i,"You must render this element inside a <HydratedRouter> element"),i}function pS(i,r){let a=F.useContext(hh),[o,v]=F.useState(!1),[w,A]=F.useState(!1),{onFocus:l,onBlur:h,onMouseEnter:u,onMouseLeave:y,onTouchStart:d}=r,b=F.useRef(null);F.useEffect(()=>{if(i==="render"&&A(!0),i==="viewport"){let x=g=>{g.forEach(f=>{A(f.isIntersecting)})},m=new IntersectionObserver(x,{threshold:.5});return b.current&&m.observe(b.current),()=>{m.disconnect()}}},[i]),F.useEffect(()=>{if(o){let x=setTimeout(()=>{A(!0)},100);return()=>{clearTimeout(x)}}},[o]);let C=()=>{v(!0)},k=()=>{v(!1),A(!1)};return a?i!=="intent"?[w,b,{}]:[w,b,{onFocus:ca(l,C),onBlur:ca(h,k),onMouseEnter:ca(u,C),onMouseLeave:ca(y,k),onTouchStart:ca(d,C)}]:[!1,b,{}]}function ca(i,r){return a=>{i&&i(a),a.defaultPrevented||r(a)}}function vS({page:i,...r}){let{router:a}=Dp(),o=F.useMemo(()=>mp(a.routes,i,a.basename),[a.routes,i,a.basename]);return o?F.createElement(yS,{page:i,matches:o,...r}):null}function gS(i){let{manifest:r,routeModules:a}=kp(),[o,v]=F.useState([]);return F.useEffect(()=>{let w=!1;return uS(i,r,a).then(A=>{w||v(A)}),()=>{w=!0}},[i,r,a]),o}function yS({page:i,matches:r,...a}){let o=Ys(),{future:v,manifest:w,routeModules:A}=kp(),{basename:l}=Dp(),{loaderData:h,matches:u}=_S(),y=F.useMemo(()=>E_(i,r,u,w,o,"data"),[i,r,u,w,o]),d=F.useMemo(()=>E_(i,r,u,w,o,"assets"),[i,r,u,w,o]),b=F.useMemo(()=>{if(i===o.pathname+o.search+o.hash)return[];let x=new Set,m=!1;if(r.forEach(f=>{var S;let p=w.routes[f.route.id];!p||!p.hasLoader||(!y.some(R=>R.route.id===f.route.id)&&f.route.id in h&&((S=A[f.route.id])!=null&&S.shouldRevalidate)||p.hasClientLoader?m=!0:x.add(f.route.id))}),x.size===0)return[];let g=oS(i,l,v.unstable_trailingSlashAwareDataRequests,"data");return m&&x.size>0&&g.searchParams.set("_routes",r.filter(f=>x.has(f.route.id)).map(f=>f.route.id).join(",")),[g.pathname+g.search]},[l,v.unstable_trailingSlashAwareDataRequests,h,o,w,y,r,i,A]),C=F.useMemo(()=>hS(d,w),[d,w]),k=gS(d);return F.createElement(F.Fragment,null,b.map(x=>F.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...a})),C.map(x=>F.createElement("link",{key:x,rel:"modulepreload",href:x,...a})),k.map(({key:x,link:m})=>F.createElement("link",{key:x,nonce:a.nonce,...m,crossOrigin:m.crossOrigin??a.crossOrigin})))}function SS(...i){return r=>{i.forEach(a=>{typeof a=="function"?a(r):a!=null&&(a.current=r)})}}var bS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{bS&&(window.__reactRouterVersion="7.13.2")}catch{}function xS({basename:i,children:r,unstable_useTransitions:a,window:o}){let v=F.useRef();v.current==null&&(v.current=Q0({window:o,v5Compat:!0}));let w=v.current,[A,l]=F.useState({action:w.action,location:w.location}),h=F.useCallback(u=>{a===!1?l(u):F.startTransition(()=>l(u))},[a]);return F.useLayoutEffect(()=>w.listen(h),[w,h]),F.createElement(Xy,{basename:i,children:r,location:A.location,navigationType:A.action,navigator:w,unstable_useTransitions:a})}var Op=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hi=F.forwardRef(function({onClick:r,discover:a="render",prefetch:o="none",relative:v,reloadDocument:w,replace:A,unstable_mask:l,state:h,target:u,to:y,preventScrollReset:d,viewTransition:b,unstable_defaultShouldRevalidate:C,...k},x){let{basename:m,navigator:g,unstable_useTransitions:f}=F.useContext(Oi),p=typeof y=="string"&&Op.test(y),S=yp(y,m);y=S.to;let R=Ly(y,{relative:v}),D=Ys(),M=null;if(l){let te=ah(l,[],D.unstable_mask?D.unstable_mask.pathname:"/",!0);m!=="/"&&(te.pathname=te.pathname==="/"?m:Ki([m,te.pathname])),M=g.createHref(te)}let[T,N,I]=pS(o,k),$=ES(y,{replace:A,unstable_mask:l,state:h,target:u,preventScrollReset:d,relative:v,viewTransition:b,unstable_defaultShouldRevalidate:C,unstable_useTransitions:f});function q(te){r&&r(te),te.defaultPrevented||$(te)}let P=!(S.isExternal||w),Q=F.createElement("a",{...k,...I,href:(P?M:void 0)||S.absoluteURL||R,onClick:P?q:r,ref:SS(x,N),target:u,"data-discover":!p&&a==="render"?"true":void 0});return T&&!p?F.createElement(F.Fragment,null,Q,F.createElement(vS,{page:R})):Q});Hi.displayName="Link";var Mp=F.forwardRef(function({"aria-current":r="page",caseSensitive:a=!1,className:o="",end:v=!1,style:w,to:A,viewTransition:l,children:h,...u},y){let d=Ca(A,{relative:u.relative}),b=Ys(),C=F.useContext(ul),{navigator:k,basename:x}=F.useContext(Oi),m=C!=null&&kS(d)&&l===!0,g=k.encodeLocation?k.encodeLocation(d).pathname:d.pathname,f=b.pathname,p=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;a||(f=f.toLowerCase(),p=p?p.toLowerCase():null,g=g.toLowerCase()),p&&x&&(p=Ss(p,x)||p);const S=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let R=f===g||!v&&f.startsWith(g)&&f.charAt(S)==="/",D=p!=null&&(p===g||!v&&p.startsWith(g)&&p.charAt(g.length)==="/"),M={isActive:R,isPending:D,isTransitioning:m},T=R?r:void 0,N;typeof o=="function"?N=o(M):N=[o,R?"active":null,D?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let I=typeof w=="function"?w(M):w;return F.createElement(Hi,{...u,"aria-current":T,className:N,ref:y,style:I,to:A,viewTransition:l},typeof h=="function"?h(M):h)});Mp.displayName="NavLink";var CS=F.forwardRef(({discover:i="render",fetcherKey:r,navigate:a,reloadDocument:o,replace:v,state:w,method:A=Jo,action:l,onSubmit:h,relative:u,preventScrollReset:y,viewTransition:d,unstable_defaultShouldRevalidate:b,...C},k)=>{let{unstable_useTransitions:x}=F.useContext(Oi),m=RS(),g=DS(l,{relative:u}),f=A.toLowerCase()==="get"?"get":"post",p=typeof l=="string"&&Op.test(l),S=R=>{if(h&&h(R),R.defaultPrevented)return;R.preventDefault();let D=R.nativeEvent.submitter,M=(D==null?void 0:D.getAttribute("formmethod"))||A,T=()=>m(D||R.currentTarget,{fetcherKey:r,method:M,navigate:a,replace:v,state:w,relative:u,preventScrollReset:y,viewTransition:d,unstable_defaultShouldRevalidate:b});x&&a!==!1?F.startTransition(()=>T()):T()};return F.createElement("form",{ref:k,method:f,action:g,onSubmit:o?h:S,...C,"data-discover":!p&&i==="render"?"true":void 0})});CS.displayName="Form";function wS(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Lp(i){let r=F.useContext(ln);return lt(r,wS(i)),r}function ES(i,{target:r,replace:a,unstable_mask:o,state:v,preventScrollReset:w,relative:A,viewTransition:l,unstable_defaultShouldRevalidate:h,unstable_useTransitions:u}={}){let y=hl(),d=Ys(),b=Ca(i,{relative:A});return F.useCallback(C=>{if(sS(C,r)){C.preventDefault();let k=a!==void 0?a:ya(d)===ya(b),x=()=>y(i,{replace:k,unstable_mask:o,state:v,preventScrollReset:w,relative:A,viewTransition:l,unstable_defaultShouldRevalidate:h});u?F.startTransition(()=>x()):x()}},[d,y,b,a,o,v,r,i,w,A,l,h,u])}var TS=0,AS=()=>`__${String(++TS)}__`;function RS(){let{router:i}=Lp("useSubmit"),{basename:r}=F.useContext(Oi),a=Gy(),o=i.fetch,v=i.navigate;return F.useCallback(async(w,A={})=>{let{action:l,method:h,encType:u,formData:y,body:d}=aS(w,r);if(A.navigate===!1){let b=A.fetcherKey||AS();await o(b,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 v(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,v,r,a])}function DS(i,{relative:r}={}){let{basename:a}=F.useContext(Oi),o=F.useContext(Ui);lt(o,"useFormAction must be used inside a RouteContext");let[v]=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===".")&&v.route.index&&(w.search=w.search?w.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(w.pathname=w.pathname==="/"?a:Ki([a,w.pathname])),ya(w)}function kS(i,{relative:r}={}){let a=F.useContext(bp);lt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=Lp("useViewTransitionState"),v=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(v.pathname,A)!=null||il(v.pathname,w)!=null}class OS extends F.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?E.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-center px-4",children:[E.jsx("div",{className:"text-6xl mb-4",children:"⚠"}),E.jsx("h1",{className:"text-lg text-[#e0e0e0] mb-2",children:"Something went wrong"}),E.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."}),E.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 MS=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Np=(...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 LS={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 NS=F.forwardRef(({color:i="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:v="",children:w,iconNode:A,...l},h)=>F.createElement("svg",{ref:h,...LS,width:r,height:r,stroke:i,strokeWidth:o?Number(a)*24/Number(r):a,className:Np("lucide",v),...l},[...A.map(([u,y])=>F.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 Ze=(i,r)=>{const a=F.forwardRef(({className:o,...v},w)=>F.createElement(NS,{ref:w,iconNode:r,className:Np(`lucide-${MS(i)}`,o),...v}));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 BS=[["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"}]],Bp=Ze("Activity",BS);/**
|
|
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 jS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],jp=Ze("Ban",jS);/**
|
|
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 zS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],zp=Ze("CircleCheck",zS);/**
|
|
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 HS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],US=Ze("CirclePlus",HS);/**
|
|
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 IS=[["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=Ze("CircleX",IS);/**
|
|
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 PS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],$S=Ze("Clock",PS);/**
|
|
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 FS=[["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"}]],ZS=Ze("Copy",FS);/**
|
|
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 qS=[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]],GS=Ze("CornerDownLeft",qS);/**
|
|
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 KS=[["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"}]],WS=Ze("EyeOff",KS);/**
|
|
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 VS=[["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"}]],YS=Ze("Eye",VS);/**
|
|
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 XS=[["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=Ze("KeyRound",XS);/**
|
|
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 JS=[["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"}]],QS=Ze("Layers",JS);/**
|
|
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 eb=[["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"}]],tb=Ze("LayoutDashboard",eb);/**
|
|
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 ib=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qu=Ze("LoaderCircle",ib);/**
|
|
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 sb=[["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"}]],rb=Ze("MessageSquare",sb);/**
|
|
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 nb=[["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"}]],ab=Ze("Octagon",nb);/**
|
|
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 ob=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Hp=Ze("Play",ob);/**
|
|
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 lb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],wa=Ze("Plus",lb);/**
|
|
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 cb=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],ub=Ze("Power",cb);/**
|
|
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 hb=[["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"}]],Up=Ze("RefreshCw",hb);/**
|
|
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 fb=[["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"}]],db=Ze("Send",fb);/**
|
|
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 mb=[["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"}]],_b=Ze("ShieldAlert",mb);/**
|
|
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 pb=[["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"}]],vb=Ze("Shield",pb);/**
|
|
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 gb=[["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"}]],yb=Ze("Skull",gb);/**
|
|
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 Sb=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],bb=Ze("Terminal",Sb);/**
|
|
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 xb=[["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"}]],fh=Ze("Trash2",xb);/**
|
|
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 Cb=[["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"}]],Ip=Ze("TriangleAlert",Cb);/**
|
|
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 wb=[["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"}]],Eb=Ze("UserCheck",wb);/**
|
|
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 Tb=[["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"}]],Ab=Ze("Users",Tb);/**
|
|
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 Rb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],dl=Ze("X",Rb);/**
|
|
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 Db=[["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"}]],kb=Ze("Zap",Db),T_=i=>{let r;const a=new Set,o=(u,y)=>{const d=typeof u=="function"?u(r):u;if(!Object.is(d,r)){const b=r;r=y??(typeof d!="object"||d===null)?d:Object.assign({},r,d),a.forEach(C=>C(r,b))}},v=()=>r,l={setState:o,getState:v,getInitialState:()=>h,subscribe:u=>(a.add(u),()=>a.delete(u))},h=r=i(o,v,l);return l},Ob=(i=>i?T_(i):T_),Mb=i=>i;function Lb(i,r=Mb){const a=va.useSyncExternalStore(i.subscribe,va.useCallback(()=>r(i.getState()),[i,r]),va.useCallback(()=>r(i.getInitialState()),[i,r]));return va.useDebugValue(a),a}const A_=i=>{const r=Ob(i),a=o=>Lb(r,o);return Object.assign(a,r),a},Pp=(i=>i?A_(i):A_),dt=Pp(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 de(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 b=y[d];b in l||(l[b]=u[b].bind(l))}}const v=(a==null?void 0:a.Parent)??Object;class w extends v{}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 $p extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const Fp={};function Ws(i){return Fp}function Zp(i){const r=Object.values(i).filter(o=>typeof o=="number");return Object.entries(i).filter(([o,v])=>r.indexOf(+o)===-1).map(([o,v])=>v)}function eh(i,r){return typeof r=="bigint"?r.toString():r}function dh(i){return{get value(){{const r=i();return Object.defineProperty(this,"value",{value:r}),r}}}}function mh(i){return i==null}function _h(i){const r=i.startsWith("^")?1:0,a=i.endsWith("$")?i.length-1:i.length;return i.slice(r,a)}function Nb(i,r){const a=(i.toString().split(".")[1]||"").length,o=r.toString();let v=(o.split(".")[1]||"").length;if(v===0&&/\d?e-\d?/.test(o)){const h=o.match(/\d?e-(\d?)/);h!=null&&h[1]&&(v=Number.parseInt(h[1]))}const w=a>v?a:v,A=Number.parseInt(i.toFixed(w).replace(".","")),l=Number.parseInt(r.toFixed(w).replace(".",""));return A%l/10**w}const R_=Symbol("evaluating");function We(i,r,a){let o;Object.defineProperty(i,r,{get(){if(o!==R_)return o===void 0&&(o=R_,o=a()),o},set(v){Object.defineProperty(i,r,{value:v})},configurable:!0})}function gr(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 D_(i){return JSON.stringify(i)}function Bb(i){return i.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const qp="captureStackTrace"in Error?Error.captureStackTrace:(...i)=>{};function rl(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}const jb=dh(()=>{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 Gp(i){return nn(i)?{...i}:Array.isArray(i)?[...i]:i}const zb=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 Ce(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 Hb(i){return Object.keys(i).filter(r=>i[r]._zod.optin==="optional"&&i[r]._zod.optout==="optional")}const Ub={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 Ib(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 gr(this,"shape",A),A},checks:[]});return Js(i,w)}function Pb(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 gr(this,"shape",A),A},checks:[]});return Js(i,w)}function $b(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 v=Xs(i._zod.def,{get shape(){const w={...i._zod.def.shape,...r};return gr(this,"shape",w),w}});return Js(i,v)}function Fb(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 gr(this,"shape",o),o}});return Js(i,a)}function Zb(i,r){const a=Xs(i._zod.def,{get shape(){const o={...i._zod.def.shape,...r._zod.def.shape};return gr(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:[]});return Js(i,a)}function qb(i,r,a){const v=r._zod.def.checks;if(v&&v.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 gr(this,"shape",h),h},checks:[]});return Js(r,A)}function Gb(i,r,a){const o=Xs(r._zod.def,{get shape(){const v=r._zod.def.shape,w={...v};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:v[A]}))}else for(const A in v)w[A]=new i({type:"nonoptional",innerType:v[A]});return gr(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 Vs(i,r,a){var v,w,A,l,h,u;const o={...i,path:i.path??[]};if(!i.message){const y=qo((A=(w=(v=i.inst)==null?void 0:v._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 ph(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 Kp=(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})},Wp=de("$ZodError",Kp),Vp=de("$ZodError",Kp,{Parent:Error});function Kb(i,r=a=>a.message){const a={},o=[];for(const v of i.issues)v.path.length>0?(a[v.path[0]]=a[v.path[0]]||[],a[v.path[0]].push(r(v))):o.push(r(v));return{formErrors:o,fieldErrors:a}}function Wb(i,r=a=>a.message){const a={_errors:[]},o=v=>{for(const w of v.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 vh=i=>(r,a,o,v)=>{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((v==null?void 0:v.Err)??i)(A.issues.map(h=>Vs(h,w,Ws())));throw qp(l,v==null?void 0:v.callee),l}return A.value},gh=i=>async(r,a,o,v)=>{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((v==null?void 0:v.Err)??i)(A.issues.map(h=>Vs(h,w,Ws())));throw qp(l,v==null?void 0:v.callee),l}return A.value},_l=i=>(r,a,o)=>{const v=o?{...o,async:!1}:{async:!1},w=r._zod.run({value:a,issues:[]},v);if(w instanceof Promise)throw new rn;return w.issues.length?{success:!1,error:new(i??Wp)(w.issues.map(A=>Vs(A,v,Ws())))}:{success:!0,data:w.value}},Vb=_l(Vp),pl=i=>async(r,a,o)=>{const v=o?Object.assign(o,{async:!0}):{async:!0};let w=r._zod.run({value:a,issues:[]},v);return w instanceof Promise&&(w=await w),w.issues.length?{success:!1,error:new i(w.issues.map(A=>Vs(A,v,Ws())))}:{success:!0,data:w.value}},Yb=pl(Vp),Xb=i=>(r,a,o)=>{const v=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return vh(i)(r,a,v)},Jb=i=>(r,a,o)=>vh(i)(r,a,o),Qb=i=>async(r,a,o)=>{const v=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return gh(i)(r,a,v)},e1=i=>async(r,a,o)=>gh(i)(r,a,o),t1=i=>(r,a,o)=>{const v=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return _l(i)(r,a,v)},i1=i=>(r,a,o)=>_l(i)(r,a,o),s1=i=>async(r,a,o)=>{const v=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return pl(i)(r,a,v)},r1=i=>async(r,a,o)=>pl(i)(r,a,o),n1=/^[cC][^\s-]{8,}$/,a1=/^[0-9a-z]+$/,o1=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,l1=/^[0-9a-vA-V]{20}$/,c1=/^[A-Za-z0-9]{27}$/,u1=/^[a-zA-Z0-9_-]{21}$/,h1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,f1=/^([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})$/,k_=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)$/,d1=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,m1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function _1(){return new RegExp(m1,"u")}const p1=/^(?:(?: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])$/,v1=/^(([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}|:))$/,g1=/^((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])$/,y1=/^(([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])$/,S1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yp=/^[A-Za-z0-9_-]*$/,b1=/^\+[1-9]\d{6,14}$/,Xp="(?:(?:\\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])))",x1=new RegExp(`^${Xp}$`);function Jp(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 C1(i){return new RegExp(`^${Jp(i)}$`)}function w1(i){const r=Jp({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(`^${Xp}T(?:${o})$`)}const E1=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}$`)},T1=/^-?\d+$/,Qp=/^-?\d+(?:\.\d+)?$/,A1=/^(?:true|false)$/i,R1=/^[^A-Z]*$/,D1=/^[^a-z]*$/,ni=de("$ZodCheck",(i,r)=>{var a;i._zod??(i._zod={}),i._zod.def=r,(a=i._zod).onattach??(a.onattach=[])}),ev={number:"number",bigint:"bigint",object:"date"},tv=de("$ZodCheckLessThan",(i,r)=>{ni.init(i,r);const a=ev[typeof r.value];i._zod.onattach.push(o=>{const v=o._zod.bag,w=(r.inclusive?v.maximum:v.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<w&&(r.inclusive?v.maximum=r.value:v.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})}}),iv=de("$ZodCheckGreaterThan",(i,r)=>{ni.init(i,r);const a=ev[typeof r.value];i._zod.onattach.push(o=>{const v=o._zod.bag,w=(r.inclusive?v.minimum:v.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>w&&(r.inclusive?v.minimum=r.value:v.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})}}),k1=de("$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):Nb(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})}}),O1=de("$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",[v,w]=Ub[r.format];i._zod.onattach.push(l=>{const h=l._zod.bag;h.format=r.format,h.minimum=v,h.maximum=w,a&&(h.pattern=T1)}),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<v&&l.issues.push({origin:"number",input:h,code:"too_small",minimum:v,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})}}),M1=de("$ZodCheckMaxLength",(i,r)=>{var a;ni.init(i,r),(a=i._zod.def).when??(a.when=o=>{const v=o.value;return!mh(v)&&v.length!==void 0}),i._zod.onattach.push(o=>{const v=o._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<v&&(o._zod.bag.maximum=r.maximum)}),i._zod.check=o=>{const v=o.value;if(v.length<=r.maximum)return;const A=ph(v);o.issues.push({origin:A,code:"too_big",maximum:r.maximum,inclusive:!0,input:v,inst:i,continue:!r.abort})}}),L1=de("$ZodCheckMinLength",(i,r)=>{var a;ni.init(i,r),(a=i._zod.def).when??(a.when=o=>{const v=o.value;return!mh(v)&&v.length!==void 0}),i._zod.onattach.push(o=>{const v=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>v&&(o._zod.bag.minimum=r.minimum)}),i._zod.check=o=>{const v=o.value;if(v.length>=r.minimum)return;const A=ph(v);o.issues.push({origin:A,code:"too_small",minimum:r.minimum,inclusive:!0,input:v,inst:i,continue:!r.abort})}}),N1=de("$ZodCheckLengthEquals",(i,r)=>{var a;ni.init(i,r),(a=i._zod.def).when??(a.when=o=>{const v=o.value;return!mh(v)&&v.length!==void 0}),i._zod.onattach.push(o=>{const v=o._zod.bag;v.minimum=r.length,v.maximum=r.length,v.length=r.length}),i._zod.check=o=>{const v=o.value,w=v.length;if(w===r.length)return;const A=ph(v),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})}}),vl=de("$ZodCheckStringFormat",(i,r)=>{var a,o;ni.init(i,r),i._zod.onattach.push(v=>{const w=v._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=v=>{r.pattern.lastIndex=0,!r.pattern.test(v.value)&&v.issues.push({origin:"string",code:"invalid_format",format:r.format,input:v.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:i,continue:!r.abort})}):(o=i._zod).check??(o.check=()=>{})}),B1=de("$ZodCheckRegex",(i,r)=>{vl.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})}}),j1=de("$ZodCheckLowerCase",(i,r)=>{r.pattern??(r.pattern=R1),vl.init(i,r)}),z1=de("$ZodCheckUpperCase",(i,r)=>{r.pattern??(r.pattern=D1),vl.init(i,r)}),H1=de("$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(v=>{const w=v._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(o)}),i._zod.check=v=>{v.value.includes(r.includes,r.position)||v.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:v.value,inst:i,continue:!r.abort})}}),U1=de("$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 v=o._zod.bag;v.patterns??(v.patterns=new Set),v.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})}}),I1=de("$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 v=o._zod.bag;v.patterns??(v.patterns=new Set),v.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})}}),P1=de("$ZodCheckOverwrite",(i,r)=>{ni.init(i,r),i._zod.check=a=>{a.value=r.tx(a.value)}});class $1{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(`
|
|
236
|
+
`).filter(A=>A),v=Math.min(...o.map(A=>A.length-A.trimStart().length)),w=o.map(A=>A.slice(v)).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,v=[...((this==null?void 0:this.content)??[""]).map(w=>` ${w}`)];return new r(...a,v.join(`
|
|
237
|
+
`))}}const F1={major:4,minor:3,patch:6},mt=de("$ZodType",(i,r)=>{var v;var a;i??(i={}),i._zod.def=r,i._zod.bag=i._zod.bag||{},i._zod.version=F1;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=[]),(v=i._zod.deferred)==null||v.push(()=>{i._zod.run=i._zod.parse});else{const w=(l,h,u)=>{let y=tn(l),d;for(const b of h){if(b._zod.def.when){if(!b._zod.def.when(l))continue}else if(y)continue;const C=l.issues.length,k=b._zod.check(l);if(k instanceof Promise&&(u==null?void 0:u.async)===!1)throw new rn;if(d||k instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await k,l.issues.length!==C&&(y||(y=tn(l,C)))});else{if(l.issues.length===C)continue;y||(y=tn(l,C))}}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)}}We(i,"~standard",()=>({validate:w=>{var A;try{const l=Vb(i,w);return l.success?{value:l.data}:{issues:(A=l.error)==null?void 0:A.issues}}catch{return Yb(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}))}),yh=de("$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()??E1(i._zod.bag),i._zod.parse=(o,v)=>{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=de("$ZodStringFormat",(i,r)=>{vl.init(i,r),yh.init(i,r)}),Z1=de("$ZodGUID",(i,r)=>{r.pattern??(r.pattern=f1),nt.init(i,r)}),q1=de("$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=k_(o))}else r.pattern??(r.pattern=k_());nt.init(i,r)}),G1=de("$ZodEmail",(i,r)=>{r.pattern??(r.pattern=d1),nt.init(i,r)}),K1=de("$ZodURL",(i,r)=>{nt.init(i,r),i._zod.check=a=>{try{const o=a.value.trim(),v=new URL(o);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(v.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(v.protocol.endsWith(":")?v.protocol.slice(0,-1):v.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=v.href:a.value=o;return}catch{a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:i,continue:!r.abort})}}}),W1=de("$ZodEmoji",(i,r)=>{r.pattern??(r.pattern=_1()),nt.init(i,r)}),V1=de("$ZodNanoID",(i,r)=>{r.pattern??(r.pattern=u1),nt.init(i,r)}),Y1=de("$ZodCUID",(i,r)=>{r.pattern??(r.pattern=n1),nt.init(i,r)}),X1=de("$ZodCUID2",(i,r)=>{r.pattern??(r.pattern=a1),nt.init(i,r)}),J1=de("$ZodULID",(i,r)=>{r.pattern??(r.pattern=o1),nt.init(i,r)}),Q1=de("$ZodXID",(i,r)=>{r.pattern??(r.pattern=l1),nt.init(i,r)}),ex=de("$ZodKSUID",(i,r)=>{r.pattern??(r.pattern=c1),nt.init(i,r)}),tx=de("$ZodISODateTime",(i,r)=>{r.pattern??(r.pattern=w1(r)),nt.init(i,r)}),ix=de("$ZodISODate",(i,r)=>{r.pattern??(r.pattern=x1),nt.init(i,r)}),sx=de("$ZodISOTime",(i,r)=>{r.pattern??(r.pattern=C1(r)),nt.init(i,r)}),rx=de("$ZodISODuration",(i,r)=>{r.pattern??(r.pattern=h1),nt.init(i,r)}),nx=de("$ZodIPv4",(i,r)=>{r.pattern??(r.pattern=p1),nt.init(i,r),i._zod.bag.format="ipv4"}),ax=de("$ZodIPv6",(i,r)=>{r.pattern??(r.pattern=v1),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})}}}),ox=de("$ZodCIDRv4",(i,r)=>{r.pattern??(r.pattern=g1),nt.init(i,r)}),lx=de("$ZodCIDRv6",(i,r)=>{r.pattern??(r.pattern=y1),nt.init(i,r),i._zod.check=a=>{const o=a.value.split("/");try{if(o.length!==2)throw new Error;const[v,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://[${v}]`)}catch{a.issues.push({code:"invalid_format",format:"cidrv6",input:a.value,inst:i,continue:!r.abort})}}});function sv(i){if(i==="")return!0;if(i.length%4!==0)return!1;try{return atob(i),!0}catch{return!1}}const cx=de("$ZodBase64",(i,r)=>{r.pattern??(r.pattern=S1),nt.init(i,r),i._zod.bag.contentEncoding="base64",i._zod.check=a=>{sv(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:i,continue:!r.abort})}});function ux(i){if(!Yp.test(i))return!1;const r=i.replace(/[-_]/g,o=>o==="-"?"+":"/"),a=r.padEnd(Math.ceil(r.length/4)*4,"=");return sv(a)}const hx=de("$ZodBase64URL",(i,r)=>{r.pattern??(r.pattern=Yp),nt.init(i,r),i._zod.bag.contentEncoding="base64url",i._zod.check=a=>{ux(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:i,continue:!r.abort})}}),fx=de("$ZodE164",(i,r)=>{r.pattern??(r.pattern=b1),nt.init(i,r)});function dx(i,r=null){try{const a=i.split(".");if(a.length!==3)return!1;const[o]=a;if(!o)return!1;const v=JSON.parse(atob(o));return!("typ"in v&&(v==null?void 0:v.typ)!=="JWT"||!v.alg||r&&(!("alg"in v)||v.alg!==r))}catch{return!1}}const mx=de("$ZodJWT",(i,r)=>{nt.init(i,r),i._zod.check=a=>{dx(a.value,r.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:i,continue:!r.abort})}}),rv=de("$ZodNumber",(i,r)=>{mt.init(i,r),i._zod.pattern=i._zod.bag.pattern??Qp,i._zod.parse=(a,o)=>{if(r.coerce)try{a.value=Number(a.value)}catch{}const v=a.value;if(typeof v=="number"&&!Number.isNaN(v)&&Number.isFinite(v))return a;const w=typeof v=="number"?Number.isNaN(v)?"NaN":Number.isFinite(v)?void 0:"Infinity":void 0;return a.issues.push({expected:"number",code:"invalid_type",input:v,inst:i,...w?{received:w}:{}}),a}}),_x=de("$ZodNumberFormat",(i,r)=>{O1.init(i,r),rv.init(i,r)}),px=de("$ZodBoolean",(i,r)=>{mt.init(i,r),i._zod.pattern=A1,i._zod.parse=(a,o)=>{if(r.coerce)try{a.value=!!a.value}catch{}const v=a.value;return typeof v=="boolean"||a.issues.push({expected:"boolean",code:"invalid_type",input:v,inst:i}),a}}),vx=de("$ZodUnknown",(i,r)=>{mt.init(i,r),i._zod.parse=a=>a}),gx=de("$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 O_(i,r,a){i.issues.length&&r.issues.push(...sn(a,i.issues)),r.value[a]=i.value}const yx=de("$ZodArray",(i,r)=>{mt.init(i,r),i._zod.parse=(a,o)=>{const v=a.value;if(!Array.isArray(v))return a.issues.push({expected:"array",code:"invalid_type",input:v,inst:i}),a;a.value=Array(v.length);const w=[];for(let A=0;A<v.length;A++){const l=v[A],h=r.element._zod.run({value:l,issues:[]},o);h instanceof Promise?w.push(h.then(u=>O_(u,a,A))):O_(h,a,A)}return w.length?Promise.all(w).then(()=>a):a}});function nl(i,r,a,o,v){if(i.issues.length){if(v&&!(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 nv(i){var o,v,w,A;const r=Object.keys(i.shape);for(const l of r)if(!((A=(w=(v=(o=i.shape)==null?void 0:o[l])==null?void 0:v._zod)==null?void 0:w.traits)!=null&&A.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const a=Hb(i.shape);return{...i,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(a)}}function av(i,r,a,o,v,w){const A=[],l=v.keySet,h=v.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 b=h.run({value:r[d],issues:[]},o);b instanceof Promise?i.push(b.then(C=>nl(C,a,d,r,y))):nl(b,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 Sx=de("$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=dh(()=>nv(r));We(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 v=rl,w=r.catchall;let A;i._zod.parse=(l,h)=>{A??(A=o.value);const u=l.value;if(!v(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:i}),l;l.value={};const y=[],d=A.shape;for(const b of A.keys){const C=d[b],k=C._zod.optout==="optional",x=C._zod.run({value:u[b],issues:[]},h);x instanceof Promise?y.push(x.then(m=>nl(m,l,b,u,k))):nl(x,l,b,u,k)}return w?av(y,u,l,h,o.value,i):y.length?Promise.all(y).then(()=>l):l}}),bx=de("$ZodObjectJIT",(i,r)=>{Sx.init(i,r);const a=i._zod.parse,o=dh(()=>nv(r)),v=b=>{var p;const C=new $1(["shape","payload","ctx"]),k=o.value,x=S=>{const R=D_(S);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};C.write("const input = payload.value;");const m=Object.create(null);let g=0;for(const S of k.keys)m[S]=`key_${g++}`;C.write("const newResult = {};");for(const S of k.keys){const R=m[S],D=D_(S),M=b[S],T=((p=M==null?void 0:M._zod)==null?void 0:p.optout)==="optional";C.write(`const ${R} = ${x(S)};`),T?C.write(`
|
|
238
|
+
if (${R}.issues.length) {
|
|
239
|
+
if (${D} in input) {
|
|
240
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
241
|
+
...iss,
|
|
242
|
+
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
243
|
+
})));
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (${R}.value === undefined) {
|
|
248
|
+
if (${D} in input) {
|
|
249
|
+
newResult[${D}] = undefined;
|
|
250
|
+
}
|
|
251
|
+
} else {
|
|
252
|
+
newResult[${D}] = ${R}.value;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
`):C.write(`
|
|
256
|
+
if (${R}.issues.length) {
|
|
257
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
258
|
+
...iss,
|
|
259
|
+
path: iss.path ? [${D}, ...iss.path] : [${D}]
|
|
260
|
+
})));
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
if (${R}.value === undefined) {
|
|
264
|
+
if (${D} in input) {
|
|
265
|
+
newResult[${D}] = undefined;
|
|
266
|
+
}
|
|
267
|
+
} else {
|
|
268
|
+
newResult[${D}] = ${R}.value;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
`)}C.write("payload.value = newResult;"),C.write("return payload;");const f=C.compile();return(S,R)=>f(b,S,R)};let w;const A=rl,l=!Fp.jitless,u=l&&jb.value,y=r.catchall;let d;i._zod.parse=(b,C)=>{d??(d=o.value);const k=b.value;return A(k)?l&&u&&(C==null?void 0:C.async)===!1&&C.jitless!==!0?(w||(w=v(r.shape)),b=w(b,C),y?av([],k,b,C,d,i):b):a(b,C):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:i}),b)}});function M_(i,r,a,o){for(const w of i)if(w.issues.length===0)return r.value=w.value,r;const v=i.filter(w=>!tn(w));return v.length===1?(r.value=v[0].value,v[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:a,errors:i.map(w=>w.issues.map(A=>Vs(A,o,Ws())))}),r)}const xx=de("$ZodUnion",(i,r)=>{mt.init(i,r),We(i._zod,"optin",()=>r.options.some(v=>v._zod.optin==="optional")?"optional":void 0),We(i._zod,"optout",()=>r.options.some(v=>v._zod.optout==="optional")?"optional":void 0),We(i._zod,"values",()=>{if(r.options.every(v=>v._zod.values))return new Set(r.options.flatMap(v=>Array.from(v._zod.values)))}),We(i._zod,"pattern",()=>{if(r.options.every(v=>v._zod.pattern)){const v=r.options.map(w=>w._zod.pattern);return new RegExp(`^(${v.map(w=>_h(w.source)).join("|")})$`)}});const a=r.options.length===1,o=r.options[0]._zod.run;i._zod.parse=(v,w)=>{if(a)return o(v,w);let A=!1;const l=[];for(const h of r.options){const u=h._zod.run({value:v.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=>M_(h,v,i,w)):M_(l,v,i,w)}}),Cx=de("$ZodIntersection",(i,r)=>{mt.init(i,r),i._zod.parse=(a,o)=>{const v=a.value,w=r.left._zod.run({value:v,issues:[]},o),A=r.right._zod.run({value:v,issues:[]},o);return w instanceof Promise||A instanceof Promise?Promise.all([w,A]).then(([h,u])=>L_(a,h,u)):L_(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),v={...i,...r};for(const w of o){const A=th(i[w],r[w]);if(!A.valid)return{valid:!1,mergeErrorPath:[w,...A.mergeErrorPath]};v[w]=A.data}return{valid:!0,data:v}}if(Array.isArray(i)&&Array.isArray(r)){if(i.length!==r.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let o=0;o<i.length;o++){const v=i[o],w=r[o],A=th(v,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 L_(i,r,a){const o=new Map;let v;for(const l of r.issues)if(l.code==="unrecognized_keys"){v??(v=l);for(const 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&&v&&i.issues.push({...v,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 wx=de("$ZodRecord",(i,r)=>{mt.init(i,r),i._zod.parse=(a,o)=>{const v=a.value;if(!nn(v))return a.issues.push({expected:"record",code:"invalid_type",input:v,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:v[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 v)l.has(u)||(h=h??[],h.push(u));h&&h.length>0&&a.issues.push({code:"unrecognized_keys",input:v,inst:i,keys:h})}else{a.value={};for(const l of Reflect.ownKeys(v)){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"&&Qp.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]=v[l]:a.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(d=>Vs(d,o,Ws())),input:l,path:[l],inst:i});continue}const y=r.valueType._zod.run({value:v[l],issues:[]},o);y instanceof Promise?w.push(y.then(d=>{d.issues.length&&a.issues.push(...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}}),Ex=de("$ZodEnum",(i,r)=>{mt.init(i,r);const a=Zp(r.entries),o=new Set(a);i._zod.values=o,i._zod.pattern=new RegExp(`^(${a.filter(v=>zb.has(typeof v)).map(v=>typeof v=="string"?ml(v):v.toString()).join("|")})$`),i._zod.parse=(v,w)=>{const A=v.value;return o.has(A)||v.issues.push({code:"invalid_value",values:a,input:A,inst:i}),v}}),Tx=de("$ZodTransform",(i,r)=>{mt.init(i,r),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new $p(i.constructor.name);const v=r.transform(a.value,a);if(o.async)return(v instanceof Promise?v:Promise.resolve(v)).then(A=>(a.value=A,a));if(v instanceof Promise)throw new rn;return a.value=v,a}});function N_(i,r){return i.issues.length&&r===void 0?{issues:[],value:void 0}:i}const ov=de("$ZodOptional",(i,r)=>{mt.init(i,r),i._zod.optin="optional",i._zod.optout="optional",We(i._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),We(i._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${_h(a.source)})?$`):void 0}),i._zod.parse=(a,o)=>{if(r.innerType._zod.optin==="optional"){const v=r.innerType._zod.run(a,o);return v instanceof Promise?v.then(w=>N_(w,a.value)):N_(v,a.value)}return a.value===void 0?a:r.innerType._zod.run(a,o)}}),Ax=de("$ZodExactOptional",(i,r)=>{ov.init(i,r),We(i._zod,"values",()=>r.innerType._zod.values),We(i._zod,"pattern",()=>r.innerType._zod.pattern),i._zod.parse=(a,o)=>r.innerType._zod.run(a,o)}),Rx=de("$ZodNullable",(i,r)=>{mt.init(i,r),We(i._zod,"optin",()=>r.innerType._zod.optin),We(i._zod,"optout",()=>r.innerType._zod.optout),We(i._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${_h(a.source)}|null)$`):void 0}),We(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)}),Dx=de("$ZodDefault",(i,r)=>{mt.init(i,r),i._zod.optin="optional",We(i._zod,"values",()=>r.innerType._zod.values),i._zod.parse=(a,o)=>{if(o.direction==="backward")return r.innerType._zod.run(a,o);if(a.value===void 0)return a.value=r.defaultValue,a;const v=r.innerType._zod.run(a,o);return v instanceof Promise?v.then(w=>B_(w,r)):B_(v,r)}});function B_(i,r){return i.value===void 0&&(i.value=r.defaultValue),i}const kx=de("$ZodPrefault",(i,r)=>{mt.init(i,r),i._zod.optin="optional",We(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))}),Ox=de("$ZodNonOptional",(i,r)=>{mt.init(i,r),We(i._zod,"values",()=>{const a=r.innerType._zod.values;return a?new Set([...a].filter(o=>o!==void 0)):void 0}),i._zod.parse=(a,o)=>{const v=r.innerType._zod.run(a,o);return v instanceof Promise?v.then(w=>j_(w,i)):j_(v,i)}});function j_(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 Mx=de("$ZodCatch",(i,r)=>{mt.init(i,r),We(i._zod,"optin",()=>r.innerType._zod.optin),We(i._zod,"optout",()=>r.innerType._zod.optout),We(i._zod,"values",()=>r.innerType._zod.values),i._zod.parse=(a,o)=>{if(o.direction==="backward")return r.innerType._zod.run(a,o);const v=r.innerType._zod.run(a,o);return v instanceof Promise?v.then(w=>(a.value=w.value,w.issues.length&&(a.value=r.catchValue({...a,error:{issues:w.issues.map(A=>Vs(A,o,Ws()))},input:a.value}),a.issues=[]),a)):(a.value=v.value,v.issues.length&&(a.value=r.catchValue({...a,error:{issues:v.issues.map(w=>Vs(w,o,Ws()))},input:a.value}),a.issues=[]),a)}}),Lx=de("$ZodPipe",(i,r)=>{mt.init(i,r),We(i._zod,"values",()=>r.in._zod.values),We(i._zod,"optin",()=>r.in._zod.optin),We(i._zod,"optout",()=>r.out._zod.optout),We(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 v=r.in._zod.run(a,o);return v instanceof Promise?v.then(w=>Go(w,r.out,o)):Go(v,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 Nx=de("$ZodReadonly",(i,r)=>{mt.init(i,r),We(i._zod,"propValues",()=>r.innerType._zod.propValues),We(i._zod,"values",()=>r.innerType._zod.values),We(i._zod,"optin",()=>{var a,o;return(o=(a=r.innerType)==null?void 0:a._zod)==null?void 0:o.optin}),We(i._zod,"optout",()=>{var a,o;return(o=(a=r.innerType)==null?void 0:a._zod)==null?void 0:o.optout}),i._zod.parse=(a,o)=>{if(o.direction==="backward")return r.innerType._zod.run(a,o);const v=r.innerType._zod.run(a,o);return v instanceof Promise?v.then(z_):z_(v)}});function z_(i){return i.value=Object.freeze(i.value),i}const Bx=de("$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,v=r.fn(o);if(v instanceof Promise)return v.then(w=>H_(w,a,o,i));H_(v,a,o,i)}});function H_(i,r,a,o){if(!i){const v={code:"custom",input:a,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(v.params=o._zod.def.params),r.issues.push(Sa(v))}}var U_;class jx{constructor(){this._map=new WeakMap,this._idmap=new Map}add(r,...a){const o=a[0];return this._map.set(r,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,r),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(r){const a=this._map.get(r);return a&&typeof a=="object"&&"id"in a&&this._idmap.delete(a.id),this._map.delete(r),this}get(r){const a=r._zod.parent;if(a){const o={...this.get(a)??{}};delete o.id;const v={...o,...this._map.get(r)};return Object.keys(v).length?v:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function zx(){return new jx}(U_=globalThis).__zod_globalRegistry??(U_.__zod_globalRegistry=zx());const ga=globalThis.__zod_globalRegistry;function Hx(i,r){return new i({type:"string",...Ce(r)})}function Ux(i,r){return new i({type:"string",format:"email",check:"string_format",abort:!1,...Ce(r)})}function I_(i,r){return new i({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(r)})}function Ix(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(r)})}function Px(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(r)})}function $x(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(r)})}function Fx(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(r)})}function Zx(i,r){return new i({type:"string",format:"url",check:"string_format",abort:!1,...Ce(r)})}function qx(i,r){return new i({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(r)})}function Gx(i,r){return new i({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(r)})}function Kx(i,r){return new i({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(r)})}function Wx(i,r){return new i({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(r)})}function Vx(i,r){return new i({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(r)})}function Yx(i,r){return new i({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(r)})}function Xx(i,r){return new i({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(r)})}function Jx(i,r){return new i({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(r)})}function Qx(i,r){return new i({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(r)})}function eC(i,r){return new i({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(r)})}function tC(i,r){return new i({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(r)})}function iC(i,r){return new i({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(r)})}function sC(i,r){return new i({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(r)})}function rC(i,r){return new i({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(r)})}function nC(i,r){return new i({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(r)})}function aC(i,r){return new i({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(r)})}function oC(i,r){return new i({type:"string",format:"date",check:"string_format",...Ce(r)})}function lC(i,r){return new i({type:"string",format:"time",check:"string_format",precision:null,...Ce(r)})}function cC(i,r){return new i({type:"string",format:"duration",check:"string_format",...Ce(r)})}function uC(i,r){return new i({type:"number",checks:[],...Ce(r)})}function hC(i,r){return new i({type:"number",check:"number_format",abort:!1,format:"safeint",...Ce(r)})}function fC(i,r){return new i({type:"boolean",...Ce(r)})}function dC(i){return new i({type:"unknown"})}function mC(i,r){return new i({type:"never",...Ce(r)})}function P_(i,r){return new tv({check:"less_than",...Ce(r),value:i,inclusive:!1})}function zu(i,r){return new tv({check:"less_than",...Ce(r),value:i,inclusive:!0})}function $_(i,r){return new iv({check:"greater_than",...Ce(r),value:i,inclusive:!1})}function Hu(i,r){return new iv({check:"greater_than",...Ce(r),value:i,inclusive:!0})}function F_(i,r){return new k1({check:"multiple_of",...Ce(r),value:i})}function lv(i,r){return new M1({check:"max_length",...Ce(r),maximum:i})}function al(i,r){return new L1({check:"min_length",...Ce(r),minimum:i})}function cv(i,r){return new N1({check:"length_equals",...Ce(r),length:i})}function _C(i,r){return new B1({check:"string_format",format:"regex",...Ce(r),pattern:i})}function pC(i){return new j1({check:"string_format",format:"lowercase",...Ce(i)})}function vC(i){return new z1({check:"string_format",format:"uppercase",...Ce(i)})}function gC(i,r){return new H1({check:"string_format",format:"includes",...Ce(r),includes:i})}function yC(i,r){return new U1({check:"string_format",format:"starts_with",...Ce(r),prefix:i})}function SC(i,r){return new I1({check:"string_format",format:"ends_with",...Ce(r),suffix:i})}function cn(i){return new P1({check:"overwrite",tx:i})}function bC(i){return cn(r=>r.normalize(i))}function xC(){return cn(i=>i.trim())}function CC(){return cn(i=>i.toLowerCase())}function wC(){return cn(i=>i.toUpperCase())}function EC(){return cn(i=>Bb(i))}function TC(i,r,a){return new i({type:"array",element:r,...Ce(a)})}function AC(i,r,a){return new i({type:"custom",check:"custom",fn:r,...Ce(a)})}function RC(i){const r=DC(a=>(a.addIssue=o=>{if(typeof o=="string")a.issues.push(Sa(o,a.value,r._zod.def));else{const v=o;v.fatal&&(v.continue=!1),v.code??(v.code="custom"),v.input??(v.input=a.value),v.inst??(v.inst=r),v.continue??(v.continue=!r._zod.def.abort),a.issues.push(Sa(v))}},i(a.value,a)));return r}function DC(i,r){const a=new ni({check:"custom",...Ce(r)});return a._zod.check=i,a}function uv(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)??ga,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 v=i._zod.def,w=r.seen.get(i);if(w)return w.count++,a.schemaPath.includes(i)&&(w.cycle=a.path),w.schema;const 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 b={...a,schemaPath:[...a.schemaPath,i],path:a.path};if(i._zod.processJSONSchema)i._zod.processJSONSchema(r,A.schema,b);else{const k=A.schema,x=r.processors[v.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${v.type}`);x(i,r,k,b)}const C=i._zod.parent;C&&(A.ref||(A.ref=C),Tt(C,r,b),r.seen.get(C).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 hv(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 b=o.get(d);if(b&&b!==y[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(d,y[0])}}const v=y=>{var x;const d=i.target==="draft-2020-12"?"$defs":"definitions";if(i.external){const m=(x=i.external.registry.get(y[0]))==null?void 0:x.id,g=i.external.uri??(p=>p);if(m)return{ref:g(m)};const f=y[1].defId??y[1].schema.id??`schema${i.counter++}`;return y[1].defId=f,{defId:f,ref:`${g("__shared")}#/${d}/${f}`}}if(y[1]===a)return{ref:"#"};const C=`#/${d}/`,k=y[1].schema.id??`__schema${i.counter++}`;return{defId:k,ref:C+k}},w=y=>{if(y[1].schema.$ref)return;const d=y[1],{ref:b,defId:C}=v(y);d.def={...d.schema},C&&(d.defId=C);const k=d.schema;for(const x in k)delete k[x];k.$ref=b};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>
|
|
272
|
+
|
|
273
|
+
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 C=(h=i.external.registry.get(y[0]))==null?void 0:h.id;if(r!==y[0]&&C){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 fv(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,b={...d},C=y.ref;if(y.ref=null,C){o(C);const x=i.seen.get(C),m=x.schema;if(m.$ref&&(i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(m)):Object.assign(d,m),Object.assign(d,b),u._zod.parent===C)for(const f in d)f==="$ref"||f==="allOf"||f in b||delete d[f];if(m.$ref&&x.def)for(const f in d)f==="$ref"||f==="allOf"||f in x.def&&JSON.stringify(d[f])===JSON.stringify(x.def[f])&&delete d[f]}const k=u._zod.parent;if(k&&k!==C){o(k);const x=i.seen.get(k);if(x!=null&&x.schema.$ref&&(d.$ref=x.schema.$ref,x.def))for(const m in d)m==="$ref"||m==="allOf"||m in x.def&&JSON.stringify(d[m])===JSON.stringify(x.def[m])&&delete d[m]}i.override({zodSchema:u,jsonSchema:d,path:y.path??[]})};for(const u of[...i.seen.entries()].reverse())o(u[0]);const v={};if(i.target==="draft-2020-12"?v.$schema="https://json-schema.org/draft/2020-12/schema":i.target==="draft-07"?v.$schema="http://json-schema.org/draft-07/schema#":i.target==="draft-04"?v.$schema="http://json-schema.org/draft-04/schema#":i.target,(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");v.$id=i.external.uri(u)}Object.assign(v,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"?v.$defs=w:v.definitions=w);try{const u=JSON.parse(JSON.stringify(v));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 v in o.shape)if(Kt(o.shape[v],a))return!0;return!1}if(o.type==="union"){for(const v of o.options)if(Kt(v,a))return!0;return!1}if(o.type==="tuple"){for(const v of o.items)if(Kt(v,a))return!0;return!!(o.rest&&Kt(o.rest,a))}return!1}const kC=(i,r={})=>a=>{const o=uv({...a,processors:r});return Tt(i,o),hv(o,i),fv(o,i)},ol=(i,r,a={})=>o=>{const{libraryOptions:v,target:w}=o??{},A=uv({...v??{},target:w,io:r,processors:a});return Tt(i,A),hv(A,i),fv(A,i)},OC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},MC=(i,r,a,o)=>{const v=a;v.type="string";const{minimum:w,maximum:A,format:l,patterns:h,contentEncoding:u}=i._zod.bag;if(typeof w=="number"&&(v.minLength=w),typeof A=="number"&&(v.maxLength=A),l&&(v.format=OC[l]??l,v.format===""&&delete v.format,l==="time"&&delete v.format),u&&(v.contentEncoding=u),h&&h.size>0){const y=[...h];y.length===1?v.pattern=y[0].source:y.length>1&&(v.allOf=[...y.map(d=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},LC=(i,r,a,o)=>{const v=a,{minimum:w,maximum:A,format:l,multipleOf:h,exclusiveMaximum:u,exclusiveMinimum:y}=i._zod.bag;typeof l=="string"&&l.includes("int")?v.type="integer":v.type="number",typeof y=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(v.minimum=y,v.exclusiveMinimum=!0):v.exclusiveMinimum=y),typeof w=="number"&&(v.minimum=w,typeof y=="number"&&r.target!=="draft-04"&&(y>=w?delete v.minimum:delete v.exclusiveMinimum)),typeof u=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(v.maximum=u,v.exclusiveMaximum=!0):v.exclusiveMaximum=u),typeof A=="number"&&(v.maximum=A,typeof u=="number"&&r.target!=="draft-04"&&(u<=A?delete v.maximum:delete v.exclusiveMaximum)),typeof h=="number"&&(v.multipleOf=h)},NC=(i,r,a,o)=>{a.type="boolean"},BC=(i,r,a,o)=>{a.not={}},jC=(i,r,a,o)=>{},zC=(i,r,a,o)=>{const v=i._zod.def,w=Zp(v.entries);w.every(A=>typeof A=="number")&&(a.type="number"),w.every(A=>typeof A=="string")&&(a.type="string"),a.enum=w},HC=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},UC=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},IC=(i,r,a,o)=>{const v=a,w=i._zod.def,{minimum:A,maximum:l}=i._zod.bag;typeof A=="number"&&(v.minItems=A),typeof l=="number"&&(v.maxItems=l),v.type="array",v.items=Tt(w.element,r,{...o,path:[...o.path,"items"]})},PC=(i,r,a,o)=>{var u;const v=a,w=i._zod.def;v.type="object",v.properties={};const A=w.shape;for(const y in A)v.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&&(v.required=Array.from(h)),((u=w.catchall)==null?void 0:u._zod.def.type)==="never"?v.additionalProperties=!1:w.catchall?w.catchall&&(v.additionalProperties=Tt(w.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(v.additionalProperties=!1)},$C=(i,r,a,o)=>{const v=i._zod.def,w=v.inclusive===!1,A=v.options.map((l,h)=>Tt(l,r,{...o,path:[...o.path,w?"oneOf":"anyOf",h]}));w?a.oneOf=A:a.anyOf=A},FC=(i,r,a,o)=>{const v=i._zod.def,w=Tt(v.left,r,{...o,path:[...o.path,"allOf",0]}),A=Tt(v.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},ZC=(i,r,a,o)=>{const v=a,w=i._zod.def;v.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","*"]});v.patternProperties={};for(const d of h)v.patternProperties[d.source]=y}else(r.target==="draft-07"||r.target==="draft-2020-12")&&(v.propertyNames=Tt(w.keyType,r,{...o,path:[...o.path,"propertyNames"]})),v.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&&(v.required=y)}},qC=(i,r,a,o)=>{const v=i._zod.def,w=Tt(v.innerType,r,o),A=r.seen.get(i);r.target==="openapi-3.0"?(A.ref=v.innerType,a.nullable=!0):a.anyOf=[w,{type:"null"}]},GC=(i,r,a,o)=>{const v=i._zod.def;Tt(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType},KC=(i,r,a,o)=>{const v=i._zod.def;Tt(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType,a.default=JSON.parse(JSON.stringify(v.defaultValue))},WC=(i,r,a,o)=>{const v=i._zod.def;Tt(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType,r.io==="input"&&(a._prefault=JSON.parse(JSON.stringify(v.defaultValue)))},VC=(i,r,a,o)=>{const v=i._zod.def;Tt(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType;let A;try{A=v.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}a.default=A},YC=(i,r,a,o)=>{const v=i._zod.def,w=r.io==="input"?v.in._zod.def.type==="transform"?v.out:v.in:v.out;Tt(w,r,o);const A=r.seen.get(i);A.ref=w},XC=(i,r,a,o)=>{const v=i._zod.def;Tt(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType,a.readOnly=!0},dv=(i,r,a,o)=>{const v=i._zod.def;Tt(v.innerType,r,o);const w=r.seen.get(i);w.ref=v.innerType},JC=de("ZodISODateTime",(i,r)=>{tx.init(i,r),ct.init(i,r)});function QC(i){return aC(JC,i)}const ew=de("ZodISODate",(i,r)=>{ix.init(i,r),ct.init(i,r)});function tw(i){return oC(ew,i)}const iw=de("ZodISOTime",(i,r)=>{sx.init(i,r),ct.init(i,r)});function sw(i){return lC(iw,i)}const rw=de("ZodISODuration",(i,r)=>{rx.init(i,r),ct.init(i,r)});function nw(i){return cC(rw,i)}const aw=(i,r)=>{Wp.init(i,r),i.name="ZodError",Object.defineProperties(i,{format:{value:a=>Wb(i,a)},flatten:{value:a=>Kb(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=de("ZodError",aw,{Parent:Error}),ow=vh(Mi),lw=gh(Mi),cw=_l(Mi),uw=pl(Mi),hw=Xb(Mi),fw=Jb(Mi),dw=Qb(Mi),mw=e1(Mi),_w=t1(Mi),pw=i1(Mi),vw=s1(Mi),gw=r1(Mi),_t=de("ZodType",(i,r)=>(mt.init(i,r),Object.assign(i["~standard"],{jsonSchema:{input:ol(i,"input"),output:ol(i,"output")}}),i.toJSONSchema=kC(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)=>ow(i,a,o,{callee:i.parse}),i.safeParse=(a,o)=>cw(i,a,o),i.parseAsync=async(a,o)=>lw(i,a,o,{callee:i.parseAsync}),i.safeParseAsync=async(a,o)=>uw(i,a,o),i.spa=i.safeParseAsync,i.encode=(a,o)=>hw(i,a,o),i.decode=(a,o)=>fw(i,a,o),i.encodeAsync=async(a,o)=>dw(i,a,o),i.decodeAsync=async(a,o)=>mw(i,a,o),i.safeEncode=(a,o)=>_w(i,a,o),i.safeDecode=(a,o)=>pw(i,a,o),i.safeEncodeAsync=async(a,o)=>vw(i,a,o),i.safeDecodeAsync=async(a,o)=>gw(i,a,o),i.refine=(a,o)=>i.check(h2(a,o)),i.superRefine=a=>i.check(f2(a)),i.overwrite=a=>i.check(cn(a)),i.optional=()=>G_(i),i.exactOptional=()=>Jw(i),i.nullable=()=>K_(i),i.nullish=()=>G_(K_(i)),i.nonoptional=a=>r2(i,a),i.array=()=>Ea(i),i.or=a=>qw([i,a]),i.and=a=>Kw(i,a),i.transform=a=>W_(i,Yw(a)),i.default=a=>t2(i,a),i.prefault=a=>s2(i,a),i.catch=a=>a2(i,a),i.pipe=a=>W_(i,a),i.readonly=()=>c2(i),i.describe=a=>{const o=i.clone();return ga.add(o,{description:a}),o},Object.defineProperty(i,"description",{get(){var a;return(a=ga.get(i))==null?void 0:a.description},configurable:!0}),i.meta=(...a)=>{if(a.length===0)return ga.get(i);const o=i.clone();return ga.add(o,a[0]),o},i.isOptional=()=>i.safeParse(void 0).success,i.isNullable=()=>i.safeParse(null).success,i.apply=a=>a(i),i)),mv=de("_ZodString",(i,r)=>{yh.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(o,v,w)=>MC(i,o,v);const a=i._zod.bag;i.format=a.format??null,i.minLength=a.minimum??null,i.maxLength=a.maximum??null,i.regex=(...o)=>i.check(_C(...o)),i.includes=(...o)=>i.check(gC(...o)),i.startsWith=(...o)=>i.check(yC(...o)),i.endsWith=(...o)=>i.check(SC(...o)),i.min=(...o)=>i.check(al(...o)),i.max=(...o)=>i.check(lv(...o)),i.length=(...o)=>i.check(cv(...o)),i.nonempty=(...o)=>i.check(al(1,...o)),i.lowercase=o=>i.check(pC(o)),i.uppercase=o=>i.check(vC(o)),i.trim=()=>i.check(xC()),i.normalize=(...o)=>i.check(bC(...o)),i.toLowerCase=()=>i.check(CC()),i.toUpperCase=()=>i.check(wC()),i.slugify=()=>i.check(EC())}),yw=de("ZodString",(i,r)=>{yh.init(i,r),mv.init(i,r),i.email=a=>i.check(Ux(Sw,a)),i.url=a=>i.check(Zx(bw,a)),i.jwt=a=>i.check(nC(jw,a)),i.emoji=a=>i.check(qx(xw,a)),i.guid=a=>i.check(I_(Z_,a)),i.uuid=a=>i.check(Ix(Ko,a)),i.uuidv4=a=>i.check(Px(Ko,a)),i.uuidv6=a=>i.check($x(Ko,a)),i.uuidv7=a=>i.check(Fx(Ko,a)),i.nanoid=a=>i.check(Gx(Cw,a)),i.guid=a=>i.check(I_(Z_,a)),i.cuid=a=>i.check(Kx(ww,a)),i.cuid2=a=>i.check(Wx(Ew,a)),i.ulid=a=>i.check(Vx(Tw,a)),i.base64=a=>i.check(iC(Lw,a)),i.base64url=a=>i.check(sC(Nw,a)),i.xid=a=>i.check(Yx(Aw,a)),i.ksuid=a=>i.check(Xx(Rw,a)),i.ipv4=a=>i.check(Jx(Dw,a)),i.ipv6=a=>i.check(Qx(kw,a)),i.cidrv4=a=>i.check(eC(Ow,a)),i.cidrv6=a=>i.check(tC(Mw,a)),i.e164=a=>i.check(rC(Bw,a)),i.datetime=a=>i.check(QC(a)),i.date=a=>i.check(tw(a)),i.time=a=>i.check(sw(a)),i.duration=a=>i.check(nw(a))});function Le(i){return Hx(yw,i)}const ct=de("ZodStringFormat",(i,r)=>{nt.init(i,r),mv.init(i,r)}),Sw=de("ZodEmail",(i,r)=>{G1.init(i,r),ct.init(i,r)}),Z_=de("ZodGUID",(i,r)=>{Z1.init(i,r),ct.init(i,r)}),Ko=de("ZodUUID",(i,r)=>{q1.init(i,r),ct.init(i,r)}),bw=de("ZodURL",(i,r)=>{K1.init(i,r),ct.init(i,r)}),xw=de("ZodEmoji",(i,r)=>{W1.init(i,r),ct.init(i,r)}),Cw=de("ZodNanoID",(i,r)=>{V1.init(i,r),ct.init(i,r)}),ww=de("ZodCUID",(i,r)=>{Y1.init(i,r),ct.init(i,r)}),Ew=de("ZodCUID2",(i,r)=>{X1.init(i,r),ct.init(i,r)}),Tw=de("ZodULID",(i,r)=>{J1.init(i,r),ct.init(i,r)}),Aw=de("ZodXID",(i,r)=>{Q1.init(i,r),ct.init(i,r)}),Rw=de("ZodKSUID",(i,r)=>{ex.init(i,r),ct.init(i,r)}),Dw=de("ZodIPv4",(i,r)=>{nx.init(i,r),ct.init(i,r)}),kw=de("ZodIPv6",(i,r)=>{ax.init(i,r),ct.init(i,r)}),Ow=de("ZodCIDRv4",(i,r)=>{ox.init(i,r),ct.init(i,r)}),Mw=de("ZodCIDRv6",(i,r)=>{lx.init(i,r),ct.init(i,r)}),Lw=de("ZodBase64",(i,r)=>{cx.init(i,r),ct.init(i,r)}),Nw=de("ZodBase64URL",(i,r)=>{hx.init(i,r),ct.init(i,r)}),Bw=de("ZodE164",(i,r)=>{fx.init(i,r),ct.init(i,r)}),jw=de("ZodJWT",(i,r)=>{mx.init(i,r),ct.init(i,r)}),_v=de("ZodNumber",(i,r)=>{rv.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(o,v,w)=>LC(i,o,v),i.gt=(o,v)=>i.check($_(o,v)),i.gte=(o,v)=>i.check(Hu(o,v)),i.min=(o,v)=>i.check(Hu(o,v)),i.lt=(o,v)=>i.check(P_(o,v)),i.lte=(o,v)=>i.check(zu(o,v)),i.max=(o,v)=>i.check(zu(o,v)),i.int=o=>i.check(q_(o)),i.safe=o=>i.check(q_(o)),i.positive=o=>i.check($_(0,o)),i.nonnegative=o=>i.check(Hu(0,o)),i.negative=o=>i.check(P_(0,o)),i.nonpositive=o=>i.check(zu(0,o)),i.multipleOf=(o,v)=>i.check(F_(o,v)),i.step=(o,v)=>i.check(F_(o,v)),i.finite=()=>i;const a=i._zod.bag;i.minValue=Math.max(a.minimum??Number.NEGATIVE_INFINITY,a.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,i.maxValue=Math.min(a.maximum??Number.POSITIVE_INFINITY,a.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,i.isInt=(a.format??"").includes("int")||Number.isSafeInteger(a.multipleOf??.5),i.isFinite=!0,i.format=a.format??null});function De(i){return uC(_v,i)}const zw=de("ZodNumberFormat",(i,r)=>{_x.init(i,r),_v.init(i,r)});function q_(i){return hC(zw,i)}const Hw=de("ZodBoolean",(i,r)=>{px.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>NC(i,a,o)});function ys(i){return fC(Hw,i)}const Uw=de("ZodUnknown",(i,r)=>{vx.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>jC()});function ll(){return dC(Uw)}const Iw=de("ZodNever",(i,r)=>{gx.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>BC(i,a,o)});function Pw(i){return mC(Iw,i)}const $w=de("ZodArray",(i,r)=>{yx.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>IC(i,a,o,v),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(lv(a,o)),i.length=(a,o)=>i.check(cv(a,o)),i.unwrap=()=>i.element});function Ea(i,r){return TC($w,i,r)}const Fw=de("ZodObject",(i,r)=>{bx.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>PC(i,a,o,v),We(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:Pw()}),i.strip=()=>i.clone({...i._zod.def,catchall:void 0}),i.extend=a=>$b(i,a),i.safeExtend=a=>Fb(i,a),i.merge=a=>Zb(i,a),i.pick=a=>Ib(i,a),i.omit=a=>Pb(i,a),i.partial=(...a)=>qb(pv,i,a[0]),i.required=(...a)=>Gb(vv,i,a[0])});function At(i,r){const a={type:"object",shape:i??{},...Ce(r)};return new Fw(a)}const Zw=de("ZodUnion",(i,r)=>{xx.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>$C(i,a,o,v),i.options=r.options});function qw(i,r){return new Zw({type:"union",options:i,...Ce(r)})}const Gw=de("ZodIntersection",(i,r)=>{Cx.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>FC(i,a,o,v)});function Kw(i,r){return new Gw({type:"intersection",left:i,right:r})}const Ww=de("ZodRecord",(i,r)=>{wx.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>ZC(i,a,o,v),i.keyType=r.keyType,i.valueType=r.valueType});function gl(i,r,a){return new Ww({type:"record",keyType:i,valueType:r,...Ce(a)})}const ih=de("ZodEnum",(i,r)=>{Ex.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(o,v,w)=>zC(i,o,v),i.enum=r.entries,i.options=Object.values(r.entries);const a=new Set(Object.keys(r.entries));i.extract=(o,v)=>{const w={};for(const 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:[],...Ce(v),entries:w})},i.exclude=(o,v)=>{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:[],...Ce(v),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,...Ce(r)})}const Vw=de("ZodTransform",(i,r)=>{Tx.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>UC(i,a),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new $p(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 v=r.transform(a.value,a);return v instanceof Promise?v.then(w=>(a.value=w,a)):(a.value=v,a)}});function Yw(i){return new Vw({type:"transform",transform:i})}const pv=de("ZodOptional",(i,r)=>{ov.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>dv(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function G_(i){return new pv({type:"optional",innerType:i})}const Xw=de("ZodExactOptional",(i,r)=>{Ax.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>dv(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function Jw(i){return new Xw({type:"optional",innerType:i})}const Qw=de("ZodNullable",(i,r)=>{Rx.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>qC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function K_(i){return new Qw({type:"nullable",innerType:i})}const e2=de("ZodDefault",(i,r)=>{Dx.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>KC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType,i.removeDefault=i.unwrap});function t2(i,r){return new e2({type:"default",innerType:i,get defaultValue(){return typeof r=="function"?r():Gp(r)}})}const i2=de("ZodPrefault",(i,r)=>{kx.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>WC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function s2(i,r){return new i2({type:"prefault",innerType:i,get defaultValue(){return typeof r=="function"?r():Gp(r)}})}const vv=de("ZodNonOptional",(i,r)=>{Ox.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>GC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function r2(i,r){return new vv({type:"nonoptional",innerType:i,...Ce(r)})}const n2=de("ZodCatch",(i,r)=>{Mx.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>VC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType,i.removeCatch=i.unwrap});function a2(i,r){return new n2({type:"catch",innerType:i,catchValue:typeof r=="function"?r:()=>r})}const o2=de("ZodPipe",(i,r)=>{Lx.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>YC(i,a,o,v),i.in=r.in,i.out=r.out});function W_(i,r){return new o2({type:"pipe",in:i,out:r})}const l2=de("ZodReadonly",(i,r)=>{Nx.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>XC(i,a,o,v),i.unwrap=()=>i._zod.def.innerType});function c2(i){return new l2({type:"readonly",innerType:i})}const u2=de("ZodCustom",(i,r)=>{Bx.init(i,r),_t.init(i,r),i._zod.processJSONSchema=(a,o,v)=>HC(i,a)});function h2(i,r={}){return AC(u2,i,r)}function f2(i){return RC(i)}const Sh=an(["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"]),bh=At({ok:ys()}),d2=At({id:Le(),name:Le(),createdAt:De(),lastUsedAt:De(),rateLimit:De()}),m2=At({id:Le(),name:Le(),key:Le()}),_2=bh.extend({delivered:ys(),attempts:De()}),p2=At({status:Le(),version:Le(),uptime:De(),sessions:At({active:De(),total:De()}),timestamp:Le()}),xh=At({id:Le(),windowId:Le(),windowName:Le(),workDir:Le(),claudeSessionId:Le().optional(),jsonlPath:Le().optional(),byteOffset:De(),monitorOffset:De(),status:Sh,createdAt:De(),lastActivity:De(),stallThresholdMs:De(),permissionMode:Le(),autoApprove:ys().optional(),settingsPatched:ys().optional(),promptDelivery:At({delivered:ys(),attempts:De()}).optional(),actionHints:gl(Le(),At({method:Le(),url:Le(),description:Le()})).optional()}),v2=At({sessions:Ea(xh),pagination:At({page:De(),limit:De(),total:De(),totalPages:De()})}),g2=At({alive:ys(),windowExists:ys(),claudeRunning:ys(),paneCommand:Le().nullable(),status:Sh,hasTranscript:ys(),lastActivity:De(),lastActivityAgo:De(),sessionAge:De(),details:Le(),actionHints:gl(Le(),At({method:Le(),url:Le(),description:Le()})).optional()}),y2=At({durationSec:De(),messages:De(),toolCalls:De(),approvals:De(),autoApprovals:De(),statusChanges:Ea(Le())}),S2=At({role:an(["user","assistant","system"]),contentType:an(["text","thinking","tool_use","tool_result","permission_request"]),text:Le(),toolName:Le().optional(),toolUseId:Le().optional(),timestamp:Le().optional()}),b2=At({messages:Ea(S2),status:Sh,statusText:Le().nullable(),interactiveContent:Le().nullable()}),x2=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()})}),C2=an(["status","message","approval","ended","heartbeat","stall","dead","system","hook","subagent_start","subagent_stop"]),w2=At({event:C2,sessionId:Le(),timestamp:Le(),data:gl(Le(),ll()).optional()}),E2=an(["session_status_change","session_message","session_approval","session_ended","session_created","session_stall","session_dead","session_subagent_start","session_subagent_stop"]),T2=At({event:E2,sessionId:Le(),timestamp:Le(),data:gl(Le(),ll())}),A2=3e4,R2=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,v,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>=R2){this.gaveUp||(this.gaveUp=!0,(v=(o=this.callbacks).onGiveUp)==null||v.call(o),(A=(w=this.callbacks).onClose)==null||A.call(w));return}this.consecutiveFailures++;const r=Math.min(A2,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 D2="";function k2(i){if(!i)return{};if(i instanceof Headers){const r={};return i.forEach((a,o)=>{r[o]=a}),r}return i}function O2(i,r,a){const o=r.safeParse(i);if(o.success)return o.data;throw console.error(`[aegis] API response validation failed (${a}):`,o.error.issues),new Error(`API response validation failed for ${a}: ${o.error.issues.map(v=>v.message).join(", ")}`)}function M2(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}`}:{},...k2(r.headers)},{retries:v=0,schema:w,schemaContext:A,...l}=r;let h=null;for(let u=0;u<=v;u++)try{const y=await fetch(`${D2}${i}`,{...l,headers:o});if(!y.ok){const b=await y.json().catch(()=>({error:y.statusText})),C=new Error(b.error??`HTTP ${y.status}`);throw C.statusCode=y.status,C}const d=await y.json();return w?O2(d,w,A??i):d}catch(y){if(h=y,u<v&&M2(h))await new Promise(d=>setTimeout(d,1e3*Math.pow(2,u)));else throw h}throw h}function L2(){return et("/v1/health",{schema:p2,schemaContext:"getHealth"})}function N2(){return et("/v1/metrics",{schema:x2,schemaContext:"getMetrics"})}function B2(){return et("/v1/sessions",{schema:v2,schemaContext:"getSessions"})}function j2(i){return et(`/v1/sessions/${encodeURIComponent(i)}`,{schema:xh,schemaContext:"getSession"})}function z2(i){const{signal:r,...a}=i;return et("/v1/sessions",{method:"POST",body:JSON.stringify(a),signal:r,schema:xh,schemaContext:"createSession"})}function gv(i){return et(`/v1/sessions/${encodeURIComponent(i)}`,{method:"DELETE",schema:bh,schemaContext:"killSession"})}function H2(i){return et(`/v1/sessions/${encodeURIComponent(i)}/health`,{schema:g2,schemaContext:"getSessionHealth"})}function U2(){return et("/v1/sessions/health")}function I2(i){return et(`/v1/sessions/${encodeURIComponent(i)}/read`,{schema:b2,schemaContext:"getSessionMessages"})}function P2(i){return et(`/v1/sessions/${encodeURIComponent(i)}/metrics`,{schema:y2,schemaContext:"getSessionMetrics"})}function $2(i){return et(`/v1/sessions/${encodeURIComponent(i)}/pane`)}function F2(i,r){return et(`/v1/sessions/${encodeURIComponent(i)}/send`,{method:"POST",body:JSON.stringify({text:r}),schema:_2,schemaContext:"sendMessage"})}function yv(i){return et(`/v1/sessions/${encodeURIComponent(i)}/approve`,{method:"POST"})}function Z2(i){return et(`/v1/sessions/${encodeURIComponent(i)}/reject`,{method:"POST"})}function Sv(i){return et(`/v1/sessions/${encodeURIComponent(i)}/interrupt`,{method:"POST"})}function q2(i){return et(`/v1/sessions/${encodeURIComponent(i)}/escape`,{method:"POST"})}const V_=3,G2=1e3;async function bv(i,r){for(let a=0;a<V_;a++){if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");try{return await eE(r)}catch{if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");if(a<V_-1){const o=G2*Math.pow(2,a);await new Promise(v=>{const w=setTimeout(v,o);r==null||r.addEventListener("abort",()=>{clearTimeout(w),v(void 0)},{once:!0})})}}}throw i==null||i(),new Error("Real-time updates unavailable")}function xv(i,r,a,o){const v=`/v1/sessions/${encodeURIComponent(i)}/events`;let w=null,A=!1;const l=new AbortController;return a?bv(o==null?void 0:o.onGiveUp,l.signal).then(h=>{if(A)return;const u=`${v}?token=${encodeURIComponent(h.token)}`;w=new cl(u,r,o)}).catch(()=>{}):w=new cl(v,r,o),()=>{A=!0,l.abort(),w==null||w.close()}}function K2(i,r,a){const o="/v1/events";let v=null,w=!1;const A=new AbortController,l=h=>{try{const u=T2.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?bv(a==null?void 0:a.onGiveUp,A.signal).then(h=>{if(w)return;const u=`${o}?token=${encodeURIComponent(h.token)}`;v=new cl(u,l,a)}).catch(()=>{}):v=new cl(o,l,a),()=>{var h;w=!0,A.abort(),(h=a==null?void 0:a.onClose)==null||h.call(a),v==null||v.close()}}function W2(i,r){return et(`/v1/sessions/${encodeURIComponent(i)}/command`,{method:"POST",body:JSON.stringify({command:r})})}function V2(i,r){return et(`/v1/sessions/${encodeURIComponent(i)}/bash`,{method:"POST",body:JSON.stringify({command:r})})}function Y2(i){const{signal:r,...a}=i;return et("/v1/sessions/batch",{method:"POST",signal:r,body:JSON.stringify(a)})}function X2(i){return et("/v1/pipelines",{method:"POST",body:JSON.stringify(i)})}function J2(){return et("/v1/pipelines")}function Q2(i){return et(`/v1/pipelines/${encodeURIComponent(i)}`)}function eE(i){return et("/v1/auth/sse-token",{method:"POST",signal:i})}function tE(i){return et("/v1/auth/keys",{method:"POST",body:JSON.stringify({name:i}),schema:m2,schemaContext:"createAuthKey"})}function iE(){return et("/v1/auth/keys",{schema:Ea(d2),schemaContext:"getAuthKeys"})}function sE(i){return et(`/v1/auth/keys/${encodeURIComponent(i)}`,{method:"DELETE",schema:bh,schemaContext:"revokeAuthKey"})}const Wo=new Map;let rE=0;const bs=Pp(i=>({toasts:[],addToast:(r,a,o)=>{const v=`toast-${++rE}`,w=setTimeout(()=>{Wo.delete(v),i(A=>({toasts:A.toasts.filter(l=>l.id!==v)}))},4e3);return Wo.set(v,w),i(A=>({toasts:[...A.toasts,{id:v,type:r,title:a,description:o}]})),v},removeToast:r=>{const a=Wo.get(r);a&&(clearTimeout(a),Wo.delete(r)),i(o=>({toasts:o.toasts.filter(v=>v.id!==r)}))}})),nE={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 aE({id:i,type:r,title:a,description:o}){const v=bs(w=>w.removeToast);return E.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 ${nE[r]}`,children:[E.jsxs("div",{className:"flex-1 min-w-0",children:[E.jsx("p",{className:"text-sm font-medium",children:a}),o&&E.jsx("p",{className:"mt-0.5 text-xs opacity-80",children:o})]}),E.jsx("button",{onClick:()=>v(i),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:E.jsx(dl,{className:"h-3.5 w-3.5"})})]})}function oE(){const i=bs(r=>r.toasts);return i.length===0?null:E.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=>E.jsx("div",{className:"pointer-events-auto",children:E.jsx(aE,{id:r.id,type:r.type,title:r.title,description:r.description})},r.id))})}const lE=[{to:"/",label:"Overview",icon:tb},{to:"/pipelines",label:"Pipelines",icon:Bp},{to:"/auth/keys",label:"Auth Keys",icon:Ju}],cE=5,uE=1e3;function hE(){const i=dt(u=>u.sseConnected),r=dt(u=>u.setSseConnected),a=dt(u=>u.sseError),o=dt(u=>u.setSseError),v=dt(u=>u.addActivity),w=dt(u=>u.token),A=F.useRef(null),[l,h]=F.useState(0);return F.useEffect(()=>{let u=!1,y,d=null;function b(C){if(!u)try{y=K2(k=>{k.sessionId&&v(k)},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(k){if(console.error("Failed to subscribe to global SSE (attempt %d):",C+1,k),C<cE){const x=uE*Math.pow(2,C);h(C+1),d=setTimeout(()=>b(C+1),x)}else o("SSE subscription failed after retries — real-time updates unavailable"),r(!1)}}return b(0),()=>{u=!0,A.current&&clearTimeout(A.current),d&&clearTimeout(d),y==null||y()}},[r,o,v,w]),E.jsxs("div",{className:"flex h-screen overflow-hidden bg-void",children:[E.jsxs("aside",{className:"flex w-56 flex-col border-r border-void-lighter bg-void-light shrink-0",children:[E.jsxs("div",{className:"flex items-center gap-2 px-4 py-5 border-b border-void-lighter",children:[E.jsx(vb,{className:"h-6 w-6 text-cyan glow-text-cyan"}),E.jsx("span",{className:"text-lg font-semibold tracking-tight text-gray-100",children:"Aegis"})]}),E.jsxs("nav",{className:"flex flex-col gap-1 px-2 py-4 flex-1",children:[lE.map(({to:u,label:y,icon:d})=>E.jsxs(Mp,{to:u,end:u==="/",className:({isActive:b})=>`flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${b?"bg-cyan/10 text-cyan":"text-gray-400 hover:bg-void-lighter hover:text-gray-200"}`,children:[E.jsx(d,{className:"h-4 w-4"}),y]},u)),E.jsx("div",{className:"mt-4 border-t border-void-lighter pt-4 opacity-40",children:E.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:[E.jsx(bb,{className:"h-4 w-4"}),"Sessions"]})})]})]}),E.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[E.jsxs("header",{className:"flex items-center justify-between border-b border-void-lighter bg-void-light px-6 py-3 shrink-0",children:[E.jsx("h1",{className:"text-sm font-medium text-gray-300",children:"Aegis Dashboard"}),E.jsx("div",{className:"flex items-center gap-3",children:E.jsx("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",title:a??void 0,children:a?E.jsxs(E.Fragment,{children:[E.jsx(Ip,{className:"h-3 w-3 text-amber-500"}),E.jsxs("span",{className:"text-amber-500",children:["SSE Error",l>0?` (retry ${l})`:""]})]}):E.jsxs(E.Fragment,{children:[E.jsx("span",{className:`status-dot ${i?"status-dot--idle":""}`,style:i?void 0:{backgroundColor:"#666"}}),i?"SSE Live":"SSE Off"]})})})]}),E.jsx("main",{className:"flex-1 overflow-auto p-6",children:E.jsx(Yy,{})})]}),E.jsx(oE,{})]})}function fE(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 vr(i){const r=Date.now()-i;if(r<0)return"just now";const a=Math.floor(r/1e3);if(a<60)return`${a}s ago`;const o=Math.floor(a/60);if(o<60)return`${o}m ago`;const v=Math.floor(o/60);return v<24?`${v}h ago`:`${Math.floor(v/24)}d ago`}function dE(i){if(i<0)return"0s";const r=Math.floor(i/1e3);if(r<60)return`${r}s`;const a=Math.floor(r/60),o=r%60;if(a<60)return`${a}m ${o.toString().padStart(2,"0")}s`;const v=Math.floor(a/60),w=a%60;return`${v}h ${w.toString().padStart(2,"0")}m`}const mE=15e3,_E=6e4;function pE(i){return new Date(i).toLocaleString()}function vE(i){return i.length<=12?"•".repeat(i.length):`${i.slice(0,8)}${"•".repeat(Math.max(8,i.length-12))}${i.slice(-4)}`}function gE(){const[i,r]=F.useState([]),[a,o]=F.useState(!0),[v,w]=F.useState(null),[A,l]=F.useState(""),[h,u]=F.useState(!1),[y,d]=F.useState(!1),[b,C]=F.useState(null),[k,x]=F.useState(null),[m,g]=F.useState(!1),f=bs(M=>M.addToast),p=F.useCallback(async(M=!1)=>{M?d(!0):o(!0);try{const T=await iE();r(T.slice().sort((N,I)=>I.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]);F.useEffect(()=>{p();const M=setInterval(()=>{p(!0)},mE);return()=>clearInterval(M)},[p]),F.useEffect(()=>{if(!k)return;const M=setTimeout(()=>{x(null),g(!1)},_E);return()=>clearTimeout(M)},[k]);async function S(M){M.preventDefault();const T=A.trim();if(T){u(!0);try{const N=await tE(T);x(N),g(!1),l(""),f("success","Auth key created","Store the secret now. It is only shown once."),await p(!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(k)try{if(!((M=navigator.clipboard)!=null&&M.writeText))throw new Error("Clipboard access is unavailable in this browser");await navigator.clipboard.writeText(k.key),f("success","Auth key copied")}catch(T){f("warning","Failed to copy auth key",T instanceof Error?T.message:void 0)}}async function D(M,T){if(window.confirm(`Revoke auth key "${T}"? This cannot be undone.`)){C(M);try{await sE(M),r(N=>N.filter(I=>I.id!==M)),(k==null?void 0:k.id)===M&&(x(null),g(!1)),f("success","Auth key revoked")}catch(N){f("error","Failed to revoke auth key",N instanceof Error?N.message:void 0)}finally{C(null)}}}return E.jsxs("div",{className:"flex flex-col gap-6",children:[E.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[E.jsxs("div",{children:[E.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Auth Keys"}),E.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Create, review, and revoke dashboard API keys without exposing stored secrets."})]}),E.jsxs("button",{type:"button",onClick:()=>void p(!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:[E.jsx(Up,{className:`h-3.5 w-3.5 ${y?"animate-spin":""}`}),"Refresh"]})]}),E.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,360px)_minmax(0,1fr)]",children:[E.jsxs("section",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-5",children:[E.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-gray-100",children:[E.jsx(wa,{className:"h-4 w-4 text-[#00e5ff]"}),"Create Key"]}),E.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."}),E.jsxs("form",{className:"mt-4 space-y-4",onSubmit:S,children:[E.jsxs("div",{children:[E.jsx("label",{className:"mb-1.5 block text-xs font-medium text-gray-400",htmlFor:"auth-key-name",children:"Key Name"}),E.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"})]}),E.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:[E.jsx(Ju,{className:"h-4 w-4"}),h?"Creating…":"Create Auth Key"]})]}),k?E.jsxs("div",{className:"mt-5 rounded-lg border border-emerald-500/20 bg-emerald-500/5 p-4",role:"status",children:[E.jsxs("div",{className:"flex items-start justify-between gap-3",children:[E.jsxs("div",{children:[E.jsx("h3",{className:"text-sm font-semibold text-emerald-300",children:"Store this key now"}),E.jsx("p",{className:"mt-1 text-xs text-emerald-200/80",children:"This secret is shown once and is hidden by default."})]}),E.jsx("button",{type:"button",onClick:()=>{x(null),g(!1)},className:"text-xs font-medium text-emerald-200/80 transition-colors hover:text-emerald-200",children:"Dismiss"})]}),E.jsxs("dl",{className:"mt-4 space-y-3 text-sm text-gray-200",children:[E.jsxs("div",{children:[E.jsx("dt",{className:"text-xs uppercase tracking-wide text-gray-500",children:"Name"}),E.jsx("dd",{className:"mt-1 font-medium text-gray-100",children:k.name})]}),E.jsxs("div",{children:[E.jsx("dt",{className:"text-xs uppercase tracking-wide text-gray-500",children:"Secret"}),E.jsx("dd",{className:"mt-1 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 font-mono text-xs text-[#9af5ff]",children:m?k.key:vE(k.key)})]})]}),E.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[E.jsxs("button",{type:"button",onClick:()=>g(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:[m?E.jsx(WS,{className:"h-3.5 w-3.5"}):E.jsx(YS,{className:"h-3.5 w-3.5"}),m?"Hide secret":"Reveal secret"]}),E.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:[E.jsx(ZS,{className:"h-3.5 w-3.5"}),"Copy secret"]})]})]}):null]}),E.jsxs("section",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-5",children:[E.jsx("div",{className:"flex items-center justify-between gap-3 border-b border-[#1a1a2e] pb-4",children:E.jsxs("div",{children:[E.jsx("h3",{className:"text-sm font-semibold text-gray-100",children:"Existing Keys"}),E.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[i.length," key",i.length===1?"":"s"," configured"]})]})}),a?E.jsx("div",{className:"flex min-h-[240px] items-center justify-center text-sm text-gray-500",children:E.jsx("div",{className:"animate-pulse",children:"Loading auth keys…"})}):v?E.jsxs("div",{className:"mt-4 rounded-lg border border-amber-500/20 bg-amber-500/5 p-4 text-sm text-amber-200",children:[E.jsx("p",{className:"font-medium",children:"Unable to load auth keys"}),E.jsx("p",{className:"mt-1 text-amber-200/80",children:v}),E.jsx("button",{type:"button",onClick:()=>void p(),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?E.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:[E.jsx(Ju,{className:"h-8 w-8 text-gray-600"}),E.jsx("p",{className:"mt-4 text-sm font-medium text-gray-300",children:"No auth keys yet"}),E.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."})]}):E.jsx("div",{className:"mt-4 space-y-3",children:i.map(M=>E.jsx("article",{className:"rounded-lg border border-[#1a1a2e] bg-[#0a0a0f] p-4",children:E.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[E.jsxs("div",{className:"min-w-0",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"truncate font-medium text-gray-100",children:M.name}),E.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})]}),E.jsxs("p",{className:"mt-2 text-sm text-gray-400",children:["Created ",E.jsx("span",{title:pE(M.createdAt),children:vr(M.createdAt)})]})]}),E.jsxs("button",{type:"button",onClick:()=>void D(M.id,M.name),disabled:b===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:[E.jsx(fh,{className:"h-3.5 w-3.5"}),b===M.id?"Revoking…":"Revoke"]})]})},M.id))})]})]})]})}function Ks({label:i,value:r,icon:a,suffix:o}){return E.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[E.jsxs("div",{className:"mb-2 flex items-center gap-2 text-sm text-[#888]",children:[a,i]}),E.jsxs("div",{className:"font-mono text-2xl text-[#00e5ff]",children:[r,o&&E.jsx("span",{className:"ml-1 text-base text-[#666]",children:o})]})]})}function yE(){const i=dt(y=>y.metrics),r=dt(y=>y.sseConnected),a=dt(y=>y.setMetrics),[o,v]=F.useState(null),w=F.useCallback(async()=>{try{const[y,d]=await Promise.all([N2(),L2()]);a(y),v(d)}catch(y){bs.getState().addToast("error","Failed to load metrics",y instanceof Error?y.message:void 0)}},[a]);F.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 E.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:[E.jsx(Ks,{label:"Active Sessions",value:A,icon:E.jsx(Bp,{className:"h-4 w-4"})}),E.jsx(Ks,{label:"Total Created",value:l,icon:E.jsx(QS,{className:"h-4 w-4"})}),E.jsx(Ks,{label:"Delivery Rate",value:h!=null?h.toFixed(1):"—",suffix:"%",icon:E.jsx(kb,{className:"h-4 w-4"})}),E.jsx(Ks,{label:"Uptime",value:fE(u),icon:E.jsx($S,{className:"h-4 w-4"})})]})}const Y_={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"},SE=new Set(["working","permission_prompt","bash_approval","ask_question"]),X_={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=Y_[i]??Y_.unknown,a=SE.has(i),o=X_[i]??X_.unknown;return E.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 Cv=i=>i.status==="permission_prompt"||i.status==="bash_approval",wv=(i,r=40)=>i.length>r?`…${i.slice(i.length-r+1)}`:i,bE=(i,r)=>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,Ev=(i,r)=>bE(i.session,r.session)&&i.isAlive===r.isAlive&&i.currentAction===r.currentAction,xE=F.memo(function({session:r,isAlive:a,currentAction:o,onApprove:v,onInterrupt:w,onKill:A}){return E.jsxs("div",{className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 active:bg-[#1a1a2e]/50 transition-colors",children:[E.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[E.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[E.jsx(yl,{status:r.status}),E.jsx(Hi,{to:`/sessions/${encodeURIComponent(r.id)}`,className:"min-w-0 truncate font-medium text-gray-200 transition-colors hover:text-cyan",children:r.windowName||r.id}),!a&&E.jsx(sl,{className:"h-3.5 w-3.5 shrink-0 text-red-400"})]}),E.jsxs("div",{className:"ml-2 flex shrink-0 items-center gap-1.5",children:[Cv(r)&&E.jsx("button",{onClick:l=>v(l,r.id),disabled:o==="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:E.jsx(Hp,{className:"h-4 w-4"})}),E.jsx("button",{onClick:l=>w(l,r.id),disabled:o==="interrupt"||o==="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:E.jsx(jp,{className:"h-4 w-4"})}),E.jsx("button",{onClick:l=>A(l,r.id),disabled:o==="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:E.jsx(sl,{className:"h-4 w-4"})})]})]}),E.jsx("div",{className:"mb-1.5 truncate font-mono text-xs text-gray-500",children:wv(r.workDir,50)}),E.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-500",children:[E.jsxs("span",{children:["Age: ",vr(r.createdAt)]}),E.jsxs("span",{children:["Active: ",vr(r.lastActivity)]}),r.permissionMode&&r.permissionMode!=="default"?E.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-900/30 px-2 py-0.5 text-green-400",children:[E.jsx(zp,{className:"h-3 w-3"})," ",r.permissionMode]}):null]})]})},Ev),CE=F.memo(function({session:r,isAlive:a,currentAction:o,onApprove:v,onInterrupt:w,onKill:A}){return E.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[E.jsx("td",{className:"px-4 py-3",children:E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(yl,{status:r.status}),!a&&E.jsx(sl,{className:"h-3.5 w-3.5 text-red-400"})]})}),E.jsx("td",{className:"px-4 py-3",children:E.jsx(Hi,{to:`/sessions/${encodeURIComponent(r.id)}`,className:"font-medium text-gray-200 transition-colors hover:text-cyan",children:r.windowName||r.id})}),E.jsx("td",{className:"max-w-[200px] truncate px-4 py-3 font-mono text-xs text-gray-400",title:r.workDir,children:wv(r.workDir)}),E.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:vr(r.createdAt)}),E.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:vr(r.lastActivity)}),E.jsx("td",{className:"px-4 py-3",children:r.permissionMode&&r.permissionMode!=="default"?E.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:[E.jsx(zp,{className:"h-3 w-3"}),r.permissionMode]}):E.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"})}),E.jsx("td",{className:"px-4 py-3",children:E.jsxs("div",{className:"flex items-center gap-1.5",children:[Cv(r)&&E.jsx("button",{onClick:l=>v(l,r.id),disabled:o==="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:E.jsx(Hp,{className:"h-3 w-3"})}),E.jsx("button",{onClick:l=>w(l,r.id),disabled:o==="interrupt"||o==="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:E.jsx(jp,{className:"h-3 w-3"})}),E.jsx("button",{onClick:l=>A(l,r.id),disabled:o==="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:E.jsx(sl,{className:"h-3 w-3"})})]})})]})},Ev);function wE(){const i=dt(b=>b.sessions),r=dt(b=>b.healthMap),a=dt(b=>b.sseConnected),o=dt(b=>b.setSessionsAndHealth),v=bs(b=>b.addToast),[w,A]=F.useState({}),l=F.useCallback(async(b,C,k)=>{A(x=>({...x,[b]:C}));try{await k()}finally{A(x=>({...x,[b]:null}))}},[]),h=F.useCallback(async()=>{try{const b=await B2();let C={};try{const k=await U2(),x=new Set(b.sessions.map(m=>m.id));for(const[m,g]of Object.entries(k))x.has(m)&&(C[m]={alive:g.alive,loading:!1})}catch{}o(b.sessions,C)}catch(b){v("error","Failed to fetch sessions",b instanceof Error?b.message:void 0)}},[v,o]);F.useEffect(()=>{if(h(),a)return;const b=setInterval(h,5e3);return()=>clearInterval(b)},[h,a]);const u=F.useCallback(async(b,C)=>{b.preventDefault(),await l(C,"approve",async()=>{try{await yv(C)}catch(k){v("error","Approve failed",k instanceof Error?k.message:void 0)}})},[v,l]),y=F.useCallback(async(b,C)=>{b.preventDefault(),await l(C,"interrupt",async()=>{try{await Sv(C)}catch(k){v("error","Interrupt failed",k instanceof Error?k.message:void 0)}})},[v,l]),d=F.useCallback(async(b,C)=>{b.preventDefault(),confirm("Kill this session?")&&await l(C,"kill",async()=>{try{await gv(C)}catch(k){v("error","Failed to kill session",k instanceof Error?k.message:void 0)}})},[v,l]);return i.length===0?E.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:E.jsx("p",{className:"text-gray-500",children:"No active sessions"})}):E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"space-y-3 md:hidden",children:i.map(b=>{const C=r[b.id],k=C?C.alive:!0;return E.jsx(xE,{session:b,isAlive:k,currentAction:w[b.id]??null,onApprove:u,onInterrupt:y,onKill:d},b.id)})}),E.jsx("div",{className:"hidden overflow-x-auto rounded-lg border border-void-lighter bg-[#111118] md:block",children:E.jsxs("table",{className:"w-full text-left text-sm",children:[E.jsx("thead",{children:E.jsxs("tr",{className:"border-b border-void-lighter text-[#666]",children:[E.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),E.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),E.jsx("th",{className:"px-4 py-3 font-medium",children:"WorkDir"}),E.jsx("th",{className:"px-4 py-3 font-medium",children:"Age"}),E.jsx("th",{className:"px-4 py-3 font-medium",children:"Last Activity"}),E.jsx("th",{className:"px-4 py-3 font-medium",children:"Permission"}),E.jsx("th",{className:"px-4 py-3 font-medium",children:"Actions"})]})}),E.jsx("tbody",{children:i.map(b=>{const C=r[b.id],k=C?C.alive:!0;return E.jsx(CE,{session:b,isAlive:k,currentAction:w[b.id]??null,onApprove:u,onInterrupt:y,onKill:d},b.id)})})]})})]})}const Uu={session_status_change:{icon:Up,label:"Status",color:"#00e5ff"},session_message:{icon:rb,label:"Message",color:"#00ff88"},session_approval:{icon:_b,label:"Approval",color:"#ffaa00"},session_ended:{icon:ub,label:"Ended",color:"#ff3366"},session_created:{icon:US,label:"Created",color:"#a78bfa"},session_stall:{icon:Ip,label:"Stall",color:"#ff6600"},session_dead:{icon:yb,label:"Dead",color:"#ff0044"},session_subagent_start:{icon:Ab,label:"Subagent",color:"#38bdf8"},session_subagent_stop:{icon:Eb,label:"Subagent Done",color:"#34d399"}};function pr(i,r="unknown"){return typeof i=="string"?i:r}function EE(i){const r=i.data;switch(i.event){case"session_status_change":{const a=pr(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}: ${J_(o,80)}`}case"session_approval":{const a=typeof r.prompt=="string"?r.prompt:JSON.stringify(r.prompt??"");return`Approval needed: ${J_(a,80)}`}case"session_ended":return`Session ended: ${pr(r.reason)}`;case"session_created":return`Created in ${pr(r.workDir,"unknown dir")}`;case"session_stall":return`Session stalled: ${pr(r.stallType)}`;case"session_dead":return`Session dead: ${pr(r.stallType)}`;case"session_subagent_start":return`Subagent started: ${pr(r.name)}`;case"session_subagent_stop":return`Subagent finished: ${pr(r.name)}`;default:return JSON.stringify(r)}}function J_(i,r){return i.length>r?i.slice(0,r)+"...":i}function TE(i){try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function AE(){const i=dt(u=>u.activities),r=dt(u=>u.activityFilterSession),a=dt(u=>u.activityFilterType),o=dt(u=>u.setActivityFilterSession),v=dt(u=>u.setActivityFilterType),w=dt(u=>u.sessions),A=F.useMemo(()=>i.filter(u=>!(r&&u.sessionId!==r||a&&u.event!==a)),[i,r,a]),l=F.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 E.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg w-full",children:[E.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:[E.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Activity Stream"}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.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:[E.jsx("option",{value:"",children:"All sessions"}),w.map(u=>E.jsx("option",{value:u.id,children:u.windowName||u.id.slice(0,8)},u.id))]}),E.jsxs("select",{value:a??"",onChange:u=>v(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:[E.jsx("option",{value:"",children:"All types"}),Object.entries(Uu).map(([u,y])=>E.jsx("option",{value:u,children:y.label},u))]}),(r||a)&&E.jsx("button",{onClick:()=>{o(null),v(null)},className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300",children:E.jsx(dl,{className:"h-4 w-4"})})]})]}),E.jsxs("div",{className:"max-h-[360px] overflow-y-auto divide-y divide-[#1a1a2e]/50",children:[A.length===0&&E.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,b=d.icon;return E.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:[E.jsx(b,{className:"h-4 w-4 mt-0.5 shrink-0",style:{color:d.color}}),E.jsxs("div",{className:"flex-1 min-w-0",children:[E.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[E.jsx("span",{className:"text-xs font-medium text-gray-300 truncate",children:h(u.sessionId)}),E.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})]}),E.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:EE(u)})]}),E.jsx("span",{className:"text-[10px] text-[#444] shrink-0 tabular-nums mt-0.5",children:TE(u.timestamp)})]},`${u.sessionId}-${u.timestamp}-${y}`)})]})]})}let RE=0;function ua(){return{workDir:"",name:"",prompt:"",_key:RE++}}function DE({open:i,onClose:r}){const a=hl(),o=F.useRef(null),v=F.useRef(null),w=F.useCallback(()=>{$(),r()},[r]),A=F.useRef(null);F.useEffect(()=>{if(!i)return;const Y=ee=>{var B;ee.key==="Escape"&&((B=v.current)==null||B.abort(),w())};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[i,w]),F.useEffect(()=>{if(!i)return;const Y=A.current;if(!Y)return;const ee='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',B=U=>{if(U.key!=="Tab")return;const L=Array.from(Y.querySelectorAll(ee));if(L.length===0)return;const H=L[0],X=L[L.length-1];U.shiftKey?document.activeElement===H&&(U.preventDefault(),X.focus()):document.activeElement===X&&(U.preventDefault(),H.focus())};return Y.addEventListener("keydown",B),()=>Y.removeEventListener("keydown",B)},[i]),F.useEffect(()=>{if(i){const Y=setTimeout(()=>{var ee;return(ee=o.current)==null?void 0:ee.focus()},50);return()=>clearTimeout(Y)}},[i]);const[l,h]=F.useState(""),[u,y]=F.useState(""),[d,b]=F.useState(""),[C,k]=F.useState("default"),[x,m]=F.useState(!1),[g,f]=F.useState(null),[p,S]=F.useState("single"),[R,D]=F.useState([ua(),ua()]),[M,T]=F.useState(""),[N,I]=F.useState(null);function $(){h(""),y(""),b(""),k("default"),m(!1),f(null),D([ua(),ua()]),T(""),I(null),S("single")}function q(){R.length>=10||D([...R,ua()])}function P(Y){R.length<=1||D(R.filter((ee,B)=>B!==Y))}function Q(Y,ee,B){D(R.map((U,L)=>L===Y?{...U,[ee]:B}:U))}async function te(Y){var U;Y.preventDefault(),f(null),I(null);const ee=R.filter(L=>L.workDir.trim());if(ee.length===0){f("At least one working directory is required");return}m(!0),(U=v.current)==null||U.abort();const B=new AbortController;v.current=B;try{const L=await Y2({sessions:ee.map(H=>({workDir:H.workDir.trim(),name:H.name.trim()||void 0,prompt:H.prompt.trim()||M.trim()||void 0,permissionMode:C})),signal:B.signal});I(L)}catch(L){if(B.signal.aborted)return;f(L instanceof Error?L.message:"Failed to create sessions")}finally{v.current===B&&(v.current=null,m(!1))}}if(!i)return null;async function G(Y){var B;if(Y.preventDefault(),f(null),!l.trim()){f("Working directory is required");return}m(!0),(B=v.current)==null||B.abort();const ee=new AbortController;v.current=ee;try{const U=await z2({workDir:l.trim(),name:u.trim()||void 0,prompt:d.trim()||void 0,permissionMode:C,signal:ee.signal});$(),r(),a(`/sessions/${U.id}`)}catch(U){if(ee.signal.aborted)return;f(U instanceof Error?U.message:"Failed to create session")}finally{v.current===ee&&(v.current=null,m(!1))}}return E.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[E.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:w}),E.jsxs("div",{ref:A,role:"dialog","aria-modal":"true","aria-label":"Create new session",className:`relative w-full ${p==="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:[E.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[E.jsxs("div",{className:"flex items-center gap-4",children:[E.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Session"}),E.jsxs("div",{className:"flex rounded bg-[#0a0a0f] p-0.5",children:[E.jsx("button",{type:"button",onClick:()=>S("single"),className:`px-3 py-1 text-xs rounded transition-colors ${p==="single"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Single"}),E.jsx("button",{type:"button",onClick:()=>S("batch"),className:`px-3 py-1 text-xs rounded transition-colors ${p==="batch"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Batch"})]})]}),E.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:E.jsx(dl,{className:"h-4 w-4"})})]}),p==="single"&&E.jsxs("form",{onSubmit:G,className:"p-4 sm:p-5 space-y-4",children:[E.jsxs("div",{children:[E.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Working Directory ",E.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),E.jsx("input",{type:"text",ref:o,value:l,onChange:Y=>h(Y.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"})]}),E.jsxs("div",{children:[E.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Session Name"}),E.jsx("input",{type:"text",value:u,onChange:Y=>y(Y.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]"})]}),E.jsxs("div",{children:[E.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Initial Prompt"}),E.jsx("textarea",{value:d,onChange:Y=>b(Y.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"})]}),E.jsxs("div",{children:[E.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),E.jsxs("select",{value:C,onChange:Y=>k(Y.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:[E.jsx("option",{value:"default",children:"default — asks for everything"}),E.jsx("option",{value:"plan",children:"plan — auto-reads, asks for writes"}),E.jsx("option",{value:"acceptEdits",children:"acceptEdits — auto-edits, asks for bash"}),E.jsx("option",{value:"bypassPermissions",children:"bypassPermissions — never asks"}),E.jsx("option",{value:"auto",children:"auto — auto-approve in sandbox"})]})]}),g&&E.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:g}),E.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[E.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"}),E.jsxs("button",{type:"submit",disabled:x||!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:[x&&E.jsx(Qu,{className:"h-3 w-3 animate-spin"}),"Create Session"]})]})]}),p==="batch"&&!N&&E.jsxs("form",{onSubmit:te,className:"p-4 sm:p-5 space-y-4",children:[E.jsxs("div",{children:[E.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Shared Prompt"}),E.jsx("textarea",{value:M,onChange:Y=>T(Y.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"})]}),E.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[E.jsxs("span",{children:["Working Directory ",E.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),E.jsx("span",{children:"Name"}),E.jsx("span",{children:"Prompt (override)"}),E.jsx("span",{})]}),E.jsx("div",{className:"space-y-2",children:R.map((Y,ee)=>E.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[E.jsx("input",{type:"text",value:Y.workDir,onChange:B=>Q(ee,"workDir",B.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"}),E.jsx("input",{type:"text",value:Y.name,onChange:B=>Q(ee,"name",B.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]"}),E.jsx("input",{type:"text",value:Y.prompt,onChange:B=>Q(ee,"prompt",B.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]"}),E.jsx("button",{type:"button",onClick:()=>P(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:E.jsx(fh,{className:"h-3.5 w-3.5"})})]},Y._key))}),R.length<10&&E.jsxs("button",{type:"button",onClick:q,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[E.jsx(wa,{className:"h-3.5 w-3.5"}),"Add session"]}),E.jsxs("div",{children:[E.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),E.jsxs("select",{value:C,onChange:Y=>k(Y.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:[E.jsx("option",{value:"default",children:"default — asks for everything"}),E.jsx("option",{value:"plan",children:"plan — auto-reads, asks for writes"}),E.jsx("option",{value:"acceptEdits",children:"acceptEdits — auto-edits, asks for bash"}),E.jsx("option",{value:"bypassPermissions",children:"bypassPermissions — never asks"}),E.jsx("option",{value:"auto",children:"auto — auto-approve in sandbox"})]})]}),g&&E.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:g}),E.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[E.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"}),E.jsxs("button",{type:"submit",disabled:x||!R.some(Y=>Y.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:[x&&E.jsx(Qu,{className:"h-3 w-3 animate-spin"}),"Create ",R.filter(Y=>Y.workDir.trim()).length," Session(s)"]})]})]}),N&&E.jsxs("div",{className:"p-4 sm:p-5 space-y-4",children:[E.jsxs("div",{className:"flex items-center gap-3",children:[N.created>0&&E.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&&E.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&&E.jsxs("div",{className:"space-y-1",children:[E.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Created sessions"}),E.jsx("ul",{className:"space-y-1",children:N.sessions.map(Y=>E.jsx("li",{children:E.jsxs("button",{type:"button",onClick:()=>{w(),a(`/sessions/${Y.id}`)},className:"text-xs text-[#00e5ff] hover:underline font-mono",children:[Y.id.slice(0,8),"...",Y.name?` — ${Y.name}`:""]})},Y.id))})]}),N.errors.length>0&&E.jsxs("div",{className:"space-y-1",children:[E.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Errors"}),E.jsx("ul",{className:"space-y-1",children:N.errors.map((Y,ee)=>E.jsx("li",{className:"text-xs text-[#ff3366]",children:Y},ee))})]}),E.jsx("div",{className:"flex justify-end pt-2",children:E.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 kE(){const[i,r]=F.useState(!1);return E.jsxs("div",{className:"flex flex-col gap-6",children:[E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsxs("div",{children:[E.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Overview"}),E.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Aegis session monitoring and metrics"})]}),E.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:[E.jsx(wa,{className:"h-3.5 w-3.5"}),"New Session"]})]}),E.jsx(yE,{}),E.jsxs("div",{children:[E.jsx("h3",{className:"mb-3 text-lg font-semibold text-gray-200",children:"Sessions"}),E.jsx(wE,{})]}),E.jsx(AE,{}),E.jsx(DE,{open:i,onClose:()=>r(!1)})]})}function Q_(i){return i instanceof Error&&"statusCode"in i}function OE(i){const r=dt(Q=>Q.token),a=bs(Q=>Q.addToast),[o,v]=F.useState(null),[w,A]=F.useState(null),[l,h]=F.useState(!1),[u,y]=F.useState(!0),[d,b]=F.useState(""),[C,k]=F.useState(!0),[x,m]=F.useState(null),[g,f]=F.useState(!0),p=F.useRef(i);p.current=i;const S=F.useRef(!1),R=F.useRef(0),D=F.useRef(void 0),M=F.useRef(void 0),T=F.useCallback(async()=>{try{const[Q,te]=await Promise.allSettled([j2(p.current),H2(p.current)]);if(Q.status==="rejected"&&Q_(Q.reason)&&Q.reason.statusCode===404||te.status==="rejected"&&Q_(te.reason)&&te.reason.statusCode===404){h(!0);return}Q.status==="fulfilled"&&v(Q.value),te.status==="fulfilled"&&A(te.value)}catch(Q){a("error","Failed to load session",Q instanceof Error?Q.message:void 0)}finally{y(!1)}},[a]);D.current=T;const N=F.useCallback(async()=>{if(S.current)return;const Q=p.current;try{const te=await $2(Q);S.current||b(te.pane??"")}catch(te){a("warning","Failed to load terminal pane",te instanceof Error?te.message:void 0)}finally{S.current||k(!1)}try{const te=await P2(Q);S.current||m(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,F.useEffect(()=>(S.current=!1,R.current++,y(!0),k(!0),f(!0),T(),N(),()=>{S.current=!0,I.current&&clearTimeout(I.current),$.current&&clearTimeout($.current)}),[i,T,N]);const I=F.useRef(void 0),$=F.useRef(void 0),q=F.useCallback(()=>{I.current&&clearTimeout(I.current);const Q=R.current;I.current=setTimeout(()=>{var te;R.current===Q&&((te=M.current)==null||te.call(M))},1e3)},[]),P=F.useCallback(()=>{$.current&&clearTimeout($.current);const Q=R.current;$.current=setTimeout(()=>{var te;R.current===Q&&((te=D.current)==null||te.call(D))},1e3)},[]);return F.useEffect(()=>{if(!i)return;const Q=xv(i,te=>{var G,Y;try{const ee=w2.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":P(),q();break;case"message":q();break;case"ended":(G=D.current)==null||G.call(D),(Y=M.current)==null||Y.call(M);break}}catch{}},r);return()=>Q()},[i,r,P,q]),{session:o,health:w,notFound:l,loading:u,paneContent:d,paneLoading:C,metrics:x,metricsLoading:g,refetchPaneAndMetrics:N}}const ME={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 ep(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 tp(i){return new Date(i).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function LE({session:i,health:r,onApprove:a,onReject:o,onInterrupt:v,onKill:w}){const[A,l]=F.useState(!1),h=r.status==="permission_prompt"||r.status==="bash_approval";return E.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3 sm:p-4",children:[E.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[E.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[E.jsx(yl,{status:r.status}),E.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:ME[r.status]})]}),E.jsxs("div",{className:"flex-1 min-w-0",children:[E.jsx("h1",{className:"text-base sm:text-lg font-semibold text-[#e0e0e0] truncate",children:i.windowName||"Untitled Session"}),E.jsx("div",{className:"text-xs text-[#555] font-mono truncate mt-0.5",children:ep(i.workDir,40)})]}),E.jsxs("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[i.permissionMode&&i.permissionMode!=="default"&&E.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?E.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"}):E.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"})]})]}),E.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 text-[11px] text-[#555] mb-3 flex-wrap",children:[E.jsxs("span",{children:["Created: ",tp(i.createdAt)]}),E.jsxs("span",{className:"hidden sm:inline",children:["Last activity: ",tp(i.lastActivity)]}),E.jsxs("span",{className:"font-mono hidden sm:inline",children:["ID: ",ep(i.id,16)]}),r.details&&E.jsx("span",{className:"text-[#888] italic",children:r.details})]}),E.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h&&E.jsxs(E.Fragment,{children:[E.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"}),E.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"})]}),E.jsx("button",{onClick:v,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors",children:"Interrupt"}),A?E.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[E.jsx("span",{className:"text-xs text-[#ff3366]",children:"Confirm kill?"}),E.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"}),E.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"})]}):E.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:Tv,setPrototypeOf:ip,isFrozen:NE,getPrototypeOf:BE,getOwnPropertyDescriptor:jE}=Object;let{freeze:Wt,seal:ki,create:el}=Object,{apply:sh,construct:rh}=typeof Reflect<"u"&&Reflect;Wt||(Wt=function(r){return r});ki||(ki=function(r){return r});sh||(sh=function(r,a){for(var o=arguments.length,v=new Array(o>2?o-2:0),w=2;w<o;w++)v[w-2]=arguments[w];return r.apply(a,v)});rh||(rh=function(r){for(var a=arguments.length,o=new Array(a>1?a-1:0),v=1;v<a;v++)o[v-1]=arguments[v];return new r(...o)});const Vo=Vt(Array.prototype.forEach),zE=Vt(Array.prototype.lastIndexOf),sp=Vt(Array.prototype.pop),ha=Vt(Array.prototype.push),HE=Vt(Array.prototype.splice),tl=Vt(String.prototype.toLowerCase),Iu=Vt(String.prototype.toString),Pu=Vt(String.prototype.match),fa=Vt(String.prototype.replace),UE=Vt(String.prototype.indexOf),IE=Vt(String.prototype.trim),mi=Vt(Object.prototype.hasOwnProperty),Gt=Vt(RegExp.prototype.test),da=PE(TypeError);function Vt(i){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var a=arguments.length,o=new Array(a>1?a-1:0),v=1;v<a;v++)o[v-1]=arguments[v];return sh(i,r,o)}}function PE(i){return function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return rh(i,a)}}function Me(i,r){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:tl;ip&&ip(i,null);let o=r.length;for(;o--;){let v=r[o];if(typeof v=="string"){const w=a(v);w!==v&&(NE(r)||(r[o]=w),v=w)}i[v]=!0}return i}function $E(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 Tv(i))mi(i,a)&&(Array.isArray(o)?r[a]=$E(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=jE(i,r);if(o){if(o.get)return Vt(o.get);if(typeof o.value=="function")return Vt(o.value)}i=BE(i)}function a(){return null}return a}const rp=Wt(["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=Wt(["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=Wt(["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"]),FE=Wt(["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=Wt(["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"]),ZE=Wt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),np=Wt(["#text"]),ap=Wt(["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=Wt(["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"]),op=Wt(["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=Wt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),qE=ki(/\{\{[\w\W]*|[\w\W]*\}\}/gm),GE=ki(/<%[\w\W]*|[\w\W]*%>/gm),KE=ki(/\$\{[\w\W]*/gm),WE=ki(/^data-[\-\w.\u00B7-\uFFFF]+$/),VE=ki(/^aria-[\-\w]+$/),Av=ki(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),YE=ki(/^(?:\w+script|data):/i),XE=ki(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rv=ki(/^html$/i),JE=ki(/^[a-z][.\w]*(-[.\w]+)+$/i);var lp=Object.freeze({__proto__:null,ARIA_ATTR:VE,ATTR_WHITESPACE:XE,CUSTOM_ELEMENT:JE,DATA_ATTR:WE,DOCTYPE_NAME:Rv,ERB_EXPR:GE,IS_ALLOWED_URI:Av,IS_SCRIPT_OR_DATA:YE,MUSTACHE_EXPR:qE,TMPLIT_EXPR:KE});const _a={element:1,text:3,progressingInstruction:7,comment:8,document:9},QE=function(){return typeof window>"u"?null:window},e3=function(r,a){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let o=null;const v="data-tt-policy-suffix";a&&a.hasAttribute(v)&&(o=a.getAttribute(v));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}},cp=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Dv(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:QE();const r=Se=>Dv(Se);if(r.version="3.3.3",r.removed=[],!i||!i.document||i.document.nodeType!==_a.document||!i.Element)return r.isSupported=!1,r;let{document:a}=i;const o=a,v=o.currentScript,{DocumentFragment:w,HTMLTemplateElement:A,Node:l,Element:h,NodeFilter:u,NamedNodeMap:y=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:b,trustedTypes:C}=i,k=h.prototype,x=ma(k,"cloneNode"),m=ma(k,"remove"),g=ma(k,"nextSibling"),f=ma(k,"childNodes"),p=ma(k,"parentNode");if(typeof A=="function"){const Se=a.createElement("template");Se.content&&Se.content.ownerDocument&&(a=Se.content.ownerDocument)}let S,R="";const{implementation:D,createNodeIterator:M,createDocumentFragment:T,getElementsByTagName:N}=a,{importNode:I}=o;let $=cp();r.isSupported=typeof Tv=="function"&&typeof p=="function"&&D&&D.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:q,ERB_EXPR:P,TMPLIT_EXPR:Q,DATA_ATTR:te,ARIA_ATTR:G,IS_SCRIPT_OR_DATA:Y,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:B}=lp;let{IS_ALLOWED_URI:U}=lp,L=null;const H=Me({},[...rp,...$u,...Fu,...Zu,...np]);let X=null;const ae=Me({},[...ap,...qu,...op,...Yo]);let he=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}})),ne=null,K=null;const z=Object.seal(el(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ue=!0,le=!0,ve=!1,pe=!0,Te=!1,He=!0,Ie=!1,ut=!1,Ee=!1,Ft=!1,_i=!1,pi=!1,Ii=!0,Vi=!1;const Pt="user-content-";let at=!0,kt=!1,Zt={},Nt=null;const Bt=Me({},["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=Me({},["audio","video","img","source","image","track"]);let Li=null;const Ve=Me({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vi="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=Me({},[vi,Ot,Mt],Iu);let Xi=Me({},["mi","mo","mn","ms","mtext"]),Ji=Me({},["annotation-xml"]);const yr=Me({},["title","style","font","a","script"]);let ai=null;const Sr=["application/xhtml+xml","text/html"],Qs="text/html";let pt=null,Qi=null;const fn=a.createElement("form"),xs=function(W){return W instanceof RegExp||W instanceof Function},dn=function(){let W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Qi&&Qi===W)){if((!W||typeof W!="object")&&(W={}),W=Gi(W),ai=Sr.indexOf(W.PARSER_MEDIA_TYPE)===-1?Qs:W.PARSER_MEDIA_TYPE,pt=ai==="application/xhtml+xml"?Iu:tl,L=mi(W,"ALLOWED_TAGS")?Me({},W.ALLOWED_TAGS,pt):H,X=mi(W,"ALLOWED_ATTR")?Me({},W.ALLOWED_ATTR,pt):ae,hn=mi(W,"ALLOWED_NAMESPACES")?Me({},W.ALLOWED_NAMESPACES,Iu):Sl,Li=mi(W,"ADD_URI_SAFE_ATTR")?Me(Gi(Ve),W.ADD_URI_SAFE_ATTR,pt):Ve,Yi=mi(W,"ADD_DATA_URI_TAGS")?Me(Gi(Yt),W.ADD_DATA_URI_TAGS,pt):Yt,Nt=mi(W,"FORBID_CONTENTS")?Me({},W.FORBID_CONTENTS,pt):Bt,ne=mi(W,"FORBID_TAGS")?Me({},W.FORBID_TAGS,pt):Gi({}),K=mi(W,"FORBID_ATTR")?Me({},W.FORBID_ATTR,pt):Gi({}),Zt=mi(W,"USE_PROFILES")?W.USE_PROFILES:!1,ue=W.ALLOW_ARIA_ATTR!==!1,le=W.ALLOW_DATA_ATTR!==!1,ve=W.ALLOW_UNKNOWN_PROTOCOLS||!1,pe=W.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Te=W.SAFE_FOR_TEMPLATES||!1,He=W.SAFE_FOR_XML!==!1,Ie=W.WHOLE_DOCUMENT||!1,Ft=W.RETURN_DOM||!1,_i=W.RETURN_DOM_FRAGMENT||!1,pi=W.RETURN_TRUSTED_TYPE||!1,Ee=W.FORCE_BODY||!1,Ii=W.SANITIZE_DOM!==!1,Vi=W.SANITIZE_NAMED_PROPS||!1,at=W.KEEP_CONTENT!==!1,kt=W.IN_PLACE||!1,U=W.ALLOWED_URI_REGEXP||Av,yt=W.NAMESPACE||Mt,Xi=W.MATHML_TEXT_INTEGRATION_POINTS||Xi,Ji=W.HTML_INTEGRATION_POINTS||Ji,he=W.CUSTOM_ELEMENT_HANDLING||{},W.CUSTOM_ELEMENT_HANDLING&&xs(W.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(he.tagNameCheck=W.CUSTOM_ELEMENT_HANDLING.tagNameCheck),W.CUSTOM_ELEMENT_HANDLING&&xs(W.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(he.attributeNameCheck=W.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),W.CUSTOM_ELEMENT_HANDLING&&typeof W.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=W.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Te&&(le=!1),_i&&(Ft=!0),Zt&&(L=Me({},np),X=el(null),Zt.html===!0&&(Me(L,rp),Me(X,ap)),Zt.svg===!0&&(Me(L,$u),Me(X,qu),Me(X,Yo)),Zt.svgFilters===!0&&(Me(L,Fu),Me(X,qu),Me(X,Yo)),Zt.mathMl===!0&&(Me(L,Zu),Me(X,op),Me(X,Yo))),mi(W,"ADD_TAGS")||(z.tagCheck=null),mi(W,"ADD_ATTR")||(z.attributeCheck=null),W.ADD_TAGS&&(typeof W.ADD_TAGS=="function"?z.tagCheck=W.ADD_TAGS:(L===H&&(L=Gi(L)),Me(L,W.ADD_TAGS,pt))),W.ADD_ATTR&&(typeof W.ADD_ATTR=="function"?z.attributeCheck=W.ADD_ATTR:(X===ae&&(X=Gi(X)),Me(X,W.ADD_ATTR,pt))),W.ADD_URI_SAFE_ATTR&&Me(Li,W.ADD_URI_SAFE_ATTR,pt),W.FORBID_CONTENTS&&(Nt===Bt&&(Nt=Gi(Nt)),Me(Nt,W.FORBID_CONTENTS,pt)),W.ADD_FORBID_CONTENTS&&(Nt===Bt&&(Nt=Gi(Nt)),Me(Nt,W.ADD_FORBID_CONTENTS,pt)),at&&(L["#text"]=!0),Ie&&Me(L,["html","head","body"]),L.table&&(Me(L,["tbody"]),delete ne.tbody),W.TRUSTED_TYPES_POLICY){if(typeof W.TRUSTED_TYPES_POLICY.createHTML!="function")throw da('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof W.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw da('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=W.TRUSTED_TYPES_POLICY,R=S.createHTML("")}else S===void 0&&(S=e3(C,v)),S!==null&&typeof R=="string"&&(R=S.createHTML(""));Wt&&Wt(W),Qi=W}},mn=Me({},[...$u,...Fu,...FE]),_n=Me({},[...Zu,...ZE]),Aa=function(W){let _e=p(W);(!_e||!_e.tagName)&&(_e={namespaceURI:yt,tagName:"template"});const ge=tl(W.tagName),qe=tl(_e.tagName);return hn[W.namespaceURI]?W.namespaceURI===Ot?_e.namespaceURI===Mt?ge==="svg":_e.namespaceURI===vi?ge==="svg"&&(qe==="annotation-xml"||Xi[qe]):!!mn[ge]:W.namespaceURI===vi?_e.namespaceURI===Mt?ge==="math":_e.namespaceURI===Ot?ge==="math"&&Ji[qe]:!!_n[ge]:W.namespaceURI===Mt?_e.namespaceURI===Ot&&!Ji[qe]||_e.namespaceURI===vi&&!Xi[qe]?!1:!_n[ge]&&(yr[ge]||!mn[ge]):!!(ai==="application/xhtml+xml"&&hn[W.namespaceURI]):!1},Xt=function(W){ha(r.removed,{element:W});try{p(W).removeChild(W)}catch{m(W)}},Ni=function(W,_e){try{ha(r.removed,{attribute:_e.getAttributeNode(W),from:_e})}catch{ha(r.removed,{attribute:null,from:_e})}if(_e.removeAttribute(W),W==="is")if(Ft||_i)try{Xt(_e)}catch{}else try{_e.setAttribute(W,"")}catch{}},pn=function(W){let _e=null,ge=null;if(Ee)W="<remove></remove>"+W;else{const Oe=Pu(W,/^[\r\n\t ]+/);ge=Oe&&Oe[0]}ai==="application/xhtml+xml"&&yt===Mt&&(W='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+W+"</body></html>");const qe=S?S.createHTML(W):W;if(yt===Mt)try{_e=new b().parseFromString(qe,ai)}catch{}if(!_e||!_e.documentElement){_e=D.createDocument(yt,"template",null);try{_e.documentElement.innerHTML=un?R:qe}catch{}}const ot=_e.body||_e.documentElement;return W&&ge&&ot.insertBefore(a.createTextNode(ge),ot.childNodes[0]||null),yt===Mt?N.call(_e,Ie?"html":"body")[0]:Ie?_e.documentElement:ot},vn=function(W){return M.call(W.ownerDocument||W,W,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},gi=function(W){return W instanceof d&&(typeof W.nodeName!="string"||typeof W.textContent!="string"||typeof W.removeChild!="function"||!(W.attributes instanceof y)||typeof W.removeAttribute!="function"||typeof W.setAttribute!="function"||typeof W.namespaceURI!="string"||typeof W.insertBefore!="function"||typeof W.hasChildNodes!="function")},St=function(W){return typeof l=="function"&&W instanceof l};function st(Se,W,_e){Vo(Se,ge=>{ge.call(r,W,_e,Qi)})}const es=function(W){let _e=null;if(st($.beforeSanitizeElements,W,null),gi(W))return Xt(W),!0;const ge=pt(W.nodeName);if(st($.uponSanitizeElement,W,{tagName:ge,allowedTags:L}),He&&W.hasChildNodes()&&!St(W.firstElementChild)&&Gt(/<[/\w!]/g,W.innerHTML)&&Gt(/<[/\w!]/g,W.textContent)||W.nodeType===_a.progressingInstruction||He&&W.nodeType===_a.comment&&Gt(/<[/\w]/g,W.data))return Xt(W),!0;if(!(z.tagCheck instanceof Function&&z.tagCheck(ge))&&(!L[ge]||ne[ge])){if(!ne[ge]&&Ra(ge)&&(he.tagNameCheck instanceof RegExp&&Gt(he.tagNameCheck,ge)||he.tagNameCheck instanceof Function&&he.tagNameCheck(ge)))return!1;if(at&&!Nt[ge]){const qe=p(W)||W.parentNode,ot=f(W)||W.childNodes;if(ot&&qe){const Oe=ot.length;for(let jt=Oe-1;jt>=0;--jt){const yi=x(ot[jt],!0);yi.__removalCount=(W.__removalCount||0)+1,qe.insertBefore(yi,g(W))}}}return Xt(W),!0}return W instanceof h&&!Aa(W)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&Gt(/<\/no(script|embed|frames)/i,W.innerHTML)?(Xt(W),!0):(Te&&W.nodeType===_a.text&&(_e=W.textContent,Vo([q,P,Q],qe=>{_e=fa(_e,qe," ")}),W.textContent!==_e&&(ha(r.removed,{element:W.cloneNode()}),W.textContent=_e)),st($.afterSanitizeElements,W,null),!1)},br=function(W,_e,ge){if(K[_e]||Ii&&(_e==="id"||_e==="name")&&(ge in a||ge in fn))return!1;if(!(le&&!K[_e]&&Gt(te,_e))){if(!(ue&&Gt(G,_e))){if(!(z.attributeCheck instanceof Function&&z.attributeCheck(_e,W))){if(!X[_e]||K[_e]){if(!(Ra(W)&&(he.tagNameCheck instanceof RegExp&&Gt(he.tagNameCheck,W)||he.tagNameCheck instanceof Function&&he.tagNameCheck(W))&&(he.attributeNameCheck instanceof RegExp&&Gt(he.attributeNameCheck,_e)||he.attributeNameCheck instanceof Function&&he.attributeNameCheck(_e,W))||_e==="is"&&he.allowCustomizedBuiltInElements&&(he.tagNameCheck instanceof RegExp&&Gt(he.tagNameCheck,ge)||he.tagNameCheck instanceof Function&&he.tagNameCheck(ge))))return!1}else if(!Li[_e]){if(!Gt(U,fa(ge,ee,""))){if(!((_e==="src"||_e==="xlink:href"||_e==="href")&&W!=="script"&&UE(ge,"data:")===0&&Yi[W])){if(!(ve&&!Gt(Y,fa(ge,ee,"")))){if(ge)return!1}}}}}}}return!0},Ra=function(W){return W!=="annotation-xml"&&Pu(W,B)},Da=function(W){st($.beforeSanitizeAttributes,W,null);const{attributes:_e}=W;if(!_e||gi(W))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let qe=_e.length;for(;qe--;){const ot=_e[qe],{name:Oe,namespaceURI:jt,value:yi}=ot,Jt=pt(Oe),Pi=yi;let Rt=Oe==="value"?Pi:IE(Pi);if(ge.attrName=Jt,ge.attrValue=Rt,ge.keepAttr=!0,ge.forceKeepAttr=void 0,st($.uponSanitizeAttribute,W,ge),Rt=ge.attrValue,Vi&&(Jt==="id"||Jt==="name")&&(Ni(Oe,W),Rt=Pt+Rt),He&&Gt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Rt)){Ni(Oe,W);continue}if(Jt==="attributename"&&Pu(Rt,"href")){Ni(Oe,W);continue}if(ge.forceKeepAttr)continue;if(!ge.keepAttr){Ni(Oe,W);continue}if(!pe&&Gt(/\/>/i,Rt)){Ni(Oe,W);continue}Te&&Vo([q,P,Q],yn=>{Rt=fa(Rt,yn," ")});const gn=pt(W.nodeName);if(!br(gn,Jt,Rt)){Ni(Oe,W);continue}if(S&&typeof C=="object"&&typeof C.getAttributeType=="function"&&!jt)switch(C.getAttributeType(gn,Jt)){case"TrustedHTML":{Rt=S.createHTML(Rt);break}case"TrustedScriptURL":{Rt=S.createScriptURL(Rt);break}}if(Rt!==Pi)try{jt?W.setAttributeNS(jt,Oe,Rt):W.setAttribute(Oe,Rt),gi(W)?Xt(W):sp(r.removed)}catch{Ni(Oe,W)}}st($.afterSanitizeAttributes,W,null)},ka=function Se(W){let _e=null;const ge=vn(W);for(st($.beforeSanitizeShadowDOM,W,null);_e=ge.nextNode();)st($.uponSanitizeShadowNode,_e,null),es(_e),Da(_e),_e.content instanceof w&&Se(_e.content);st($.afterSanitizeShadowDOM,W,null)};return r.sanitize=function(Se){let W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_e=null,ge=null,qe=null,ot=null;if(un=!Se,un&&(Se="<!-->"),typeof Se!="string"&&!St(Se))if(typeof Se.toString=="function"){if(Se=Se.toString(),typeof Se!="string")throw da("dirty is not a string, aborting")}else throw da("toString is not a function");if(!r.isSupported)return Se;if(ut||dn(W),r.removed=[],typeof Se=="string"&&(kt=!1),kt){if(Se.nodeName){const yi=pt(Se.nodeName);if(!L[yi]||ne[yi])throw da("root node is forbidden and cannot be sanitized in-place")}}else if(Se instanceof l)_e=pn("<!---->"),ge=_e.ownerDocument.importNode(Se,!0),ge.nodeType===_a.element&&ge.nodeName==="BODY"||ge.nodeName==="HTML"?_e=ge:_e.appendChild(ge);else{if(!Ft&&!Te&&!Ie&&Se.indexOf("<")===-1)return S&&pi?S.createHTML(Se):Se;if(_e=pn(Se),!_e)return Ft?null:pi?R:""}_e&&Ee&&Xt(_e.firstChild);const Oe=vn(kt?Se:_e);for(;qe=Oe.nextNode();)es(qe),Da(qe),qe.content instanceof w&&ka(qe.content);if(kt)return Se;if(Ft){if(_i)for(ot=T.call(_e.ownerDocument);_e.firstChild;)ot.appendChild(_e.firstChild);else ot=_e;return(X.shadowroot||X.shadowrootmode)&&(ot=I.call(o,ot,!0)),ot}let jt=Ie?_e.outerHTML:_e.innerHTML;return Ie&&L["!doctype"]&&_e.ownerDocument&&_e.ownerDocument.doctype&&_e.ownerDocument.doctype.name&&Gt(Rv,_e.ownerDocument.doctype.name)&&(jt="<!DOCTYPE "+_e.ownerDocument.doctype.name+`>
|
|
274
|
+
`+jt),Te&&Vo([q,P,Q],yi=>{jt=fa(jt,yi," ")}),S&&pi?S.createHTML(jt):jt},r.setConfig=function(){let Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dn(Se),ut=!0},r.clearConfig=function(){Qi=null,ut=!1},r.isValidAttribute=function(Se,W,_e){Qi||dn({});const ge=pt(Se),qe=pt(W);return br(ge,qe,_e)},r.addHook=function(Se,W){typeof W=="function"&&ha($[Se],W)},r.removeHook=function(Se,W){if(W!==void 0){const _e=zE($[Se],W);return _e===-1?void 0:HE($[Se],_e,1)[0]}return sp($[Se])},r.removeHooks=function(Se){$[Se]=[]},r.removeAllHooks=function(){$=cp()},r}var t3=Dv();function Ta(i){return t3.sanitize(i,{ALLOWED_TAGS:[]})}const i3={Read:"📖",Edit:"✏️",Write:"📝",Bash:"💻",Search:"🔍"};function s3(i){return i?i3[i]??"❓":"❓"}function r3(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 E.jsx("div",{className:`flex ${r?"justify-end":"justify-start"} mb-3`,children:E.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:[E.jsx("div",{className:"whitespace-pre-wrap break-words",children:Ta(i.text)}),i.timestamp&&E.jsx("div",{className:`text-[10px] mt-1 ${r?"text-[#555]":"text-[#444]"}`,children:r3(i.timestamp)})]})})}function n3({entry:i}){const[r,a]=F.useState(!1);return E.jsx("div",{className:"flex justify-start mb-3",children:E.jsxs("div",{className:"max-w-[80%] w-full",children:[E.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:[E.jsx("span",{className:"inline-block transition-transform duration-200",style:{transform:r?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),E.jsx("span",{className:"italic",children:"Thinking…"})]}),r&&E.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 a3({entry:i}){const r=Ta(i.text),a=r.length>100?r.slice(0,100)+"…":r;return E.jsx("div",{className:"flex justify-start mb-3",children:E.jsxs("div",{className:"max-w-[80%] w-full bg-[#0d0d12] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[E.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-[#1a1a2e]",children:[E.jsx("span",{className:"text-base",children:s3(i.toolName)}),E.jsx("span",{className:"text-xs font-semibold text-[#00e5ff] font-mono",children:i.toolName??"Tool"}),E.jsx("span",{className:"text-[10px] text-[#555] ml-auto",children:"tool_use"})]}),E.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 o3({entry:i}){const r=/^\s*error(?:\s*[:\-]|\s*$)/i.test(i.text)||/^\s*(?:failed|exception)(?:\s*[:\-]|\s*$)/i.test(i.text);return E.jsx("div",{className:"flex justify-start mb-3",children:E.jsxs("div",{className:`max-w-[80%] w-full bg-[#0d0d12] rounded-lg overflow-hidden ${r?"border border-[#ff3366]/40":"border border-[#00ff88]/30"}`,children:[E.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-[#1a1a2e]",children:[E.jsx("span",{className:"text-xs font-semibold text-[#888]",children:r?"✗ Result":"✓ Result"}),i.toolName&&E.jsx("span",{className:"text-[10px] text-[#555] font-mono",children:i.toolName})]}),E.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 l3({entry:i}){if(i.role==="user")return E.jsx(Gu,{entry:i});switch(i.contentType){case"text":return E.jsx(Gu,{entry:i});case"thinking":return E.jsx(n3,{entry:i});case"tool_use":return E.jsx(a3,{entry:i});case"tool_result":return E.jsx(o3,{entry:i});case"permission_request":return E.jsxs("div",{className:"text-red-400 text-sm font-semibold px-3 py-2",children:["Permission Request: ",Ta(i.text)]});default:return E.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 c3({sessionId:i}){const[r,a]=F.useState([]),[o,v]=F.useState(!0),[w,A]=F.useState(null),l=dt(S=>S.token),[h,u]=F.useState({thinking:!1,tool_use:!0,tool_result:!0}),[y,d]=F.useState(!1),b=F.useRef(null),C=F.useRef(null),k=F.useRef(!1),x=F.useRef(new Set);F.useEffect(()=>{let S=!1;return I2(i).then(R=>{if(!S){const D=R.messages??[],M=D.length>Xo?D.slice(D.length-Xo):D;a(M),x.current=new Set(M.map(Ku))}}).catch(R=>{S||A(R instanceof Error?R.message:"Failed to load")}).finally(()=>{S||v(!1)}),()=>{S=!0}},[i]),F.useEffect(()=>{const S=xv(i,R=>{try{const D=JSON.parse(R.data);if(D.event!=="message")return;const M=D.data;a(T=>{const N=Ku(M);if(x.current.has(N))return T;x.current.add(N);const I=[...T,M];if(I.length>Xo){const $=I.length-Xo,q=I.slice($);for(let P=0;P<$;P++)x.current.delete(Ku(I[P]));return q}return I})}catch{}},l);return()=>S()},[i,l]),F.useEffect(()=>{var S;k.current||(S=b.current)==null||S.scrollIntoView({behavior:"smooth"})},[r]);const m=F.useCallback(()=>{const S=C.current;if(!S)return;const R=S.scrollHeight-S.scrollTop-S.clientHeight<60;k.current=!R,d(!R)},[]),g=F.useCallback(()=>{var S;k.current=!1,(S=b.current)==null||S.scrollIntoView({behavior:"smooth"})},[]),f=F.useCallback(S=>{u(R=>({...R,[S]:!R[S]}))},[]),p=F.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?E.jsx("div",{className:"flex items-center justify-center h-full text-[#555] text-sm",children:E.jsx("div",{className:"animate-pulse",children:"Loading transcript…"})}):w?E.jsxs("div",{className:"flex items-center justify-center h-full text-[#ff3366] text-sm",children:["⚠ ",w]}):E.jsxs("div",{className:"flex flex-col h-full relative",children:[E.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-[#1a1a2e] bg-[#0a0a0f] shrink-0",children:[E.jsx("span",{className:"text-[10px] text-[#555] uppercase tracking-wider",children:"Filter:"}),["thinking","tool_use","tool_result"].map(S=>E.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)),E.jsxs("span",{className:"text-[10px] text-[#444] ml-auto",children:[p.length," / ",r.length]})]}),E.jsxs("div",{ref:C,onScroll:m,className:"flex-1 overflow-y-auto px-4 py-3",children:[p.length===0&&E.jsx("div",{className:"flex items-center justify-center h-full text-[#555] text-sm",children:"No messages yet"}),p.map((S,R)=>E.jsx(l3,{entry:S},S.toolUseId??`${S.role}-${S.timestamp??R}`)),E.jsx("div",{ref:b})]}),y&&E.jsx("button",{onClick:g,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 Wu={exports:{}},up;function u3(){return up||(up=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,p,S,R){var D,M=arguments.length,T=M<3?p:R===null?R=Object.getOwnPropertyDescriptor(p,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(f,p,S,R);else for(var N=f.length-1;N>=0;N--)(D=f[N])&&(T=(M<3?D(T):M>3?D(p,S,T):D(p,S))||T);return M>3&&T&&Object.defineProperty(p,S,T),T},y=this&&this.__param||function(f,p){return function(S,R){p(S,R,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const d=h(9042),b=h(9924),C=h(844),k=h(4725),x=h(2585),m=h(3656);let g=l.AccessibilityManager=class extends C.Disposable{constructor(f,p,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 D=0;D<this._terminal.rows;D++)this._rowElements[D]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[D]);if(this._topBoundaryFocusListener=D=>this._handleBoundaryFocus(D,0),this._bottomBoundaryFocusListener=D=>this._handleBoundaryFocus(D,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new b.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((D=>this._handleResize(D.rows)))),this.register(this._terminal.onRender((D=>this._refreshRows(D.start,D.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((D=>this._handleChar(D)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
275
|
+
`)))),this.register(this._terminal.onA11yTab((D=>this._handleTab(D)))),this.register(this._terminal.onKey((D=>this._handleKey(D.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,m.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,C.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(f){for(let p=0;p<f;p++)this._handleChar(" ")}_handleChar(f){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==f&&(this._charsToAnnounce+=f):this._charsToAnnounce+=f,f===`
|
|
276
|
+
`&&(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,p){this._liveRegionDebouncer.refresh(f,p,this._terminal.rows)}_renderRows(f,p){const S=this._terminal.buffer,R=S.lines.length.toString();for(let D=f;D<=p;D++){const M=S.lines.get(S.ydisp+D),T=[],N=(M==null?void 0:M.translateToString(!0,void 0,void 0,T))||"",I=(S.ydisp+D+1).toString(),$=this._rowElements[D];$&&(N.length===0?($.innerText=" ",this._rowColumns.set($,[0,1])):($.textContent=N,this._rowColumns.set($,T)),$.setAttribute("aria-posinset",I),$.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(f,p){const S=f.target,R=this._rowElements[p===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(p===0?"1":`${this._terminal.buffer.lines.length}`)||f.relatedTarget!==R)return;let D,M;if(p===0?(D=S,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(D=this._rowElements.shift(),M=S,this._rowContainer.removeChild(D)),D.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),p===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(p===0?-1:1),this._rowElements[p===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 p={node:f.anchorNode,offset:f.anchorOffset},S={node:f.focusNode,offset:f.focusOffset};if((p.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||p.node===S.node&&p.offset>S.offset)&&([p,S]=[S,p]),p.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(p={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(p.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 D=({node:I,offset:$})=>{const q=I instanceof Text?I.parentNode:I;let P=parseInt(q==null?void 0:q.getAttribute("aria-posinset"),10)-1;if(isNaN(P))return console.warn("row is invalid. Race condition?"),null;const Q=this._rowColumns.get(q);if(!Q)return console.warn("columns is null. Race condition?"),null;let te=$<Q.length?Q[$]:Q.slice(-1)[0]+1;return te>=this._terminal.cols&&(++P,te=0),{row:P,column:te}},M=D(p),T=D(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 p=this._rowContainer.children.length;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);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=g=u([y(1,x.IInstantiationService),y(2,k.ICoreBrowserService),y(3,k.IRenderService)],g)},3614:(A,l)=>{function h(b){return b.replace(/\r?\n/g,"\r")}function u(b,C){return C?"\x1B[200~"+b+"\x1B[201~":b}function y(b,C,k,x){b=u(b=h(b),k.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(b,!0),C.value=""}function d(b,C,k){const x=k.getBoundingClientRect(),m=b.clientX-x.left-10,g=b.clientY-x.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${m}px`,C.style.top=`${g}px`,C.style.zIndex="1000",C.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(b,C){b.clipboardData&&b.clipboardData.setData("text/plain",C.selectionText),b.preventDefault()},l.handlePasteEvent=function(b,C,k,x){b.stopPropagation(),b.clipboardData&&y(b.clipboardData.getData("text/plain"),C,k,x)},l.paste=y,l.moveTextAreaUnderMouseCursor=d,l.rightClickHandler=function(b,C,k,x,m){d(b,C,k),m&&x.rightClickSelect(b),C.value=x.selectionText,C.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,b){this._css.set(y,d,b)}getCss(y,d){return this._css.get(y,d)}setColor(y,d,b){this._color.set(y,d,b)}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 b=!1;return{dispose:()=>{b||(b=!0,h.removeEventListener(u,y,d))}}}},3551:function(A,l,h){var u=this&&this.__decorate||function(g,f,p,S){var R,D=arguments.length,M=D<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(g,f,p,S);else for(var T=g.length-1;T>=0;T--)(R=g[T])&&(M=(D<3?R(M):D>3?R(f,p,M):R(f,p))||M);return D>3&&M&&Object.defineProperty(f,p,M),M},y=this&&this.__param||function(g,f){return function(p,S){f(p,S,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const d=h(3656),b=h(8460),C=h(844),k=h(2585),x=h(4725);let m=l.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(g,f,p,S,R){super(),this._element=g,this._mouseService=f,this._renderService=p,this._bufferService=S,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new b.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new b.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)((()=>{var D;this._lastMouseEvent=void 0,(D=this._activeProviderReplies)==null||D.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(g){this._lastMouseEvent=g;const f=this._positionFromMouseEvent(g,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const p=g.composedPath();for(let S=0;S<p.length;S++){const R=p[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(g){if(this._activeLine!==g.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(g,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,g)||(this._clearCurrentLink(),this._askForLink(g,!0))}_askForLink(g,f){var S,R;this._activeProviderReplies&&f||((S=this._activeProviderReplies)==null||S.forEach((D=>{D==null||D.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=g.y);let p=!1;for(const[D,M]of this._linkProviderService.linkProviders.entries())f?(R=this._activeProviderReplies)!=null&&R.get(D)&&(p=this._checkLinkProviderResult(D,g,p)):M.provideLinks(g.y,(T=>{var I,$;if(this._isMouseOut)return;const N=T==null?void 0:T.map((q=>({link:q})));(I=this._activeProviderReplies)==null||I.set(D,N),p=this._checkLinkProviderResult(D,g,p),(($=this._activeProviderReplies)==null?void 0:$.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(g.y,this._activeProviderReplies)}))}_removeIntersectingLinks(g,f){const p=new Set;for(let S=0;S<f.size;S++){const R=f.get(S);if(R)for(let D=0;D<R.length;D++){const M=R[D],T=M.link.range.start.y<g?0:M.link.range.start.x,N=M.link.range.end.y>g?this._bufferService.cols:M.link.range.end.x;for(let I=T;I<=N;I++){if(p.has(I)){R.splice(D--,1);break}p.add(I)}}}}_checkLinkProviderResult(g,f,p){var D;if(!this._activeProviderReplies)return p;const S=this._activeProviderReplies.get(g);let R=!1;for(let M=0;M<g;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&&(p=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!p)for(let M=0;M<this._activeProviderReplies.size;M++){const T=(D=this._activeProviderReplies.get(M))==null?void 0:D.find((N=>this._linkAtPosition(N.link,f)));if(T){p=!0,this._handleNewLink(T);break}}return p}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(g){if(!this._currentLink)return;const f=this._positionFromMouseEvent(g,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(g,this._currentLink.link.text)}_clearCurrentLink(g,f){this._currentLink&&this._lastMouseEvent&&(!g||!f||this._currentLink.link.range.start.y>=g&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(g){if(!this._lastMouseEvent)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(g.link,f)&&(this._currentLink=g,this._currentLink.state={decorations:{underline:g.link.decorations===void 0||g.link.decorations.underline,pointerCursor:g.link.decorations===void 0||g.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,g.link,this._lastMouseEvent),g.link.decorations={},Object.defineProperties(g.link.decorations,{pointerCursor:{get:()=>{var p,S;return(S=(p=this._currentLink)==null?void 0:p.state)==null?void 0:S.decorations.pointerCursor},set:p=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==p&&(this._currentLink.state.decorations.pointerCursor=p,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",p))}},underline:{get:()=>{var p,S;return(S=(p=this._currentLink)==null?void 0:p.state)==null?void 0:S.decorations.underline},set:p=>{var S,R,D;(S=this._currentLink)!=null&&S.state&&((D=(R=this._currentLink)==null?void 0:R.state)==null?void 0:D.decorations.underline)!==p&&(this._currentLink.state.decorations.underline=p,this._currentLink.state.isHovered&&this._fireUnderlineEvent(g.link,p))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((p=>{if(!this._currentLink)return;const S=p.start===0?0:p.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+p.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(S,R),this._lastMouseEvent)){const D=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);D&&this._askForLink(D,!1)}}))))}_linkHover(g,f,p){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&&g.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(p,f.text)}_fireUnderlineEvent(g,f){const p=g.range,S=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(p.start.x-1,p.start.y-S-1,p.end.x,p.end.y-S-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(g,f,p){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&&g.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(p,f.text)}_linkAtPosition(g,f){const p=g.range.start.y*this._bufferService.cols+g.range.start.x,S=g.range.end.y*this._bufferService.cols+g.range.end.x,R=f.y*this._bufferService.cols+f.x;return p<=R&&R<=S}_positionFromMouseEvent(g,f,p){const S=p.getCoords(g,f,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(g,f,p,S,R){return{x1:g,y1:f,x2:p,y2:S,cols:this._bufferService.cols,fg:R}}};l.Linkifier=m=u([y(1,x.IMouseService),y(2,x.IRenderService),y(3,k.IBufferService),y(4,x.ILinkProviderService)],m)},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(x,m,g,f){var p,S=arguments.length,R=S<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,g):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(x,m,g,f);else for(var D=x.length-1;D>=0;D--)(p=x[D])&&(R=(S<3?p(R):S>3?p(m,g,R):p(m,g))||R);return S>3&&R&&Object.defineProperty(m,g,R),R},y=this&&this.__param||function(x,m){return function(g,f){m(g,f,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const d=h(511),b=h(2585);let C=l.OscLinkProvider=class{constructor(x,m,g){this._bufferService=x,this._optionsService=m,this._oscLinkService=g}provideLinks(x,m){var N;const g=this._bufferService.buffer.lines.get(x-1);if(!g)return void m(void 0);const f=[],p=this._optionsService.rawOptions.linkHandler,S=new d.CellData,R=g.getTrimmedLength();let D=-1,M=-1,T=!1;for(let I=0;I<R;I++)if(M!==-1||g.hasContent(I)){if(g.loadCell(I,S),S.hasExtendedAttrs()&&S.extended.urlId){if(M===-1){M=I,D=S.extended.urlId;continue}T=S.extended.urlId!==D}else M!==-1&&(T=!0);if(T||M!==-1&&I===R-1){const $=(N=this._oscLinkService.getLinkData(D))==null?void 0:N.uri;if($){const q={start:{x:M+1,y:x},end:{x:I+(T||I!==R-1?0:1),y:x}};let P=!1;if(!(p!=null&&p.allowNonHttpProtocols))try{const Q=new URL($);["http:","https:"].includes(Q.protocol)||(P=!0)}catch{P=!0}P||f.push({text:$,range:q,activate:(Q,te)=>p?p.activate(Q,te,q):k(0,te),hover:(Q,te)=>{var G;return(G=p==null?void 0:p.hover)==null?void 0:G.call(p,Q,te,q)},leave:(Q,te)=>{var G;return(G=p==null?void 0:p.leave)==null?void 0:G.call(p,Q,te,q)}})}T=!1,S.hasExtendedAttrs()&&S.extended.urlId?(M=I,D=S.extended.urlId):(M=-1,D=-1)}}m(f)}};function k(x,m){if(confirm(`Do you want to navigate to ${m}?
|
|
277
|
+
|
|
278
|
+
WARNING: This link could potentially be dangerous`)){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=m}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=C=u([y(0,b.IBufferService),y(1,b.IOptionsService),y(2,b.IOscLinkService)],C)},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),b=h(9042),C=h(3730),k=h(1680),x=h(3107),m=h(5744),g=h(2950),f=h(1296),p=h(428),S=h(4269),R=h(5114),D=h(8934),M=h(3230),T=h(9312),N=h(4725),I=h(6731),$=h(8055),q=h(8969),P=h(8460),Q=h(844),te=h(6114),G=h(8437),Y=h(2584),ee=h(7399),B=h(5941),U=h(9074),L=h(2585),H=h(5435),X=h(4567),ae=h(779);class he extends q.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(K={}){super(K),this.browser=te,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Q.MutableDisposable),this._onCursorMove=this.register(new P.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new P.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new P.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new P.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new P.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new P.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new P.EventEmitter),this._onBlur=this.register(new P.EventEmitter),this._onA11yCharEmitter=this.register(new P.EventEmitter),this._onA11yTabEmitter=this.register(new P.EventEmitter),this._onWillOpen=this.register(new P.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(U.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ae.LinkProviderService),this._instantiationService.setService(N.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((z,ue)=>this.refresh(z,ue)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((z=>this._reportWindowsOptions(z)))),this.register(this._inputHandler.onColor((z=>this._handleColorEvent(z)))),this.register((0,P.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,P.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((z=>this._afterResize(z.cols,z.rows)))),this.register((0,Q.toDisposable)((()=>{var z,ue;this._customKeyEventHandler=void 0,(ue=(z=this.element)==null?void 0:z.parentNode)==null||ue.removeChild(this.element)})))}_handleColorEvent(K){if(this._themeService)for(const z of K){let ue,le="";switch(z.index){case 256:ue="foreground",le="10";break;case 257:ue="background",le="11";break;case 258:ue="cursor",le="12";break;default:ue="ansi",le="4;"+z.index}switch(z.type){case 0:const ve=$.color.toColorRGB(ue==="ansi"?this._themeService.colors.ansi[z.index]:this._themeService.colors[ue]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${le};${(0,B.toRgbString)(ve)}${Y.C1_ESCAPED.ST}`);break;case 1:if(ue==="ansi")this._themeService.modifyColors((pe=>pe.ansi[z.index]=$.channels.toColor(...z.color)));else{const pe=ue;this._themeService.modifyColors((Te=>Te[pe]=$.channels.toColor(...z.color)))}break;case 2:this._themeService.restoreColor(z.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(K){K?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(X.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(K){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var K;return(K=this.textarea)==null?void 0:K.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.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 K=this.buffer.ybase+this.buffer.y,z=this.buffer.lines.get(K);if(!z)return;const ue=Math.min(this.buffer.x,this.cols-1),le=this._renderService.dimensions.css.cell.height,ve=z.getWidth(ue),pe=this._renderService.dimensions.css.cell.width*ve,Te=this.buffer.y*this._renderService.dimensions.css.cell.height,He=ue*this._renderService.dimensions.css.cell.width;this.textarea.style.left=He+"px",this.textarea.style.top=Te+"px",this.textarea.style.width=pe+"px",this.textarea.style.height=le+"px",this.textarea.style.lineHeight=le+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(z=>{this.hasSelection()&&(0,u.copyHandler)(z,this._selectionService)})));const K=z=>(0,u.handlePasteEvent)(z,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",K)),this.register((0,y.addDisposableDomListener)(this.element,"paste",K)),te.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(z=>{z.button===2&&(0,u.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(z=>{(0,u.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),te.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(z=>{z.button===1&&(0,u.moveTextAreaUnderMouseCursor)(z,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(K=>this._keyUp(K)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(K=>this._keyDown(K)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(K=>this._keyPress(K)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(K=>this._compositionHelper.compositionupdate(K)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(K=>this._inputEvent(K)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(K){var ue;if(!K)throw new Error("Terminal requires a parent element.");if(K.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ue=this.element)==null?void 0:ue.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=K.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"),K.appendChild(this.element);const z=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),z.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",(le=>this.updateCursorStyle(le)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),z.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",b.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,K.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",(le=>this._handleTextAreaFocus(le)))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(p.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(N.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(I.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((le=>this._onRender.fire(le)))),this.onResize((le=>this._renderService.resize(le.cols,le.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(g.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(D.MouseService),this._instantiationService.setService(N.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(z);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((le=>this.scrollLines(le.amount,le.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((le=>this.scrollLines(le.amount,le.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((le=>this._renderService.handleSelectionChanged(le.start,le.end,le.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((le=>{this.textarea.value=le,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((le=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(le=>this._selectionService.handleMouseDown(le)))),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(X.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(le=>this._handleScreenReaderModeOptionChange(le)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(le=>{!this._overviewRulerRenderer&&le&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const K=this,z=this.element;function ue(pe){const Te=K._mouseService.getMouseReportCoords(pe,K.screenElement);if(!Te)return!1;let He,Ie;switch(pe.overrideType||pe.type){case"mousemove":Ie=32,pe.buttons===void 0?(He=3,pe.button!==void 0&&(He=pe.button<3?pe.button:3)):He=1&pe.buttons?0:4&pe.buttons?1:2&pe.buttons?2:3;break;case"mouseup":Ie=0,He=pe.button<3?pe.button:3;break;case"mousedown":Ie=1,He=pe.button<3?pe.button:3;break;case"wheel":if(K._customWheelEventHandler&&K._customWheelEventHandler(pe)===!1||K.viewport.getLinesScrolled(pe)===0)return!1;Ie=pe.deltaY<0?0:1,He=4;break;default:return!1}return!(Ie===void 0||He===void 0||He>4)&&K.coreMouseService.triggerMouseEvent({col:Te.col,row:Te.row,x:Te.x,y:Te.y,button:He,action:Ie,ctrl:pe.ctrlKey,alt:pe.altKey,shift:pe.shiftKey})}const le={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ve={mouseup:pe=>(ue(pe),pe.buttons||(this._document.removeEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.removeEventListener("mousemove",le.mousedrag)),this.cancel(pe)),wheel:pe=>(ue(pe),this.cancel(pe,!0)),mousedrag:pe=>{pe.buttons&&ue(pe)},mousemove:pe=>{pe.buttons||ue(pe)}};this.register(this.coreMouseService.onProtocolChange((pe=>{pe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(pe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&pe?le.mousemove||(z.addEventListener("mousemove",ve.mousemove),le.mousemove=ve.mousemove):(z.removeEventListener("mousemove",le.mousemove),le.mousemove=null),16&pe?le.wheel||(z.addEventListener("wheel",ve.wheel,{passive:!1}),le.wheel=ve.wheel):(z.removeEventListener("wheel",le.wheel),le.wheel=null),2&pe?le.mouseup||(le.mouseup=ve.mouseup):(this._document.removeEventListener("mouseup",le.mouseup),le.mouseup=null),4&pe?le.mousedrag||(le.mousedrag=ve.mousedrag):(this._document.removeEventListener("mousemove",le.mousedrag),le.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(z,"mousedown",(pe=>{if(pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(pe))return ue(pe),le.mouseup&&this._document.addEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.addEventListener("mousemove",le.mousedrag),this.cancel(pe)}))),this.register((0,y.addDisposableDomListener)(z,"wheel",(pe=>{if(!le.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(pe)===!1)return!1;if(!this.buffer.hasScrollback){const Te=this.viewport.getLinesScrolled(pe);if(Te===0)return;const He=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(pe.deltaY<0?"A":"B");let Ie="";for(let ut=0;ut<Math.abs(Te);ut++)Ie+=He;return this.coreService.triggerDataEvent(Ie,!0),this.cancel(pe,!0)}return this.viewport.handleWheel(pe)?this.cancel(pe):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(z,"touchstart",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(pe),this.cancel(pe)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(z,"touchmove",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(pe)?void 0:this.cancel(pe)}),{passive:!1}))}refresh(K,z){var ue;(ue=this._renderService)==null||ue.refreshRows(K,z)}updateCursorStyle(K){var z;(z=this._selectionService)!=null&&z.shouldColumnSelect(K)?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(K,z,ue=0){var le;ue===1?(super.scrollLines(K,z,ue),this.refresh(0,this.rows-1)):(le=this.viewport)==null||le.scrollLines(K)}paste(K){(0,u.paste)(K,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(K){this._customKeyEventHandler=K}attachCustomWheelEventHandler(K){this._customWheelEventHandler=K}registerLinkProvider(K){return this._linkProviderService.registerLinkProvider(K)}registerCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const z=this._characterJoinerService.register(K);return this.refresh(0,this.rows-1),z}deregisterCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(K)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(K){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+K)}registerDecoration(K){return this._decorationService.registerDecoration(K)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(K,z,ue){this._selectionService.setSelection(K,z,ue)}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 K;(K=this._selectionService)==null||K.clearSelection()}selectAll(){var K;(K=this._selectionService)==null||K.selectAll()}selectLines(K,z){var ue;(ue=this._selectionService)==null||ue.selectLines(K,z)}_keyDown(K){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;const z=this.browser.isMac&&this.options.macOptionIsMeta&&K.altKey;if(!z&&!this._compositionHelper.keydown(K))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;z||K.key!=="Dead"&&K.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ue=(0,ee.evaluateKeyboardEvent)(K,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(K),ue.type===3||ue.type===2){const le=this.rows-1;return this.scrollLines(ue.type===2?-le:le),this.cancel(K,!0)}return ue.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,K)||(ue.cancel&&this.cancel(K,!0),!ue.key||!!(K.key&&!K.ctrlKey&&!K.altKey&&!K.metaKey&&K.key.length===1&&K.key.charCodeAt(0)>=65&&K.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ue.key!==Y.C0.ETX&&ue.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ue.key,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(ue.key,!0),!this.optionsService.rawOptions.screenReaderMode||K.altKey||K.ctrlKey?this.cancel(K,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(K,z){const ue=K.isMac&&!this.options.macOptionIsMeta&&z.altKey&&!z.ctrlKey&&!z.metaKey||K.isWindows&&z.altKey&&z.ctrlKey&&!z.metaKey||K.isWindows&&z.getModifierState("AltGraph");return z.type==="keypress"?ue:ue&&(!z.keyCode||z.keyCode>47)}_keyUp(K){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1||((function(z){return z.keyCode===16||z.keyCode===17||z.keyCode===18})(K)||this.focus(),this.updateCursorStyle(K),this._keyPressHandled=!1)}_keyPress(K){let z;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(this.cancel(K),K.charCode)z=K.charCode;else if(K.which===null||K.which===void 0)z=K.keyCode;else{if(K.which===0||K.charCode===0)return!1;z=K.which}return!(!z||(K.altKey||K.ctrlKey||K.metaKey)&&!this._isThirdLevelShift(this.browser,K)||(z=String.fromCharCode(z),this._onKey.fire({key:z,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(z,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(K){if(K.data&&K.inputType==="insertText"&&(!K.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const z=K.data;return this.coreService.triggerDataEvent(z,!0),this.cancel(K),!0}return!1}resize(K,z){K!==this.cols||z!==this.rows?super.resize(K,z):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(K,z){var ue,le;(ue=this._charSizeService)==null||ue.measure(),(le=this.viewport)==null||le.syncScrollArea(!0)}clear(){var K;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 z=1;z<this.rows;z++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(K=this.viewport)==null||K.reset(),this.refresh(0,this.rows-1)}}reset(){var z,ue;this.options.rows=this.rows,this.options.cols=this.cols;const K=this._customKeyEventHandler;this._setup(),super.reset(),(z=this._selectionService)==null||z.reset(),this._decorationService.reset(),(ue=this.viewport)==null||ue.reset(),this._customKeyEventHandler=K,this.refresh(0,this.rows-1)}clearTextureAtlas(){var K;(K=this._renderService)==null||K.clearTextureAtlas()}_reportFocus(){var K;(K=this.element)!=null&&K.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(K){if(this._renderService)switch(K){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const z=this._renderService.dimensions.css.canvas.width.toFixed(0),ue=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${ue};${z}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const le=this._renderService.dimensions.css.cell.width.toFixed(0),ve=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${ve};${le}t`)}}cancel(K,z){if(this.options.cancelEvents||z)return K.preventDefault(),K.stopPropagation(),!1}}l.Terminal=he},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 b=d-this._lastRefreshMs,C=this._debounceThresholdMS-b;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),C)}}_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(g,f,p,S){var R,D=arguments.length,M=D<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(g,f,p,S);else for(var T=g.length-1;T>=0;T--)(R=g[T])&&(M=(D<3?R(M):D>3?R(f,p,M):R(f,p))||M);return D>3&&M&&Object.defineProperty(f,p,M),M},y=this&&this.__param||function(g,f){return function(p,S){f(p,S,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const d=h(3656),b=h(4725),C=h(8460),k=h(844),x=h(2585);let m=l.Viewport=class extends k.Disposable{constructor(g,f,p,S,R,D,M,T){super(),this._viewportElement=g,this._scrollArea=f,this._bufferService=p,this._optionsService=S,this._charSizeService=R,this._renderService=D,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 C.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(g){this._viewportElement.style.backgroundColor=g.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(g){if(g)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const 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 g=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==g&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=g),this._refreshAnimationFrame=null}syncScrollArea(g=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(g);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(g)}_handleScroll(g){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const 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 g=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(g*(this._smoothScrollState.target-this._smoothScrollState.origin)),g<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(g,f){const p=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&p<this._lastRecordedBufferHeight)||(g.cancelable&&g.preventDefault(),!1)}handleWheel(g){const f=this._getPixelsScrolled(g);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(g,f))}scrollLines(g){if(g!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=g*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:g,suppressScrollEvent:!1})}_getPixelsScrolled(g){if(g.deltaY===0||g.shiftKey)return 0;let f=this._applyScrollModifier(g.deltaY,g);return g.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:g.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(g,f){var T;let p,S="";const R=[],D=f??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let N=g;N<D;N++){const I=M.get(N);if(!I)continue;const $=(T=M.get(N+1))==null?void 0:T.isWrapped;if(S+=I.translateToString(!$),!$||N===M.length-1){const q=document.createElement("div");q.textContent=S,R.push(q),S.length>0&&(p=q),S=""}}return{bufferElements:R,cursorElement:p}}getLinesScrolled(g){if(g.deltaY===0||g.shiftKey)return 0;let f=this._applyScrollModifier(g.deltaY,g);return g.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):g.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(g,f){const p=this._optionsService.rawOptions.fastScrollModifier;return p==="alt"&&f.altKey||p==="ctrl"&&f.ctrlKey||p==="shift"&&f.shiftKey?g*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:g*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(g){this._lastTouchY=g.touches[0].pageY}handleTouchMove(g){const f=this._lastTouchY-g.touches[0].pageY;return this._lastTouchY=g.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(g,f))}};l.Viewport=m=u([y(2,x.IBufferService),y(3,x.IOptionsService),y(4,b.ICharSizeService),y(5,b.IRenderService),y(6,b.ICoreBrowserService),y(7,b.IThemeService)],m)},3107:function(A,l,h){var u=this&&this.__decorate||function(x,m,g,f){var p,S=arguments.length,R=S<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,g):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(x,m,g,f);else for(var D=x.length-1;D>=0;D--)(p=x[D])&&(R=(S<3?p(R):S>3?p(m,g,R):p(m,g))||R);return S>3&&R&&Object.defineProperty(m,g,R),R},y=this&&this.__param||function(x,m){return function(g,f){m(g,f,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const d=h(4725),b=h(844),C=h(2585);let k=l.BufferDecorationRenderer=class extends b.Disposable{constructor(x,m,g,f,p){super(),this._screenElement=x,this._bufferService=m,this._coreBrowserService=g,this._decorationService=f,this._renderService=p,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((S=>this._removeDecoration(S)))),this.register((0,b.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const x of this._decorationService.decorations)this._renderDecoration(x);this._dimensionsChanged=!1}_renderDecoration(x){this._refreshStyle(x),this._dimensionsChanged&&this._refreshXPosition(x)}_createElement(x){var f;const m=this._coreBrowserService.mainDocument.createElement("div");m.classList.add("xterm-decoration"),m.classList.toggle("xterm-decoration-top-layer",((f=x==null?void 0:x.options)==null?void 0:f.layer)==="top"),m.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,m.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",m.style.top=(x.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",m.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const g=x.options.x??0;return g&&g>this._bufferService.cols&&(m.style.display="none"),this._refreshXPosition(x,m),m}_refreshStyle(x){const m=x.marker.line-this._bufferService.buffers.active.ydisp;if(m<0||m>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let g=this._decorationElements.get(x);g||(g=this._createElement(x),x.element=g,this._decorationElements.set(x,g),this._container.appendChild(g),x.onDispose((()=>{this._decorationElements.delete(x),g.remove()}))),g.style.top=m*this._renderService.dimensions.css.cell.height+"px",g.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(g)}}_refreshXPosition(x,m=x.element){if(!m)return;const g=x.options.x??0;(x.options.anchor||"left")==="right"?m.style.right=g?g*this._renderService.dimensions.css.cell.width+"px":"":m.style.left=g?g*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){var m;(m=this._decorationElements.get(x))==null||m.remove(),this._decorationElements.delete(x),x.dispose()}};l.BufferDecorationRenderer=k=u([y(1,C.IBufferService),y(2,d.ICoreBrowserService),y(3,C.IDecorationService),y(4,d.IRenderService)],k)},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(p,S,R,D){var M,T=arguments.length,N=T<3?S:D===null?D=Object.getOwnPropertyDescriptor(S,R):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(p,S,R,D);else for(var I=p.length-1;I>=0;I--)(M=p[I])&&(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(p,S){return function(R,D){S(R,D,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const d=h(5871),b=h(4725),C=h(844),k=h(2585),x={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0},g={full:0,left:0,center:0,right:0};let f=l.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(p,S,R,D,M,T,N){var $;super(),this._viewportElement=p,this._screenElement=S,this._bufferService=R,this._decorationService=D,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(),($=this._viewportElement.parentElement)==null||$.insertBefore(this._canvas,this._viewportElement);const I=this._canvas.getContext("2d");if(!I)throw new Error("Ctx cannot be null");this._ctx=I,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,C.toDisposable)((()=>{var q;(q=this._canvas)==null||q.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 p=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);m.full=this._canvas.width,m.left=p,m.center=S,m.right=p,this._refreshDrawHeightConstants(),g.full=0,g.left=0,g.center=m.left,g.right=m.left+m.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);const p=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(p,12),6)*this._coreBrowserService.dpr);x.left=S,x.center=S,x.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.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 p=this._colorZoneStore.zones;for(const S of p)S.position!=="full"&&this._renderColorZone(S);for(const S of p)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(p){this._ctx.fillStyle=p.color,this._ctx.fillRect(g[p.position||"full"],Math.round((this._canvas.height-1)*(p.startBufferLine/this._bufferService.buffers.active.lines.length)-x[p.position||"full"]/2),m[p.position||"full"],Math.round((this._canvas.height-1)*((p.endBufferLine-p.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[p.position||"full"]))}_queueRefresh(p,S){this._shouldUpdateDimensions=p||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,k.IBufferService),y(3,k.IDecorationService),y(4,b.IRenderService),y(5,k.IOptionsService),y(6,b.ICoreBrowserService)],f)},2950:function(A,l,h){var u=this&&this.__decorate||function(x,m,g,f){var p,S=arguments.length,R=S<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,g):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(x,m,g,f);else for(var D=x.length-1;D>=0;D--)(p=x[D])&&(R=(S<3?p(R):S>3?p(m,g,R):p(m,g))||R);return S>3&&R&&Object.defineProperty(m,g,R),R},y=this&&this.__param||function(x,m){return function(g,f){m(g,f,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const d=h(4725),b=h(2585),C=h(2584);let k=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,m,g,f,p,S){this._textarea=x,this._compositionView=m,this._bufferService=g,this._optionsService=f,this._coreService=p,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(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const m={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let g;this._isSendingComposition=!1,m.start+=this._dataAlreadySent.length,g=this._isComposing?this._textarea.value.substring(m.start,m.end):this._textarea.value.substring(m.start),g.length>0&&this._coreService.triggerDataEvent(g,!0)}}),0)}else{this._isSendingComposition=!1;const m=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(m,!0)}}_handleAnyTextareaChanges(){const x=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const m=this._textarea.value,g=m.replace(x,"");this._dataAlreadySent=g,m.length>x.length?this._coreService.triggerDataEvent(g,!0):m.length<x.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):m.length===x.length&&m!==x&&this._coreService.triggerDataEvent(m,!0)}}),0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const m=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),g=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,p=m*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=p+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=g+"px",this._compositionView.style.lineHeight=g+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=p+"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"}x||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=k=u([y(2,b.IBufferService),y(3,b.IOptionsService),y(4,b.ICoreService),y(5,d.IRenderService)],k)},9806:(A,l)=>{function h(u,y,d){const b=d.getBoundingClientRect(),C=u.getComputedStyle(d),k=parseInt(C.getPropertyValue("padding-left")),x=parseInt(C.getPropertyValue("padding-top"));return[y.clientX-b.left-k,y.clientY-b.top-x]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=h,l.getCoords=function(u,y,d,b,C,k,x,m,g){if(!k)return;const f=h(u,y,d);return f?(f[0]=Math.ceil((f[0]+(g?x/2:0))/x),f[1]=Math.ceil(f[1]/m),f[0]=Math.min(Math.max(f[0],1),b+(g?1:0)),f[1]=Math.min(Math.max(f[1],1),C),f):void 0}},9504:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const u=h(2584);function y(m,g,f,p){const S=m-d(m,f),R=g-d(g,f),D=Math.abs(S-R)-(function(M,T,N){let I=0;const $=M-d(M,N),q=T-d(T,N);for(let P=0;P<Math.abs($-q);P++){const Q=b(M,T)==="A"?-1:1,te=N.buffer.lines.get($+Q*P);te!=null&&te.isWrapped&&I++}return I})(m,g,f);return x(D,k(b(m,g),p))}function d(m,g){let f=0,p=g.buffer.lines.get(m),S=p==null?void 0:p.isWrapped;for(;S&&m>=0&&m<g.rows;)f++,p=g.buffer.lines.get(--m),S=p==null?void 0:p.isWrapped;return f}function b(m,g){return m>g?"A":"B"}function C(m,g,f,p,S,R){let D=m,M=g,T="";for(;D!==f||M!==p;)D+=S?1:-1,S&&D>R.cols-1?(T+=R.buffer.translateBufferLineToString(M,!1,m,D),D=0,m=0,M++):!S&&D<0&&(T+=R.buffer.translateBufferLineToString(M,!1,0,m+1),D=R.cols-1,m=D,M--);return T+R.buffer.translateBufferLineToString(M,!1,m,D)}function k(m,g){const f=g?"O":"[";return u.C0.ESC+f+m}function x(m,g){m=Math.floor(m);let f="";for(let p=0;p<m;p++)f+=g;return f}l.moveToCellSequence=function(m,g,f,p){const S=f.buffer.x,R=f.buffer.y;if(!f.buffer.hasScrollback)return(function(T,N,I,$,q,P){return y(N,$,q,P).length===0?"":x(C(T,N,T,N-d(N,q),!1,q).length,k("D",P))})(S,R,0,g,f,p)+y(R,g,f,p)+(function(T,N,I,$,q,P){let Q;Q=y(N,$,q,P).length>0?$-d($,q):N;const te=$,G=(function(Y,ee,B,U,L,H){let X;return X=y(B,U,L,H).length>0?U-d(U,L):ee,Y<B&&X<=U||Y>=B&&X<U?"C":"D"})(T,N,I,$,q,P);return x(C(T,Q,I,te,G==="C",q).length,k(G,P))})(S,R,m,g,f,p);let D;if(R===g)return D=S>m?"D":"C",x(Math.abs(S-m),k(D,p));D=R>g?"D":"C";const M=Math.abs(R-g);return x((function(T,N){return N.cols-T})(R>g?m:S,f)+(M-1)*f.cols+1+((R>g?S:m)-1),k(D,p))}},1296:function(A,l,h){var u=this&&this.__decorate||function(P,Q,te,G){var Y,ee=arguments.length,B=ee<3?Q:G===null?G=Object.getOwnPropertyDescriptor(Q,te):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(P,Q,te,G);else for(var U=P.length-1;U>=0;U--)(Y=P[U])&&(B=(ee<3?Y(B):ee>3?Y(Q,te,B):Y(Q,te))||B);return ee>3&&B&&Object.defineProperty(Q,te,B),B},y=this&&this.__param||function(P,Q){return function(te,G){Q(te,G,P)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const d=h(3787),b=h(2550),C=h(2223),k=h(6171),x=h(6052),m=h(4725),g=h(8055),f=h(8460),p=h(844),S=h(2585),R="xterm-dom-renderer-owner-",D="xterm-rows",M="xterm-fg-",T="xterm-bg-",N="xterm-focus",I="xterm-selection";let $=1,q=l.DomRenderer=class extends p.Disposable{constructor(P,Q,te,G,Y,ee,B,U,L,H,X,ae,he){super(),this._terminal=P,this._document=Q,this._element=te,this._screenElement=G,this._viewportElement=Y,this._helperContainer=ee,this._linkifier2=B,this._charSizeService=L,this._optionsService=H,this._bufferService=X,this._coreBrowserService=ae,this._themeService=he,this._terminalClass=$++,this._rowElements=[],this._selectionRenderModel=(0,x.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(D),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(I),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ne=>this._injectCss(ne)))),this._injectCss(this._themeService.colors),this._rowFactory=U.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((ne=>this._handleLinkHover(ne)))),this.register(this._linkifier2.onHideLinkUnderline((ne=>this._handleLinkLeave(ne)))),this.register((0,p.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 b.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const P=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*P,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*P),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/P),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/P),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 Q=`${this._terminalSelector} .${D} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Q,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(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Q=`${this._terminalSelector} .${D} { color: ${P.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Q+=`${this._terminalSelector} .${D} .xterm-dim { color: ${g.color.multiplyOpacity(P.foreground,.5).css};}`,Q+=`${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}`,G=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;Q+=`@keyframes ${te} { 50% { border-bottom-style: hidden; }}`,Q+=`@keyframes ${G} { 50% { box-shadow: none; }}`,Q+=`@keyframes ${Y} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,Q+=`${this._terminalSelector} .${D}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${te} 1s step-end infinite;}${this._terminalSelector} .${D}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${D}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css};}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${P.cursor.css} !important; color: ${P.cursorAccent.css} !important;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Q+=`${this._terminalSelector} .${I} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${I} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${I} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,B]of P.ansi.entries())Q+=`${this._terminalSelector} .${M}${ee} { color: ${B.css}; }${this._terminalSelector} .${M}${ee}.xterm-dim { color: ${g.color.multiplyOpacity(B,.5).css}; }${this._terminalSelector} .${T}${ee} { background-color: ${B.css}; }`;Q+=`${this._terminalSelector} .${M}${C.INVERTED_DEFAULT_COLOR} { color: ${g.color.opaque(P.background).css}; }${this._terminalSelector} .${M}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${g.color.multiplyOpacity(g.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${T}${C.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=Q}_setDefaultSpacing(){const P=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${P}px`,this._rowFactory.defaultSpacing=P}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(P,Q){for(let te=this._rowElements.length;te<=Q;te++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>Q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,Q){this._refreshRowElements(P,Q),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(P,Q,te){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,Q,te),this.renderRows(0,this._bufferService.rows-1),!P||!Q)return;this._selectionRenderModel.update(this._terminal,P,Q,te);const G=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,ee=this._selectionRenderModel.viewportCappedStartRow,B=this._selectionRenderModel.viewportCappedEndRow;if(ee>=this._bufferService.rows||B<0)return;const U=this._document.createDocumentFragment();if(te){const L=P[0]>Q[0];U.appendChild(this._createSelectionElement(ee,L?Q[0]:P[0],L?P[0]:Q[0],B-ee+1))}else{const L=G===ee?P[0]:0,H=ee===Y?Q[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(ee,L,H));const X=B-ee-1;if(U.appendChild(this._createSelectionElement(ee+1,0,this._bufferService.cols,X)),ee!==B){const ae=Y===B?Q[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(B,0,ae))}}this._selectionContainer.appendChild(U)}_createSelectionElement(P,Q,te,G=1){const Y=this._document.createElement("div"),ee=Q*this.dimensions.css.cell.width;let B=this.dimensions.css.cell.width*(te-Q);return ee+B>this.dimensions.css.canvas.width&&(B=this.dimensions.css.canvas.width-ee),Y.style.height=G*this.dimensions.css.cell.height+"px",Y.style.top=P*this.dimensions.css.cell.height+"px",Y.style.left=`${ee}px`,Y.style.width=`${B}px`,Y}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 P of this._rowElements)P.replaceChildren()}renderRows(P,Q){const te=this._bufferService.buffer,G=te.ybase+te.y,Y=Math.min(te.x,this._bufferService.cols-1),ee=this._optionsService.rawOptions.cursorBlink,B=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=P;L<=Q;L++){const H=L+te.ydisp,X=this._rowElements[L],ae=te.lines.get(H);if(!X||!ae)break;X.replaceChildren(...this._rowFactory.createRow(ae,H,H===G,B,U,Y,ee,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!0)}_handleLinkLeave(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!1)}_setCellUnderline(P,Q,te,G,Y,ee){te<0&&(P=0),G<0&&(Q=0);const B=this._bufferService.rows-1;te=Math.max(Math.min(te,B),0),G=Math.max(Math.min(G,B),0),Y=Math.min(Y,this._bufferService.cols);const U=this._bufferService.buffer,L=U.ybase+U.y,H=Math.min(U.x,Y-1),X=this._optionsService.rawOptions.cursorBlink,ae=this._optionsService.rawOptions.cursorStyle,he=this._optionsService.rawOptions.cursorInactiveStyle;for(let ne=te;ne<=G;++ne){const K=ne+U.ydisp,z=this._rowElements[ne],ue=U.lines.get(K);if(!z||!ue)break;z.replaceChildren(...this._rowFactory.createRow(ue,K,K===L,ae,he,H,X,this.dimensions.css.cell.width,this._widthCache,ee?ne===te?P:0:-1,ee?(ne===G?Q:Y)-1:-1))}}};l.DomRenderer=q=u([y(7,S.IInstantiationService),y(8,m.ICharSizeService),y(9,S.IOptionsService),y(10,S.IBufferService),y(11,m.ICoreBrowserService),y(12,m.IThemeService)],q)},3787:function(A,l,h){var u=this&&this.__decorate||function(D,M,T,N){var I,$=arguments.length,q=$<3?M:N===null?N=Object.getOwnPropertyDescriptor(M,T):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(D,M,T,N);else for(var P=D.length-1;P>=0;P--)(I=D[P])&&(q=($<3?I(q):$>3?I(M,T,q):I(M,T))||q);return $>3&&q&&Object.defineProperty(M,T,q),q},y=this&&this.__param||function(D,M){return function(T,N){M(T,N,D)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const d=h(2223),b=h(643),C=h(511),k=h(2585),x=h(8055),m=h(4725),g=h(4269),f=h(6171),p=h(3734);let S=l.DomRendererRowFactory=class{constructor(D,M,T,N,I,$,q){this._document=D,this._characterJoinerService=M,this._optionsService=T,this._coreBrowserService=N,this._coreService=I,this._decorationService=$,this._themeService=q,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(D,M,T){this._selectionStart=D,this._selectionEnd=M,this._columnSelectMode=T}createRow(D,M,T,N,I,$,q,P,Q,te,G){const Y=[],ee=this._characterJoinerService.getJoinedCharacters(M),B=this._themeService.colors;let U,L=D.getNoBgTrimmedLength();T&&L<$+1&&(L=$+1);let H=0,X="",ae=0,he=0,ne=0,K=!1,z=0,ue=!1,le=0;const ve=[],pe=te!==-1&&G!==-1;for(let Te=0;Te<L;Te++){D.loadCell(Te,this._workCell);let He=this._workCell.getWidth();if(He===0)continue;let Ie=!1,ut=Te,Ee=this._workCell;if(ee.length>0&&Te===ee[0][0]){Ie=!0;const Ve=ee.shift();Ee=new g.JoinedCellData(this._workCell,D.translateToString(!0,Ve[0],Ve[1]),Ve[1]-Ve[0]),ut=Ve[1]-1,He=Ee.getWidth()}const Ft=this._isCellInSelection(Te,M),_i=T&&Te===$,pi=pe&&Te>=te&&Te<=G;let Ii=!1;this._decorationService.forEachDecorationAtCell(Te,M,void 0,(Ve=>{Ii=!0}));let Vi=Ee.getChars()||b.WHITESPACE_CELL_CHAR;if(Vi===" "&&(Ee.isUnderline()||Ee.isOverline())&&(Vi=" "),le=He*P-Q.get(Vi,Ee.isBold(),Ee.isItalic()),U){if(H&&(Ft&&ue||!Ft&&!ue&&Ee.bg===ae)&&(Ft&&ue&&B.selectionForeground||Ee.fg===he)&&Ee.extended.ext===ne&&pi===K&&le===z&&!_i&&!Ie&&!Ii){Ee.isInvisible()?X+=b.WHITESPACE_CELL_CHAR:X+=Vi,H++;continue}H&&(U.textContent=X),U=this._document.createElement("span"),H=0,X=""}else U=this._document.createElement("span");if(ae=Ee.bg,he=Ee.fg,ne=Ee.extended.ext,K=pi,z=le,ue=Ft,Ie&&$>=Te&&$<=ut&&($=Te),!this._coreService.isCursorHidden&&_i&&this._coreService.isCursorInitialized){if(ve.push("xterm-cursor"),this._coreBrowserService.isFocused)q&&ve.push("xterm-cursor-blink"),ve.push(N==="bar"?"xterm-cursor-bar":N==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(I)switch(I){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(Ee.isBold()&&ve.push("xterm-bold"),Ee.isItalic()&&ve.push("xterm-italic"),Ee.isDim()&&ve.push("xterm-dim"),X=Ee.isInvisible()?b.WHITESPACE_CELL_CHAR:Ee.getChars()||b.WHITESPACE_CELL_CHAR,Ee.isUnderline()&&(ve.push(`xterm-underline-${Ee.extended.underlineStyle}`),X===" "&&(X=" "),!Ee.isUnderlineColorDefault()))if(Ee.isUnderlineColorRGB())U.style.textDecorationColor=`rgb(${p.AttributeData.toColorRGB(Ee.getUnderlineColor()).join(",")})`;else{let Ve=Ee.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ee.isBold()&&Ve<8&&(Ve+=8),U.style.textDecorationColor=B.ansi[Ve].css}Ee.isOverline()&&(ve.push("xterm-overline"),X===" "&&(X=" ")),Ee.isStrikethrough()&&ve.push("xterm-strikethrough"),pi&&(U.style.textDecoration="underline");let Pt=Ee.getFgColor(),at=Ee.getFgColorMode(),kt=Ee.getBgColor(),Zt=Ee.getBgColorMode();const Nt=!!Ee.isInverse();if(Nt){const Ve=Pt;Pt=kt,kt=Ve;const vi=at;at=Zt,Zt=vi}let Bt,Yi,Yt,Li=!1;switch(this._decorationService.forEachDecorationAtCell(Te,M,void 0,(Ve=>{Ve.options.layer!=="top"&&Li||(Ve.backgroundColorRGB&&(Zt=50331648,kt=Ve.backgroundColorRGB.rgba>>8&16777215,Bt=Ve.backgroundColorRGB),Ve.foregroundColorRGB&&(at=50331648,Pt=Ve.foregroundColorRGB.rgba>>8&16777215,Yi=Ve.foregroundColorRGB),Li=Ve.options.layer==="top")})),!Li&&Ft&&(Bt=this._coreBrowserService.isFocused?B.selectionBackgroundOpaque:B.selectionInactiveBackgroundOpaque,kt=Bt.rgba>>8&16777215,Zt=50331648,Li=!0,B.selectionForeground&&(at=50331648,Pt=B.selectionForeground.rgba>>8&16777215,Yi=B.selectionForeground)),Li&&ve.push("xterm-decoration-top"),Zt){case 16777216:case 33554432:Yt=B.ansi[kt],ve.push(`xterm-bg-${kt}`);break;case 50331648:Yt=x.channels.toColor(kt>>16,kt>>8&255,255&kt),this._addStyle(U,`background-color:#${R((kt>>>0).toString(16),"0",6)}`);break;default:Nt?(Yt=B.foreground,ve.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):Yt=B.background}switch(Bt||Ee.isDim()&&(Bt=x.color.multiplyOpacity(Yt,.5)),at){case 16777216:case 33554432:Ee.isBold()&&Pt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Pt+=8),this._applyMinimumContrast(U,Yt,B.ansi[Pt],Ee,Bt,void 0)||ve.push(`xterm-fg-${Pt}`);break;case 50331648:const Ve=x.channels.toColor(Pt>>16&255,Pt>>8&255,255&Pt);this._applyMinimumContrast(U,Yt,Ve,Ee,Bt,Yi)||this._addStyle(U,`color:#${R(Pt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(U,Yt,B.foreground,Ee,Bt,Yi)||Nt&&ve.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ve.length&&(U.className=ve.join(" "),ve.length=0),_i||Ie||Ii?U.textContent=X:H++,le!==this.defaultSpacing&&(U.style.letterSpacing=`${le}px`),Y.push(U),Te=ut}return U&&H&&(U.textContent=X),Y}_applyMinimumContrast(D,M,T,N,I,$){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(N.getCode()))return!1;const q=this._getContrastCache(N);let P;if(I||$||(P=q.getColor(M.rgba,T.rgba)),P===void 0){const Q=this._optionsService.rawOptions.minimumContrastRatio/(N.isDim()?2:1);P=x.color.ensureContrastRatio(I||M,$||T,Q),q.setColor((I||M).rgba,($||T).rgba,P??null)}return!!P&&(this._addStyle(D,`color:${P.css}`),!0)}_getContrastCache(D){return D.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(D,M){D.setAttribute("style",`${D.getAttribute("style")||""}${M};`)}_isCellInSelection(D,M){const T=this._selectionStart,N=this._selectionEnd;return!(!T||!N)&&(this._columnSelectMode?T[0]<=N[0]?D>=T[0]&&M>=T[1]&&D<N[0]&&M<=N[1]:D<T[0]&&M>=T[1]&&D>=N[0]&&M<=N[1]:M>T[1]&&M<N[1]||T[1]===N[1]&&M===T[1]&&D>=T[0]&&D<N[0]||T[1]<N[1]&&M===N[1]&&D<N[0]||T[1]<N[1]&&M===T[1]&&D>=T[0])}};function R(D,M,T){for(;D.length<T;)D=M+D;return D}l.DomRendererRowFactory=S=u([y(1,m.ICharacterJoinerService),y(2,k.IOptionsService),y(3,m.ICoreBrowserService),y(4,k.ICoreService),y(5,k.IDecorationService),y(6,m.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 b=h.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontStyle="italic";const C=h.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontWeight="bold",C.style.fontStyle="italic",this._measureElements=[y,d,b,C],this._container.appendChild(y),this._container.appendChild(d),this._container.appendChild(b),this._container.appendChild(C),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 k=this._measure(h,0);return k>0&&(this._flat[d]=k),k}let b=h;u&&(b+="B"),y&&(b+="I");let C=this._holey.get(b);if(C===void 0){let k=0;u&&(k|=1),y&&(k|=2),C=this._measure(h,k),C>0&&this._holey.set(b,C)}return C}_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,b,C){return d===1&&b>Math.ceil(1.5*C)&&y!==void 0&&y>255&&!u(y)&&!h(y)&&!(function(k){return 57344<=k&&k<=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,b=0){return(y-(2*Math.round(d)-b))%(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,b,C=!1){if(this.selectionStart=d,this.selectionEnd=b,!d||!b||d[0]===b[0]&&d[1]===b[1])return void this.clear();const k=y.buffers.active.ydisp,x=d[1]-k,m=b[1]-k,g=Math.max(x,0),f=Math.min(m,y.rows-1);g>=y.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=x,this.viewportEndRow=m,this.viewportCappedStartRow=g,this.viewportCappedEndRow=f,this.startCol=d[0],this.endCol=b[0])}isCellSelected(y,d,b){return!!this.hasSelection&&(b-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&b>=this.viewportCappedStartRow&&d<this.endCol&&b<=this.viewportCappedEndRow:d<this.startCol&&b>=this.viewportCappedStartRow&&d>=this.endCol&&b<=this.viewportCappedEndRow:b>this.viewportStartRow&&b<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&b===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===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,p,S,R){var D,M=arguments.length,T=M<3?p:R===null?R=Object.getOwnPropertyDescriptor(p,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(f,p,S,R);else for(var N=f.length-1;N>=0;N--)(D=f[N])&&(T=(M<3?D(T):M>3?D(p,S,T):D(p,S))||T);return M>3&&T&&Object.defineProperty(p,S,T),T},y=this&&this.__param||function(f,p){return function(S,R){p(S,R,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const d=h(2585),b=h(8460),C=h(844);let k=l.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,p,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new b.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new g(this._optionsService))}catch{this._measureStrategy=this.register(new m(f,p,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=k=u([y(2,d.IOptionsService)],k);class x extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(p,S){p!==void 0&&p>0&&S!==void 0&&S>0&&(this._result.width=p,this._result.height=S)}}class m extends x{constructor(p,S,R){super(),this._document=p,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 g extends x{constructor(p){super(),this._optionsService=p,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 p=this._ctx.measureText("W");return this._validateAndSet(p.width,p.fontBoundingBoxAscent+p.fontBoundingBoxDescent),this._result}}},4269:function(A,l,h){var u=this&&this.__decorate||function(g,f,p,S){var R,D=arguments.length,M=D<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(g,f,p,S);else for(var T=g.length-1;T>=0;T--)(R=g[T])&&(M=(D<3?R(M):D>3?R(f,p,M):R(f,p))||M);return D>3&&M&&Object.defineProperty(f,p,M),M},y=this&&this.__param||function(g,f){return function(p,S){f(p,S,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const d=h(3734),b=h(643),C=h(511),k=h(2585);class x extends d.AttributeData{constructor(f,p,S){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=p,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=x;let m=l.CharacterJoinerService=class kv{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(f){const p={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(p),p.id}deregister(f){for(let p=0;p<this._characterJoiners.length;p++)if(this._characterJoiners[p].id===f)return this._characterJoiners.splice(p,1),!0;return!1}getJoinedCharacters(f){if(this._characterJoiners.length===0)return[];const p=this._bufferService.buffer.lines.get(f);if(!p||p.length===0)return[];const S=[],R=p.translateToString(!0);let D=0,M=0,T=0,N=p.getFg(0),I=p.getBg(0);for(let $=0;$<p.getTrimmedLength();$++)if(p.loadCell($,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==N||this._workCell.bg!==I){if($-D>1){const q=this._getJoinedRanges(R,T,M,p,D);for(let P=0;P<q.length;P++)S.push(q[P])}D=$,T=M,N=this._workCell.fg,I=this._workCell.bg}M+=this._workCell.getChars().length||b.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-D>1){const $=this._getJoinedRanges(R,T,M,p,D);for(let q=0;q<$.length;q++)S.push($[q])}return S}_getJoinedRanges(f,p,S,R,D){const M=f.substring(p,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 I=this._characterJoiners[N].handler(M);for(let $=0;$<I.length;$++)kv._mergeRanges(T,I[$])}catch(I){console.error(I)}return this._stringRangesToCellRanges(T,R,D),T}_stringRangesToCellRanges(f,p,S){let R=0,D=!1,M=0,T=f[R];if(T){for(let N=S;N<this._bufferService.cols;N++){const I=p.getWidth(N),$=p.getString(N).length||b.WHITESPACE_CELL_CHAR.length;if(I!==0){if(!D&&T[0]<=M&&(T[0]=N,D=!0),T[1]<=M){if(T[1]=N,T=f[++R],!T)break;T[0]<=M?(T[0]=N,D=!0):D=!1}M+=$}}T&&(T[1]=this._bufferService.cols)}}static _mergeRanges(f,p){let S=!1;for(let R=0;R<f.length;R++){const D=f[R];if(S){if(p[1]<=D[0])return f[R-1][1]=p[1],f;if(p[1]<=D[1])return f[R-1][1]=Math.max(p[1],D[1]),f.splice(R,1),f;f.splice(R,1),R--}else{if(p[1]<=D[0])return f.splice(R,0,p),f;if(p[1]<=D[1])return D[0]=Math.min(p[0],D[0]),f;p[0]<D[1]&&(D[0]=Math.min(p[0],D[0]),S=!0)}}return S?f[f.length-1][1]=p[1]:f.push(p),f}};l.CharacterJoinerService=m=u([y(0,k.IBufferService)],m)},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 b extends u.Disposable{constructor(x,m,g){super(),this._textarea=x,this._window=m,this.mainDocument=g,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new C(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(x){this._window!==x&&(this._window=x,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=b;class C extends u.Disposable{constructor(x){super(),this._parentWindow=x,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(x){this._parentWindow=x,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 x;this._outerListener&&((x=this._resolutionMediaMatchList)==null||x.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(b){return this.linkProviders.push(b),{dispose:()=>{const C=this.linkProviders.indexOf(b);C!==-1&&this.linkProviders.splice(C,1)}}}}l.LinkProviderService=y},8934:function(A,l,h){var u=this&&this.__decorate||function(k,x,m,g){var f,p=arguments.length,S=p<3?x:g===null?g=Object.getOwnPropertyDescriptor(x,m):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(k,x,m,g);else for(var R=k.length-1;R>=0;R--)(f=k[R])&&(S=(p<3?f(S):p>3?f(x,m,S):f(x,m))||S);return p>3&&S&&Object.defineProperty(x,m,S),S},y=this&&this.__param||function(k,x){return function(m,g){x(m,g,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const d=h(4725),b=h(9806);let C=l.MouseService=class{constructor(k,x){this._renderService=k,this._charSizeService=x}getCoords(k,x,m,g,f){return(0,b.getCoords)(window,k,x,m,g,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(k,x){const m=(0,b.getCoordsRelativeToElement)(window,k,x);if(this._charSizeService.hasValidSize)return m[0]=Math.min(Math.max(m[0],0),this._renderService.dimensions.css.canvas.width-1),m[1]=Math.min(Math.max(m[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(m[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(m[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(m[0]),y:Math.floor(m[1])}}};l.MouseService=C=u([y(0,d.IRenderService),y(1,d.ICharSizeService)],C)},3230:function(A,l,h){var u=this&&this.__decorate||function(f,p,S,R){var D,M=arguments.length,T=M<3?p:R===null?R=Object.getOwnPropertyDescriptor(p,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(f,p,S,R);else for(var N=f.length-1;N>=0;N--)(D=f[N])&&(T=(M<3?D(T):M>3?D(p,S,T):D(p,S))||T);return M>3&&T&&Object.defineProperty(p,S,T),T},y=this&&this.__param||function(f,p){return function(S,R){p(S,R,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const d=h(6193),b=h(4725),C=h(8460),k=h(844),x=h(7226),m=h(2585);let g=l.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(f,p,S,R,D,M,T,N){super(),this._rowCount=f,this._charSizeService=R,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new x.DebouncedIdleTask,this._observerDisposable=this.register(new k.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 C.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new C.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new C.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((I,$)=>this._renderRows(I,$)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>{var I;return(I=this._renderer.value)==null?void 0:I.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(D.onDecorationRegistered((()=>this._fullRefresh()))),this.register(D.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,p),this.register(T.onWindowChange((I=>this._registerIntersectionObserver(I,p))))}_registerIntersectionObserver(f,p){if("IntersectionObserver"in f){const S=new f.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});S.observe(p),this._observerDisposable.value=(0,k.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,p,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(f,p,this._rowCount))}_renderRows(f,p){this._renderer.value&&(f=Math.min(f,this._rowCount-1),p=Math.min(p,this._rowCount-1),this._renderer.value.renderRows(f,p),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:p}),this._onRender.fire({start:f,end:p}),this._isNextRenderRedrawOnly=!0)}resize(f,p){this._rowCount=p,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((p=>this.refreshRows(p.start,p.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,p;this._renderer.value&&((p=(f=this._renderer.value).clearTextureAtlas)==null||p.call(f),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(f,p){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(f,p)})):this._renderer.value.handleResize(f,p),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,p,S){var R;this._selectionState.start=f,this._selectionState.end=p,this._selectionState.columnSelectMode=S,(R=this._renderer.value)==null||R.handleSelectionChanged(f,p,S)}handleCursorMove(){var f;(f=this._renderer.value)==null||f.handleCursorMove()}clear(){var f;(f=this._renderer.value)==null||f.clear()}};l.RenderService=g=u([y(2,m.IOptionsService),y(3,b.ICharSizeService),y(4,m.IDecorationService),y(5,m.IBufferService),y(6,b.ICoreBrowserService),y(7,b.IThemeService)],g)},9312:function(A,l,h){var u=this&&this.__decorate||function(T,N,I,$){var q,P=arguments.length,Q=P<3?N:$===null?$=Object.getOwnPropertyDescriptor(N,I):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(T,N,I,$);else for(var te=T.length-1;te>=0;te--)(q=T[te])&&(Q=(P<3?q(Q):P>3?q(N,I,Q):q(N,I))||Q);return P>3&&Q&&Object.defineProperty(N,I,Q),Q},y=this&&this.__param||function(T,N){return function(I,$){N(I,$,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const d=h(9806),b=h(9504),C=h(456),k=h(4725),x=h(8460),m=h(844),g=h(6114),f=h(4841),p=h(511),S=h(2585),R=" ",D=new RegExp(R,"g");let M=l.SelectionService=class extends m.Disposable{constructor(T,N,I,$,q,P,Q,te,G){super(),this._element=T,this._screenElement=N,this._linkifier=I,this._bufferService=$,this._coreService=q,this._mouseService=P,this._optionsService=Q,this._renderService=te,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new p.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Y=>this._handleMouseMove(Y),this._mouseUpListener=Y=>this._handleMouseUp(Y),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Y=>this._handleTrim(Y))),this.register(this._bufferService.buffers.onBufferActivate((Y=>this._handleBufferActivate(Y)))),this.enable(),this._model=new C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,m.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const T=this._model.finalSelectionStart,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 I=this._bufferService.buffer,$=[];if(this._activeSelectionMode===3){if(T[0]===N[0])return"";const q=T[0]<N[0]?T[0]:N[0],P=T[0]<N[0]?N[0]:T[0];for(let Q=T[1];Q<=N[1];Q++){const te=I.translateBufferLineToString(Q,!0,q,P);$.push(te)}}else{const q=T[1]===N[1]?N[0]:void 0;$.push(I.translateBufferLineToString(T[1],!0,T[0],q));for(let P=T[1]+1;P<=N[1]-1;P++){const Q=I.lines.get(P),te=I.translateBufferLineToString(P,!0);Q!=null&&Q.isWrapped?$[$.length-1]+=te:$.push(te)}if(T[1]!==N[1]){const P=I.lines.get(N[1]),Q=I.translateBufferLineToString(N[1],!0,0,N[0]);P&&P.isWrapped?$[$.length-1]+=Q:$.push(Q)}}return $.map((q=>q.replace(D," "))).join(g.isWindows?`\r
|
|
279
|
+
`:`
|
|
280
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),g.isLinux&&T&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(T){const N=this._getMouseBufferCoords(T),I=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!!(I&&$&&N)&&this._areCoordsInSelection(N,I,$)}isCellInSelection(T,N){const I=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!(!I||!$)&&this._areCoordsInSelection([T,N],I,$)}_areCoordsInSelection(T,N,I){return T[1]>N[1]&&T[1]<I[1]||N[1]===I[1]&&T[1]===N[1]&&T[0]>=N[0]&&T[0]<I[0]||N[1]<I[1]&&T[1]===I[1]&&T[0]<I[0]||N[1]<I[1]&&T[1]===N[1]&&T[0]>=N[0]}_selectWordAtCursor(T,N){var q,P;const I=(P=(q=this._linkifier.currentLink)==null?void 0:q.link)==null?void 0:P.range;if(I)return this._model.selectionStart=[I.start.x-1,I.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(I,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const $=this._getMouseBufferCoords(T);return!!$&&(this._selectWordAt($,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 I=this._renderService.dimensions.css.canvas.height;return N>=0&&N<=I?0:(N>I&&(N-=I),N=Math.min(Math.max(N,-50),50),N/=50,N/Math.abs(N)+Math.round(14*N))}shouldForceSelection(T){return g.isMac?T.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:T.shiftKey}handleMouseDown(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._handleIncrementalClick(T):T.detail===1?this._handleSingleClick(T):T.detail===2?this._handleDoubleClick(T):T.detail===3&&this._handleTripleClick(T),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))}_handleSingleClick(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const 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&&!(g.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 I=this._bufferService.buffer;if(this._model.selectionEnd[1]<I.lines.length){const $=I.lines.get(this._model.selectionEnd[1]);$&&$.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 I=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(I&&I[0]!==void 0&&I[1]!==void 0){const $=(0,b.moveToCellSequence)(I[0]-1,I[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent($,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,N=this._model.finalSelectionEnd,I=!(!T||!N||T[0]===N[0]&&T[1]===N[1]);I?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,I)):this._oldHasSelection&&this._fireOnSelectionChange(T,N,I)}_fireOnSelectionChange(T,N,I){this._oldSelectionStart=T,this._oldSelectionEnd=N,this._oldHasSelection=I,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((N=>this._handleTrim(N)))}_convertViewportColToCharacterIndex(T,N){let I=N;for(let $=0;N>=$;$++){const q=T.loadCell($,this._workCell).getChars().length;this._workCell.getWidth()===0?I--:q>1&&N!==$&&(I+=q-1)}return I}setSelection(T,N,I){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,N],this._model.selectionStartLength=I,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,N,I=!0,$=!0){if(T[0]>=this._bufferService.cols)return;const q=this._bufferService.buffer,P=q.lines.get(T[1]);if(!P)return;const Q=q.translateBufferLineToString(T[1],!1);let te=this._convertViewportColToCharacterIndex(P,T[0]),G=te;const Y=T[0]-te;let ee=0,B=0,U=0,L=0;if(Q.charAt(te)===" "){for(;te>0&&Q.charAt(te-1)===" ";)te--;for(;G<Q.length&&Q.charAt(G+1)===" ";)G++}else{let ae=T[0],he=T[0];P.getWidth(ae)===0&&(ee++,ae--),P.getWidth(he)===2&&(B++,he++);const ne=P.getString(he).length;for(ne>1&&(L+=ne-1,G+=ne-1);ae>0&&te>0&&!this._isCharWordSeparator(P.loadCell(ae-1,this._workCell));){P.loadCell(ae-1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,ae--):K>1&&(U+=K-1,te-=K-1),te--,ae--}for(;he<P.length&&G+1<Q.length&&!this._isCharWordSeparator(P.loadCell(he+1,this._workCell));){P.loadCell(he+1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===2?(B++,he++):K>1&&(L+=K-1,G+=K-1),G++,he++}}G++;let H=te+Y-ee+U,X=Math.min(this._bufferService.cols,G-te+ee+B-U-L);if(N||Q.slice(te,G).trim()!==""){if(I&&H===0&&P.getCodePoint(0)!==32){const ae=q.lines.get(T[1]-1);if(ae&&P.isWrapped&&ae.getCodePoint(this._bufferService.cols-1)!==32){const he=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(he){const ne=this._bufferService.cols-he.start;H-=ne,X+=ne}}}if($&&H+X===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const ae=q.lines.get(T[1]+1);if(ae!=null&&ae.isWrapped&&ae.getCodePoint(0)!==32){const he=this._getWordAt([0,T[1]+1],!1,!1,!0);he&&(X+=he.length)}}return{start:H,length:X}}}_selectWordAt(T,N){const I=this._getWordAt(T,N);if(I){for(;I.start<0;)I.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[I.start,T[1]],this._model.selectionStartLength=I.length}}_selectToWordAt(T){const N=this._getWordAt(T,!0);if(N){let I=T[1];for(;N.start<0;)N.start+=this._bufferService.cols,I--;if(!this._model.areSelectionValuesReversed())for(;N.start+N.length>this._bufferService.cols;)N.length-=this._bufferService.cols,I++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?N.start:N.start+N.length,I]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const N=this._bufferService.buffer.getWrappedRangeForLine(T),I={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)(I,this._bufferService.cols)}};l.SelectionService=M=u([y(3,S.IBufferService),y(4,S.ICoreService),y(5,k.IMouseService),y(6,S.IOptionsService),y(7,k.IRenderService),y(8,k.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,I){var $,q=arguments.length,P=q<3?T:I===null?I=Object.getOwnPropertyDescriptor(T,N):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,T,N,I);else for(var Q=M.length-1;Q>=0;Q--)($=M[Q])&&(P=(q<3?$(P):q>3?$(T,N,P):$(T,N))||P);return q>3&&P&&Object.defineProperty(T,N,P),P},y=this&&this.__param||function(M,T){return function(N,I){T(N,I,M)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const d=h(7239),b=h(8055),C=h(8460),k=h(844),x=h(2585),m=b.css.toColor("#ffffff"),g=b.css.toColor("#000000"),f=b.css.toColor("#ffffff"),p=b.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let N=0;N<216;N++){const I=T[N/36%6|0],$=T[N/6%6|0],q=T[N%6];M.push({css:b.channels.toCss(I,$,q),rgba:b.channels.toRgba(I,$,q)})}for(let N=0;N<24;N++){const I=8+10*N;M.push({css:b.channels.toCss(I,I,I),rgba:b.channels.toRgba(I,I,I)})}return M})());let R=l.ThemeService=class extends k.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 C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:m,background:g,cursor:f,cursorAccent:p,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:b.color.blend(g,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:b.color.blend(g,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=D(M.foreground,m),T.background=D(M.background,g),T.cursor=D(M.cursor,f),T.cursorAccent=D(M.cursorAccent,p),T.selectionBackgroundTransparent=D(M.selectionBackground,S),T.selectionBackgroundOpaque=b.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=D(M.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=b.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=M.selectionForeground?D(M.selectionForeground,b.NULL_COLOR):void 0,T.selectionForeground===b.NULL_COLOR&&(T.selectionForeground=void 0),b.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=b.color.opacity(T.selectionBackgroundTransparent,.3)),b.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=b.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=l.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=D(M.black,l.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=D(M.red,l.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=D(M.green,l.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=D(M.yellow,l.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=D(M.blue,l.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=D(M.magenta,l.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=D(M.cyan,l.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=D(M.white,l.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=D(M.brightBlack,l.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=D(M.brightRed,l.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=D(M.brightGreen,l.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=D(M.brightYellow,l.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=D(M.brightBlue,l.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=D(M.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=D(M.brightCyan,l.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=D(M.brightWhite,l.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const N=Math.min(T.ansi.length-16,M.extendedAnsi.length);for(let I=0;I<N;I++)T.ansi[I+16]=D(M.extendedAnsi[I],l.DEFAULT_ANSI_COLORS[I+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 D(M,T){if(M!==void 0)try{return b.css.toColor(M)}catch{}return T}l.ThemeService=R=u([y(0,x.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(C){super(),this._maxLength=C,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(C){if(this._maxLength===C)return;const k=new Array(C);for(let x=0;x<Math.min(C,this.length);x++)k[x]=this._array[this._getCyclicIndex(x)];this._array=k,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let k=this._length;k<C;k++)this._array[k]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,k){this._array[this._getCyclicIndex(C)]=k}push(C){this._array[this._getCyclicIndex(this._length)]=C,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(C,k,...x){if(k){for(let m=C;m<this._length-k;m++)this._array[this._getCyclicIndex(m)]=this._array[this._getCyclicIndex(m+k)];this._length-=k,this.onDeleteEmitter.fire({index:C,amount:k})}for(let m=this._length-1;m>=C;m--)this._array[this._getCyclicIndex(m+x.length)]=this._array[this._getCyclicIndex(m)];for(let m=0;m<x.length;m++)this._array[this._getCyclicIndex(C+m)]=x[m];if(x.length&&this.onInsertEmitter.fire({index:C,amount:x.length}),this._length+x.length>this._maxLength){const m=this._length+x.length-this._maxLength;this._startIndex+=m,this._length=this._maxLength,this.onTrimEmitter.fire(m)}else this._length+=x.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,k,x){if(!(k<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let g=k-1;g>=0;g--)this.set(C+g+x,this.get(C+g));const m=C+k+x-this._length;if(m>0)for(this._length+=m;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let m=0;m<k;m++)this.set(C+m+x,this.get(C+m))}}_getCyclicIndex(C){return(this._startIndex+C)%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 b in u)d[b]=y<=1?u[b]:u[b]&&h(u[b],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 b,C,k,x,m;function g(p){const S=p.toString(16);return S.length<2?"0"+S:S}function f(p,S){return p<S?(S+.05)/(p+.05):(p+.05)/(S+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(p){p.toCss=function(S,R,D,M){return M!==void 0?`#${g(S)}${g(R)}${g(D)}${g(M)}`:`#${g(S)}${g(R)}${g(D)}`},p.toRgba=function(S,R,D,M=255){return(S<<24|R<<16|D<<8|M)>>>0},p.toColor=function(S,R,D,M){return{css:p.toCss(S,R,D,M),rgba:p.toRgba(S,R,D,M)}}})(b||(l.channels=b={})),(function(p){function S(R,D){return d=Math.round(255*D),[h,u,y]=m.toChannels(R.rgba),{css:b.toCss(h,u,y,d),rgba:b.toRgba(h,u,y,d)}}p.blend=function(R,D){if(d=(255&D.rgba)/255,d===1)return{css:D.css,rgba:D.rgba};const M=D.rgba>>24&255,T=D.rgba>>16&255,N=D.rgba>>8&255,I=R.rgba>>24&255,$=R.rgba>>16&255,q=R.rgba>>8&255;return h=I+Math.round((M-I)*d),u=$+Math.round((T-$)*d),y=q+Math.round((N-q)*d),{css:b.toCss(h,u,y),rgba:b.toRgba(h,u,y)}},p.isOpaque=function(R){return(255&R.rgba)==255},p.ensureContrastRatio=function(R,D,M){const T=m.ensureContrastRatio(R.rgba,D.rgba,M);if(T)return b.toColor(T>>24&255,T>>16&255,T>>8&255)},p.opaque=function(R){const D=(255|R.rgba)>>>0;return[h,u,y]=m.toChannels(D),{css:b.toCss(h,u,y),rgba:D}},p.opacity=S,p.multiplyOpacity=function(R,D){return d=255&R.rgba,S(R,d*D/255)},p.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(C||(l.color=C={})),(function(p){let S,R;try{const D=document.createElement("canvas");D.width=1,D.height=1;const M=D.getContext("2d",{willReadFrequently:!0});M&&(S=M,S.globalCompositeOperation="copy",R=S.createLinearGradient(0,0,1,1))}catch{}p.toColor=function(D){if(D.match(/#[\da-f]{3,8}/i))switch(D.length){case 4:return h=parseInt(D.slice(1,2).repeat(2),16),u=parseInt(D.slice(2,3).repeat(2),16),y=parseInt(D.slice(3,4).repeat(2),16),b.toColor(h,u,y);case 5:return h=parseInt(D.slice(1,2).repeat(2),16),u=parseInt(D.slice(2,3).repeat(2),16),y=parseInt(D.slice(3,4).repeat(2),16),d=parseInt(D.slice(4,5).repeat(2),16),b.toColor(h,u,y,d);case 7:return{css:D,rgba:(parseInt(D.slice(1),16)<<8|255)>>>0};case 9:return{css:D,rgba:parseInt(D.slice(1),16)>>>0}}const M=D.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]))),b.toColor(h,u,y,d);if(!S||!R)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=R,S.fillStyle=D,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:b.toRgba(h,u,y,d),css:D}}})(k||(l.css=k={})),(function(p){function S(R,D,M){const T=R/255,N=D/255,I=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*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))}p.relativeLuminance=function(R){return S(R>>16&255,R>>8&255,255&R)},p.relativeLuminance2=S})(x||(l.rgb=x={})),(function(p){function S(D,M,T){const N=D>>24&255,I=D>>16&255,$=D>>8&255;let q=M>>24&255,P=M>>16&255,Q=M>>8&255,te=f(x.relativeLuminance2(q,P,Q),x.relativeLuminance2(N,I,$));for(;te<T&&(q>0||P>0||Q>0);)q-=Math.max(0,Math.ceil(.1*q)),P-=Math.max(0,Math.ceil(.1*P)),Q-=Math.max(0,Math.ceil(.1*Q)),te=f(x.relativeLuminance2(q,P,Q),x.relativeLuminance2(N,I,$));return(q<<24|P<<16|Q<<8|255)>>>0}function R(D,M,T){const N=D>>24&255,I=D>>16&255,$=D>>8&255;let q=M>>24&255,P=M>>16&255,Q=M>>8&255,te=f(x.relativeLuminance2(q,P,Q),x.relativeLuminance2(N,I,$));for(;te<T&&(q<255||P<255||Q<255);)q=Math.min(255,q+Math.ceil(.1*(255-q))),P=Math.min(255,P+Math.ceil(.1*(255-P))),Q=Math.min(255,Q+Math.ceil(.1*(255-Q))),te=f(x.relativeLuminance2(q,P,Q),x.relativeLuminance2(N,I,$));return(q<<24|P<<16|Q<<8|255)>>>0}p.blend=function(D,M){if(d=(255&M)/255,d===1)return M;const T=M>>24&255,N=M>>16&255,I=M>>8&255,$=D>>24&255,q=D>>16&255,P=D>>8&255;return h=$+Math.round((T-$)*d),u=q+Math.round((N-q)*d),y=P+Math.round((I-P)*d),b.toRgba(h,u,y)},p.ensureContrastRatio=function(D,M,T){const N=x.relativeLuminance(D>>8),I=x.relativeLuminance(M>>8);if(f(N,I)<T){if(I<N){const P=S(D,M,T),Q=f(N,x.relativeLuminance(P>>8));if(Q<T){const te=R(D,M,T);return Q>f(N,x.relativeLuminance(te>>8))?P:te}return P}const $=R(D,M,T),q=f(N,x.relativeLuminance($>>8));if(q<T){const P=S(D,M,T);return q>f(N,x.relativeLuminance(P>>8))?$:P}return $}},p.reduceLuminance=S,p.increaseLuminance=R,p.toChannels=function(D){return[D>>24&255,D>>16&255,D>>8&255,255&D]}})(m||(l.rgba=m={})),l.toPaddedHex=g,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),b=h(7866),C=h(744),k=h(7302),x=h(6975),m=h(8460),g=h(1753),f=h(1480),p=h(7994),S=h(9282),R=h(5435),D=h(5981),M=h(2660);let T=!1;class N extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new m.EventEmitter),this._onScroll.event(($=>{var q;(q=this._onScrollApi)==null||q.fire($.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($){for(const q in $)this.optionsService.options[q]=$[q]}constructor($){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new m.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new m.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new k.OptionsService($)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(b.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(g.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(p.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,m.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,m.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,m.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,m.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((q=>{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((q=>{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 D.WriteBuffer(((q,P)=>this._inputHandler.parse(q,P)))),this.register((0,m.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write($,q){this._writeBuffer.write($,q)}writeSync($,q){this._logService.logLevel<=y.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync($,q)}input($,q=!0){this.coreService.triggerDataEvent($,q)}resize($,q){isNaN($)||isNaN(q)||($=Math.max($,C.MINIMUM_COLS),q=Math.max(q,C.MINIMUM_ROWS),this._bufferService.resize($,q))}scroll($,q=!1){this._bufferService.scroll($,q)}scrollLines($,q,P){this._bufferService.scrollLines($,q,P)}scrollPages($){this.scrollLines($*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine($){const q=$-this._bufferService.buffer.ydisp;q!==0&&this.scrollLines(q)}registerEscHandler($,q){return this._inputHandler.registerEscHandler($,q)}registerDcsHandler($,q){return this._inputHandler.registerDcsHandler($,q)}registerCsiHandler($,q){return this._inputHandler.registerCsiHandler($,q)}registerOscHandler($,q){return this._inputHandler.registerOscHandler($,q)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let $=!1;const q=this.optionsService.rawOptions.windowsPty;q&&q.buildNumber!==void 0&&q.buildNumber!==void 0?$=q.backend==="conpty"&&q.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&($=!0),$?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const $=[];$.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),$.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const q of $)q.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,B,U,L){var H,X=arguments.length,ae=X<3?B:L===null?L=Object.getOwnPropertyDescriptor(B,U):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(ee,B,U,L);else for(var he=ee.length-1;he>=0;he--)(H=ee[he])&&(ae=(X<3?H(ae):X>3?H(B,U,ae):H(B,U))||ae);return X>3&&ae&&Object.defineProperty(B,U,ae),ae},y=this&&this.__param||function(ee,B){return function(U,L){B(U,L,ee)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const d=h(2584),b=h(7116),C=h(2015),k=h(844),x=h(482),m=h(8437),g=h(8460),f=h(643),p=h(511),S=h(3734),R=h(2585),D=h(1480),M=h(6242),T=h(6351),N=h(5941),I={"(":0,")":1,"*":2,"+":3,"-":1,".":2},$=131072;function q(ee,B){if(ee>24)return B.setWinLines||!1;switch(ee){case 1:return!!B.restoreWin;case 2:return!!B.minimizeWin;case 3:return!!B.setWinPosition;case 4:return!!B.setWinSizePixels;case 5:return!!B.raiseWin;case 6:return!!B.lowerWin;case 7:return!!B.refreshWin;case 8:return!!B.setWinSizeChars;case 9:return!!B.maximizeWin;case 10:return!!B.fullscreenWin;case 11:return!!B.getWinState;case 13:return!!B.getWinPosition;case 14:return!!B.getWinSizePixels;case 15:return!!B.getScreenSizePixels;case 16:return!!B.getCellSizePixels;case 18:return!!B.getWinSizeChars;case 19:return!!B.getScreenSizeChars;case 20:return!!B.getIconTitle;case 21:return!!B.getWinTitle;case 22:return!!B.pushTitle;case 23:return!!B.popTitle;case 24:return!!B.setWinLines}return!1}var P;(function(ee){ee[ee.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ee[ee.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(l.WindowsOptionsReportType=P={}));let Q=0;class te extends k.Disposable{getAttrData(){return this._curAttrData}constructor(B,U,L,H,X,ae,he,ne,K=new C.EscapeSequenceParser){super(),this._bufferService=B,this._charsetService=U,this._coreService=L,this._logService=H,this._optionsService=X,this._oscLinkService=ae,this._coreMouseService=he,this._unicodeService=ne,this._parser=K,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new p.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new g.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new g.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new g.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new g.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new g.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new g.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new g.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new g.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new g.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new g.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new g.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new g.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new g.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((z=>this._activeBuffer=z.activeBuffer))),this._parser.setCsiHandlerFallback(((z,ue)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(z),params:ue.toArray()})})),this._parser.setEscHandlerFallback((z=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(z)})})),this._parser.setExecuteHandlerFallback((z=>{this._logService.debug("Unknown EXECUTE code: ",{code:z})})),this._parser.setOscHandlerFallback(((z,ue,le)=>{this._logService.debug("Unknown OSC code: ",{identifier:z,action:ue,data:le})})),this._parser.setDcsHandlerFallback(((z,ue,le)=>{ue==="HOOK"&&(le=le.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(z),action:ue,payload:le})})),this._parser.setPrintHandler(((z,ue,le)=>this.print(z,ue,le))),this._parser.registerCsiHandler({final:"@"},(z=>this.insertChars(z))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(z=>this.scrollLeft(z))),this._parser.registerCsiHandler({final:"A"},(z=>this.cursorUp(z))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(z=>this.scrollRight(z))),this._parser.registerCsiHandler({final:"B"},(z=>this.cursorDown(z))),this._parser.registerCsiHandler({final:"C"},(z=>this.cursorForward(z))),this._parser.registerCsiHandler({final:"D"},(z=>this.cursorBackward(z))),this._parser.registerCsiHandler({final:"E"},(z=>this.cursorNextLine(z))),this._parser.registerCsiHandler({final:"F"},(z=>this.cursorPrecedingLine(z))),this._parser.registerCsiHandler({final:"G"},(z=>this.cursorCharAbsolute(z))),this._parser.registerCsiHandler({final:"H"},(z=>this.cursorPosition(z))),this._parser.registerCsiHandler({final:"I"},(z=>this.cursorForwardTab(z))),this._parser.registerCsiHandler({final:"J"},(z=>this.eraseInDisplay(z,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(z=>this.eraseInDisplay(z,!0))),this._parser.registerCsiHandler({final:"K"},(z=>this.eraseInLine(z,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(z=>this.eraseInLine(z,!0))),this._parser.registerCsiHandler({final:"L"},(z=>this.insertLines(z))),this._parser.registerCsiHandler({final:"M"},(z=>this.deleteLines(z))),this._parser.registerCsiHandler({final:"P"},(z=>this.deleteChars(z))),this._parser.registerCsiHandler({final:"S"},(z=>this.scrollUp(z))),this._parser.registerCsiHandler({final:"T"},(z=>this.scrollDown(z))),this._parser.registerCsiHandler({final:"X"},(z=>this.eraseChars(z))),this._parser.registerCsiHandler({final:"Z"},(z=>this.cursorBackwardTab(z))),this._parser.registerCsiHandler({final:"`"},(z=>this.charPosAbsolute(z))),this._parser.registerCsiHandler({final:"a"},(z=>this.hPositionRelative(z))),this._parser.registerCsiHandler({final:"b"},(z=>this.repeatPrecedingCharacter(z))),this._parser.registerCsiHandler({final:"c"},(z=>this.sendDeviceAttributesPrimary(z))),this._parser.registerCsiHandler({prefix:">",final:"c"},(z=>this.sendDeviceAttributesSecondary(z))),this._parser.registerCsiHandler({final:"d"},(z=>this.linePosAbsolute(z))),this._parser.registerCsiHandler({final:"e"},(z=>this.vPositionRelative(z))),this._parser.registerCsiHandler({final:"f"},(z=>this.hVPosition(z))),this._parser.registerCsiHandler({final:"g"},(z=>this.tabClear(z))),this._parser.registerCsiHandler({final:"h"},(z=>this.setMode(z))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(z=>this.setModePrivate(z))),this._parser.registerCsiHandler({final:"l"},(z=>this.resetMode(z))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(z=>this.resetModePrivate(z))),this._parser.registerCsiHandler({final:"m"},(z=>this.charAttributes(z))),this._parser.registerCsiHandler({final:"n"},(z=>this.deviceStatus(z))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(z=>this.deviceStatusPrivate(z))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(z=>this.softReset(z))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(z=>this.setCursorStyle(z))),this._parser.registerCsiHandler({final:"r"},(z=>this.setScrollRegion(z))),this._parser.registerCsiHandler({final:"s"},(z=>this.saveCursor(z))),this._parser.registerCsiHandler({final:"t"},(z=>this.windowOptions(z))),this._parser.registerCsiHandler({final:"u"},(z=>this.restoreCursor(z))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(z=>this.insertColumns(z))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(z=>this.deleteColumns(z))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(z=>this.selectProtected(z))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(z=>this.requestMode(z,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(z=>this.requestMode(z,!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((z=>(this.setTitle(z),this.setIconName(z),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((z=>this.setIconName(z)))),this._parser.registerOscHandler(2,new M.OscHandler((z=>this.setTitle(z)))),this._parser.registerOscHandler(4,new M.OscHandler((z=>this.setOrReportIndexedColor(z)))),this._parser.registerOscHandler(8,new M.OscHandler((z=>this.setHyperlink(z)))),this._parser.registerOscHandler(10,new M.OscHandler((z=>this.setOrReportFgColor(z)))),this._parser.registerOscHandler(11,new M.OscHandler((z=>this.setOrReportBgColor(z)))),this._parser.registerOscHandler(12,new M.OscHandler((z=>this.setOrReportCursorColor(z)))),this._parser.registerOscHandler(104,new M.OscHandler((z=>this.restoreIndexedColor(z)))),this._parser.registerOscHandler(110,new M.OscHandler((z=>this.restoreFgColor(z)))),this._parser.registerOscHandler(111,new M.OscHandler((z=>this.restoreBgColor(z)))),this._parser.registerOscHandler(112,new M.OscHandler((z=>this.restoreCursorColor(z)))),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 z in b.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:z},(()=>this.selectCharset("("+z))),this._parser.registerEscHandler({intermediates:")",final:z},(()=>this.selectCharset(")"+z))),this._parser.registerEscHandler({intermediates:"*",final:z},(()=>this.selectCharset("*"+z))),this._parser.registerEscHandler({intermediates:"+",final:z},(()=>this.selectCharset("+"+z))),this._parser.registerEscHandler({intermediates:"-",final:z},(()=>this.selectCharset("-"+z))),this._parser.registerEscHandler({intermediates:".",final:z},(()=>this.selectCharset("."+z))),this._parser.registerEscHandler({intermediates:"/",final:z},(()=>this.selectCharset("/"+z)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((z=>(this._logService.error("Parsing error: ",z),z))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler(((z,ue)=>this.requestStatusString(z,ue))))}_preserveStack(B,U,L,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=B,this._parseStack.cursorStartY=U,this._parseStack.decodedLength=L,this._parseStack.position=H}_logSlowResolvingAsync(B){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([B,new Promise(((U,L)=>setTimeout((()=>L("#SLOW_TIMEOUT")),5e3)))]).catch((U=>{if(U!=="#SLOW_TIMEOUT")throw U;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(B,U){let L,H=this._activeBuffer.x,X=this._activeBuffer.y,ae=0;const he=this._parseStack.paused;if(he){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,U))return this._logSlowResolvingAsync(L),L;H=this._parseStack.cursorStartX,X=this._parseStack.cursorStartY,this._parseStack.paused=!1,B.length>$&&(ae=this._parseStack.position+$)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof B=="string"?` "${B}"`:` "${Array.prototype.map.call(B,(z=>String.fromCharCode(z))).join("")}"`),typeof B=="string"?B.split("").map((z=>z.charCodeAt(0))):B),this._parseBuffer.length<B.length&&this._parseBuffer.length<$&&(this._parseBuffer=new Uint32Array(Math.min(B.length,$))),he||this._dirtyRowTracker.clearRange(),B.length>$)for(let z=ae;z<B.length;z+=$){const ue=z+$<B.length?z+$:B.length,le=typeof B=="string"?this._stringDecoder.decode(B.substring(z,ue),this._parseBuffer):this._utf8Decoder.decode(B.subarray(z,ue),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,le))return this._preserveStack(H,X,le,z),this._logSlowResolvingAsync(L),L}else if(!he){const z=typeof B=="string"?this._stringDecoder.decode(B,this._parseBuffer):this._utf8Decoder.decode(B,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,z))return this._preserveStack(H,X,z,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===H&&this._activeBuffer.y===X||this._onCursorMove.fire();const ne=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),K=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);K<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(K,this._bufferService.rows-1),Math.min(ne,this._bufferService.rows-1))}print(B,U,L){let H,X;const ae=this._charsetService.charset,he=this._optionsService.rawOptions.screenReaderMode,ne=this._bufferService.cols,K=this._coreService.decPrivateModes.wraparound,z=this._coreService.modes.insertMode,ue=this._curAttrData;let le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-U>0&&le.getWidth(this._activeBuffer.x-1)===2&&le.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ue);let ve=this._parser.precedingJoinState;for(let pe=U;pe<L;++pe){if(H=B[pe],H<127&&ae){const ut=ae[String.fromCharCode(H)];ut&&(H=ut.charCodeAt(0))}const Te=this._unicodeService.charProperties(H,ve);X=D.UnicodeService.extractWidth(Te);const He=D.UnicodeService.extractShouldJoin(Te),Ie=He?D.UnicodeService.extractWidth(ve):0;if(ve=Te,he&&this._onA11yChar.fire((0,x.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+X-Ie>ne){if(K){const ut=le;let Ee=this._activeBuffer.x-Ie;for(this._activeBuffer.x=Ie,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),le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ie>0&&le instanceof m.BufferLine&&le.copyCellsFrom(ut,Ee,0,Ie,!1);Ee<ne;)ut.setCellFromCodepoint(Ee++,0,1,ue)}else if(this._activeBuffer.x=ne-1,X===2)continue}if(He&&this._activeBuffer.x){const ut=le.getWidth(this._activeBuffer.x-1)?1:2;le.addCodepointToCell(this._activeBuffer.x-ut,H,X);for(let Ee=X-Ie;--Ee>=0;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,ue)}else if(z&&(le.insertCells(this._activeBuffer.x,X-Ie,this._activeBuffer.getNullCell(ue)),le.getWidth(ne-1)===2&&le.setCellFromCodepoint(ne-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,ue)),le.setCellFromCodepoint(this._activeBuffer.x++,H,X,ue),X>0)for(;--X;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,ue)}this._parser.precedingJoinState=ve,this._activeBuffer.x<ne&&L-U>0&&le.getWidth(this._activeBuffer.x)===0&&!le.hasContent(this._activeBuffer.x)&&le.setCellFromCodepoint(this._activeBuffer.x,0,1,ue),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(B,U){return B.final!=="t"||B.prefix||B.intermediates?this._parser.registerCsiHandler(B,U):this._parser.registerCsiHandler(B,(L=>!q(L.params[0],this._optionsService.rawOptions.windowOptions)||U(L)))}registerDcsHandler(B,U){return this._parser.registerDcsHandler(B,new T.DcsHandler(U))}registerEscHandler(B,U){return this._parser.registerEscHandler(B,U)}registerOscHandler(B,U){return this._parser.registerOscHandler(B,new M.OscHandler(U))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var B;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&&((B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&B.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);U.hasWidth(this._activeBuffer.x)&&!U.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const B=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-B),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(B=this._bufferService.cols-1){this._activeBuffer.x=Math.min(B,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(B,U){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=B,this._activeBuffer.y=this._activeBuffer.scrollTop+U):(this._activeBuffer.x=B,this._activeBuffer.y=U),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(B,U){this._restrictCursor(),this._setCursor(this._activeBuffer.x+B,this._activeBuffer.y+U)}cursorUp(B){const U=this._activeBuffer.y-this._activeBuffer.scrollTop;return U>=0?this._moveCursor(0,-Math.min(U,B.params[0]||1)):this._moveCursor(0,-(B.params[0]||1)),!0}cursorDown(B){const U=this._activeBuffer.scrollBottom-this._activeBuffer.y;return U>=0?this._moveCursor(0,Math.min(U,B.params[0]||1)):this._moveCursor(0,B.params[0]||1),!0}cursorForward(B){return this._moveCursor(B.params[0]||1,0),!0}cursorBackward(B){return this._moveCursor(-(B.params[0]||1),0),!0}cursorNextLine(B){return this.cursorDown(B),this._activeBuffer.x=0,!0}cursorPrecedingLine(B){return this.cursorUp(B),this._activeBuffer.x=0,!0}cursorCharAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(B){return this._setCursor(B.length>=2?(B.params[1]||1)-1:0,(B.params[0]||1)-1),!0}charPosAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(B){return this._moveCursor(B.params[0]||1,0),!0}linePosAbsolute(B){return this._setCursor(this._activeBuffer.x,(B.params[0]||1)-1),!0}vPositionRelative(B){return this._moveCursor(0,B.params[0]||1),!0}hVPosition(B){return this.cursorPosition(B),!0}tabClear(B){const U=B.params[0];return U===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:U===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=B.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=B.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(B){const U=B.params[0];return U===1&&(this._curAttrData.bg|=536870912),U!==2&&U!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(B,U,L,H=!1,X=!1){const ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);ae.replaceCells(U,L,this._activeBuffer.getNullCell(this._eraseAttrData()),X),H&&(ae.isWrapped=!1)}_resetBufferLine(B,U=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),U),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+B),L.isWrapped=!1)}eraseInDisplay(B,U=!1){let L;switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);L<this._bufferService.rows;L++)this._resetBufferLine(L,U);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,U),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,U);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,U);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(B,U=!1){switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,U);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,U)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(B){this._restrictCursor();let U=B.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,X=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;U--;)this._activeBuffer.lines.splice(X-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(B){this._restrictCursor();let U=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;U--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(B){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.insertCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(B){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.deleteCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(B){let U=B.params[0]||1;for(;U--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(B){let U=B.params[0]||1;for(;U--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(m.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.deleteCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.insertCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.insertCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=B.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.deleteCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(B){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(B.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(B){const U=this._parser.precedingJoinState;if(!U)return!0;const L=B.params[0]||1,H=D.UnicodeService.extractWidth(U),X=this._activeBuffer.x-H,ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(X),he=new Uint32Array(ae.length*L);let ne=0;for(let z=0;z<ae.length;){const ue=ae.codePointAt(z)||0;he[ne++]=ue,z+=ue>65535?2:1}let K=ne;for(let z=1;z<L;++z)he.copyWithin(K,0,ne),K+=ne;return this.print(he,0,K),!0}sendDeviceAttributesPrimary(B){return B.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(B){return B.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(B.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(B){return(this._optionsService.rawOptions.termName+"").indexOf(B)===0}setMode(B){for(let U=0;U<B.length;U++)switch(B.params[U]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(B){for(let U=0;U<B.length;U++)switch(B.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),this._charsetService.setgCharset(1,b.DEFAULT_CHARSET),this._charsetService.setgCharset(2,b.DEFAULT_CHARSET),this._charsetService.setgCharset(3,b.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(B){for(let U=0;U<B.length;U++)switch(B.params[U]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(B){for(let U=0;U<B.length;U++)switch(B.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),B.params[U]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(B,U){const L=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:X}=this._coreMouseService,ae=this._coreService,{buffers:he,cols:ne}=this._bufferService,{active:K,alt:z}=he,ue=this._optionsService.rawOptions,le=He=>He?1:2,ve=B.params[0];return pe=ve,Te=U?ve===2?4:ve===4?le(ae.modes.insertMode):ve===12?3:ve===20?le(ue.convertEol):0:ve===1?le(L.applicationCursorKeys):ve===3?ue.windowOptions.setWinLines?ne===80?2:ne===132?1:0:0:ve===6?le(L.origin):ve===7?le(L.wraparound):ve===8?3:ve===9?le(H==="X10"):ve===12?le(ue.cursorBlink):ve===25?le(!ae.isCursorHidden):ve===45?le(L.reverseWraparound):ve===66?le(L.applicationKeypad):ve===67?4:ve===1e3?le(H==="VT200"):ve===1002?le(H==="DRAG"):ve===1003?le(H==="ANY"):ve===1004?le(L.sendFocus):ve===1005?4:ve===1006?le(X==="SGR"):ve===1015?4:ve===1016?le(X==="SGR_PIXELS"):ve===1048?1:ve===47||ve===1047||ve===1049?le(K===z):ve===2004?le(L.bracketedPasteMode):0,ae.triggerDataEvent(`${d.C0.ESC}[${U?"":"?"}${pe};${Te}$y`),!0;var pe,Te}_updateAttrColor(B,U,L,H,X){return U===2?(B|=50331648,B&=-16777216,B|=S.AttributeData.fromColorRGB([L,H,X])):U===5&&(B&=-50331904,B|=33554432|255&L),B}_extractColor(B,U,L){const H=[0,0,-1,0,0,0];let X=0,ae=0;do{if(H[ae+X]=B.params[U+ae],B.hasSubParams(U+ae)){const he=B.getSubParams(U+ae);let ne=0;do H[1]===5&&(X=1),H[ae+ne+1+X]=he[ne];while(++ne<he.length&&ne+ae+1+X<H.length);break}if(H[1]===5&&ae+X>=2||H[1]===2&&ae+X>=5)break;H[1]&&(X=1)}while(++ae+U<B.length&&ae+X<H.length);for(let he=2;he<H.length;++he)H[he]===-1&&(H[he]=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 ae}_processUnderline(B,U){U.extended=U.extended.clone(),(!~B||B>5)&&(B=1),U.extended.underlineStyle=B,U.fg|=268435456,B===0&&(U.fg&=-268435457),U.updateExtended()}_processSGR0(B){B.fg=m.DEFAULT_ATTR_DATA.fg,B.bg=m.DEFAULT_ATTR_DATA.bg,B.extended=B.extended.clone(),B.extended.underlineStyle=0,B.extended.underlineColor&=-67108864,B.updateExtended()}charAttributes(B){if(B.length===1&&B.params[0]===0)return this._processSGR0(this._curAttrData),!0;const U=B.length;let L;const H=this._curAttrData;for(let X=0;X<U;X++)L=B.params[X],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(B.hasSubParams(X)?B.getSubParams(X)[0]:1,H)):L===5?H.fg|=536870912:L===7?H.fg|=67108864:L===8?H.fg|=1073741824:L===9?H.fg|=2147483648:L===2?H.bg|=134217728:L===21?this._processUnderline(2,H):L===22?(H.fg&=-134217729,H.bg&=-134217729):L===23?H.bg&=-67108865:L===24?(H.fg&=-268435457,this._processUnderline(0,H)):L===25?H.fg&=-536870913:L===27?H.fg&=-67108865:L===28?H.fg&=-1073741825:L===29?H.fg&=2147483647:L===39?(H.fg&=-67108864,H.fg|=16777215&m.DEFAULT_ATTR_DATA.fg):L===49?(H.bg&=-67108864,H.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?X+=this._extractColor(B,X,H):L===53?H.bg|=1073741824:L===55?H.bg&=-1073741825:L===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):L===100?(H.fg&=-67108864,H.fg|=16777215&m.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(B){switch(B.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const U=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${U};${L}R`)}return!0}deviceStatusPrivate(B){if(B.params[0]===6){const U=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${U};${L}R`)}return!0}softReset(B){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(B){const U=B.params[0]||1;switch(U){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const L=U%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(B){const U=B.params[0]||1;let L;return(B.length<2||(L=B.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>U&&(this._activeBuffer.scrollTop=U-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(B){if(!q(B.params[0],this._optionsService.rawOptions.windowOptions))return!0;const U=B.length>1?B.params[1]:0;switch(B.params[0]){case 14:U!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:U!==0&&U!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),U!==0&&U!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:U!==0&&U!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),U!==0&&U!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(B){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(B){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(B){return this._windowTitle=B,this._onTitleChange.fire(B),!0}setIconName(B){return this._iconName=B,!0}setOrReportIndexedColor(B){const U=[],L=B.split(";");for(;L.length>1;){const H=L.shift(),X=L.shift();if(/^\d+$/.exec(H)){const ae=parseInt(H);if(Y(ae))if(X==="?")U.push({type:0,index:ae});else{const he=(0,N.parseColor)(X);he&&U.push({type:1,index:ae,color:he})}}}return U.length&&this._onColor.fire(U),!0}setHyperlink(B){const U=B.split(";");return!(U.length<2)&&(U[1]?this._createHyperlink(U[0],U[1]):!U[0]&&this._finishHyperlink())}_createHyperlink(B,U){this._getCurrentLinkId()&&this._finishHyperlink();const L=B.split(":");let H;const X=L.findIndex((ae=>ae.startsWith("id=")));return X!==-1&&(H=L[X].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:U}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(B,U){const L=B.split(";");for(let H=0;H<L.length&&!(U>=this._specialColors.length);++H,++U)if(L[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[U]}]);else{const X=(0,N.parseColor)(L[H]);X&&this._onColor.fire([{type:1,index:this._specialColors[U],color:X}])}return!0}setOrReportFgColor(B){return this._setOrReportSpecialColor(B,0)}setOrReportBgColor(B){return this._setOrReportSpecialColor(B,1)}setOrReportCursorColor(B){return this._setOrReportSpecialColor(B,2)}restoreIndexedColor(B){if(!B)return this._onColor.fire([{type:2}]),!0;const U=[],L=B.split(";");for(let H=0;H<L.length;++H)if(/^\d+$/.exec(L[H])){const X=parseInt(L[H]);Y(X)&&U.push({type:2,index:X})}return U.length&&this._onColor.fire(U),!0}restoreFgColor(B){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(B){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(B){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),!0}selectCharset(B){return B.length!==2?(this.selectDefaultCharset(),!0):(B[0]==="/"||this._charsetService.setgCharset(I[B[0]],b.CHARSETS[B[1]]||b.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const B=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,B,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(B){return this._charsetService.setgLevel(B),!0}screenAlignmentPattern(){const B=new p.CellData;B.content=4194373,B.fg=this._curAttrData.fg,B.bg=this._curAttrData.bg,this._setCursor(0,0);for(let U=0;U<this._bufferService.rows;++U){const L=this._activeBuffer.ybase+this._activeBuffer.y+U,H=this._activeBuffer.lines.get(L);H&&(H.fill(B),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(B,U){const L=this._bufferService.buffer,H=this._optionsService.rawOptions;return(X=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${X}${d.C0.ESC}\\`),!0))(B==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:B==='"p'?'P1$r61;1"p':B==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:B==="m"?"P1$r0m":B===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(B,U){this._dirtyRowTracker.markRangeDirty(B,U)}}l.InputHandler=te;let G=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,B){ee>B&&(Q=ee,ee=B,B=Q),ee<this.start&&(this.start=ee),B>this.end&&(this.end=B)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(ee){return 0<=ee&&ee<256}G=u([y(0,R.IBufferService)],G)},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,b){this._data[y]||(this._data[y]={}),this._data[y][d]=b}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,b,C){this._data.get(u,y)||this._data.set(u,y,new h),this._data.get(u,y).set(d,b,C)}get(u,y,d,b){var C;return(C=this._data.get(u,y))==null?void 0:C.get(d,b)}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 b=y+d>>1;const C=this._getKey(this._array[b]);if(C>u)d=b-1;else{if(!(C<u)){for(;b>0&&this._getKey(this._array[b-1])===u;)b--;return b}y=b+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(C){this._tasks.push(C),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(C){this._idleCallback=void 0;let k=0,x=0,m=C.timeRemaining(),g=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),x=Math.max(k,x),g=C.timeRemaining(),1.5*x>g)return m-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(m-k))}ms`),void this._start();m=g}this.clear()}}class d extends y{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const k=Date.now()+C;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}l.PriorityTaskQueue=d,l.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:d,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}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),b=d==null?void 0:d.get(y.cols-1),C=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);C&&b&&(C.isWrapped=b[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&b[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,b=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=b}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),b=h(8437),C=h(4634),k=h(511),x=h(643),m=h(4863),g=h(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(f,p,S){this._hasScrollback=f,this._optionsService=p,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=b.DEFAULT_ATTR_DATA.clone(),this.savedCharset=g.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.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,p){return new b.BufferLine(this._bufferService.cols,this.getNullCell(f),p)}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 p=f+this._optionsService.rawOptions.scrollback;return p>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:p}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=b.DEFAULT_ATTR_DATA);let p=this._rows;for(;p--;)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,p){const S=this.getNullCell(b.DEFAULT_ATTR_DATA);let R=0;const D=this._getCorrectBufferLength(p);if(D>this.lines.maxLength&&(this.lines.maxLength=D),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<p)for(let T=this._rows;T<p;T++)this.lines.length<p+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new b.BufferLine(f,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new b.BufferLine(f,S)));else for(let T=this._rows;T>p;T--)this.lines.length>p+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(D<this.lines.maxLength){const T=this.lines.length-D;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=D}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,p-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=p-1,this._isReflowEnabled&&(this._reflow(f,p),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=p,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 p=0;for(;this._memoryCleanupPosition<this.lines.length;)if(p+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),p>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,p){this._cols!==f&&(f>this._cols?this._reflowLarger(f,p):this._reflowSmaller(f,p))}_reflowLarger(f,p){const S=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(b.DEFAULT_ATTR_DATA));if(S.length>0){const R=(0,C.reflowLargerCreateNewLayout)(this.lines,S);(0,C.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(f,p,R.countRemoved)}}_reflowLargerAdjustViewport(f,p,S){const R=this.getNullCell(b.DEFAULT_ATTR_DATA);let D=S;for(;D-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<p&&this.lines.push(new b.BufferLine(f,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(f,p){const S=this.getNullCell(b.DEFAULT_ATTR_DATA),R=[];let D=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 I=this.ybase+this.y;if(I>=M&&I<M+N.length)continue;const $=N[N.length-1].getTrimmedLength(),q=(0,C.reflowSmallerGetNewLineLengths)(N,this._cols,f),P=q.length-N.length;let Q;Q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+P):Math.max(0,this.lines.length-this.lines.maxLength+P);const te=[];for(let L=0;L<P;L++){const H=this.getBlankLine(b.DEFAULT_ATTR_DATA,!0);te.push(H)}te.length>0&&(R.push({start:M+N.length+D,newLines:te}),D+=te.length),N.push(...te);let G=q.length-1,Y=q[G];Y===0&&(G--,Y=q[G]);let ee=N.length-P-1,B=$;for(;ee>=0;){const L=Math.min(B,Y);if(N[G]===void 0)break;if(N[G].copyCellsFrom(N[ee],B-L,Y-L,L,!0),Y-=L,Y===0&&(G--,Y=q[G]),B-=L,B===0){ee--;const H=Math.max(ee,0);B=(0,C.getWrappedLineTrimmedLength)(N,H,this._cols)}}for(let L=0;L<N.length;L++)q[L]<f&&N[L].setCell(q[L],S);let U=P-Q;for(;U-- >0;)this.ybase===0?this.y<p-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+D)-p&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+p-1)}if(R.length>0){const M=[],T=[];for(let G=0;G<this.lines.length;G++)T.push(this.lines.get(G));const N=this.lines.length;let I=N-1,$=0,q=R[$];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+D);let P=0;for(let G=Math.min(this.lines.maxLength-1,N+D-1);G>=0;G--)if(q&&q.start>I+P){for(let Y=q.newLines.length-1;Y>=0;Y--)this.lines.set(G--,q.newLines[Y]);G++,M.push({index:I+1,amount:q.newLines.length}),P+=q.newLines.length,q=R[++$]}else this.lines.set(G,T[I--]);let Q=0;for(let G=M.length-1;G>=0;G--)M[G].index+=Q,this.lines.onInsertEmitter.fire(M[G]),Q+=M[G].amount;const te=Math.max(0,N+D-this.lines.maxLength);te>0&&this.lines.onTrimEmitter.fire(te)}}translateBufferLineToString(f,p,S=0,R){const D=this.lines.get(f);return D?D.translateToString(p,S,R):""}getWrappedRangeForLine(f){let p=f,S=f;for(;p>0&&this.lines.get(p).isWrapped;)p--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:p,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 p=0;p<this.markers.length;p++)this.markers[p].line===f&&(this.markers[p].dispose(),this.markers.splice(p--,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 p=new m.Marker(f);return this.markers.push(p),p.register(this.lines.onTrim((S=>{p.line-=S,p.line<0&&p.dispose()}))),p.register(this.lines.onInsert((S=>{p.line>=S.index&&(p.line+=S.amount)}))),p.register(this.lines.onDelete((S=>{p.line>=S.index&&p.line<S.index+S.amount&&p.dispose(),p.line>S.index&&(p.line-=S.amount)}))),p.register(p.onDispose((()=>this._removeMarker(p)))),p}_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),b=h(482);l.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let C=0;class k{constructor(m,g,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*m);const p=g||y.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let S=0;S<m;++S)this.setCell(S,p);this.length=m}get(m){const g=this._data[3*m+0],f=2097151&g;return[this._data[3*m+1],2097152&g?this._combined[m]:f?(0,b.stringFromCodePoint)(f):"",g>>22,2097152&g?this._combined[m].charCodeAt(this._combined[m].length-1):f]}set(m,g){this._data[3*m+1]=g[d.CHAR_DATA_ATTR_INDEX],g[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[m]=g[1],this._data[3*m+0]=2097152|m|g[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*m+0]=g[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(m){return this._data[3*m+0]>>22}hasWidth(m){return 12582912&this._data[3*m+0]}getFg(m){return this._data[3*m+1]}getBg(m){return this._data[3*m+2]}hasContent(m){return 4194303&this._data[3*m+0]}getCodePoint(m){const g=this._data[3*m+0];return 2097152&g?this._combined[m].charCodeAt(this._combined[m].length-1):2097151&g}isCombined(m){return 2097152&this._data[3*m+0]}getString(m){const g=this._data[3*m+0];return 2097152&g?this._combined[m]:2097151&g?(0,b.stringFromCodePoint)(2097151&g):""}isProtected(m){return 536870912&this._data[3*m+2]}loadCell(m,g){return C=3*m,g.content=this._data[C+0],g.fg=this._data[C+1],g.bg=this._data[C+2],2097152&g.content&&(g.combinedData=this._combined[m]),268435456&g.bg&&(g.extended=this._extendedAttrs[m]),g}setCell(m,g){2097152&g.content&&(this._combined[m]=g.combinedData),268435456&g.bg&&(this._extendedAttrs[m]=g.extended),this._data[3*m+0]=g.content,this._data[3*m+1]=g.fg,this._data[3*m+2]=g.bg}setCellFromCodepoint(m,g,f,p){268435456&p.bg&&(this._extendedAttrs[m]=p.extended),this._data[3*m+0]=g|f<<22,this._data[3*m+1]=p.fg,this._data[3*m+2]=p.bg}addCodepointToCell(m,g,f){let p=this._data[3*m+0];2097152&p?this._combined[m]+=(0,b.stringFromCodePoint)(g):2097151&p?(this._combined[m]=(0,b.stringFromCodePoint)(2097151&p)+(0,b.stringFromCodePoint)(g),p&=-2097152,p|=2097152):p=g|4194304,f&&(p&=-12582913,p|=f<<22),this._data[3*m+0]=p}insertCells(m,g,f){if((m%=this.length)&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,f),g<this.length-m){const p=new y.CellData;for(let S=this.length-m-g-1;S>=0;--S)this.setCell(m+g+S,this.loadCell(m+S,p));for(let S=0;S<g;++S)this.setCell(m+S,f)}else for(let p=m;p<this.length;++p)this.setCell(p,f);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,f)}deleteCells(m,g,f){if(m%=this.length,g<this.length-m){const p=new y.CellData;for(let S=0;S<this.length-m-g;++S)this.setCell(m+S,this.loadCell(m+g+S,p));for(let S=this.length-g;S<this.length;++S)this.setCell(S,f)}else for(let p=m;p<this.length;++p)this.setCell(p,f);m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,f),this.getWidth(m)!==0||this.hasContent(m)||this.setCellFromCodepoint(m,0,1,f)}replaceCells(m,g,f,p=!1){if(p)for(m&&this.getWidth(m-1)===2&&!this.isProtected(m-1)&&this.setCellFromCodepoint(m-1,0,1,f),g<this.length&&this.getWidth(g-1)===2&&!this.isProtected(g)&&this.setCellFromCodepoint(g,0,1,f);m<g&&m<this.length;)this.isProtected(m)||this.setCell(m,f),m++;else for(m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,f),g<this.length&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g,0,1,f);m<g&&m<this.length;)this.setCell(m++,f)}resize(m,g){if(m===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*m;if(m>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const p=new Uint32Array(f);p.set(this._data),this._data=p}for(let p=this.length;p<m;++p)this.setCell(p,g)}else{this._data=this._data.subarray(0,f);const p=Object.keys(this._combined);for(let R=0;R<p.length;R++){const D=parseInt(p[R],10);D>=m&&delete this._combined[D]}const S=Object.keys(this._extendedAttrs);for(let R=0;R<S.length;R++){const D=parseInt(S[R],10);D>=m&&delete this._extendedAttrs[D]}}return this.length=m,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const m=new Uint32Array(this._data.length);return m.set(this._data),this._data=m,1}return 0}fill(m,g=!1){if(g)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,m);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,m)}}copyFrom(m){this.length!==m.length?this._data=new Uint32Array(m._data):this._data.set(m._data),this.length=m.length,this._combined={};for(const g in m._combined)this._combined[g]=m._combined[g];this._extendedAttrs={};for(const g in m._extendedAttrs)this._extendedAttrs[g]=m._extendedAttrs[g];this.isWrapped=m.isWrapped}clone(){const m=new k(0);m._data=new Uint32Array(this._data),m.length=this.length;for(const g in this._combined)m._combined[g]=this._combined[g];for(const g in this._extendedAttrs)m._extendedAttrs[g]=this._extendedAttrs[g];return m.isWrapped=this.isWrapped,m}getTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0])return m+(this._data[3*m+0]>>22);return 0}getNoBgTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0]||50331648&this._data[3*m+2])return m+(this._data[3*m+0]>>22);return 0}copyCellsFrom(m,g,f,p,S){const R=m._data;if(S)for(let M=p-1;M>=0;M--){for(let T=0;T<3;T++)this._data[3*(f+M)+T]=R[3*(g+M)+T];268435456&R[3*(g+M)+2]&&(this._extendedAttrs[f+M]=m._extendedAttrs[g+M])}else for(let M=0;M<p;M++){for(let T=0;T<3;T++)this._data[3*(f+M)+T]=R[3*(g+M)+T];268435456&R[3*(g+M)+2]&&(this._extendedAttrs[f+M]=m._extendedAttrs[g+M])}const D=Object.keys(m._combined);for(let M=0;M<D.length;M++){const T=parseInt(D[M],10);T>=g&&(this._combined[T-g+f]=m._combined[T])}}translateToString(m,g,f,p){g=g??0,f=f??this.length,m&&(f=Math.min(f,this.getTrimmedLength())),p&&(p.length=0);let S="";for(;g<f;){const R=this._data[3*g+0],D=2097151&R,M=2097152&R?this._combined[g]:D?(0,b.stringFromCodePoint)(D):d.WHITESPACE_CELL_CHAR;if(S+=M,p)for(let T=0;T<M.length;++T)p.push(g);g+=R>>22||1}return p&&p.push(g),S}}l.BufferLine=k},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 b=!u[y].hasContent(d-1)&&u[y].getWidth(d-1)===1,C=u[y+1].getWidth(0)===2;return b&&C?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,b,C){const k=[];for(let x=0;x<u.length-1;x++){let m=x,g=u.get(++m);if(!g.isWrapped)continue;const f=[u.get(x)];for(;m<u.length&&g.isWrapped;)f.push(g),g=u.get(++m);if(b>=x&&b<m){x+=f.length-1;continue}let p=0,S=h(f,p,y),R=1,D=0;for(;R<f.length;){const T=h(f,R,y),N=T-D,I=d-S,$=Math.min(N,I);f[p].copyCellsFrom(f[R],D,S,$,!1),S+=$,S===d&&(p++,S=0),D+=$,D===T&&(R++,D=0),S===0&&p!==0&&f[p-1].getWidth(d-1)===2&&(f[p].copyCellsFrom(f[p-1],d-1,S++,1,!1),f[p-1].setCell(d-1,C))}f[p].replaceCells(S,d,C);let M=0;for(let T=f.length-1;T>0&&(T>p||f[T].getTrimmedLength()===0);T--)M++;M>0&&(k.push(x+f.length-M),k.push(M)),x+=f.length-1}return k},l.reflowLargerCreateNewLayout=function(u,y){const d=[];let b=0,C=y[b],k=0;for(let x=0;x<u.length;x++)if(C===x){const m=y[++b];u.onDeleteEmitter.fire({index:x-k,amount:m}),x+=m-1,k+=m,C=y[++b]}else d.push(x);return{layout:d,countRemoved:k}},l.reflowLargerApplyNewLayout=function(u,y){const d=[];for(let b=0;b<y.length;b++)d.push(u.get(y[b]));for(let b=0;b<d.length;b++)u.set(b,d[b]);u.length=y.length},l.reflowSmallerGetNewLineLengths=function(u,y,d){const b=[],C=u.map(((g,f)=>h(u,f,y))).reduce(((g,f)=>g+f));let k=0,x=0,m=0;for(;m<C;){if(C-m<d){b.push(C-m);break}k+=d;const g=h(u,x,y);k>g&&(k-=g,x++);const f=u[x].getWidth(k-1)===2;f&&k--;const p=f?d-1:d;b.push(p),m+=p}return b},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 b extends y.Disposable{constructor(k,x){super(),this._optionsService=k,this._bufferService=x,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(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,x){this._normal.resize(k,x),this._alt.resize(k,x),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}l.BufferSet=b},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 b extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const x=new b;return x.setFromCharData(k),x}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(k){this.fg=k[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(k[y.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(k[y.CHAR_DATA_CHAR_INDEX].length===2){const m=k[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=m&&m<=56319){const g=k[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=g&&g<=57343?this.content=1024*(m-55296)+g-56320+65536|k[y.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=k[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[y.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=k[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=b},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(C){this.line=C,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(C){return this._disposables.push(C),C}}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=`
|
|
281
|
+
`,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,b,C,k){const x={type:0,cancel:!1,key:void 0},m=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?x.key=b?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?x.key=b?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?x.key=b?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(x.key=b?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:x.key=d.ctrlKey?"\b":u.C0.DEL,d.altKey&&(x.key=u.C0.ESC+x.key);break;case 9:if(d.shiftKey){x.key=u.C0.ESC+"[Z";break}x.key=u.C0.HT,x.cancel=!0;break;case 13:x.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,x.cancel=!0;break;case 27:x.key=u.C0.ESC,d.altKey&&(x.key=u.C0.ESC+u.C0.ESC),x.cancel=!0;break;case 37:if(d.metaKey)break;m?(x.key=u.C0.ESC+"[1;"+(m+1)+"D",x.key===u.C0.ESC+"[1;3D"&&(x.key=u.C0.ESC+(C?"b":"[1;5D"))):x.key=b?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;m?(x.key=u.C0.ESC+"[1;"+(m+1)+"C",x.key===u.C0.ESC+"[1;3C"&&(x.key=u.C0.ESC+(C?"f":"[1;5C"))):x.key=b?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;m?(x.key=u.C0.ESC+"[1;"+(m+1)+"A",C||x.key!==u.C0.ESC+"[1;3A"||(x.key=u.C0.ESC+"[1;5A")):x.key=b?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;m?(x.key=u.C0.ESC+"[1;"+(m+1)+"B",C||x.key!==u.C0.ESC+"[1;3B"||(x.key=u.C0.ESC+"[1;5B")):x.key=b?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(x.key=u.C0.ESC+"[2~");break;case 46:x.key=m?u.C0.ESC+"[3;"+(m+1)+"~":u.C0.ESC+"[3~";break;case 36:x.key=m?u.C0.ESC+"[1;"+(m+1)+"H":b?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:x.key=m?u.C0.ESC+"[1;"+(m+1)+"F":b?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?x.type=2:d.ctrlKey?x.key=u.C0.ESC+"[5;"+(m+1)+"~":x.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?x.type=3:d.ctrlKey?x.key=u.C0.ESC+"[6;"+(m+1)+"~":x.key=u.C0.ESC+"[6~";break;case 112:x.key=m?u.C0.ESC+"[1;"+(m+1)+"P":u.C0.ESC+"OP";break;case 113:x.key=m?u.C0.ESC+"[1;"+(m+1)+"Q":u.C0.ESC+"OQ";break;case 114:x.key=m?u.C0.ESC+"[1;"+(m+1)+"R":u.C0.ESC+"OR";break;case 115:x.key=m?u.C0.ESC+"[1;"+(m+1)+"S":u.C0.ESC+"OS";break;case 116:x.key=m?u.C0.ESC+"[15;"+(m+1)+"~":u.C0.ESC+"[15~";break;case 117:x.key=m?u.C0.ESC+"[17;"+(m+1)+"~":u.C0.ESC+"[17~";break;case 118:x.key=m?u.C0.ESC+"[18;"+(m+1)+"~":u.C0.ESC+"[18~";break;case 119:x.key=m?u.C0.ESC+"[19;"+(m+1)+"~":u.C0.ESC+"[19~";break;case 120:x.key=m?u.C0.ESC+"[20;"+(m+1)+"~":u.C0.ESC+"[20~";break;case 121:x.key=m?u.C0.ESC+"[21;"+(m+1)+"~":u.C0.ESC+"[21~";break;case 122:x.key=m?u.C0.ESC+"[23;"+(m+1)+"~":u.C0.ESC+"[23~";break;case 123:x.key=m?u.C0.ESC+"[24;"+(m+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(C&&!k||!d.altKey||d.metaKey)!C||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?x.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(x.key=u.C0.US),d.key==="@"&&(x.key=u.C0.NUL)):d.keyCode===65&&(x.type=1);else{const g=y[d.keyCode],f=g==null?void 0:g[d.shiftKey?1:0];if(f)x.key=u.C0.ESC+f;else if(d.keyCode>=65&&d.keyCode<=90){const p=d.ctrlKey?d.keyCode-64:d.keyCode+32;let S=String.fromCharCode(p);d.shiftKey&&(S=S.toUpperCase()),x.key=u.C0.ESC+S}else if(d.keyCode===32)x.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let p=d.code.slice(3,4);d.shiftKey||(p=p.toLowerCase()),x.key=u.C0.ESC+p,x.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?x.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?x.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?x.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?x.key=u.C0.DEL:d.keyCode===219?x.key=u.C0.ESC:d.keyCode===220?x.key=u.C0.FS:d.keyCode===221&&(x.key=u.C0.GS)}return x}},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 b=u;b<y;++b){let C=h[b];C>65535?(C-=65536,d+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):d+=String.fromCharCode(C)}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,b=0;if(this._interim){const C=h.charCodeAt(b++);56320<=C&&C<=57343?u[d++]=1024*(this._interim-55296)+C-56320+65536:(u[d++]=this._interim,u[d++]=C),this._interim=0}for(let C=b;C<y;++C){const k=h.charCodeAt(C);if(55296<=k&&k<=56319){if(++C>=y)return this._interim=k,d;const x=h.charCodeAt(C);56320<=x&&x<=57343?u[d++]=1024*(k-55296)+x-56320+65536:(u[d++]=k,u[d++]=x)}else k!==65279&&(u[d++]=k)}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,b,C,k,x=0,m=0,g=0;if(this.interim[0]){let S=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let D,M=0;for(;(D=63&this.interim[++M])&&M<4;)R<<=6,R|=D;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,N=T-M;for(;g<N;){if(g>=y)return 0;if(D=h[g++],(192&D)!=128){g--,S=!0;break}this.interim[M++]=D,R<<=6,R|=63&D}S||(T===2?R<128?g--:u[x++]=R:T===3?R<2048||R>=55296&&R<=57343||R===65279||(u[x++]=R):R<65536||R>1114111||(u[x++]=R)),this.interim.fill(0)}const f=y-4;let p=g;for(;p<y;){for(;!(!(p<f)||128&(d=h[p])||128&(b=h[p+1])||128&(C=h[p+2])||128&(k=h[p+3]));)u[x++]=d,u[x++]=b,u[x++]=C,u[x++]=k,p+=4;if(d=h[p++],d<128)u[x++]=d;else if((224&d)==192){if(p>=y)return this.interim[0]=d,x;if(b=h[p++],(192&b)!=128){p--;continue}if(m=(31&d)<<6|63&b,m<128){p--;continue}u[x++]=m}else if((240&d)==224){if(p>=y)return this.interim[0]=d,x;if(b=h[p++],(192&b)!=128){p--;continue}if(p>=y)return this.interim[0]=d,this.interim[1]=b,x;if(C=h[p++],(192&C)!=128){p--;continue}if(m=(15&d)<<12|(63&b)<<6|63&C,m<2048||m>=55296&&m<=57343||m===65279)continue;u[x++]=m}else if((248&d)==240){if(p>=y)return this.interim[0]=d,x;if(b=h[p++],(192&b)!=128){p--;continue}if(p>=y)return this.interim[0]=d,this.interim[1]=b,x;if(C=h[p++],(192&C)!=128){p--;continue}if(p>=y)return this.interim[0]=d,this.interim[1]=b,this.interim[2]=C,x;if(k=h[p++],(192&k)!=128){p--;continue}if(m=(7&d)<<18|(63&b)<<12|(63&C)<<6|63&k,m<65536||m>1114111)continue;u[x++]=m}}return x}}},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 b;l.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let C=0;C<y.length;++C)b.fill(0,y[C][0],y[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?b[C]:(function(k,x){let m,g=0,f=x.length-1;if(k<x[0][0]||k>x[f][1])return!1;for(;f>=g;)if(m=g+f>>1,k>x[m][1])g=m+1;else{if(!(k<x[m][0]))return!0;f=m-1}return!1})(C,d)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,k){let x=this.wcwidth(C),m=x===0&&k!==0;if(m){const g=u.UnicodeService.extractWidth(k);g===0?m=!1:g>x&&(x=g)}return u.UnicodeService.createPropertyValue(0,x,m)}}},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(C){super(),this._action=C,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(C,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const m=this._callbacks.shift();m&&m()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,k){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+=C.length,this._writeBuffer.push(C),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(k)}_innerWrite(C=0,k=!0){const x=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const m=this._writeBuffer[this._bufferOffset],g=this._action(m,k);if(g){const p=S=>Date.now()-x>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(x,S);return void g.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(p)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=m.length,Date.now()-x>=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,b){const C=d.toString(16),k=C.length<2?"0"+C:C;switch(b){case 4:return C[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}l.parseColor=function(d){if(!d)return;let b=d.toLowerCase();if(b.indexOf("rgb:")===0){b=b.slice(4);const C=h.exec(b);if(C){const k=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/k*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/k*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/k*255)]}}else if(b.indexOf("#")===0&&(b=b.slice(1),u.exec(b)&&[3,6,9,12].includes(b.length))){const C=b.length/3,k=[0,0,0];for(let x=0;x<3;++x){const m=parseInt(b.slice(C*x,C*x+C),16);k[x]=C===1?m<<4:C===2?m:C===3?m>>4:m>>8}return k}},l.toRgbString=function(d,b=16){const[C,k,x]=d;return`rgb:${y(C,b)}/${y(k,b)}/${y(x,b)}`}},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),b=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=b,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=b}registerHandler(k,x){this._handlers[k]===void 0&&(this._handlers[k]=[]);const m=this._handlers[k];return m.push(x),{dispose:()=>{const g=m.indexOf(x);g!==-1&&m.splice(g,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=b,this._ident=0}hook(k,x){if(this.reset(),this._ident=k,this._active=this._handlers[k]||b,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(k,x,m){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(k,x,m);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(k,x,m))}unhook(k,x=!0){if(this._active.length){let m=!1,g=this._active.length-1,f=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,m=x,f=this._stack.fallThrough,this._stack.paused=!1),!f&&m===!1){for(;g>=0&&(m=this._active[g].unhook(k),m!==!0);g--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,m;g--}for(;g>=0;g--)if(m=this._active[g].unhook(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,m}else this._handlerFb(this._ident,"UNHOOK",k);this._active=b,this._ident=0}};const C=new y.Params;C.addParam(0),l.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=C,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():C,this._data="",this._hitLimit=!1}put(k,x,m){this._hitLimit||(this._data+=(0,u.utf32ToString)(k,x,m),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let x=!1;if(this._hitLimit)x=!1;else if(k&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then((m=>(this._params=C,this._data="",this._hitLimit=!1,m)));return this._params=C,this._data="",this._hitLimit=!1,x}}},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),b=h(6351);class C{constructor(g){this.table=new Uint8Array(g)}setDefault(g,f){this.table.fill(g<<4|f)}add(g,f,p,S){this.table[f<<8|g]=p<<4|S}addMany(g,f,p,S){for(let R=0;R<g.length;R++)this.table[f<<8|g[R]]=p<<4|S}}l.TransitionTable=C;const k=160;l.VT500_TRANSITION_TABLE=(function(){const m=new C(4095),g=Array.apply(null,Array(256)).map(((M,T)=>T)),f=(M,T)=>g.slice(M,T),p=f(32,127),S=f(0,24);S.push(25),S.push.apply(S,f(28,32));const R=f(0,14);let D;for(D in m.setDefault(1,0),m.addMany(p,0,2,0),R)m.addMany([24,26,153,154],D,3,0),m.addMany(f(128,144),D,3,0),m.addMany(f(144,152),D,3,0),m.add(156,D,0,0),m.add(27,D,11,1),m.add(157,D,4,8),m.addMany([152,158,159],D,0,7),m.add(155,D,11,3),m.add(144,D,11,9);return m.addMany(S,0,3,0),m.addMany(S,1,3,1),m.add(127,1,0,1),m.addMany(S,8,0,8),m.addMany(S,3,3,3),m.add(127,3,0,3),m.addMany(S,4,3,4),m.add(127,4,0,4),m.addMany(S,6,3,6),m.addMany(S,5,3,5),m.add(127,5,0,5),m.addMany(S,2,3,2),m.add(127,2,0,2),m.add(93,1,4,8),m.addMany(p,8,5,8),m.add(127,8,5,8),m.addMany([156,27,24,26,7],8,6,0),m.addMany(f(28,32),8,0,8),m.addMany([88,94,95],1,0,7),m.addMany(p,7,0,7),m.addMany(S,7,0,7),m.add(156,7,0,0),m.add(127,7,0,7),m.add(91,1,11,3),m.addMany(f(64,127),3,7,0),m.addMany(f(48,60),3,8,4),m.addMany([60,61,62,63],3,9,4),m.addMany(f(48,60),4,8,4),m.addMany(f(64,127),4,7,0),m.addMany([60,61,62,63],4,0,6),m.addMany(f(32,64),6,0,6),m.add(127,6,0,6),m.addMany(f(64,127),6,0,0),m.addMany(f(32,48),3,9,5),m.addMany(f(32,48),5,9,5),m.addMany(f(48,64),5,0,6),m.addMany(f(64,127),5,7,0),m.addMany(f(32,48),4,9,5),m.addMany(f(32,48),1,9,2),m.addMany(f(32,48),2,9,2),m.addMany(f(48,127),2,10,0),m.addMany(f(48,80),1,10,0),m.addMany(f(81,88),1,10,0),m.addMany([89,90,92],1,10,0),m.addMany(f(96,127),1,10,0),m.add(80,1,11,9),m.addMany(S,9,0,9),m.add(127,9,0,9),m.addMany(f(28,32),9,0,9),m.addMany(f(32,48),9,9,12),m.addMany(f(48,60),9,8,10),m.addMany([60,61,62,63],9,9,10),m.addMany(S,11,0,11),m.addMany(f(32,128),11,0,11),m.addMany(f(28,32),11,0,11),m.addMany(S,10,0,10),m.add(127,10,0,10),m.addMany(f(28,32),10,0,10),m.addMany(f(48,60),10,8,10),m.addMany([60,61,62,63],10,0,11),m.addMany(f(32,48),10,9,12),m.addMany(S,12,0,12),m.add(127,12,0,12),m.addMany(f(28,32),12,0,12),m.addMany(f(32,48),12,9,12),m.addMany(f(48,64),12,0,11),m.addMany(f(64,127),12,12,13),m.addMany(f(64,127),10,12,13),m.addMany(f(64,127),9,12,13),m.addMany(S,13,13,13),m.addMany(p,13,13,13),m.add(127,13,0,13),m.addMany([27,156,24,26],13,14,0),m.add(k,0,2,0),m.add(k,8,5,8),m.add(k,6,0,6),m.add(k,11,0,11),m.add(k,13,13,13),m})();class x extends u.Disposable{constructor(g=l.VT500_TRANSITION_TABLE){super(),this._transitions=g,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new y.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(f,p,S)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,p)=>{},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 b.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(g,f=[64,126]){let p=0;if(g.prefix){if(g.prefix.length>1)throw new Error("only one byte as prefix supported");if(p=g.prefix.charCodeAt(0),p&&60>p||p>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(g.intermediates){if(g.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<g.intermediates.length;++R){const D=g.intermediates.charCodeAt(R);if(32>D||D>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");p<<=8,p|=D}}if(g.final.length!==1)throw new Error("final must be a single byte");const S=g.final.charCodeAt(0);if(f[0]>S||S>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return p<<=8,p|=S,p}identToString(g){const f=[];for(;g;)f.push(String.fromCharCode(255&g)),g>>=8;return f.reverse().join("")}setPrintHandler(g){this._printHandler=g}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(g,f){const p=this._identifier(g,[48,126]);this._escHandlers[p]===void 0&&(this._escHandlers[p]=[]);const S=this._escHandlers[p];return S.push(f),{dispose:()=>{const R=S.indexOf(f);R!==-1&&S.splice(R,1)}}}clearEscHandler(g){this._escHandlers[this._identifier(g,[48,126])]&&delete this._escHandlers[this._identifier(g,[48,126])]}setEscHandlerFallback(g){this._escHandlerFb=g}setExecuteHandler(g,f){this._executeHandlers[g.charCodeAt(0)]=f}clearExecuteHandler(g){this._executeHandlers[g.charCodeAt(0)]&&delete this._executeHandlers[g.charCodeAt(0)]}setExecuteHandlerFallback(g){this._executeHandlerFb=g}registerCsiHandler(g,f){const p=this._identifier(g);this._csiHandlers[p]===void 0&&(this._csiHandlers[p]=[]);const S=this._csiHandlers[p];return S.push(f),{dispose:()=>{const R=S.indexOf(f);R!==-1&&S.splice(R,1)}}}clearCsiHandler(g){this._csiHandlers[this._identifier(g)]&&delete this._csiHandlers[this._identifier(g)]}setCsiHandlerFallback(g){this._csiHandlerFb=g}registerDcsHandler(g,f){return this._dcsParser.registerHandler(this._identifier(g),f)}clearDcsHandler(g){this._dcsParser.clearHandler(this._identifier(g))}setDcsHandlerFallback(g){this._dcsParser.setHandlerFallback(g)}registerOscHandler(g,f){return this._oscParser.registerHandler(g,f)}clearOscHandler(g){this._oscParser.clearHandler(g)}setOscHandlerFallback(g){this._oscParser.setHandlerFallback(g)}setErrorHandler(g){this._errorHandler=g}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(g,f,p,S,R){this._parseStack.state=g,this._parseStack.handlers=f,this._parseStack.handlerPos=p,this._parseStack.transition=S,this._parseStack.chunkPos=R}parse(g,f,p){let S,R=0,D=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(p===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(p===!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(p===!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=g[this._parseStack.chunkPos],S=this._dcsParser.unhook(R!==24&&R!==26,p),S)return S;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=g[this._parseStack.chunkPos],S=this._oscParser.end(R!==24&&R!==26,p),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=g[T],D=this._transitions.table[this.currentState<<8|(R<160?R:k)],D>>4){case 2:for(let P=T+1;;++P){if(P>=f||(R=g[P])<32||R>126&&R<k){this._printHandler(g,T,P),T=P-1;break}if(++P>=f||(R=g[P])<32||R>126&&R<k){this._printHandler(g,T,P),T=P-1;break}if(++P>=f||(R=g[P])<32||R>126&&R<k){this._printHandler(g,T,P),T=P-1;break}if(++P>=f||(R=g[P])<32||R>126&&R<k){this._printHandler(g,T,P),T=P-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 I=N?N.length-1:-1;for(;I>=0&&(S=N[I](this._params),S!==!0);I--)if(S instanceof Promise)return this._preserveStack(3,N,I,D,T),S;I<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=g[T])>47&&R<60);T--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const $=this._escHandlers[this._collect<<8|R];let q=$?$.length-1:-1;for(;q>=0&&(S=$[q](),S!==!0);q--)if(S instanceof Promise)return this._preserveStack(4,$,q,D,T),S;q<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 P=T+1;;++P)if(P>=f||(R=g[P])===24||R===26||R===27||R>127&&R<k){this._dcsParser.put(g,T,P),T=P-1;break}break;case 14:if(S=this._dcsParser.unhook(R!==24&&R!==26),S)return this._preserveStack(6,[],0,D,T),S;R===27&&(D|=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 P=T+1;;P++)if(P>=f||(R=g[P])<32||R>127&&R<k){this._oscParser.put(g,T,P),T=P-1;break}break;case 6:if(S=this._oscParser.end(R!==24&&R!==26),S)return this._preserveStack(5,[],0,D,T),S;R===27&&(D|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&D}}}l.EscapeSequenceParser=x},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(b,C){this._handlers[b]===void 0&&(this._handlers[b]=[]);const k=this._handlers[b];return k.push(C),{dispose:()=>{const x=k.indexOf(C);x!==-1&&k.splice(x,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].start();else this._handlerFb(this._id,"START")}_put(b,C,k){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(b,C,k);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(b,C,k))}start(){this.reset(),this._state=1}put(b,C,k){if(this._state!==3){if(this._state===1)for(;C<k;){const x=b[C++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&k-C>0&&this._put(b,C,k)}}end(b,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,x=this._active.length-1,m=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,k=C,m=this._stack.fallThrough,this._stack.paused=!1),!m&&k===!1){for(;x>=0&&(k=this._active[x].end(b),k!==!0);x--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,k;x--}for(;x>=0;x--)if(k=this._active[x].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",b);this._active=d,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(b){this._handler=b,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(b,C,k){this._hitLimit||(this._data+=(0,y.utf32ToString)(b,C,k),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(b){let C=!1;if(this._hitLimit)C=!1;else if(b&&(C=this._handler(this._data),C instanceof Promise))return C.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,C}}},8742:(A,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const h=2147483647;class u{static fromArray(d){const b=new u;if(!d.length)return b;for(let C=Array.isArray(d[0])?1:0;C<d.length;++C){const k=d[C];if(Array.isArray(k))for(let x=0;x<k.length;++x)b.addSubParam(k[x]);else b.addParam(k)}return b}constructor(d=32,b=32){if(this.maxLength=d,this.maxSubParamsLength=b,b>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(b),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 b=0;b<this.length;++b){d.push(this.params[b]);const C=this._subParamsIdx[b]>>8,k=255&this._subParamsIdx[b];k-C>0&&d.push(Array.prototype.slice.call(this._subParams,C,k))}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 b=this._subParamsIdx[d]>>8,C=255&this._subParamsIdx[d];return C-b>0?this._subParams.subarray(b,C):null}getSubParamsAll(){const d={};for(let b=0;b<this.length;++b){const C=this._subParamsIdx[b]>>8,k=255&this._subParamsIdx[b];k-C>0&&(d[b]=this._subParams.slice(C,k))}return d}addDigit(d){let b;if(this._rejectDigits||!(b=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,k=C[b-1];C[b-1]=~k?Math.min(10*k+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,b){this._buffer=d,this.type=b}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 b=this._buffer.lines.get(d);if(b)return new u.BufferLineApiView(b)}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,b){return this._line.translateToString(y,d,b)}}},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 b extends d.Disposable{constructor(k){super(),this._core=k,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=b},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(m,g,f,p){var S,R=arguments.length,D=R<3?g:p===null?p=Object.getOwnPropertyDescriptor(g,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(m,g,f,p);else for(var M=m.length-1;M>=0;M--)(S=m[M])&&(D=(R<3?S(D):R>3?S(g,f,D):S(g,f))||D);return R>3&&D&&Object.defineProperty(g,f,D),D},y=this&&this.__param||function(m,g){return function(f,p){g(f,p,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const d=h(8460),b=h(844),C=h(5295),k=h(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let x=l.BufferService=class extends b.Disposable{get buffer(){return this.buffers.active}constructor(m){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(m.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(m.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(m,this))}resize(m,g){this.cols=m,this.rows=g,this.buffers.resize(m,g),this._onResize.fire({cols:m,rows:g})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(m,g=!1){const f=this.buffer;let p;p=this._cachedBlankLine,p&&p.length===this.cols&&p.getFg(0)===m.fg&&p.getBg(0)===m.bg||(p=f.getBlankLine(m,g),this._cachedBlankLine=p),p.isWrapped=g;const S=f.ybase+f.scrollTop,R=f.ybase+f.scrollBottom;if(f.scrollTop===0){const D=f.lines.isFull;R===f.lines.length-1?D?f.lines.recycle().copyFrom(p):f.lines.push(p.clone()):f.lines.splice(R+1,0,p.clone()),D?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const D=R-S+1;f.lines.shiftElements(S+1,D-1,-1),f.lines.set(R,p.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(m,g,f){const p=this.buffer;if(m<0){if(p.ydisp===0)return;this.isUserScrolling=!0}else m+p.ydisp>=p.ybase&&(this.isUserScrolling=!1);const S=p.ydisp;p.ydisp=Math.max(Math.min(p.ydisp+m,p.ybase),0),S!==p.ydisp&&(g||this._onScroll.fire(p.ydisp))}};l.BufferService=x=u([y(0,k.IOptionsService)],x)},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(p,S,R,D){var M,T=arguments.length,N=T<3?S:D===null?D=Object.getOwnPropertyDescriptor(S,R):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(p,S,R,D);else for(var I=p.length-1;I>=0;I--)(M=p[I])&&(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(p,S){return function(R,D){S(R,D,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const d=h(2585),b=h(8460),C=h(844),k={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:p=>p.button!==4&&p.action===1&&(p.ctrl=!1,p.alt=!1,p.shift=!1,!0)},VT200:{events:19,restrict:p=>p.action!==32},DRAG:{events:23,restrict:p=>p.action!==32||p.button!==3},ANY:{events:31,restrict:p=>!0}};function x(p,S){let R=(p.ctrl?16:0)|(p.shift?4:0)|(p.alt?8:0);return p.button===4?(R|=64,R|=p.action):(R|=3&p.button,4&p.button&&(R|=64),8&p.button&&(R|=128),p.action===32?R|=32:p.action!==0||S||(R|=3)),R}const m=String.fromCharCode,g={DEFAULT:p=>{const S=[x(p,!1)+32,p.col+32,p.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${m(S[0])}${m(S[1])}${m(S[2])}`},SGR:p=>{const S=p.action===0&&p.button!==4?"m":"M";return`\x1B[<${x(p,!0)};${p.col};${p.row}${S}`},SGR_PIXELS:p=>{const S=p.action===0&&p.button!==4?"m":"M";return`\x1B[<${x(p,!0)};${p.x};${p.y}${S}`}};let f=l.CoreMouseService=class extends C.Disposable{constructor(p,S){super(),this._bufferService=p,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new b.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(k))this.addProtocol(R,k[R]);for(const R of Object.keys(g))this.addEncoding(R,g[R]);this.reset()}addProtocol(p,S){this._protocols[p]=S}addEncoding(p,S){this._encodings[p]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(p){if(!this._protocols[p])throw new Error(`unknown protocol "${p}"`);this._activeProtocol=p,this._onProtocolChange.fire(this._protocols[p].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(p){if(!this._encodings[p])throw new Error(`unknown encoding "${p}"`);this._activeEncoding=p}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(p){if(p.col<0||p.col>=this._bufferService.cols||p.row<0||p.row>=this._bufferService.rows||p.button===4&&p.action===32||p.button===3&&p.action!==32||p.button!==4&&(p.action===2||p.action===3)||(p.col++,p.row++,p.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,p,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(p))return!1;const S=this._encodings[this._activeEncoding](p);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=p,!0}explainEvents(p){return{down:!!(1&p),up:!!(2&p),drag:!!(4&p),move:!!(8&p),wheel:!!(16&p)}}_equalEvents(p,S,R){if(R){if(p.x!==S.x||p.y!==S.y)return!1}else if(p.col!==S.col||p.row!==S.row)return!1;return p.button===S.button&&p.action===S.action&&p.ctrl===S.ctrl&&p.alt===S.alt&&p.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,p,S,R){var D,M=arguments.length,T=M<3?p:R===null?R=Object.getOwnPropertyDescriptor(p,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(f,p,S,R);else for(var N=f.length-1;N>=0;N--)(D=f[N])&&(T=(M<3?D(T):M>3?D(p,S,T):D(p,S))||T);return M>3&&T&&Object.defineProperty(p,S,T),T},y=this&&this.__param||function(f,p){return function(S,R){p(S,R,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const d=h(1439),b=h(8460),C=h(844),k=h(2585),x=Object.freeze({insertMode:!1}),m=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let g=l.CoreService=class extends C.Disposable{constructor(f,p,S){super(),this._bufferService=f,this._logService=p,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new b.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new b.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(x),this.decPrivateModes=(0,d.clone)(m)}reset(){this.modes=(0,d.clone)(x),this.decPrivateModes=(0,d.clone)(m)}triggerDataEvent(f,p=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;p&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),p&&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((p=>p.charCodeAt(0))))),this._onBinary.fire(f))}};l.CoreService=g=u([y(0,k.IBufferService),y(1,k.ILogService),y(2,k.IOptionsService)],g)},9074:(A,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const u=h(8055),y=h(8460),d=h(844),b=h(6106);let C=0,k=0;class x extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new b.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 p=new m(f);if(p){const S=p.marker.onDispose((()=>p.dispose()));p.onDispose((()=>{p&&(this._decorations.delete(p)&&this._onDecorationRemoved.fire(p),S.dispose())})),this._decorations.insert(p),this._onDecorationRegistered.fire(p)}return p}reset(){for(const f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,p,S){let R=0,D=0;for(const M of this._decorations.getKeyIterator(p))R=M.options.x??0,D=R+(M.options.width??1),f>=R&&f<D&&(!S||(M.options.layer??"bottom")===S)&&(yield M)}forEachDecorationAtCell(f,p,S,R){this._decorations.forEachByKey(p,(D=>{C=D.options.x??0,k=C+(D.options.width??1),f>=C&&f<k&&(!S||(D.options.layer??"bottom")===S)&&R(D)}))}}l.DecorationService=x;class m 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(...C){this._entries=new Map;for(const[k,x]of C)this.set(k,x)}set(C,k){const x=this._entries.get(C);return this._entries.set(C,k),x}forEach(C){for(const[k,x]of this._entries.entries())C(k,x)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}l.ServiceCollection=d,l.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(b,C){this._services.set(b,C)}getService(b){return this._services.get(b)}createInstance(b,...C){const k=(0,y.getServiceDependencies)(b).sort(((g,f)=>g.index-f.index)),x=[];for(const g of k){const f=this._services.get(g.id);if(!f)throw new Error(`[createInstance] ${b.name} depends on UNKNOWN service ${g.id}.`);x.push(f)}const m=k.length>0?k[0].index:C.length;if(C.length!==m)throw new Error(`[createInstance] First service dependency of ${b.name} at position ${m+1} conflicts with ${C.length} static arguments`);return new b(...C,...x)}}},7866:function(A,l,h){var u=this&&this.__decorate||function(m,g,f,p){var S,R=arguments.length,D=R<3?g:p===null?p=Object.getOwnPropertyDescriptor(g,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(m,g,f,p);else for(var M=m.length-1;M>=0;M--)(S=m[M])&&(D=(R<3?S(D):R>3?S(g,f,D):S(g,f))||D);return R>3&&D&&Object.defineProperty(g,f,D),D},y=this&&this.__param||function(m,g){return function(f,p){g(f,p,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const d=h(844),b=h(2585),C={trace:b.LogLevelEnum.TRACE,debug:b.LogLevelEnum.DEBUG,info:b.LogLevelEnum.INFO,warn:b.LogLevelEnum.WARN,error:b.LogLevelEnum.ERROR,off:b.LogLevelEnum.OFF};let k,x=l.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(m){super(),this._optionsService=m,this._logLevel=b.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(m){for(let g=0;g<m.length;g++)typeof m[g]=="function"&&(m[g]=m[g]())}_log(m,g,f){this._evalLazyOptionalParams(f),m.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+g,...f)}trace(m,...g){var f;this._logLevel<=b.LogLevelEnum.TRACE&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.trace.bind(this._optionsService.options.logger))??console.log,m,g)}debug(m,...g){var f;this._logLevel<=b.LogLevelEnum.DEBUG&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.debug.bind(this._optionsService.options.logger))??console.log,m,g)}info(m,...g){var f;this._logLevel<=b.LogLevelEnum.INFO&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.info.bind(this._optionsService.options.logger))??console.info,m,g)}warn(m,...g){var f;this._logLevel<=b.LogLevelEnum.WARN&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.warn.bind(this._optionsService.options.logger))??console.warn,m,g)}error(m,...g){var f;this._logLevel<=b.LogLevelEnum.ERROR&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.error.bind(this._optionsService.options.logger))??console.error,m,g)}};l.LogService=x=u([y(0,b.IOptionsService)],x),l.setTraceLogger=function(m){k=m},l.traceCall=function(m,g,f){if(typeof f.value!="function")throw new Error("not supported");const p=f.value;f.value=function(...S){if(k.logLevel!==b.LogLevelEnum.TRACE)return p.apply(this,S);k.trace(`GlyphRenderer#${p.name}(${S.map((D=>JSON.stringify(D))).join(", ")})`);const R=p.apply(this,S);return k.trace(`GlyphRenderer#${p.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 b=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends y.Disposable{constructor(x){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const m={...l.DEFAULT_OPTIONS};for(const g in x)if(g in m)try{const f=x[g];m[g]=this._sanitizeAndValidateOption(g,f)}catch(f){console.error(f)}this.rawOptions=m,this.options={...m},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(x,m){return this.onOptionChange((g=>{g===x&&m(this.rawOptions[x])}))}onMultipleOptionChange(x,m){return this.onOptionChange((g=>{x.indexOf(g)!==-1&&m()}))}_setupOptions(){const x=g=>{if(!(g in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${g}"`);return this.rawOptions[g]},m=(g,f)=>{if(!(g in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${g}"`);f=this._sanitizeAndValidateOption(g,f),this.rawOptions[g]!==f&&(this.rawOptions[g]=f,this._onOptionChange.fire(g))};for(const g in this.rawOptions){const f={get:x.bind(this,g),set:m.bind(this,g)};Object.defineProperty(this.options,g,f)}}_sanitizeAndValidateOption(x,m){switch(x){case"cursorStyle":if(m||(m=l.DEFAULT_OPTIONS[x]),!(function(g){return g==="block"||g==="underline"||g==="bar"})(m))throw new Error(`"${m}" is not a valid value for ${x}`);break;case"wordSeparator":m||(m=l.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof m=="number"&&1<=m&&m<=1e3)break;m=b.includes(m)?m:l.DEFAULT_OPTIONS[x];break;case"cursorWidth":m=Math.floor(m);case"lineHeight":case"tabStopWidth":if(m<1)throw new Error(`${x} cannot be less than 1, value: ${m}`);break;case"minimumContrastRatio":m=Math.max(1,Math.min(21,Math.round(10*m)/10));break;case"scrollback":if((m=Math.min(m,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${m}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(m<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${m}`);break;case"rows":case"cols":if(!m&&m!==0)throw new Error(`${x} must be numeric, value: ${m}`);break;case"windowsPty":m=m??{}}return m}}l.OptionsService=C},2660:function(A,l,h){var u=this&&this.__decorate||function(C,k,x,m){var g,f=arguments.length,p=f<3?k:m===null?m=Object.getOwnPropertyDescriptor(k,x):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(C,k,x,m);else for(var S=C.length-1;S>=0;S--)(g=C[S])&&(p=(f<3?g(p):f>3?g(k,x,p):g(k,x))||p);return f>3&&p&&Object.defineProperty(k,x,p),p},y=this&&this.__param||function(C,k){return function(x,m){k(x,m,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const d=h(2585);let b=l.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const k=this._bufferService.buffer;if(C.id===void 0){const S=k.addMarker(k.ybase+k.y),R={data:C,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(R,S))),this._dataByLinkId.set(R.id,R),R.id}const x=C,m=this._getEntryIdKey(x),g=this._entriesWithId.get(m);if(g)return this.addLineToLink(g.id,k.ybase+k.y),g.id;const f=k.addMarker(k.ybase+k.y),p={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[f]};return f.onDispose((()=>this._removeMarkerFromLink(p,f))),this._entriesWithId.set(p.key,p),this._dataByLinkId.set(p.id,p),p.id}addLineToLink(C,k){const x=this._dataByLinkId.get(C);if(x&&x.lines.every((m=>m.line!==k))){const m=this._bufferService.buffer.addMarker(k);x.lines.push(m),m.onDispose((()=>this._removeMarkerFromLink(x,m)))}}getLinkData(C){var k;return(k=this._dataByLinkId.get(C))==null?void 0:k.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,k){const x=C.lines.indexOf(k);x!==-1&&(C.lines.splice(x,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};l.OscLinkService=b=u([y(0,d.IBufferService)],b)},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(b,C,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,m,g){m[h]===m?m[u].push({id:x,index:g}):(m[u]=[{id:x,index:g}],m[h]=m)})(d,b,k)};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(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,k,x=!1){return(16777215&C)<<3|(3&k)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const C=new y.UnicodeV6;this.register(C),this._active=C.version,this._activeProvider=C}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(C){if(!this._providers[C])throw new Error(`unknown Unicode version "${C}"`);this._active=C,this._activeProvider=this._providers[C],this._onChange.fire(C)}register(C){this._providers[C.version]=C}wcwidth(C){return this._activeProvider.wcwidth(C)}getStringCellWidth(C){let k=0,x=0;const m=C.length;for(let g=0;g<m;++g){let f=C.charCodeAt(g);if(55296<=f&&f<=56319){if(++g>=m)return k+this.wcwidth(f);const R=C.charCodeAt(g);56320<=R&&R<=57343?f=1024*(f-55296)+R-56320+65536:k+=this.wcwidth(R)}const p=this.charProperties(f,x);let S=d.extractWidth(p);d.extractShouldJoin(p)&&(S-=d.extractWidth(x)),k+=S,x=p}return k}charProperties(C,k){return this._activeProvider.charProperties(C,k)}}l.UnicodeService=d}},o={};function v(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,v),h.exports}var w={};return(()=>{var A=w;Object.defineProperty(A,"__esModule",{value:!0}),A.Terminal=void 0;const l=v(9042),h=v(3236),u=v(844),y=v(5741),d=v(8285),b=v(7975),C=v(7090),k=["cols","rows"];class x extends u.Disposable{constructor(g){super(),this._core=this.register(new h.Terminal(g)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const f=S=>this._core.options[S],p=(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:p.bind(this,S)};Object.defineProperty(this._publicOptions,S,R)}}_checkReadonlyOptions(g){if(k.includes(g))throw new Error(`Option "${g}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new b.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const g=this._core.coreService.decPrivateModes;let 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:g.applicationCursorKeys,applicationKeypadMode:g.applicationKeypad,bracketedPasteMode:g.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:g.origin,reverseWraparoundMode:g.reverseWraparound,sendFocusMode:g.sendFocus,wraparoundMode:g.wraparound}}get options(){return this._publicOptions}set options(g){for(const f in g)this._publicOptions[f]=g[f]}blur(){this._core.blur()}focus(){this._core.focus()}input(g,f=!0){this._core.input(g,f)}resize(g,f){this._verifyIntegers(g,f),this._core.resize(g,f)}open(g){this._core.open(g)}attachCustomKeyEventHandler(g){this._core.attachCustomKeyEventHandler(g)}attachCustomWheelEventHandler(g){this._core.attachCustomWheelEventHandler(g)}registerLinkProvider(g){return this._core.registerLinkProvider(g)}registerCharacterJoiner(g){return this._checkProposedApi(),this._core.registerCharacterJoiner(g)}deregisterCharacterJoiner(g){this._checkProposedApi(),this._core.deregisterCharacterJoiner(g)}registerMarker(g=0){return this._verifyIntegers(g),this._core.registerMarker(g)}registerDecoration(g){return this._checkProposedApi(),this._verifyPositiveIntegers(g.x??0,g.width??0,g.height??0),this._core.registerDecoration(g)}hasSelection(){return this._core.hasSelection()}select(g,f,p){this._verifyIntegers(g,f,p),this._core.select(g,f,p)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(g,f){this._verifyIntegers(g,f),this._core.selectLines(g,f)}dispose(){super.dispose()}scrollLines(g){this._verifyIntegers(g),this._core.scrollLines(g)}scrollPages(g){this._verifyIntegers(g),this._core.scrollPages(g)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(g){this._verifyIntegers(g),this._core.scrollToLine(g)}clear(){this._core.clear()}write(g,f){this._core.write(g,f)}writeln(g,f){this._core.write(g),this._core.write(`\r
|
|
282
|
+
`,f)}paste(g){this._core.paste(g)}refresh(g,f){this._verifyIntegers(g,f),this._core.refresh(g,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(g){this._addonManager.loadAddon(this,g)}static get strings(){return l}_verifyIntegers(...g){for(const f of g)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...g){for(const f of g)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}A.Terminal=x})(),w})()))})(Wu)),Wu.exports}var h3=u3(),Vu={exports:{}},hp;function f3(){return hp||(hp=1,(function(i,r){(function(a,o){i.exports=o()})(self,(()=>(()=>{var a={};return(()=>{var o=a;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.FitAddon=class{activate(v){this._terminal=v}dispose(){}fit(){const v=this.proposeDimensions();if(!v||!this._terminal||isNaN(v.cols)||isNaN(v.rows))return;const w=this._terminal._core;this._terminal.rows===v.rows&&this._terminal.cols===v.cols||(w._renderService.clear(),this._terminal.resize(v.cols,v.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const v=this._terminal._core,w=v._renderService.dimensions;if(w.css.cell.width===0||w.css.cell.height===0)return;const A=this._terminal.options.scrollback===0?0:v.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"))),b=u-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-A;return{cols:Math.max(2,Math.floor(b/w.css.cell.width)),rows:Math.max(1,Math.floor(d/w.css.cell.height))}}}})(),a})()))})(Vu)),Vu.exports}var d3=f3();const m3=3e4,_3=300*1e3;class p3{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,v,w,A,l;if(this.destroyed)return;if(this.failStartTime===null&&(this.failStartTime=Date.now()),Date.now()-this.failStartTime>=_3){(o=(a=this.callbacks).onGiveUp)==null||o.call(a),(w=(v=this.callbacks).onClose)==null||w.call(v);return}this.consecutiveFailures++;const r=Math.min(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 v3({sessionId:i,status:r}){const a=dt(m=>m.token),o=F.useRef(null),v=F.useRef(null),w=F.useRef(null),A=F.useRef(null),l=F.useRef(r),h=F.useRef("");F.useEffect(()=>{l.current=r},[r]);const[u,y]=F.useState("connecting"),[d,b]=F.useState(null),C=F.useCallback(()=>{const m=window.location.origin,g=`/v1/sessions/${encodeURIComponent(i)}/terminal`;return`${m.replace(/^http/,"ws")}${g}`},[i]);F.useEffect(()=>{if(!o.current)return;const m=new h3.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}),g=new d3.FitAddon;m.loadAddon(g),m.open(o.current),g.fit(),v.current=m,w.current=g;const f=new ResizeObserver(()=>{var R;g.fit();const{cols:p,rows:S}=m;(R=A.current)==null||R.send({type:"resize",cols:p,rows:S})});return f.observe(o.current),()=>{f.disconnect(),m.dispose(),v.current=null,w.current=null}},[]),F.useEffect(()=>{const m=C(),g=new p3(m,{onMessage:f=>{const p=f,S=v.current;if(S)switch(p.type){case"pane":{const R=h.current,D=p.content;R&&D.startsWith(R)?S.write(D.slice(R.length)):(S.reset(),S.write(D)),h.current=D,b(null);break}case"status":break;case"error":b(p.message);break}},onOpen:()=>{var p;y("connected"),b(null);const f=v.current;w.current&&f&&((p=A.current)==null||p.send({type:"resize",cols:f.cols,rows:f.rows}))},onReconnecting:()=>{y("reconnecting")},onGiveUp:()=>{y("disconnected")},onClose:()=>{y("disconnected")}},a??void 0);return A.current=g,()=>{A.current=null,g.close()}},[C,a]),F.useEffect(()=>{const m=v.current;if(!m)return;const g=m.onData(f=>{var p;(p=A.current)==null||p.send({type:"input",text:f})});return()=>{g.dispose()}},[]);const k=r==="working",x=u==="connected";return E.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[E.jsxs("div",{className:"flex items-center justify-between px-4 py-2 text-xs border-b border-[#1a1a2e]",children:[E.jsx("div",{className:"flex items-center gap-2",children:E.jsx("span",{className:"font-mono text-[#888]",children:"Terminal"})}),E.jsxs("div",{className:"flex items-center gap-3",children:[E.jsxs("div",{className:"flex items-center gap-1.5",children:[E.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:x?"#00e5ff":u==="reconnecting"?"#ffaa00":"#666",boxShadow:x?"0 0 4px #00e5ff40":"none",animation:u==="reconnecting"?"pulse 1s ease-in-out infinite":"none"}}),E.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:u==="connecting"?"connecting…":u==="reconnecting"?"reconnecting…":u==="connected"?"ws live":"disconnected"})]}),E.jsxs("div",{className:"flex items-center gap-1.5",children:[E.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:k?"#00ff88":"#888",boxShadow:k?"0 0 4px #00ff88":"none"}}),E.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:k?"active":"idle"})]})]})]}),d&&E.jsx("div",{className:"px-4 py-2 text-xs text-[#ff3366] bg-[#ff336610] border-b border-[#ff336620]",children:d}),E.jsx("div",{ref:o,className:"h-[calc(100vh-420px)] sm:h-[calc(100vh-460px)] min-h-[250px] sm:min-h-[300px]"})]})}function g3({metrics:i,loading:r}){if(r||!i)return E.jsx("div",{className:"flex items-center justify-center h-48 text-[#555] text-sm animate-pulse",children:"Loading metrics…"});const a=[{label:"Duration",value:dE(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 E.jsxs("div",{className:"space-y-4",children:[E.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:a.map(o=>E.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors duration-150 hover:border-[#00e5ff]/30",children:[E.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[E.jsx("span",{className:"text-base",children:o.icon}),E.jsx("span",{className:"text-[10px] text-[#888] uppercase tracking-wider",children:o.label})]}),E.jsx("div",{className:"text-2xl font-semibold font-mono tabular-nums",style:{color:o.color},children:o.value})]},o.label))}),i.statusChanges.length>0&&E.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-4",children:[E.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider mb-3",children:"Status Changes"}),E.jsx("div",{className:"flex flex-wrap gap-2",children:i.statusChanges.map((o,v)=>E.jsx("div",{className:"text-xs font-mono text-[#555] bg-[#0a0a0f] px-2 py-1 rounded border border-[#1a1a2e]",children:o},v))})]})]})}const y3=new Set(["bypassPermissions","dontAsk","acceptEdits","plan","auto"]);function S3({prompt:i,permissionMode:r,onApprove:a,onReject:o}){const[v,w]=F.useState(!1);return r&&r!=="default"&&y3.has(r)?E.jsx("div",{className:"flex items-center gap-2 px-4 py-2 bg-[#003322]/50 border border-[#00ff88]/30 rounded-lg text-sm",children:E.jsxs("span",{className:"text-[#00ff88] font-semibold text-xs uppercase tracking-wider",children:["AUTO-APPROVED (",r,")"]})}):E.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:[E.jsxs("div",{className:"flex items-center gap-3 sm:gap-2 min-w-0",children:[E.jsx("span",{className:"text-[#ffaa00] text-lg shrink-0",children:"⚠"}),E.jsxs("div",{className:"flex-1 min-w-0",children:[E.jsx("div",{className:"text-xs text-[#ffaa00] font-semibold uppercase tracking-wider mb-0.5",children:"Permission Required"}),E.jsxs("div",{className:`text-sm text-[#e0e0e0] font-mono cursor-pointer ${v?"":"truncate"}`,onClick:()=>w(!v),title:v?void 0:"Click to expand",children:[i,!v&&i.length>60&&E.jsx("span",{className:"text-[#888] ml-1",children:"..."})]})]})]}),E.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[E.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"}),E.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 b3=[{id:"transcript",label:"Transcript"},{id:"terminal",label:"Terminal"},{id:"metrics",label:"Metrics"}],fp=["/clear","/compact","/cost","/config"];function x3(){const{id:i}=Ep(),r=hl(),[a,o]=F.useState("transcript"),{session:v,health:w,notFound:A,loading:l,metrics:h,metricsLoading:u}=OE(i??""),[y,d]=F.useState(""),[b,C]=F.useState(!1),[k,x]=F.useState(fp[0]),[m,g]=F.useState(!1),[f,p]=F.useState(""),[S,R]=F.useState(!1),[D,M]=F.useState(!1),T=F.useRef(null),N=F.useRef(!1),I=bs(ne=>ne.addToast);if(l)return E.jsx("div",{className:"min-h-screen bg-[#0a0a0f] flex items-center justify-center text-[#555] text-sm",children:E.jsx("div",{className:"animate-pulse",children:"Loading session…"})});if(A||!v||!w)return E.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-[#555]",children:[E.jsx("div",{className:"text-6xl mb-4",children:"404"}),E.jsx("div",{className:"text-lg mb-6 text-[#e0e0e0]",children:"Session not found"}),E.jsx(Hi,{to:"/",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Overview"})]});const $=v,q=w,P=q.status==="permission_prompt"||q.status==="bash_approval";function Q(){yv($.id).catch(ne=>I("error","Approve failed",ne instanceof Error?ne.message:void 0))}function te(){Z2($.id).catch(ne=>I("error","Reject failed",ne instanceof Error?ne.message:void 0))}function G(){Sv($.id).catch(ne=>I("error","Interrupt failed",ne instanceof Error?ne.message:void 0))}function Y(){q2($.id).catch(ne=>I("error","Escape failed",ne instanceof Error?ne.message:void 0))}async function ee(){try{await gv($.id),r("/")}catch(ne){I("error","Failed to kill session",ne instanceof Error?ne.message:void 0)}}async function B(){var K;const ne=y.trim();if(ne&&!N.current){N.current=!0,C(!0);try{await F2($.id,ne),d("")}catch(z){I("error","Failed to send message",z instanceof Error?z.message:void 0)}finally{C(!1),N.current=!1,(K=T.current)==null||K.focus()}}}function U(){var ne;d(k),(ne=T.current)==null||ne.focus()}async function L(){if(!(!k||m)){g(!0);try{await W2($.id,k),d("")}catch(ne){I("error","Failed to send slash command",ne instanceof Error?ne.message:void 0)}finally{g(!1)}}}async function H(){const ne=f.trim();if(!(!ne||D)){M(!0);try{await V2($.id,ne),p(""),R(!1)}catch(K){I("error","Failed to send bash command",K instanceof Error?K.message:void 0)}finally{M(!1)}}}function X(){f.trim()&&R(!0)}function ae(ne){p(ne),S&&R(!1)}function he(ne){ne.key==="Enter"&&!ne.shiftKey&&(ne.preventDefault(),B())}return E.jsx("div",{className:"min-h-screen bg-[#0a0a0f]",children:E.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:[E.jsxs("nav",{className:"text-xs text-[#555] flex items-center gap-1",children:[E.jsx(Hi,{to:"/",className:"hover:text-[#00e5ff] transition-colors",children:"Overview"}),E.jsx("span",{className:"text-[#333]",children:"/"}),E.jsx("span",{className:"text-[#e0e0e0] truncate max-w-[160px] sm:max-w-xs",children:$.windowName||$.id})]}),E.jsx(LE,{session:$,health:q,onApprove:Q,onReject:te,onInterrupt:G,onKill:ee}),E.jsx("div",{className:"flex border-b border-[#1a1a2e]",role:"tablist",children:b3.map(ne=>E.jsxs("button",{id:`tab-${ne.id}`,onClick:()=>o(ne.id),role:"tab","aria-selected":a===ne.id,"aria-controls":`panel-${ne.id}`,tabIndex:a===ne.id?0:-1,className:`flex-1 min-h-[44px] text-sm font-medium transition-colors relative ${a===ne.id?"text-[#00e5ff]":"text-[#555] hover:text-[#888]"}`,children:[ne.label,a===ne.id&&E.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-[#00e5ff]"})]},ne.id))}),E.jsxs("div",{className:"bg-[#0a0a0f] rounded-lg min-h-[300px] sm:min-h-[400px]",children:[P&&E.jsx("div",{className:"p-3 sm:p-4 pb-0",children:E.jsx(S3,{prompt:q.details,permissionMode:$.permissionMode,onApprove:Q,onReject:te})}),a==="transcript"&&E.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:E.jsx(c3,{sessionId:$.id})}),a==="terminal"&&E.jsx("div",{id:"panel-terminal",role:"tabpanel","aria-labelledby":"tab-terminal",tabIndex:0,children:E.jsx(v3,{sessionId:$.id,status:q.status})}),a==="metrics"&&E.jsx("div",{id:"panel-metrics",role:"tabpanel","aria-labelledby":"tab-metrics",tabIndex:0,className:"p-3 sm:p-4",children:E.jsx(g3,{metrics:h,loading:u})})]}),E.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("label",{htmlFor:"session-message-input",className:"sr-only",children:"Session message input"}),E.jsx("input",{id:"session-message-input",ref:T,type:"text",value:y,onChange:ne=>d(ne.target.value),onKeyDown:he,placeholder:"Send a message to Claude…",disabled:b||!q.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"}),E.jsx("button",{onClick:B,disabled:b||!y.trim()||!q.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:E.jsx(db,{className:"h-4 w-4"})})]}),E.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#1a1a2e]/50",children:[E.jsx("label",{className:"sr-only",htmlFor:"slash-command-select",children:"Common slash command"}),E.jsx("select",{id:"slash-command-select",value:k,onChange:ne=>x(ne.target.value),disabled:m||!q.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:fp.map(ne=>E.jsx("option",{value:ne,children:ne},ne))}),E.jsx("button",{onClick:U,disabled:m||!q.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"}),E.jsx("button",{onClick:L,disabled:m||!q.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:m?"Sending Slash…":"Run Slash"}),E.jsx("label",{className:"sr-only",htmlFor:"bash-command-input",children:"Bash command"}),E.jsx("input",{id:"bash-command-input",type:"text",value:f,onChange:ne=>ae(ne.target.value),placeholder:"Bash command (requires confirmation)…",disabled:D||!q.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?E.jsxs(E.Fragment,{children:[E.jsx("span",{className:"text-[11px] text-[#ffaa00] italic",children:"Confirm bash command execution."}),E.jsx("button",{onClick:H,disabled:D||!f.trim()||!q.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:D?"Sending Bash…":"Confirm Bash"}),E.jsx("button",{onClick:()=>R(!1),disabled:D,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"})]}):E.jsx("button",{onClick:X,disabled:D||!f.trim()||!q.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"}),E.jsxs("button",{onClick:G,"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:[E.jsx(ab,{className:"h-3.5 w-3.5"}),"Interrupt"]}),E.jsxs("button",{onClick:Y,"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:[E.jsx(GS,{className:"h-3.5 w-3.5"}),"Escape"]})]})]})]})})}const C3={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"},w3=new Set(["running"]);function Ov({status:i}){const r=C3[i]??"bg-gray-500/10 text-gray-500 border-gray-500/30",a=w3.has(i);return E.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&&E.jsxs("span",{className:"relative flex h-2 w-2",children:[E.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75 bg-current"}),E.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]}),i]})}let E3=0;function pa(){return{workDir:"",name:"",prompt:"",_key:E3++}}function T3({open:i,onClose:r}){const a=hl(),o=F.useRef(null),v=F.useRef(null),[w,A]=F.useState(""),[l,h]=F.useState([pa(),pa()]),[u,y]=F.useState(!1),[d,b]=F.useState(null),C=F.useCallback(()=>{k(),r()},[r]);function k(){A(""),h([pa(),pa()]),y(!1),b(null)}F.useEffect(()=>{if(!i)return;const S=R=>{R.key==="Escape"&&C()};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[i,C]),F.useEffect(()=>{if(!i)return;const S=o.current;if(!S)return;const R='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',D=M=>{if(M.key!=="Tab")return;const T=Array.from(S.querySelectorAll(R));if(T.length===0)return;const N=T[0],I=T[T.length-1];M.shiftKey?document.activeElement===N&&(M.preventDefault(),I.focus()):document.activeElement===I&&(M.preventDefault(),N.focus())};return S.addEventListener("keydown",D),()=>S.removeEventListener("keydown",D)},[i]),F.useEffect(()=>{if(i){const S=setTimeout(()=>{var R;return(R=v.current)==null?void 0:R.focus()},50);return()=>clearTimeout(S)}},[i]);function x(){l.length>=10||h([...l,pa()])}function m(S){l.length<=1||h(l.filter((R,D)=>D!==S))}function g(S,R,D){h(l.map((M,T)=>T===S?{...M,[R]:D}:M))}async function f(S){S.preventDefault(),b(null);const R=l.filter(D=>D.workDir.trim());if(!w.trim()){b("Pipeline name is required");return}if(R.length===0){b("At least one step with a working directory is required");return}y(!0);try{const D=await X2({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}))});k(),r(),a(`/pipelines/${D.id}`)}catch(D){b(D instanceof Error?D.message:"Failed to create pipeline")}finally{y(!1)}}if(!i)return null;const p=w.trim()&&l.some(S=>S.workDir.trim());return E.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[E.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:C}),E.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:[E.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[E.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Pipeline"}),E.jsx("button",{onClick:C,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:E.jsx(dl,{className:"h-4 w-4"})})]}),E.jsxs("form",{onSubmit:f,className:"p-4 sm:p-5 space-y-4",children:[E.jsxs("div",{children:[E.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Pipeline Name ",E.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),E.jsx("input",{type:"text",ref:v,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]"})]}),E.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[E.jsxs("span",{children:["Working Directory ",E.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),E.jsx("span",{children:"Name"}),E.jsx("span",{children:"Prompt"}),E.jsx("span",{})]}),E.jsx("div",{className:"space-y-2",children:l.map((S,R)=>E.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[E.jsx("input",{type:"text",value:S.workDir,onChange:D=>g(R,"workDir",D.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"}),E.jsx("input",{type:"text",value:S.name,onChange:D=>g(R,"name",D.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]"}),E.jsx("input",{type:"text",value:S.prompt,onChange:D=>g(R,"prompt",D.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]"}),E.jsx("button",{type:"button",onClick:()=>m(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:E.jsx(fh,{className:"h-3.5 w-3.5"})})]},S._key))}),l.length<10&&E.jsxs("button",{type:"button",onClick:x,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[E.jsx(wa,{className:"h-3.5 w-3.5"}),"Add Step"]}),d&&E.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:d}),E.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[E.jsx("button",{type:"button",onClick:C,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"}),E.jsxs("button",{type:"submit",disabled:u||!p,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&&E.jsx(Qu,{className:"h-3 w-3 animate-spin"}),"Create Pipeline"]})]})]})]})]})}const A3=5e3,R3=6e4;function D3(){const[i,r]=F.useState([]),[a,o]=F.useState(!0),[v,w]=F.useState(!1),A=bs(u=>u.addToast),l=F.useCallback(async()=>{try{const u=await J2();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]);F.useEffect(()=>{let u,y=!1,d=0;const b=async()=>{if(y||(await l()?d=0:d+=1,y))return;const k=d>0?2**d:1,x=Math.min(A3*k,R3);u=setTimeout(()=>{b()},x)};return b(),()=>{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?E.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:E.jsx("div",{className:"animate-pulse",children:"Loading pipelines…"})}):E.jsxs("div",{className:"flex flex-col gap-6",children:[E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsxs("div",{children:[E.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Pipelines"}),E.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Manage and monitor session pipelines"})]}),E.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:[E.jsx(wa,{className:"h-3.5 w-3.5"}),"New Pipeline"]})]}),E.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[E.jsx(Ks,{label:"Total",value:h.total}),E.jsx(Ks,{label:"Running",value:h.running}),E.jsx(Ks,{label:"Completed",value:h.completed}),E.jsx(Ks,{label:"Failed",value:h.failed})]}),i.length===0?E.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:[E.jsx("p",{className:"text-gray-500",children:"No pipelines yet"}),E.jsx("p",{className:"mt-1 text-xs text-gray-600",children:"Create a pipeline to run sessions in sequence"})]}):E.jsx("div",{className:"space-y-3",children:i.map(u=>E.jsx(Hi,{to:`/pipelines/${u.id}`,className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 hover:border-[#00e5ff]/30 transition-colors",children:E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[E.jsx("span",{className:"font-medium text-gray-200 truncate",children:u.name}),E.jsx(Ov,{status:u.status})]}),E.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 shrink-0 ml-4",children:[E.jsxs("span",{children:[u.stages.length," step",u.stages.length!==1?"s":""]}),E.jsx("span",{children:vr(u.createdAt)})]})]})},u.id))}),E.jsx(T3,{open:v,onClose:()=>w(!1)})]})}const k3=3e3,O3=6e4;function M3(){const{id:i}=Ep(),[r,a]=F.useState(null),[o,v]=F.useState(!0),[w,A]=F.useState(!1),l=bs(u=>u.addToast),h=F.useCallback(async()=>{if(!i)return!1;try{const u=await Q2(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{v(!1)}},[i,l]);return F.useEffect(()=>{let u,y=!1,d=0;const b=async()=>{if(y||(await h()?d=0:d+=1,y))return;const k=d>0?2**d:1,x=Math.min(k3*k,O3);u=setTimeout(()=>{b()},x)};return b(),()=>{y=!0,u&&clearTimeout(u)}},[h]),o?E.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:E.jsx("div",{className:"animate-pulse",children:"Loading pipeline…"})}):w||!r?E.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[50vh] text-gray-500",children:[E.jsx("div",{className:"text-6xl mb-4",children:"404"}),E.jsx("div",{className:"text-lg mb-6 text-gray-200",children:"Pipeline not found"}),E.jsx(Hi,{to:"/pipelines",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Pipelines"})]}):E.jsxs("div",{className:"flex flex-col gap-6",children:[E.jsxs("nav",{className:"text-xs text-gray-500 flex items-center gap-1",children:[E.jsx(Hi,{to:"/pipelines",className:"hover:text-[#00e5ff] transition-colors",children:"Pipelines"}),E.jsx("span",{className:"text-gray-700",children:"/"}),E.jsx("span",{className:"text-gray-200 truncate max-w-xs",children:r.name})]}),E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsxs("div",{className:"flex items-center gap-3",children:[E.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:r.name}),E.jsx(Ov,{status:r.status})]}),E.jsxs("div",{className:"text-xs text-gray-500",children:["Created ",vr(r.createdAt)]})]}),E.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118]",children:[E.jsx("div",{className:"px-4 py-3 border-b border-void-lighter",children:E.jsxs("h3",{className:"text-sm font-semibold text-gray-200",children:["Steps (",r.stages.length,")"]})}),r.stages.length===0?E.jsx("div",{className:"p-8 text-center text-gray-500 text-sm",children:"No steps yet"}):E.jsxs("table",{className:"w-full text-left text-sm",children:[E.jsx("thead",{children:E.jsxs("tr",{className:"border-b border-void-lighter text-gray-600",children:[E.jsx("th",{className:"px-4 py-3 font-medium w-16",children:"#"}),E.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),E.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),E.jsx("th",{className:"px-4 py-3 font-medium",children:"Session"})]})}),E.jsx("tbody",{children:r.stages.map((u,y)=>E.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[E.jsxs("td",{className:"px-4 py-3 text-gray-500 font-mono text-xs",children:["#",y+1]}),E.jsx("td",{className:"px-4 py-3",children:E.jsx(yl,{status:u.status})}),E.jsx("td",{className:"px-4 py-3",children:u.sessionId?E.jsx(Hi,{to:`/sessions/${encodeURIComponent(u.sessionId)}`,className:"font-medium text-gray-200 hover:text-cyan transition-colors",children:u.name}):E.jsx("span",{className:"font-medium text-gray-200",children:u.name})}),E.jsx("td",{className:"px-4 py-3 font-mono text-xs text-gray-400",children:u.sessionId??"—"})]},u.name))})]})]})]})}function L3(){return E.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 text-center",children:[E.jsx("h1",{className:"text-6xl font-bold text-gray-500",children:"404"}),E.jsx("p",{className:"text-lg text-gray-400",children:"Page not found"}),E.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 N3(){return E.jsx(OS,{children:E.jsx(Jy,{children:E.jsxs(Gs,{element:E.jsx(hE,{}),children:[E.jsx(Gs,{path:"/",element:E.jsx(kE,{})}),E.jsx(Gs,{path:"/auth/keys",element:E.jsx(gE,{})}),E.jsx(Gs,{path:"/sessions/:id",element:E.jsx(x3,{})}),E.jsx(Gs,{path:"/pipelines",element:E.jsx(D3,{})}),E.jsx(Gs,{path:"/pipelines/:id",element:E.jsx(M3,{})}),E.jsx(Gs,{path:"*",element:E.jsx(L3,{})})]})})})}J0.createRoot(document.getElementById("root")).render(E.jsx(va.StrictMode,{children:E.jsx(xS,{basename:"/dashboard",children:E.jsx(N3,{})})}));
|