aegis-bridge 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +244 -0
  3. package/dashboard/dist/assets/index-CijFoeRu.css +32 -0
  4. package/dashboard/dist/assets/index-QtT4j0ht.js +262 -0
  5. package/dashboard/dist/index.html +14 -0
  6. package/dist/auth.d.ts +76 -0
  7. package/dist/auth.js +219 -0
  8. package/dist/channels/index.d.ts +8 -0
  9. package/dist/channels/index.js +9 -0
  10. package/dist/channels/manager.d.ts +39 -0
  11. package/dist/channels/manager.js +101 -0
  12. package/dist/channels/telegram-style.d.ts +118 -0
  13. package/dist/channels/telegram-style.js +203 -0
  14. package/dist/channels/telegram.d.ts +76 -0
  15. package/dist/channels/telegram.js +1396 -0
  16. package/dist/channels/types.d.ts +77 -0
  17. package/dist/channels/types.js +9 -0
  18. package/dist/channels/webhook.d.ts +58 -0
  19. package/dist/channels/webhook.js +162 -0
  20. package/dist/cli.d.ts +8 -0
  21. package/dist/cli.js +223 -0
  22. package/dist/config.d.ts +60 -0
  23. package/dist/config.js +188 -0
  24. package/dist/dashboard/assets/index-CijFoeRu.css +32 -0
  25. package/dist/dashboard/assets/index-QtT4j0ht.js +262 -0
  26. package/dist/dashboard/index.html +14 -0
  27. package/dist/events.d.ts +86 -0
  28. package/dist/events.js +258 -0
  29. package/dist/hook-settings.d.ts +67 -0
  30. package/dist/hook-settings.js +138 -0
  31. package/dist/hook.d.ts +18 -0
  32. package/dist/hook.js +199 -0
  33. package/dist/hooks.d.ts +32 -0
  34. package/dist/hooks.js +279 -0
  35. package/dist/jsonl-watcher.d.ts +57 -0
  36. package/dist/jsonl-watcher.js +159 -0
  37. package/dist/mcp-server.d.ts +60 -0
  38. package/dist/mcp-server.js +788 -0
  39. package/dist/metrics.d.ts +104 -0
  40. package/dist/metrics.js +226 -0
  41. package/dist/monitor.d.ts +84 -0
  42. package/dist/monitor.js +553 -0
  43. package/dist/permission-guard.d.ts +51 -0
  44. package/dist/permission-guard.js +197 -0
  45. package/dist/pipeline.d.ts +84 -0
  46. package/dist/pipeline.js +218 -0
  47. package/dist/screenshot.d.ts +26 -0
  48. package/dist/screenshot.js +57 -0
  49. package/dist/server.d.ts +10 -0
  50. package/dist/server.js +1577 -0
  51. package/dist/session.d.ts +297 -0
  52. package/dist/session.js +1275 -0
  53. package/dist/sse-limiter.d.ts +47 -0
  54. package/dist/sse-limiter.js +62 -0
  55. package/dist/sse-writer.d.ts +31 -0
  56. package/dist/sse-writer.js +95 -0
  57. package/dist/ssrf.d.ts +57 -0
  58. package/dist/ssrf.js +169 -0
  59. package/dist/swarm-monitor.d.ts +114 -0
  60. package/dist/swarm-monitor.js +267 -0
  61. package/dist/terminal-parser.d.ts +16 -0
  62. package/dist/terminal-parser.js +343 -0
  63. package/dist/tmux.d.ts +161 -0
  64. package/dist/tmux.js +725 -0
  65. package/dist/transcript.d.ts +47 -0
  66. package/dist/transcript.js +244 -0
  67. package/dist/validation.d.ts +222 -0
  68. package/dist/validation.js +268 -0
  69. package/dist/ws-terminal.d.ts +32 -0
  70. package/dist/ws-terminal.js +297 -0
  71. package/package.json +71 -0
@@ -0,0 +1,262 @@
1
+ var k0=Object.defineProperty;var O0=(i,r,a)=>r in i?k0(i,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[r]=a;var At=(i,r,a)=>O0(i,typeof r!="symbol"?r+"":r,a);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const g of document.querySelectorAll('link[rel="modulepreload"]'))o(g);new MutationObserver(g=>{for(const x of g)if(x.type==="childList")for(const T of x.addedNodes)T.tagName==="LINK"&&T.rel==="modulepreload"&&o(T)}).observe(document,{childList:!0,subtree:!0});function a(g){const x={};return g.integrity&&(x.integrity=g.integrity),g.referrerPolicy&&(x.referrerPolicy=g.referrerPolicy),g.crossOrigin==="use-credentials"?x.credentials="include":g.crossOrigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function o(g){if(g.ep)return;g.ep=!0;const x=a(g);fetch(g.href,x)}})();function lp(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Tu={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 sm;function M0(){if(sm)return oa;sm=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(o,g,x){var T=null;if(x!==void 0&&(T=""+x),g.key!==void 0&&(T=""+g.key),"key"in g){x={};for(var c in g)c!=="key"&&(x[c]=g[c])}else x=g;return g=x.ref,{$$typeof:i,type:o,key:T,ref:g!==void 0?g:null,props:x}}return oa.Fragment=r,oa.jsx=a,oa.jsxs=a,oa}var rm;function L0(){return rm||(rm=1,Tu.exports=M0()),Tu.exports}var O=L0(),Au={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 nm;function N0(){if(nm)return Ae;nm=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),T=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),C=Symbol.iterator;function w(L){return L===null||typeof L!="object"?null:(L=C&&L[C]||L["@@iterator"],typeof L=="function"?L:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,m={};function v(L,H,V){this.props=L,this.context=H,this.refs=m,this.updater=V||k}v.prototype.isReactComponent={},v.prototype.setState=function(L,H){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,H,"setState")},v.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function f(){}f.prototype=v.prototype;function p(L,H,V){this.props=L,this.context=H,this.refs=m,this.updater=V||k}var S=p.prototype=new f;S.constructor=p,b(S,v.prototype),S.isPureReactComponent=!0;var A=Array.isArray;function R(){}var M={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function B(L,H,V){var re=V.ref;return{$$typeof:i,type:L,key:H,ref:re!==void 0?re:null,props:V}}function $(L,H){return B(L.type,H,L.props)}function I(L){return typeof L=="object"&&L!==null&&L.$$typeof===i}function q(L){var H={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(V){return H[V]})}var P=/\/+/g;function J(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(R,R):(L.status="pending",L.then(function(H){L.status==="pending"&&(L.status="fulfilled",L.value=H)},function(H){L.status==="pending"&&(L.status="rejected",L.reason=H)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function G(L,H,V,re,ue){var me=typeof L;(me==="undefined"||me==="boolean")&&(L=null);var Y=!1;if(L===null)Y=!0;else switch(me){case"bigint":case"string":case"number":Y=!0;break;case"object":switch(L.$$typeof){case i:case r:Y=!0;break;case y:return Y=L._init,G(Y(L._payload),H,V,re,ue)}}if(Y)return ue=ue(L),Y=re===""?"."+J(L,0):re,A(ue)?(V="",Y!=null&&(V=Y.replace(P,"$&/")+"/"),G(ue,H,V,"",function(oe){return oe})):ue!=null&&(I(ue)&&(ue=$(ue,V+(ue.key==null||L&&L.key===ue.key?"":(""+ue.key).replace(P,"$&/")+"/")+Y)),H.push(ue)),1;Y=0;var j=re===""?".":re+":";if(A(L))for(var ce=0;ce<L.length;ce++)re=L[ce],me=j+J(re,ce),Y+=G(re,H,V,me,ue);else if(ce=w(L),typeof ce=="function")for(L=ce.call(L),ce=0;!(re=L.next()).done;)re=re.value,me=j+J(re,ce++),Y+=G(re,H,V,me,ue);else if(me==="object"){if(typeof L.then=="function")return G(te(L),H,V,re,ue);throw H=String(L),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return Y}function se(L,H,V){if(L==null)return L;var re=[],ue=0;return G(L,re,"","",function(me){return H.call(V,me,ue++)}),re}function ae(L){if(L._status===-1){var H=L._result;H=H(),H.then(function(V){(L._status===0||L._status===-1)&&(L._status=1,L._result=V)},function(V){(L._status===0||L._status===-1)&&(L._status=2,L._result=V)}),L._status===-1&&(L._status=0,L._result=H)}if(L._status===1)return L._result.default;throw L._result}var N=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:se,forEach:function(L,H,V){se(L,function(){H.apply(this,arguments)},V)},count:function(L){var H=0;return se(L,function(){H++}),H},toArray:function(L){return se(L,function(H){return H})||[]},only:function(L){if(!I(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=v,Ae.Fragment=a,Ae.Profiler=g,Ae.PureComponent=p,Ae.StrictMode=o,Ae.Suspense=u,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,V){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var re=b({},L.props),ue=L.key;if(H!=null)for(me in H.key!==void 0&&(ue=""+H.key),H)!E.call(H,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&H.ref===void 0||(re[me]=H[me]);var me=arguments.length-2;if(me===1)re.children=V;else if(1<me){for(var Y=Array(me),j=0;j<me;j++)Y[j]=arguments[j+2];re.children=Y}return B(L.type,ue,re)},Ae.createContext=function(L){return L={$$typeof:T,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:x,_context:L},L},Ae.createElement=function(L,H,V){var re,ue={},me=null;if(H!=null)for(re in H.key!==void 0&&(me=""+H.key),H)E.call(H,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ue[re]=H[re]);var Y=arguments.length-2;if(Y===1)ue.children=V;else if(1<Y){for(var j=Array(Y),ce=0;ce<Y;ce++)j[ce]=arguments[ce+2];ue.children=j}if(L&&L.defaultProps)for(re in Y=L.defaultProps,Y)ue[re]===void 0&&(ue[re]=Y[re]);return B(L,me,ue)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(L){return{$$typeof:c,render:L}},Ae.isValidElement=I,Ae.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:ae}},Ae.memo=function(L,H){return{$$typeof:h,type:L,compare:H===void 0?null:H}},Ae.startTransition=function(L){var H=M.T,V={};M.T=V;try{var re=L(),ue=M.S;ue!==null&&ue(V,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(R,N)}catch(me){N(me)}finally{H!==null&&V.types!==null&&(H.types=V.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,V){return M.H.useActionState(L,H,V)},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,V){return M.H.useImperativeHandle(L,H,V)},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,V){return M.H.useReducer(L,H,V)},Ae.useRef=function(L){return M.H.useRef(L)},Ae.useState=function(L){return M.H.useState(L)},Ae.useSyncExternalStore=function(L,H,V){return M.H.useSyncExternalStore(L,H,V)},Ae.useTransition=function(){return M.H.useTransition()},Ae.version="19.2.4",Ae}var am;function ih(){return am||(am=1,Au.exports=N0()),Au.exports}var F=ih();const pa=lp(F);var Ru={exports:{}},la={},Du={exports:{}},ku={};/**
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 om;function B0(){return om||(om=1,(function(i){function r(G,se){var ae=G.length;G.push(se);e:for(;0<ae;){var N=ae-1>>>1,U=G[N];if(0<g(U,se))G[N]=se,G[ae]=U,ae=N;else break e}}function a(G){return G.length===0?null:G[0]}function o(G){if(G.length===0)return null;var se=G[0],ae=G.pop();if(ae!==se){G[0]=ae;e:for(var N=0,U=G.length,L=U>>>1;N<L;){var H=2*(N+1)-1,V=G[H],re=H+1,ue=G[re];if(0>g(V,ae))re<U&&0>g(ue,V)?(G[N]=ue,G[re]=ae,N=re):(G[N]=V,G[H]=ae,N=H);else if(re<U&&0>g(ue,ae))G[N]=ue,G[re]=ae,N=re;else break e}}return se}function g(G,se){var ae=G.sortIndex-se.sortIndex;return ae!==0?ae:G.id-se.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var x=performance;i.unstable_now=function(){return x.now()}}else{var T=Date,c=T.now();i.unstable_now=function(){return T.now()-c}}var u=[],h=[],y=1,d=null,C=3,w=!1,k=!1,b=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;function S(G){for(var se=a(h);se!==null;){if(se.callback===null)o(h);else if(se.startTime<=G)o(h),se.sortIndex=se.expirationTime,r(u,se);else break;se=a(h)}}function A(G){if(b=!1,S(G),!k)if(a(u)!==null)k=!0,R||(R=!0,q());else{var se=a(h);se!==null&&te(A,se.startTime-G)}}var R=!1,M=-1,E=5,B=-1;function $(){return m?!0:!(i.unstable_now()-B<E)}function I(){if(m=!1,R){var G=i.unstable_now();B=G;var se=!0;try{e:{k=!1,b&&(b=!1,f(M),M=-1),w=!0;var ae=C;try{t:{for(S(G),d=a(u);d!==null&&!(d.expirationTime>G&&$());){var N=d.callback;if(typeof N=="function"){d.callback=null,C=d.priorityLevel;var U=N(d.expirationTime<=G);if(G=i.unstable_now(),typeof U=="function"){d.callback=U,S(G),se=!0;break t}d===a(u)&&o(u),S(G)}else o(u);d=a(u)}if(d!==null)se=!0;else{var L=a(h);L!==null&&te(A,L.startTime-G),se=!1}}break e}finally{d=null,C=ae,w=!1}se=void 0}}finally{se?q():R=!1}}}var q;if(typeof p=="function")q=function(){p(I)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,J=P.port2;P.port1.onmessage=I,q=function(){J.postMessage(null)}}else q=function(){v(I,0)};function te(G,se){M=v(function(){G(i.unstable_now())},se)}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"):E=0<G?Math.floor(1e3/G):5},i.unstable_getCurrentPriorityLevel=function(){return C},i.unstable_next=function(G){switch(C){case 1:case 2:case 3:var se=3;break;default:se=C}var ae=C;C=se;try{return G()}finally{C=ae}},i.unstable_requestPaint=function(){m=!0},i.unstable_runWithPriority=function(G,se){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var ae=C;C=G;try{return se()}finally{C=ae}},i.unstable_scheduleCallback=function(G,se,ae){var N=i.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?N+ae:N):ae=N,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=ae+U,G={id:y++,callback:se,priorityLevel:G,startTime:ae,expirationTime:U,sortIndex:-1},ae>N?(G.sortIndex=ae,r(h,G),a(u)===null&&G===a(h)&&(b?(f(M),M=-1):b=!0,te(A,ae-N))):(G.sortIndex=U,r(u,G),k||w||(k=!0,R||(R=!0,q()))),G},i.unstable_shouldYield=$,i.unstable_wrapCallback=function(G){var se=C;return function(){var ae=C;C=se;try{return G.apply(this,arguments)}finally{C=ae}}}})(ku)),ku}var lm;function z0(){return lm||(lm=1,Du.exports=B0()),Du.exports}var Ou={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 cm;function j0(){if(cm)return $t;cm=1;var i=ih();function r(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+u+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var o={d:{f:a,r:function(){throw Error(r(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},g=Symbol.for("react.portal");function x(u,h,y){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:g,key:d==null?null:""+d,children:u,containerInfo:h,implementation:y}}var T=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,h){if(u==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return $t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,$t.createPortal=function(u,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(r(299));return x(u,h,null,y)},$t.flushSync=function(u){var h=T.T,y=o.p;try{if(T.T=null,o.p=2,u)return u()}finally{T.T=h,o.p=y,o.d.f()}},$t.preconnect=function(u,h){typeof u=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(u,h))},$t.prefetchDNS=function(u){typeof u=="string"&&o.d.D(u)},$t.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var y=h.as,d=c(y,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?o.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:d,integrity:C,fetchPriority:w}):y==="script"&&o.d.X(u,{crossOrigin:d,integrity:C,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},$t.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=c(h.as,h.crossOrigin);o.d.M(u,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(u)},$t.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,d=c(y,h.crossOrigin);o.d.L(u,y,{crossOrigin:d,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},$t.preloadModule=function(u,h){if(typeof u=="string")if(h){var y=c(h.as,h.crossOrigin);o.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(u)},$t.requestFormReset=function(u){o.d.r(u)},$t.unstable_batchedUpdates=function(u,h){return u(h)},$t.useFormState=function(u,h,y){return T.H.useFormState(u,h,y)},$t.useFormStatus=function(){return T.H.useHostTransitionStatus()},$t.version="19.2.4",$t}var um;function H0(){if(um)return Ou.exports;um=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(),Ou.exports=j0(),Ou.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 hm;function U0(){if(hm)return la;hm=1;var i=z0(),r=ih(),a=H0();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function g(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function x(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 T(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(x(e)!==e)throw Error(o(188))}function h(e){var t=e.alternate;if(!t){if(t=x(e),t===null)throw Error(o(188));return t!==e?null:e}for(var s=e,n=t;;){var l=s.return;if(l===null)break;var _=l.alternate;if(_===null){if(n=l.return,n!==null){s=n;continue}break}if(l.child===_.child){for(_=l.child;_;){if(_===s)return u(l),e;if(_===n)return u(l),t;_=_.sibling}throw Error(o(188))}if(s.return!==n.return)s=l,n=_;else{for(var D=!1,z=l.child;z;){if(z===s){D=!0,s=l,n=_;break}if(z===n){D=!0,n=l,s=_;break}z=z.sibling}if(!D){for(z=_.child;z;){if(z===s){D=!0,s=_,n=l;break}if(z===n){D=!0,n=_,s=l;break}z=z.sibling}if(!D)throw Error(o(189))}}if(s.alternate!==n)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var d=Object.assign,C=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),p=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var P=Symbol.for("react.client.reference");function J(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 b:return"Fragment";case v:return"Profiler";case m:return"StrictMode";case A:return"Suspense";case R:return"SuspenseList";case B: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:J(e.type)||"Memo";case E:t=e._payload,e=e._init;try{return J(e(t))}catch{}}return null}var te=Array.isArray,G=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},N=[],U=-1;function L(e){return{current:e}}function H(e){0>U||(e.current=N[U],N[U]=null,U--)}function V(e,t){U++,N[U]=e.current,e.current=t}var re=L(null),ue=L(null),me=L(null),Y=L(null);function j(e,t){switch(V(me,t),V(ue,e),V(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?T_(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=T_(t),e=A_(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(re),V(re,e)}function ce(){H(re),H(ue),H(me)}function oe(e){e.memoizedState!==null&&V(Y,e);var t=re.current,s=A_(t,e.type);t!==s&&(V(ue,e),V(re,s))}function ve(e){ue.current===e&&(H(re),H(ue)),Y.current===e&&(H(Y),sa._currentValue=ae)}var pe,Te;function je(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 Ue=!1;function ct(e,t){if(!e||Ue)return"";Ue=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ne){var ie=ne}Reflect.construct(e,[],de)}else{try{de.call()}catch(ne){ie=ne}e.call(de.prototype)}}else{try{throw Error()}catch(ne){ie=ne}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ne){if(ne&&ie&&typeof ne.stack=="string")return[ne.stack,ie.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=n.DetermineComponentFrameRoot(),D=_[0],z=_[1];if(D&&z){var Z=D.split(`
44
+ `),ee=z.split(`
45
+ `);for(l=n=0;n<Z.length&&!Z[n].includes("DetermineComponentFrameRoot");)n++;for(;l<ee.length&&!ee[l].includes("DetermineComponentFrameRoot");)l++;if(n===Z.length||l===ee.length)for(n=Z.length-1,l=ee.length-1;1<=n&&0<=l&&Z[n]!==ee[l];)l--;for(;1<=n&&0<=l;n--,l--)if(Z[n]!==ee[l]){if(n!==1||l!==1)do if(n--,l--,0>l||Z[n]!==ee[l]){var le=`
46
+ `+Z[n].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=n&&0<=l);break}}}finally{Ue=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?je(s):""}function Ee(e,t){switch(e.tag){case 26:case 27:case 5:return je(e.type);case 16:return je("Lazy");case 13:return e.child!==t&&t!==null?je("Suspense Fallback"):je("Suspense");case 19:return je("SuspenseList");case 0:case 15:return ct(e.type,!1);case 11:return ct(e.type.render,!1);case 1:return ct(e.type,!0);case 31:return je("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 mi=Object.prototype.hasOwnProperty,pi=i.unstable_scheduleCallback,Ui=i.unstable_cancelCallback,Vi=i.unstable_shouldYield,Pt=i.unstable_requestPaint,nt=i.unstable_now,Rt=i.unstable_getCurrentPriorityLevel,Zt=i.unstable_ImmediatePriority,Nt=i.unstable_UserBlockingPriority,Bt=i.unstable_NormalPriority,Ki=i.unstable_LowPriority,Kt=i.unstable_IdlePriority,Li=i.log,Ye=i.unstable_setDisableYieldValue,vi=null,Dt=null;function kt(e){if(typeof Li=="function"&&Ye(e),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(vi,e)}catch{}}var gt=Math.clz32?Math.clz32:gl,un=Math.log,hn=Math.LN2;function gl(e){return e>>>=0,e===0?32:31-(un(e)/hn|0)|0}var Xi=256,Ji=262144,gr=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 yr(e,t,s){var n=e.pendingLanes;if(n===0)return 0;var l=0,_=e.suspendedLanes,D=e.pingedLanes;e=e.warmLanes;var z=n&134217727;return z!==0?(n=z&~_,n!==0?l=ai(n):(D&=z,D!==0?l=ai(D):s||(s=z&~e,s!==0&&(l=ai(s))))):(z=n&~_,z!==0?l=ai(z):D!==0?l=ai(D):s||(s=n&~e,s!==0&&(l=ai(s)))),l===0?0:t!==0&&t!==l&&(t&_)===0&&(_=l&-l,s=t&-t,_>=s||_===32&&(s&4194048)!==0)?t:l}function Js(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _t(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Qi(){var e=gr;return gr<<=1,(gr&62914560)===0&&(gr=4194304),e}function fn(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function bs(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dn(e,t,s,n,l,_){var D=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var z=e.entanglements,Z=e.expirationTimes,ee=e.hiddenUpdates;for(s=D&~s;0<s;){var le=31-gt(s),de=1<<le;z[le]=0,Z[le]=-1;var ie=ee[le];if(ie!==null)for(ee[le]=null,le=0;le<ie.length;le++){var ne=ie[le];ne!==null&&(ne.lane&=-536870913)}s&=~de}n!==0&&_n(e,n,0),_!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=_&~(D&~t))}function _n(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-gt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|s&261930}function mn(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var n=31-gt(s),l=1<<n;l&t|e[n]&t&&(e[n]|=t),s&=~l}}function xa(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=se.p;return e!==0?e:(e=window.event,e===void 0?32:K_(e.type))}function vn(e,t){var s=se.p;try{return se.p=e,t()}finally{se.p=s}}var gi=Math.random().toString(36).slice(2),yt="__reactFiber$"+gi,it="__reactProps$"+gi,es="__reactContainer$"+gi,Sr="__reactEvents$"+gi,wa="__reactListeners$"+gi,Ea="__reactHandles$"+gi,Ta="__reactResources$"+gi,Se="__reactMarker$"+gi;function W(e){delete e[yt],delete e[it],delete e[Sr],delete e[wa],delete e[Ea]}function _e(e){var t=e[yt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[es]||s[yt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=N_(e);e!==null;){if(s=e[yt])return s;e=N_(e)}return t}e=s,s=e.parentNode}return null}function ge(e){if(e=e[yt]||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 Ze(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function at(e){var t=e[Ta];return t||(t=e[Ta]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ke(e){e[Se]=!0}var zt=new Set,yi={};function Jt(e,t){Ii(e,t),Ii(e+"Capture",t)}function Ii(e,t){for(yi[e]=t,e=0;e<t.length;e++)zt.add(t[e])}var Et=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 Cv(e){return mi.call(yn,e)?!0:mi.call(gn,e)?!1:Et.test(e)?yn[e]=!0:(gn[e]=!0,!1)}function Aa(e,t,s){if(Cv(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 Ra(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 vh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xv(e,t,s){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,_=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(D){s=""+D,_.call(this,D)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(D){s=""+D},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yl(e){if(!e._valueTracker){var t=vh(e)?"checked":"value";e._valueTracker=xv(e,t,""+e[t])}}function gh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),n="";return e&&(n=vh(e)?e.checked?"true":"false":e.value),e=n,e!==s?(t.setValue(e),!0):!1}function Da(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 wv=/[\n"\\]/g;function bi(e){return e.replace(wv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Sl(e,t,s,n,l,_,D,z){e.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?e.type=D:e.removeAttribute("type"),t!=null?D==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Si(t)):e.value!==""+Si(t)&&(e.value=""+Si(t)):D!=="submit"&&D!=="reset"||e.removeAttribute("value"),t!=null?bl(e,D,Si(t)):s!=null?bl(e,D,Si(s)):n!=null&&e.removeAttribute("value"),l==null&&_!=null&&(e.defaultChecked=!!_),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?e.name=""+Si(z):e.removeAttribute("name")}function yh(e,t,s,n,l,_,D,z){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.type=_),t!=null||s!=null){if(!(_!=="submit"&&_!=="reset"||t!=null)){yl(e);return}s=s!=null?""+Si(s):"",t=t!=null?""+Si(t):s,z||t===e.value||(e.value=t),e.defaultValue=t}n=n??l,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=z?e.checked:!!n,e.defaultChecked=!!n,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(e.name=D),yl(e)}function bl(e,t,s){t==="number"&&Da(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function br(e,t,s,n){if(e=e.options,t){t={};for(var l=0;l<s.length;l++)t["$"+s[l]]=!0;for(s=0;s<e.length;s++)l=t.hasOwnProperty("$"+e[s].value),e[s].selected!==l&&(e[s].selected=l),l&&n&&(e[s].defaultSelected=!0)}else{for(s=""+Si(s),t=null,l=0;l<e.length;l++){if(e[l].value===s){e[l].selected=!0,n&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Sh(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 bh(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),yl(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 Ev=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 Ch(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||Ev.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function xh(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 l in t)n=t[l],t.hasOwnProperty(l)&&s[l]!==n&&Ch(e,l,n)}else for(var _ in t)t.hasOwnProperty(_)&&Ch(e,_,t[_])}function Cl(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 Tv=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"]]),Av=/^[\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 ka(e){return Av.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function is(){}var xl=null;function wl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xr=null,wr=null;function wh(e){var t=ge(e);if(t&&(e=t.stateNode)){var s=e[it]||null;e:switch(e=t.stateNode,t.type){case"input":if(Sl(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 l=n[it]||null;if(!l)throw Error(o(90));Sl(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<s.length;t++)n=s[t],n.form===e.form&&gh(n)}break e;case"textarea":Sh(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&br(e,!!s.multiple,t,!1)}}}var El=!1;function Eh(e,t,s){if(El)return e(t,s);El=!0;try{var n=e(t);return n}finally{if(El=!1,(xr!==null||wr!==null)&&(go(),xr&&(t=xr,e=wr,wr=xr=null,wh(t),e)))for(t=0;t<e.length;t++)wh(e[t])}}function Sn(e,t){var s=e.stateNode;if(s===null)return null;var n=s[it]||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"),Tl=!1;if(ss)try{var bn={};Object.defineProperty(bn,"passive",{get:function(){Tl=!0}}),window.addEventListener("test",bn,bn),window.removeEventListener("test",bn,bn)}catch{Tl=!1}var Cs=null,Al=null,Oa=null;function Th(){if(Oa)return Oa;var e,t=Al,s=t.length,n,l="value"in Cs?Cs.value:Cs.textContent,_=l.length;for(e=0;e<s&&t[e]===l[e];e++);var D=s-e;for(n=1;n<=D&&t[s-n]===l[_-n];n++);return Oa=l.slice(e,1<n?1-n:void 0)}function Ma(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 La(){return!0}function Ah(){return!1}function Qt(e){function t(s,n,l,_,D){this._reactName=s,this._targetInst=l,this.type=n,this.nativeEvent=_,this.target=D,this.currentTarget=null;for(var z in e)e.hasOwnProperty(z)&&(s=e[z],this[z]=s?s(_):_[z]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?La:Ah,this.isPropagationStopped=Ah,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=La)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=La)},persist:function(){},isPersistent:La}),t}var Qs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Na=Qt(Qs),Cn=d({},Qs,{view:0,detail:0}),Rv=Qt(Cn),Rl,Dl,xn,Ba=d({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ol,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!==xn&&(xn&&e.type==="mousemove"?(Rl=e.screenX-xn.screenX,Dl=e.screenY-xn.screenY):Dl=Rl=0,xn=e),Rl)},movementY:function(e){return"movementY"in e?e.movementY:Dl}}),Rh=Qt(Ba),Dv=d({},Ba,{dataTransfer:0}),kv=Qt(Dv),Ov=d({},Cn,{relatedTarget:0}),kl=Qt(Ov),Mv=d({},Qs,{animationName:0,elapsedTime:0,pseudoElement:0}),Lv=Qt(Mv),Nv=d({},Qs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Bv=Qt(Nv),zv=d({},Qs,{data:0}),Dh=Qt(zv),jv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hv={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"},Uv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Iv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Uv[e])?!!t[e]:!1}function Ol(){return Iv}var Pv=d({},Cn,{key:function(e){if(e.key){var t=jv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ma(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Hv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ol,charCode:function(e){return e.type==="keypress"?Ma(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ma(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),$v=Qt(Pv),Fv=d({},Ba,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kh=Qt(Fv),Zv=d({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ol}),qv=Qt(Zv),Gv=d({},Qs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wv=Qt(Gv),Yv=d({},Ba,{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}),Vv=Qt(Yv),Kv=d({},Qs,{newState:0,oldState:0}),Xv=Qt(Kv),Jv=[9,13,27,32],Ml=ss&&"CompositionEvent"in window,wn=null;ss&&"documentMode"in document&&(wn=document.documentMode);var Qv=ss&&"TextEvent"in window&&!wn,Oh=ss&&(!Ml||wn&&8<wn&&11>=wn),Mh=" ",Lh=!1;function Nh(e,t){switch(e){case"keyup":return Jv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Er=!1;function eg(e,t){switch(e){case"compositionend":return Bh(t);case"keypress":return t.which!==32?null:(Lh=!0,Mh);case"textInput":return e=t.data,e===Mh&&Lh?null:e;default:return null}}function tg(e,t){if(Er)return e==="compositionend"||!Ml&&Nh(e,t)?(e=Th(),Oa=Al=Cs=null,Er=!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 Oh&&t.locale!=="ko"?null:t.data;default:return null}}var ig={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 zh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ig[e.type]:t==="textarea"}function jh(e,t,s,n){xr?wr?wr.push(n):wr=[n]:xr=n,t=Eo(t,"onChange"),0<t.length&&(s=new Na("onChange","change",null,s,n),e.push({event:s,listeners:t}))}var En=null,Tn=null;function sg(e){S_(e,0)}function za(e){var t=Ze(e);if(gh(t))return e}function Hh(e,t){if(e==="change")return t}var Uh=!1;if(ss){var Ll;if(ss){var Nl="oninput"in document;if(!Nl){var Ih=document.createElement("div");Ih.setAttribute("oninput","return;"),Nl=typeof Ih.oninput=="function"}Ll=Nl}else Ll=!1;Uh=Ll&&(!document.documentMode||9<document.documentMode)}function Ph(){En&&(En.detachEvent("onpropertychange",$h),Tn=En=null)}function $h(e){if(e.propertyName==="value"&&za(Tn)){var t=[];jh(t,Tn,e,wl(e)),Eh(sg,t)}}function rg(e,t,s){e==="focusin"?(Ph(),En=t,Tn=s,En.attachEvent("onpropertychange",$h)):e==="focusout"&&Ph()}function ng(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return za(Tn)}function ag(e,t){if(e==="click")return za(t)}function og(e,t){if(e==="input"||e==="change")return za(t)}function lg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oi=typeof Object.is=="function"?Object.is:lg;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 l=s[n];if(!mi.call(t,l)||!oi(e[l],t[l]))return!1}return!0}function Fh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zh(e,t){var s=Fh(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=Fh(s)}}function qh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Da(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=Da(e.document)}return t}function Bl(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 cg=ss&&"documentMode"in document&&11>=document.documentMode,Tr=null,zl=null,Rn=null,jl=!1;function Wh(e,t,s){var n=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;jl||Tr==null||Tr!==Da(n)||(n=Tr,"selectionStart"in n&&Bl(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=Eo(zl,"onSelect"),0<n.length&&(t=new Na("onSelect","select",null,t,s),e.push({event:t,listeners:n}),t.target=Tr)))}function er(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Ar={animationend:er("Animation","AnimationEnd"),animationiteration:er("Animation","AnimationIteration"),animationstart:er("Animation","AnimationStart"),transitionrun:er("Transition","TransitionRun"),transitionstart:er("Transition","TransitionStart"),transitioncancel:er("Transition","TransitionCancel"),transitionend:er("Transition","TransitionEnd")},Hl={},Yh={};ss&&(Yh=document.createElement("div").style,"AnimationEvent"in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),"TransitionEvent"in window||delete Ar.transitionend.transition);function tr(e){if(Hl[e])return Hl[e];if(!Ar[e])return e;var t=Ar[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Yh)return Hl[e]=t[s];return e}var Vh=tr("animationend"),Kh=tr("animationiteration"),Xh=tr("animationstart"),ug=tr("transitionrun"),hg=tr("transitionstart"),fg=tr("transitioncancel"),Jh=tr("transitionend"),Qh=new Map,Ul="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(" ");Ul.push("scrollEnd");function Bi(e,t){Qh.set(e,t),Jt(t,[e])}var ja=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)},Ci=[],Rr=0,Il=0;function Ha(){for(var e=Rr,t=Il=Rr=0;t<e;){var s=Ci[t];Ci[t++]=null;var n=Ci[t];Ci[t++]=null;var l=Ci[t];Ci[t++]=null;var _=Ci[t];if(Ci[t++]=null,n!==null&&l!==null){var D=n.pending;D===null?l.next=l:(l.next=D.next,D.next=l),n.pending=l}_!==0&&ef(s,l,_)}}function Ua(e,t,s,n){Ci[Rr++]=e,Ci[Rr++]=t,Ci[Rr++]=s,Ci[Rr++]=n,Il|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Pl(e,t,s,n){return Ua(e,t,s,n),Ia(e)}function ir(e,t){return Ua(e,null,null,t),Ia(e)}function ef(e,t,s){e.lanes|=s;var n=e.alternate;n!==null&&(n.lanes|=s);for(var l=!1,_=e.return;_!==null;)_.childLanes|=s,n=_.alternate,n!==null&&(n.childLanes|=s),_.tag===22&&(e=_.stateNode,e===null||e._visibility&1||(l=!0)),e=_,_=_.return;return e.tag===3?(_=e.stateNode,l&&t!==null&&(l=31-gt(s),e=_.hiddenUpdates,n=e[l],n===null?e[l]=[t]:n.push(t),t.lane=s|536870912),_):null}function Ia(e){if(50<Kn)throw Kn=0,Kc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Dr={};function dg(e,t,s,n){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function li(e,t,s,n){return new dg(e,t,s,n)}function $l(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 tf(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 Pa(e,t,s,n,l,_){var D=0;if(n=e,typeof e=="function")$l(e)&&(D=1);else if(typeof e=="string")D=g0(e,s,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case B:return e=li(31,s,t,l),e.elementType=B,e.lanes=_,e;case b:return sr(s.children,l,_,t);case m:D=8,l|=24;break;case v:return e=li(12,s,t,l|2),e.elementType=v,e.lanes=_,e;case A:return e=li(13,s,t,l),e.elementType=A,e.lanes=_,e;case R:return e=li(19,s,t,l),e.elementType=R,e.lanes=_,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case p:D=10;break e;case f:D=9;break e;case S:D=11;break e;case M:D=14;break e;case E:D=16,n=null;break e}D=29,s=Error(o(130,e===null?"null":typeof e,"")),n=null}return t=li(D,s,t,l),t.elementType=e,t.type=n,t.lanes=_,t}function sr(e,t,s,n){return e=li(7,e,n,t),e.lanes=s,e}function Fl(e,t,s){return e=li(6,e,null,t),e.lanes=s,e}function sf(e){var t=li(18,null,null,0);return t.stateNode=e,t}function Zl(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 rf=new WeakMap;function xi(e,t){if(typeof e=="object"&&e!==null){var s=rf.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Ft(t)},rf.set(e,t),t)}return{value:e,source:t,stack:Ft(t)}}var kr=[],Or=0,$a=null,Dn=0,wi=[],Ei=0,xs=null,Pi=1,$i="";function ns(e,t){kr[Or++]=Dn,kr[Or++]=$a,$a=e,Dn=t}function nf(e,t,s){wi[Ei++]=Pi,wi[Ei++]=$i,wi[Ei++]=xs,xs=e;var n=Pi;e=$i;var l=32-gt(n)-1;n&=~(1<<l),s+=1;var _=32-gt(t)+l;if(30<_){var D=l-l%5;_=(n&(1<<D)-1).toString(32),n>>=D,l-=D,Pi=1<<32-gt(t)+l|s<<l|n,$i=_+e}else Pi=1<<_|s<<l|n,$i=e}function ql(e){e.return!==null&&(ns(e,1),nf(e,1,0))}function Gl(e){for(;e===$a;)$a=kr[--Or],kr[Or]=null,Dn=kr[--Or],kr[Or]=null;for(;e===xs;)xs=wi[--Ei],wi[Ei]=null,$i=wi[--Ei],wi[Ei]=null,Pi=wi[--Ei],wi[Ei]=null}function af(e,t){wi[Ei++]=Pi,wi[Ei++]=$i,wi[Ei++]=xs,Pi=t.id,$i=t.overflow,xs=e}var jt=null,et=null,He=!1,ws=null,Ti=!1,Wl=Error(o(519));function Es(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw kn(xi(t,e)),Wl}function of(e){var t=e.stateNode,s=e.type,n=e.memoizedProps;switch(t[yt]=e,t[it]=n,s){case"dialog":Ne("cancel",t),Ne("close",t);break;case"iframe":case"object":case"embed":Ne("load",t);break;case"video":case"audio":for(s=0;s<Jn.length;s++)Ne(Jn[s],t);break;case"source":Ne("error",t);break;case"img":case"image":case"link":Ne("error",t),Ne("load",t);break;case"details":Ne("toggle",t);break;case"input":Ne("invalid",t),yh(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Ne("invalid",t);break;case"textarea":Ne("invalid",t),bh(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||w_(t.textContent,s)?(n.popover!=null&&(Ne("beforetoggle",t),Ne("toggle",t)),n.onScroll!=null&&Ne("scroll",t),n.onScrollEnd!=null&&Ne("scrollend",t),n.onClick!=null&&(t.onclick=is),t=!0):t=!1,t||Es(e,!0)}function lf(e){for(jt=e.return;jt;)switch(jt.tag){case 5:case 31:case 13:Ti=!1;return;case 27:case 3:Ti=!0;return;default:jt=jt.return}}function Mr(e){if(e!==jt)return!1;if(!He)return lf(e),He=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||hu(e.type,e.memoizedProps)),s=!s),s&&et&&Es(e),lf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));et=L_(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));et=L_(e)}else t===27?(t=et,Us(e.type)?(e=pu,pu=null,et=e):et=t):et=jt?Ri(e.stateNode.nextSibling):null;return!0}function rr(){et=jt=null,He=!1}function Yl(){var e=ws;return e!==null&&(si===null?si=e:si.push.apply(si,e),ws=null),e}function kn(e){ws===null?ws=[e]:ws.push(e)}var Vl=L(null),nr=null,as=null;function Ts(e,t,s){V(Vl,t._currentValue),t._currentValue=s}function os(e){e._currentValue=Vl.current,H(Vl)}function Kl(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 Xl(e,t,s,n){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var _=l.dependencies;if(_!==null){var D=l.child;_=_.firstContext;e:for(;_!==null;){var z=_;_=l;for(var Z=0;Z<t.length;Z++)if(z.context===t[Z]){_.lanes|=s,z=_.alternate,z!==null&&(z.lanes|=s),Kl(_.return,s,e),n||(D=null);break e}_=z.next}}else if(l.tag===18){if(D=l.return,D===null)throw Error(o(341));D.lanes|=s,_=D.alternate,_!==null&&(_.lanes|=s),Kl(D,s,e),D=null}else D=l.child;if(D!==null)D.return=l;else for(D=l;D!==null;){if(D===e){D=null;break}if(l=D.sibling,l!==null){l.return=D.return,D=l;break}D=D.return}l=D}}function Lr(e,t,s,n){e=null;for(var l=t,_=!1;l!==null;){if(!_){if((l.flags&524288)!==0)_=!0;else if((l.flags&262144)!==0)break}if(l.tag===10){var D=l.alternate;if(D===null)throw Error(o(387));if(D=D.memoizedProps,D!==null){var z=l.type;oi(l.pendingProps.value,D.value)||(e!==null?e.push(z):e=[z])}}else if(l===Y.current){if(D=l.alternate,D===null)throw Error(o(387));D.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(sa):e=[sa])}l=l.return}e!==null&&Xl(t,e,s,n),t.flags|=262144}function Fa(e){for(e=e.firstContext;e!==null;){if(!oi(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ar(e){nr=e,as=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ht(e){return cf(nr,e)}function Za(e,t){return nr===null&&ar(e),cf(e,t)}function cf(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 _g=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},mg=i.unstable_scheduleCallback,pg=i.unstable_NormalPriority,St={$$typeof:p,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jl(){return{controller:new _g,data:new Map,refCount:0}}function On(e){e.refCount--,e.refCount===0&&mg(pg,function(){e.controller.abort()})}var Mn=null,Ql=0,Nr=0,Br=null;function vg(e,t){if(Mn===null){var s=Mn=[];Ql=0,Nr=iu(),Br={status:"pending",value:void 0,then:function(n){s.push(n)}}}return Ql++,t.then(uf,uf),t}function uf(){if(--Ql===0&&Mn!==null){Br!==null&&(Br.status="fulfilled");var e=Mn;Mn=null,Nr=0,Br=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function gg(e,t){var s=[],n={status:"pending",value:null,reason:null,then:function(l){s.push(l)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var l=0;l<s.length;l++)(0,s[l])(t)},function(l){for(n.status="rejected",n.reason=l,l=0;l<s.length;l++)(0,s[l])(void 0)}),n}var hf=G.S;G.S=function(e,t){Yd=nt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&vg(e,t),hf!==null&&hf(e,t)};var or=L(null);function ec(){var e=or.current;return e!==null?e:Je.pooledCache}function qa(e,t){t===null?V(or,or.current):V(or,t.pool)}function ff(){var e=ec();return e===null?null:{parent:St._currentValue,pool:e}}var zr=Error(o(460)),tc=Error(o(474)),Ga=Error(o(542)),Wa={then:function(){}};function df(e){return e=e.status,e==="fulfilled"||e==="rejected"}function _f(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,pf(e),e;default:if(typeof t.status=="string")t.then(is,is);else{if(e=Je,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=n}},function(n){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,pf(e),e}throw cr=t,zr}}function lr(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(cr=s,zr):s}}var cr=null;function mf(){if(cr===null)throw Error(o(459));var e=cr;return cr=null,e}function pf(e){if(e===zr||e===Ga)throw Error(o(483))}var jr=null,Ln=0;function Ya(e){var t=Ln;return Ln+=1,jr===null&&(jr=[]),_f(jr,e,t)}function Nn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Va(e,t){throw t.$$typeof===C?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function vf(e){function t(X,K){if(e){var Q=X.deletions;Q===null?(X.deletions=[K],X.flags|=16):Q.push(K)}}function s(X,K){if(!e)return null;for(;K!==null;)t(X,K),K=K.sibling;return null}function n(X){for(var K=new Map;X!==null;)X.key!==null?K.set(X.key,X):K.set(X.index,X),X=X.sibling;return K}function l(X,K){return X=rs(X,K),X.index=0,X.sibling=null,X}function _(X,K,Q){return X.index=Q,e?(Q=X.alternate,Q!==null?(Q=Q.index,Q<K?(X.flags|=67108866,K):Q):(X.flags|=67108866,K)):(X.flags|=1048576,K)}function D(X){return e&&X.alternate===null&&(X.flags|=67108866),X}function z(X,K,Q,he){return K===null||K.tag!==6?(K=Fl(Q,X.mode,he),K.return=X,K):(K=l(K,Q),K.return=X,K)}function Z(X,K,Q,he){var Ce=Q.type;return Ce===b?le(X,K,Q.props.children,he,Q.key):K!==null&&(K.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===E&&lr(Ce)===K.type)?(K=l(K,Q.props),Nn(K,Q),K.return=X,K):(K=Pa(Q.type,Q.key,Q.props,null,X.mode,he),Nn(K,Q),K.return=X,K)}function ee(X,K,Q,he){return K===null||K.tag!==4||K.stateNode.containerInfo!==Q.containerInfo||K.stateNode.implementation!==Q.implementation?(K=Zl(Q,X.mode,he),K.return=X,K):(K=l(K,Q.children||[]),K.return=X,K)}function le(X,K,Q,he,Ce){return K===null||K.tag!==7?(K=sr(Q,X.mode,he,Ce),K.return=X,K):(K=l(K,Q),K.return=X,K)}function de(X,K,Q){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=Fl(""+K,X.mode,Q),K.return=X,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case w:return Q=Pa(K.type,K.key,K.props,null,X.mode,Q),Nn(Q,K),Q.return=X,Q;case k:return K=Zl(K,X.mode,Q),K.return=X,K;case E:return K=lr(K),de(X,K,Q)}if(te(K)||q(K))return K=sr(K,X.mode,Q,null),K.return=X,K;if(typeof K.then=="function")return de(X,Ya(K),Q);if(K.$$typeof===p)return de(X,Za(X,K),Q);Va(X,K)}return null}function ie(X,K,Q,he){var Ce=K!==null?K.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ce!==null?null:z(X,K,""+Q,he);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case w:return Q.key===Ce?Z(X,K,Q,he):null;case k:return Q.key===Ce?ee(X,K,Q,he):null;case E:return Q=lr(Q),ie(X,K,Q,he)}if(te(Q)||q(Q))return Ce!==null?null:le(X,K,Q,he,null);if(typeof Q.then=="function")return ie(X,K,Ya(Q),he);if(Q.$$typeof===p)return ie(X,K,Za(X,Q),he);Va(X,Q)}return null}function ne(X,K,Q,he,Ce){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return X=X.get(Q)||null,z(K,X,""+he,Ce);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case w:return X=X.get(he.key===null?Q:he.key)||null,Z(K,X,he,Ce);case k:return X=X.get(he.key===null?Q:he.key)||null,ee(K,X,he,Ce);case E:return he=lr(he),ne(X,K,Q,he,Ce)}if(te(he)||q(he))return X=X.get(Q)||null,le(K,X,he,Ce,null);if(typeof he.then=="function")return ne(X,K,Q,Ya(he),Ce);if(he.$$typeof===p)return ne(X,K,Q,Za(K,he),Ce);Va(K,he)}return null}function ye(X,K,Q,he){for(var Ce=null,Pe=null,be=K,De=K=0,ze=null;be!==null&&De<Q.length;De++){be.index>De?(ze=be,be=null):ze=be.sibling;var $e=ie(X,be,Q[De],he);if($e===null){be===null&&(be=ze);break}e&&be&&$e.alternate===null&&t(X,be),K=_($e,K,De),Pe===null?Ce=$e:Pe.sibling=$e,Pe=$e,be=ze}if(De===Q.length)return s(X,be),He&&ns(X,De),Ce;if(be===null){for(;De<Q.length;De++)be=de(X,Q[De],he),be!==null&&(K=_(be,K,De),Pe===null?Ce=be:Pe.sibling=be,Pe=be);return He&&ns(X,De),Ce}for(be=n(be);De<Q.length;De++)ze=ne(be,X,De,Q[De],he),ze!==null&&(e&&ze.alternate!==null&&be.delete(ze.key===null?De:ze.key),K=_(ze,K,De),Pe===null?Ce=ze:Pe.sibling=ze,Pe=ze);return e&&be.forEach(function(Zs){return t(X,Zs)}),He&&ns(X,De),Ce}function we(X,K,Q,he){if(Q==null)throw Error(o(151));for(var Ce=null,Pe=null,be=K,De=K=0,ze=null,$e=Q.next();be!==null&&!$e.done;De++,$e=Q.next()){be.index>De?(ze=be,be=null):ze=be.sibling;var Zs=ie(X,be,$e.value,he);if(Zs===null){be===null&&(be=ze);break}e&&be&&Zs.alternate===null&&t(X,be),K=_(Zs,K,De),Pe===null?Ce=Zs:Pe.sibling=Zs,Pe=Zs,be=ze}if($e.done)return s(X,be),He&&ns(X,De),Ce;if(be===null){for(;!$e.done;De++,$e=Q.next())$e=de(X,$e.value,he),$e!==null&&(K=_($e,K,De),Pe===null?Ce=$e:Pe.sibling=$e,Pe=$e);return He&&ns(X,De),Ce}for(be=n(be);!$e.done;De++,$e=Q.next())$e=ne(be,X,De,$e.value,he),$e!==null&&(e&&$e.alternate!==null&&be.delete($e.key===null?De:$e.key),K=_($e,K,De),Pe===null?Ce=$e:Pe.sibling=$e,Pe=$e);return e&&be.forEach(function(D0){return t(X,D0)}),He&&ns(X,De),Ce}function Xe(X,K,Q,he){if(typeof Q=="object"&&Q!==null&&Q.type===b&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case w:e:{for(var Ce=Q.key;K!==null;){if(K.key===Ce){if(Ce=Q.type,Ce===b){if(K.tag===7){s(X,K.sibling),he=l(K,Q.props.children),he.return=X,X=he;break e}}else if(K.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===E&&lr(Ce)===K.type){s(X,K.sibling),he=l(K,Q.props),Nn(he,Q),he.return=X,X=he;break e}s(X,K);break}else t(X,K);K=K.sibling}Q.type===b?(he=sr(Q.props.children,X.mode,he,Q.key),he.return=X,X=he):(he=Pa(Q.type,Q.key,Q.props,null,X.mode,he),Nn(he,Q),he.return=X,X=he)}return D(X);case k:e:{for(Ce=Q.key;K!==null;){if(K.key===Ce)if(K.tag===4&&K.stateNode.containerInfo===Q.containerInfo&&K.stateNode.implementation===Q.implementation){s(X,K.sibling),he=l(K,Q.children||[]),he.return=X,X=he;break e}else{s(X,K);break}else t(X,K);K=K.sibling}he=Zl(Q,X.mode,he),he.return=X,X=he}return D(X);case E:return Q=lr(Q),Xe(X,K,Q,he)}if(te(Q))return ye(X,K,Q,he);if(q(Q)){if(Ce=q(Q),typeof Ce!="function")throw Error(o(150));return Q=Ce.call(Q),we(X,K,Q,he)}if(typeof Q.then=="function")return Xe(X,K,Ya(Q),he);if(Q.$$typeof===p)return Xe(X,K,Za(X,Q),he);Va(X,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,K!==null&&K.tag===6?(s(X,K.sibling),he=l(K,Q),he.return=X,X=he):(s(X,K),he=Fl(Q,X.mode,he),he.return=X,X=he),D(X)):s(X,K)}return function(X,K,Q,he){try{Ln=0;var Ce=Xe(X,K,Q,he);return jr=null,Ce}catch(be){if(be===zr||be===Ga)throw be;var Pe=li(29,be,null,X.mode);return Pe.lanes=he,Pe.return=X,Pe}finally{}}}var ur=vf(!0),gf=vf(!1),As=!1;function ic(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sc(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 Rs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ds(e,t,s){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Fe&2)!==0){var l=n.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),n.pending=t,t=Ia(e),ef(e,null,s),t}return Ua(e,n,t,s),Ia(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,mn(e,s)}}function rc(e,t){var s=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,s===n)){var l=null,_=null;if(s=s.firstBaseUpdate,s!==null){do{var D={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};_===null?l=_=D:_=_.next=D,s=s.next}while(s!==null);_===null?l=_=t:_=_.next=t}else l=_=t;s={baseState:n.baseState,firstBaseUpdate:l,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 nc=!1;function zn(){if(nc){var e=Br;if(e!==null)throw e}}function jn(e,t,s,n){nc=!1;var l=e.updateQueue;As=!1;var _=l.firstBaseUpdate,D=l.lastBaseUpdate,z=l.shared.pending;if(z!==null){l.shared.pending=null;var Z=z,ee=Z.next;Z.next=null,D===null?_=ee:D.next=ee,D=Z;var le=e.alternate;le!==null&&(le=le.updateQueue,z=le.lastBaseUpdate,z!==D&&(z===null?le.firstBaseUpdate=ee:z.next=ee,le.lastBaseUpdate=Z))}if(_!==null){var de=l.baseState;D=0,le=ee=Z=null,z=_;do{var ie=z.lane&-536870913,ne=ie!==z.lane;if(ne?(Be&ie)===ie:(n&ie)===ie){ie!==0&&ie===Nr&&(nc=!0),le!==null&&(le=le.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var ye=e,we=z;ie=t;var Xe=s;switch(we.tag){case 1:if(ye=we.payload,typeof ye=="function"){de=ye.call(Xe,de,ie);break e}de=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=we.payload,ie=typeof ye=="function"?ye.call(Xe,de,ie):ye,ie==null)break e;de=d({},de,ie);break e;case 2:As=!0}}ie=z.callback,ie!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=l.callbacks,ne===null?l.callbacks=[ie]:ne.push(ie))}else ne={lane:ie,tag:z.tag,payload:z.payload,callback:z.callback,next:null},le===null?(ee=le=ne,Z=de):le=le.next=ne,D|=ie;if(z=z.next,z===null){if(z=l.shared.pending,z===null)break;ne=z,z=ne.next,ne.next=null,l.lastBaseUpdate=ne,l.shared.pending=null}}while(!0);le===null&&(Z=de),l.baseState=Z,l.firstBaseUpdate=ee,l.lastBaseUpdate=le,_===null&&(l.shared.lanes=0),Ns|=D,e.lanes=D,e.memoizedState=de}}function yf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Sf(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)yf(s[e],t)}var Hr=L(null),Ka=L(0);function bf(e,t){e=ps,V(Ka,e),V(Hr,t),ps=e|t.baseLanes}function ac(){V(Ka,ps),V(Hr,Hr.current)}function oc(){ps=Ka.current,H(Hr),H(Ka)}var ci=L(null),Ai=null;function ks(e){var t=e.alternate;V(mt,mt.current&1),V(ci,e),Ai===null&&(t===null||Hr.current!==null||t.memoizedState!==null)&&(Ai=e)}function lc(e){V(mt,mt.current),V(ci,e),Ai===null&&(Ai=e)}function Cf(e){e.tag===22?(V(mt,mt.current),V(ci,e),Ai===null&&(Ai=e)):Os()}function Os(){V(mt,mt.current),V(ci,ci.current)}function ui(e){H(ci),Ai===e&&(Ai=null),H(mt)}var mt=L(0);function Xa(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||_u(s)||mu(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,Ve=null,bt=null,Ja=!1,Ur=!1,hr=!1,Qa=0,Hn=0,Ir=null,yg=0;function ut(){throw Error(o(321))}function cc(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 uc(e,t,s,n,l,_){return ls=_,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?nd:Ec,hr=!1,_=s(n,l),hr=!1,Ur&&(_=wf(t,s,n,l)),xf(e),_}function xf(e){G.H=Pn;var t=Ve!==null&&Ve.next!==null;if(ls=0,bt=Ve=Re=null,Ja=!1,Hn=0,Ir=null,t)throw Error(o(300));e===null||Ct||(e=e.dependencies,e!==null&&Fa(e)&&(Ct=!0))}function wf(e,t,s,n){Re=e;var l=0;do{if(Ur&&(Ir=null),Hn=0,Ur=!1,25<=l)throw Error(o(301));if(l+=1,bt=Ve=null,e.updateQueue!=null){var _=e.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}G.H=ad,_=t(s,n)}while(Ur);return _}function Sg(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?Un(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(Re.flags|=1024),t}function hc(){var e=Qa!==0;return Qa=0,e}function fc(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function dc(e){if(Ja){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ja=!1}ls=0,bt=Ve=Re=null,Ur=!1,Hn=Qa=0,Ir=null}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Re.memoizedState=bt=e:bt=bt.next=e,bt}function pt(){if(Ve===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=bt===null?Re.memoizedState:bt.next;if(t!==null)bt=t,Ve=e;else{if(e===null)throw Re.alternate===null?Error(o(467)):Error(o(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},bt===null?Re.memoizedState=bt=e:bt=bt.next=e}return bt}function eo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Un(e){var t=Hn;return Hn+=1,Ir===null&&(Ir=[]),e=_f(Ir,e,t),t=Re,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?nd:Ec),e}function to(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 _c(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(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=eo(),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]=$;return t.index++,s}function cs(e,t){return typeof t=="function"?t(e):t}function io(e){var t=pt();return mc(t,Ve,e)}function mc(e,t,s){var n=e.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=s;var l=e.baseQueue,_=n.pending;if(_!==null){if(l!==null){var D=l.next;l.next=_.next,_.next=D}t.baseQueue=l=_,n.pending=null}if(_=e.baseState,l===null)e.memoizedState=_;else{t=l.next;var z=D=null,Z=null,ee=t,le=!1;do{var de=ee.lane&-536870913;if(de!==ee.lane?(Be&de)===de:(ls&de)===de){var ie=ee.revertLane;if(ie===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),de===Nr&&(le=!0);else if((ls&ie)===ie){ee=ee.next,ie===Nr&&(le=!0);continue}else de={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},Z===null?(z=Z=de,D=_):Z=Z.next=de,Re.lanes|=ie,Ns|=ie;de=ee.action,hr&&s(_,de),_=ee.hasEagerState?ee.eagerState:s(_,de)}else ie={lane:de,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},Z===null?(z=Z=ie,D=_):Z=Z.next=ie,Re.lanes|=de,Ns|=de;ee=ee.next}while(ee!==null&&ee!==t);if(Z===null?D=_:Z.next=z,!oi(_,e.memoizedState)&&(Ct=!0,le&&(s=Br,s!==null)))throw s;e.memoizedState=_,e.baseState=D,e.baseQueue=Z,n.lastRenderedState=_}return l===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function pc(e){var t=pt(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var n=s.dispatch,l=s.pending,_=t.memoizedState;if(l!==null){s.pending=null;var D=l=l.next;do _=e(_,D.action),D=D.next;while(D!==l);oi(_,t.memoizedState)||(Ct=!0),t.memoizedState=_,t.baseQueue===null&&(t.baseState=_),s.lastRenderedState=_}return[_,n]}function Ef(e,t,s){var n=Re,l=pt(),_=He;if(_){if(s===void 0)throw Error(o(407));s=s()}else s=t();var D=!oi((Ve||l).memoizedState,s);if(D&&(l.memoizedState=s,Ct=!0),l=l.queue,yc(Rf.bind(null,n,l,e),[e]),l.getSnapshot!==t||D||bt!==null&&bt.memoizedState.tag&1){if(n.flags|=2048,Pr(9,{destroy:void 0},Af.bind(null,n,l,s,t),null),Je===null)throw Error(o(349));_||(ls&127)!==0||Tf(n,t,s)}return s}function Tf(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Re.updateQueue,t===null?(t=eo(),Re.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Af(e,t,s,n){t.value=s,t.getSnapshot=n,Df(t)&&kf(e)}function Rf(e,t,s){return s(function(){Df(t)&&kf(e)})}function Df(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!oi(e,s)}catch{return!0}}function kf(e){var t=ir(e,2);t!==null&&ri(t,e,2)}function vc(e){var t=qt();if(typeof e=="function"){var s=e;if(e=s(),hr){kt(!0);try{s()}finally{kt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:e},t}function Of(e,t,s,n){return e.baseState=s,mc(e,Ve,typeof n=="function"?n:cs)}function bg(e,t,s,n,l){if(no(e))throw Error(o(485));if(e=t.action,e!==null){var _={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){_.listeners.push(D)}};G.T!==null?s(!0):_.isTransition=!1,n(_),s=t.pending,s===null?(_.next=t.pending=_,Mf(t,_)):(_.next=s.next,t.pending=s.next=_)}}function Mf(e,t){var s=t.action,n=t.payload,l=e.state;if(t.isTransition){var _=G.T,D={};G.T=D;try{var z=s(l,n),Z=G.S;Z!==null&&Z(D,z),Lf(e,t,z)}catch(ee){gc(e,t,ee)}finally{_!==null&&D.types!==null&&(_.types=D.types),G.T=_}}else try{_=s(l,n),Lf(e,t,_)}catch(ee){gc(e,t,ee)}}function Lf(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(n){Nf(e,t,n)},function(n){return gc(e,t,n)}):Nf(e,t,s)}function Nf(e,t,s){t.status="fulfilled",t.value=s,Bf(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Mf(e,s)))}function gc(e,t,s){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=s,Bf(t),t=t.next;while(t!==n)}e.action=null}function Bf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function zf(e,t){return t}function jf(e,t){if(He){var s=Je.formState;if(s!==null){e:{var n=Re;if(He){if(et){t:{for(var l=et,_=Ti;l.nodeType!==8;){if(!_){l=null;break t}if(l=Ri(l.nextSibling),l===null){l=null;break t}}_=l.data,l=_==="F!"||_==="F"?l:null}if(l){et=Ri(l.nextSibling),n=l.data==="F!";break e}}Es(n)}n=!1}n&&(t=s[0])}}return s=qt(),s.memoizedState=s.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zf,lastRenderedState:t},s.queue=n,s=id.bind(null,Re,n),n.dispatch=s,n=vc(!1),_=wc.bind(null,Re,!1,n.queue),n=qt(),l={state:t,dispatch:null,action:e,pending:null},n.queue=l,s=bg.bind(null,Re,l,_,s),l.dispatch=s,n.memoizedState=e,[t,s,!1]}function Hf(e){var t=pt();return Uf(t,Ve,e)}function Uf(e,t,s){if(t=mc(e,t,zf)[0],e=io(cs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Un(t)}catch(D){throw D===zr?Ga:D}else n=t;t=pt();var l=t.queue,_=l.dispatch;return s!==t.memoizedState&&(Re.flags|=2048,Pr(9,{destroy:void 0},Cg.bind(null,l,s),null)),[n,_,e]}function Cg(e,t){e.action=t}function If(e){var t=pt(),s=Ve;if(s!==null)return Uf(t,s,e);pt(),t=t.memoizedState,s=pt();var n=s.queue.dispatch;return s.memoizedState=e,[t,n,!1]}function Pr(e,t,s,n){return e={tag:e,create:s,deps:n,inst:t,next:null},t=Re.updateQueue,t===null&&(t=eo(),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 Pf(){return pt().memoizedState}function so(e,t,s,n){var l=qt();Re.flags|=e,l.memoizedState=Pr(1|t,{destroy:void 0},s,n===void 0?null:n)}function ro(e,t,s,n){var l=pt();n=n===void 0?null:n;var _=l.memoizedState.inst;Ve!==null&&n!==null&&cc(n,Ve.memoizedState.deps)?l.memoizedState=Pr(t,_,s,n):(Re.flags|=e,l.memoizedState=Pr(1|t,_,s,n))}function $f(e,t){so(8390656,8,e,t)}function yc(e,t){ro(2048,8,e,t)}function xg(e){Re.flags|=4;var t=Re.updateQueue;if(t===null)t=eo(),Re.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Ff(e){var t=pt().memoizedState;return xg({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Zf(e,t){return ro(4,2,e,t)}function qf(e,t){return ro(4,4,e,t)}function Gf(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 Wf(e,t,s){s=s!=null?s.concat([e]):null,ro(4,4,Gf.bind(null,t,e),s)}function Sc(){}function Yf(e,t){var s=pt();t=t===void 0?null:t;var n=s.memoizedState;return t!==null&&cc(t,n[1])?n[0]:(s.memoizedState=[e,t],e)}function Vf(e,t){var s=pt();t=t===void 0?null:t;var n=s.memoizedState;if(t!==null&&cc(t,n[1]))return n[0];if(n=e(),hr){kt(!0);try{e()}finally{kt(!1)}}return s.memoizedState=[n,t],n}function bc(e,t,s){return s===void 0||(ls&1073741824)!==0&&(Be&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Kd(),Re.lanes|=e,Ns|=e,s)}function Kf(e,t,s,n){return oi(s,t)?s:Hr.current!==null?(e=bc(e,s,n),oi(e,t)||(Ct=!0),e):(ls&42)===0||(ls&1073741824)!==0&&(Be&261930)===0?(Ct=!0,e.memoizedState=s):(e=Kd(),Re.lanes|=e,Ns|=e,t)}function Xf(e,t,s,n,l){var _=se.p;se.p=_!==0&&8>_?_:8;var D=G.T,z={};G.T=z,wc(e,!1,t,s);try{var Z=l(),ee=G.S;if(ee!==null&&ee(z,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var le=gg(Z,n);In(e,t,le,di(e))}else In(e,t,n,di(e))}catch(de){In(e,t,{then:function(){},status:"rejected",reason:de},di())}finally{se.p=_,D!==null&&z.types!==null&&(D.types=z.types),G.T=D}}function wg(){}function Cc(e,t,s,n){if(e.tag!==5)throw Error(o(476));var l=Jf(e).queue;Xf(e,l,t,ae,s===null?wg:function(){return Qf(e),s(n)})}function Jf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:ae},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 Qf(e){var t=Jf(e);t.next===null&&(t=e.alternate.memoizedState),In(e,t.next.queue,{},di())}function xc(){return Ht(sa)}function ed(){return pt().memoizedState}function td(){return pt().memoizedState}function Eg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=di();e=Rs(s);var n=Ds(t,e,s);n!==null&&(ri(n,t,s),Bn(n,t,s)),t={cache:Jl()},e.payload=t;return}t=t.return}}function Tg(e,t,s){var n=di();s={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},no(e)?sd(t,s):(s=Pl(e,t,s,n),s!==null&&(ri(s,e,n),rd(s,t,n)))}function id(e,t,s){var n=di();In(e,t,s,n)}function In(e,t,s,n){var l={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(no(e))sd(t,l);else{var _=e.alternate;if(e.lanes===0&&(_===null||_.lanes===0)&&(_=t.lastRenderedReducer,_!==null))try{var D=t.lastRenderedState,z=_(D,s);if(l.hasEagerState=!0,l.eagerState=z,oi(z,D))return Ua(e,t,l,0),Je===null&&Ha(),!1}catch{}finally{}if(s=Pl(e,t,l,n),s!==null)return ri(s,e,n),rd(s,t,n),!0}return!1}function wc(e,t,s,n){if(n={lane:2,revertLane:iu(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},no(e)){if(t)throw Error(o(479))}else t=Pl(e,s,n,2),t!==null&&ri(t,e,2)}function no(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function sd(e,t){Ur=Ja=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function rd(e,t,s){if((s&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,s|=n,t.lanes=s,mn(e,s)}}var Pn={readContext:Ht,use:to,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut};Pn.useEffectEvent=ut;var nd={readContext:Ht,use:to,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:$f,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,so(4194308,4,Gf.bind(null,t,e),s)},useLayoutEffect:function(e,t){return so(4194308,4,e,t)},useInsertionEffect:function(e,t){so(4,2,e,t)},useMemo:function(e,t){var s=qt();t=t===void 0?null:t;var n=e();if(hr){kt(!0);try{e()}finally{kt(!1)}}return s.memoizedState=[n,t],n},useReducer:function(e,t,s){var n=qt();if(s!==void 0){var l=s(t);if(hr){kt(!0);try{s(t)}finally{kt(!1)}}}else l=t;return n.memoizedState=n.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},n.queue=e,e=e.dispatch=Tg.bind(null,Re,e),[n.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:function(e){e=vc(e);var t=e.queue,s=id.bind(null,Re,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Sc,useDeferredValue:function(e,t){var s=qt();return bc(s,e,t)},useTransition:function(){var e=vc(!1);return e=Xf.bind(null,Re,e.queue,!0,!1),qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var n=Re,l=qt();if(He){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),Je===null)throw Error(o(349));(Be&127)!==0||Tf(n,t,s)}l.memoizedState=s;var _={value:s,getSnapshot:t};return l.queue=_,$f(Rf.bind(null,n,_,e),[e]),n.flags|=2048,Pr(9,{destroy:void 0},Af.bind(null,n,_,s,t),null),s},useId:function(){var e=qt(),t=Je.identifierPrefix;if(He){var s=$i,n=Pi;s=(n&~(1<<32-gt(n)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Qa++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=yg++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:xc,useFormState:jf,useActionState:jf,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=wc.bind(null,Re,!0,s),s.dispatch=t,[e,t]},useMemoCache:_c,useCacheRefresh:function(){return qt().memoizedState=Eg.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)}}},Ec={readContext:Ht,use:to,useCallback:Yf,useContext:Ht,useEffect:yc,useImperativeHandle:Wf,useInsertionEffect:Zf,useLayoutEffect:qf,useMemo:Vf,useReducer:io,useRef:Pf,useState:function(){return io(cs)},useDebugValue:Sc,useDeferredValue:function(e,t){var s=pt();return Kf(s,Ve.memoizedState,e,t)},useTransition:function(){var e=io(cs)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:Un(e),t]},useSyncExternalStore:Ef,useId:ed,useHostTransitionStatus:xc,useFormState:Hf,useActionState:Hf,useOptimistic:function(e,t){var s=pt();return Of(s,Ve,e,t)},useMemoCache:_c,useCacheRefresh:td};Ec.useEffectEvent=Ff;var ad={readContext:Ht,use:to,useCallback:Yf,useContext:Ht,useEffect:yc,useImperativeHandle:Wf,useInsertionEffect:Zf,useLayoutEffect:qf,useMemo:Vf,useReducer:pc,useRef:Pf,useState:function(){return pc(cs)},useDebugValue:Sc,useDeferredValue:function(e,t){var s=pt();return Ve===null?bc(s,e,t):Kf(s,Ve.memoizedState,e,t)},useTransition:function(){var e=pc(cs)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:Un(e),t]},useSyncExternalStore:Ef,useId:ed,useHostTransitionStatus:xc,useFormState:If,useActionState:If,useOptimistic:function(e,t){var s=pt();return Ve!==null?Of(s,Ve,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:_c,useCacheRefresh:td};ad.useEffectEvent=Ff;function Tc(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 Ac={enqueueSetState:function(e,t,s){e=e._reactInternals;var n=di(),l=Rs(n);l.payload=t,s!=null&&(l.callback=s),t=Ds(e,l,n),t!==null&&(ri(t,e,n),Bn(t,e,n))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var n=di(),l=Rs(n);l.tag=1,l.payload=t,s!=null&&(l.callback=s),t=Ds(e,l,n),t!==null&&(ri(t,e,n),Bn(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=di(),n=Rs(s);n.tag=2,t!=null&&(n.callback=t),t=Ds(e,n,s),t!==null&&(ri(t,e,s),Bn(t,e,s))}};function od(e,t,s,n,l,_,D){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,_,D):t.prototype&&t.prototype.isPureReactComponent?!An(s,n)||!An(l,_):!0}function ld(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&&Ac.enqueueReplaceState(t,t.state,null)}function fr(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 l in e)s[l]===void 0&&(s[l]=e[l])}return s}function cd(e){ja(e)}function ud(e){console.error(e)}function hd(e){ja(e)}function ao(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function fd(e,t,s){try{var n=e.onCaughtError;n(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function Rc(e,t,s){return s=Rs(s),s.tag=3,s.payload={element:null},s.callback=function(){ao(e,t)},s}function dd(e){return e=Rs(e),e.tag=3,e}function _d(e,t,s,n){var l=s.type.getDerivedStateFromError;if(typeof l=="function"){var _=n.value;e.payload=function(){return l(_)},e.callback=function(){fd(t,s,n)}}var D=s.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(e.callback=function(){fd(t,s,n),typeof l!="function"&&(Bs===null?Bs=new Set([this]):Bs.add(this));var z=n.stack;this.componentDidCatch(n.value,{componentStack:z!==null?z:""})})}function Ag(e,t,s,n,l){if(s.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=s.alternate,t!==null&&Lr(t,s,l,!0),s=ci.current,s!==null){switch(s.tag){case 31:case 13:return Ai===null?yo():s.alternate===null&&ht===0&&(ht=3),s.flags&=-257,s.flags|=65536,s.lanes=l,n===Wa?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([n]):t.add(n),Qc(e,n,l)),!1;case 22:return s.flags|=65536,n===Wa?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)),Qc(e,n,l)),!1}throw Error(o(435,s.tag))}return Qc(e,n,l),yo(),!1}if(He)return t=ci.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,n!==Wl&&(e=Error(o(422),{cause:n}),kn(xi(e,s)))):(n!==Wl&&(t=Error(o(423),{cause:n}),kn(xi(t,s))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,n=xi(n,s),l=Rc(e.stateNode,n,l),rc(e,l),ht!==4&&(ht=2)),!1;var _=Error(o(520),{cause:n});if(_=xi(_,s),Vn===null?Vn=[_]:Vn.push(_),ht!==4&&(ht=2),t===null)return!0;n=xi(n,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=l&-l,s.lanes|=e,e=Rc(s.stateNode,n,e),rc(s,e),!1;case 1:if(t=s.type,_=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Bs===null||!Bs.has(_))))return s.flags|=65536,l&=-l,s.lanes|=l,l=dd(l),_d(l,e,s,n),rc(s,l),!1}s=s.return}while(s!==null);return!1}var Dc=Error(o(461)),Ct=!1;function Ut(e,t,s,n){t.child=e===null?gf(t,null,s,n):ur(t,e.child,s,n)}function md(e,t,s,n,l){s=s.render;var _=t.ref;if("ref"in n){var D={};for(var z in n)z!=="ref"&&(D[z]=n[z])}else D=n;return ar(t),n=uc(e,t,s,D,_,l),z=hc(),e!==null&&!Ct?(fc(e,t,l),us(e,t,l)):(He&&z&&ql(t),t.flags|=1,Ut(e,t,n,l),t.child)}function pd(e,t,s,n,l){if(e===null){var _=s.type;return typeof _=="function"&&!$l(_)&&_.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=_,vd(e,t,_,n,l)):(e=Pa(s.type,null,n,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(_=e.child,!jc(e,l)){var D=_.memoizedProps;if(s=s.compare,s=s!==null?s:An,s(D,n)&&e.ref===t.ref)return us(e,t,l)}return t.flags|=1,e=rs(_,n),e.ref=t.ref,e.return=t,t.child=e}function vd(e,t,s,n,l){if(e!==null){var _=e.memoizedProps;if(An(_,n)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=n=_,jc(e,l))(e.flags&131072)!==0&&(Ct=!0);else return t.lanes=e.lanes,us(e,t,l)}return kc(e,t,s,n,l)}function gd(e,t,s,n){var l=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,l=0;n!==null;)l=l|n.lanes|n.childLanes,n=n.sibling;n=l&~_}else n=0,t.child=null;return yd(e,t,_,s,n)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&qa(t,_!==null?_.cachePool:null),_!==null?bf(t,_):ac(),Cf(t);else return n=t.lanes=536870912,yd(e,t,_!==null?_.baseLanes|s:s,s,n)}else _!==null?(qa(t,_.cachePool),bf(t,_),Os(),t.memoizedState=null):(e!==null&&qa(t,null),ac(),Os());return Ut(e,t,l,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 yd(e,t,s,n,l){var _=ec();return _=_===null?null:{parent:St._currentValue,pool:_},t.memoizedState={baseLanes:s,cachePool:_},e!==null&&qa(t,null),ac(),Cf(t),e!==null&&Lr(e,t,n,!0),t.childLanes=l,null}function oo(e,t){return t=co({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Sd(e,t,s){return ur(t,e.child,null,s),e=oo(t,t.pendingProps),e.flags|=2,ui(t),t.memoizedState=null,e}function Rg(e,t,s){var n=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(He){if(n.mode==="hidden")return e=oo(t,n),t.lanes=536870912,$n(null,e);if(lc(t),(e=et)?(e=M_(e,Ti),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xs!==null?{id:Pi,overflow:$i}:null,retryLane:536870912,hydrationErrors:null},s=sf(e),s.return=t,t.child=s,jt=t,et=null)):e=null,e===null)throw Es(t);return t.lanes=536870912,null}return oo(t,n)}var _=e.memoizedState;if(_!==null){var D=_.dehydrated;if(lc(t),l)if(t.flags&256)t.flags&=-257,t=Sd(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||Lr(e,t,s,!1),l=(s&e.childLanes)!==0,Ct||l){if(n=Je,n!==null&&(D=xa(n,s),D!==0&&D!==_.retryLane))throw _.retryLane=D,ir(e,D),ri(n,e,D),Dc;yo(),t=Sd(e,t,s)}else e=_.treeContext,et=Ri(D.nextSibling),jt=t,He=!0,ws=null,Ti=!1,e!==null&&af(t,e),t=oo(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 lo(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 kc(e,t,s,n,l){return ar(t),s=uc(e,t,s,n,void 0,l),n=hc(),e!==null&&!Ct?(fc(e,t,l),us(e,t,l)):(He&&n&&ql(t),t.flags|=1,Ut(e,t,s,l),t.child)}function bd(e,t,s,n,l,_){return ar(t),t.updateQueue=null,s=wf(t,n,s,l),xf(e),n=hc(),e!==null&&!Ct?(fc(e,t,_),us(e,t,_)):(He&&n&&ql(t),t.flags|=1,Ut(e,t,s,_),t.child)}function Cd(e,t,s,n,l){if(ar(t),t.stateNode===null){var _=Dr,D=s.contextType;typeof D=="object"&&D!==null&&(_=Ht(D)),_=new s(n,_),t.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Ac,t.stateNode=_,_._reactInternals=t,_=t.stateNode,_.props=n,_.state=t.memoizedState,_.refs={},ic(t),D=s.contextType,_.context=typeof D=="object"&&D!==null?Ht(D):Dr,_.state=t.memoizedState,D=s.getDerivedStateFromProps,typeof D=="function"&&(Tc(t,s,D,n),_.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(D=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),D!==_.state&&Ac.enqueueReplaceState(_,_.state,null),jn(t,n,_,l),zn(),_.state=t.memoizedState),typeof _.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){_=t.stateNode;var z=t.memoizedProps,Z=fr(s,z);_.props=Z;var ee=_.context,le=s.contextType;D=Dr,typeof le=="object"&&le!==null&&(D=Ht(le));var de=s.getDerivedStateFromProps;le=typeof de=="function"||typeof _.getSnapshotBeforeUpdate=="function",z=t.pendingProps!==z,le||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(z||ee!==D)&&ld(t,_,n,D),As=!1;var ie=t.memoizedState;_.state=ie,jn(t,n,_,l),zn(),ee=t.memoizedState,z||ie!==ee||As?(typeof de=="function"&&(Tc(t,s,de,n),ee=t.memoizedState),(Z=As||od(t,s,Z,n,ie,ee,D))?(le||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=ee),_.props=n,_.state=ee,_.context=D,n=Z):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{_=t.stateNode,sc(e,t),D=t.memoizedProps,le=fr(s,D),_.props=le,de=t.pendingProps,ie=_.context,ee=s.contextType,Z=Dr,typeof ee=="object"&&ee!==null&&(Z=Ht(ee)),z=s.getDerivedStateFromProps,(ee=typeof z=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(D!==de||ie!==Z)&&ld(t,_,n,Z),As=!1,ie=t.memoizedState,_.state=ie,jn(t,n,_,l),zn();var ne=t.memoizedState;D!==de||ie!==ne||As||e!==null&&e.dependencies!==null&&Fa(e.dependencies)?(typeof z=="function"&&(Tc(t,s,z,n),ne=t.memoizedState),(le=As||od(t,s,le,n,ie,ne,Z)||e!==null&&e.dependencies!==null&&Fa(e.dependencies))?(ee||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(n,ne,Z),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(n,ne,Z)),typeof _.componentDidUpdate=="function"&&(t.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof _.componentDidUpdate!="function"||D===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=ne),_.props=n,_.state=ne,_.context=Z,n=le):(typeof _.componentDidUpdate!="function"||D===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),n=!1)}return _=n,lo(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=ur(t,e.child,null,l),t.child=ur(t,null,s,l)):Ut(e,t,s,l),t.memoizedState=_.state,e=t.child):e=us(e,t,l),e}function xd(e,t,s,n){return rr(),t.flags|=256,Ut(e,t,s,n),t.child}var Oc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Mc(e){return{baseLanes:e,cachePool:ff()}}function Lc(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=fi),e}function wd(e,t,s){var n=t.pendingProps,l=!1,_=(t.flags&128)!==0,D;if((D=_)||(D=e!==null&&e.memoizedState===null?!1:(mt.current&2)!==0),D&&(l=!0,t.flags&=-129),D=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(l?ks(t):Os(),(e=et)?(e=M_(e,Ti),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xs!==null?{id:Pi,overflow:$i}:null,retryLane:536870912,hydrationErrors:null},s=sf(e),s.return=t,t.child=s,jt=t,et=null)):e=null,e===null)throw Es(t);return mu(e)?t.lanes=32:t.lanes=536870912,null}var z=n.children;return n=n.fallback,l?(Os(),l=t.mode,z=co({mode:"hidden",children:z},l),n=sr(n,l,s,null),z.return=t,n.return=t,z.sibling=n,t.child=z,n=t.child,n.memoizedState=Mc(s),n.childLanes=Lc(e,D,s),t.memoizedState=Oc,$n(null,n)):(ks(t),Nc(t,z))}var Z=e.memoizedState;if(Z!==null&&(z=Z.dehydrated,z!==null)){if(_)t.flags&256?(ks(t),t.flags&=-257,t=Bc(e,t,s)):t.memoizedState!==null?(Os(),t.child=e.child,t.flags|=128,t=null):(Os(),z=n.fallback,l=t.mode,n=co({mode:"visible",children:n.children},l),z=sr(z,l,s,null),z.flags|=2,n.return=t,z.return=t,n.sibling=z,t.child=n,ur(t,e.child,null,s),n=t.child,n.memoizedState=Mc(s),n.childLanes=Lc(e,D,s),t.memoizedState=Oc,t=$n(null,n));else if(ks(t),mu(z)){if(D=z.nextSibling&&z.nextSibling.dataset,D)var ee=D.dgst;D=ee,n=Error(o(419)),n.stack="",n.digest=D,kn({value:n,source:null,stack:null}),t=Bc(e,t,s)}else if(Ct||Lr(e,t,s,!1),D=(s&e.childLanes)!==0,Ct||D){if(D=Je,D!==null&&(n=xa(D,s),n!==0&&n!==Z.retryLane))throw Z.retryLane=n,ir(e,n),ri(D,e,n),Dc;_u(z)||yo(),t=Bc(e,t,s)}else _u(z)?(t.flags|=192,t.child=e.child,t=null):(e=Z.treeContext,et=Ri(z.nextSibling),jt=t,He=!0,ws=null,Ti=!1,e!==null&&af(t,e),t=Nc(t,n.children),t.flags|=4096);return t}return l?(Os(),z=n.fallback,l=t.mode,Z=e.child,ee=Z.sibling,n=rs(Z,{mode:"hidden",children:n.children}),n.subtreeFlags=Z.subtreeFlags&65011712,ee!==null?z=rs(ee,z):(z=sr(z,l,s,null),z.flags|=2),z.return=t,n.return=t,n.sibling=z,t.child=n,$n(null,n),n=t.child,z=e.child.memoizedState,z===null?z=Mc(s):(l=z.cachePool,l!==null?(Z=St._currentValue,l=l.parent!==Z?{parent:Z,pool:Z}:l):l=ff(),z={baseLanes:z.baseLanes|s,cachePool:l}),n.memoizedState=z,n.childLanes=Lc(e,D,s),t.memoizedState=Oc,$n(e.child,n)):(ks(t),s=e.child,e=s.sibling,s=rs(s,{mode:"visible",children:n.children}),s.return=t,s.sibling=null,e!==null&&(D=t.deletions,D===null?(t.deletions=[e],t.flags|=16):D.push(e)),t.child=s,t.memoizedState=null,s)}function Nc(e,t){return t=co({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function co(e,t){return e=li(22,e,null,t),e.lanes=0,e}function Bc(e,t,s){return ur(t,e.child,null,s),e=Nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ed(e,t,s){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Kl(e.return,t,s)}function zc(e,t,s,n,l,_){var D=e.memoizedState;D===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:s,tailMode:l,treeForkCount:_}:(D.isBackwards=t,D.rendering=null,D.renderingStartTime=0,D.last=n,D.tail=s,D.tailMode=l,D.treeForkCount=_)}function Td(e,t,s){var n=t.pendingProps,l=n.revealOrder,_=n.tail;n=n.children;var D=mt.current,z=(D&2)!==0;if(z?(D=D&1|2,t.flags|=128):D&=1,V(mt,D),Ut(e,t,n,s),n=He?Dn:0,!z&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ed(e,s,t);else if(e.tag===19)Ed(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(l){case"forwards":for(s=t.child,l=null;s!==null;)e=s.alternate,e!==null&&Xa(e)===null&&(l=s),s=s.sibling;s=l,s===null?(l=t.child,t.child=null):(l=s.sibling,s.sibling=null),zc(t,!1,l,s,_,n);break;case"backwards":case"unstable_legacy-backwards":for(s=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Xa(e)===null){t.child=l;break}e=l.sibling,l.sibling=s,s=l,l=e}zc(t,!0,s,null,_,n);break;case"together":zc(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),Ns|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(Lr(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 jc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Fa(e)))}function Dg(e,t,s){switch(t.tag){case 3:j(t,t.stateNode.containerInfo),Ts(t,St,e.memoizedState.cache),rr();break;case 27:case 5:oe(t);break;case 4:j(t,t.stateNode.containerInfo);break;case 10:Ts(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,lc(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(ks(t),t.flags|=128,null):(s&t.child.childLanes)!==0?wd(e,t,s):(ks(t),e=us(e,t,s),e!==null?e.sibling:null);ks(t);break;case 19:var l=(e.flags&128)!==0;if(n=(s&t.childLanes)!==0,n||(Lr(e,t,s,!1),n=(s&t.childLanes)!==0),l){if(n)return Td(e,t,s);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),V(mt,mt.current),n)break;return null;case 22:return t.lanes=0,gd(e,t,s,t.pendingProps);case 24:Ts(t,St,e.memoizedState.cache)}return us(e,t,s)}function Ad(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ct=!0;else{if(!jc(e,s)&&(t.flags&128)===0)return Ct=!1,Dg(e,t,s);Ct=(e.flags&131072)!==0}else Ct=!1,He&&(t.flags&1048576)!==0&&nf(t,Dn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=lr(t.elementType),t.type=e,typeof e=="function")$l(e)?(n=fr(e,n),t.tag=1,t=Cd(null,t,e,n,s)):(t.tag=0,t=kc(null,t,e,n,s));else{if(e!=null){var l=e.$$typeof;if(l===S){t.tag=11,t=md(null,t,e,n,s);break e}else if(l===M){t.tag=14,t=pd(null,t,e,n,s);break e}}throw t=J(e)||e,Error(o(306,t,""))}}return t;case 0:return kc(e,t,t.type,t.pendingProps,s);case 1:return n=t.type,l=fr(n,t.pendingProps),Cd(e,t,n,l,s);case 3:e:{if(j(t,t.stateNode.containerInfo),e===null)throw Error(o(387));n=t.pendingProps;var _=t.memoizedState;l=_.element,sc(e,t),jn(t,n,null,s);var D=t.memoizedState;if(n=D.cache,Ts(t,St,n),n!==_.cache&&Xl(t,[St],s,!0),zn(),n=D.element,_.isDehydrated)if(_={element:n,isDehydrated:!1,cache:D.cache},t.updateQueue.baseState=_,t.memoizedState=_,t.flags&256){t=xd(e,t,n,s);break e}else if(n!==l){l=xi(Error(o(424)),t),kn(l),t=xd(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(et=Ri(e.firstChild),jt=t,He=!0,ws=null,Ti=!0,s=gf(t,null,n,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(rr(),n===l){t=us(e,t,s);break e}Ut(e,t,n,s)}t=t.child}return t;case 26:return lo(e,t),e===null?(s=H_(t.type,null,t.pendingProps,null))?t.memoizedState=s:He||(s=t.type,e=t.pendingProps,n=To(me.current).createElement(s),n[yt]=t,n[it]=e,It(n,s,e),ke(n),t.stateNode=n):t.memoizedState=H_(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return oe(t),e===null&&He&&(n=t.stateNode=B_(t.type,t.pendingProps,me.current),jt=t,Ti=!0,l=et,Us(t.type)?(pu=l,et=Ri(n.firstChild)):et=l),Ut(e,t,t.pendingProps.children,s),lo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((l=n=et)&&(n=n0(n,t.type,t.pendingProps,Ti),n!==null?(t.stateNode=n,jt=t,et=Ri(n.firstChild),Ti=!1,l=!0):l=!1),l||Es(t)),oe(t),l=t.type,_=t.pendingProps,D=e!==null?e.memoizedProps:null,n=_.children,hu(l,_)?n=null:D!==null&&hu(l,D)&&(t.flags|=32),t.memoizedState!==null&&(l=uc(e,t,Sg,null,null,s),sa._currentValue=l),lo(e,t),Ut(e,t,n,s),t.child;case 6:return e===null&&He&&((e=s=et)&&(s=a0(s,t.pendingProps,Ti),s!==null?(t.stateNode=s,jt=t,et=null,e=!0):e=!1),e||Es(t)),null;case 13:return wd(e,t,s);case 4:return j(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ur(t,null,n,s):Ut(e,t,n,s),t.child;case 11:return md(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,Ts(t,t.type,n.value),Ut(e,t,n.children,s),t.child;case 9:return l=t.type._context,n=t.pendingProps.children,ar(t),l=Ht(l),n=n(l),t.flags|=1,Ut(e,t,n,s),t.child;case 14:return pd(e,t,t.type,t.pendingProps,s);case 15:return vd(e,t,t.type,t.pendingProps,s);case 19:return Td(e,t,s);case 31:return Rg(e,t,s);case 22:return gd(e,t,s,t.pendingProps);case 24:return ar(t),n=Ht(St),e===null?(l=ec(),l===null&&(l=Je,_=Jl(),l.pooledCache=_,_.refCount++,_!==null&&(l.pooledCacheLanes|=s),l=_),t.memoizedState={parent:n,cache:l},ic(t),Ts(t,St,l)):((e.lanes&s)!==0&&(sc(e,t),jn(t,null,null,s),zn()),l=e.memoizedState,_=t.memoizedState,l.parent!==n?(l={parent:n,cache:n},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),Ts(t,St,n)):(n=_.cache,Ts(t,St,n),n!==l.cache&&Xl(t,[St],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 Hc(e,t,s,n,l){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(l&335544128)===l)if(e.stateNode.complete)e.flags|=8192;else if(e_())e.flags|=8192;else throw cr=Wa,tc}else e.flags&=-16777217}function Rd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!F_(t))if(e_())e.flags|=8192;else throw cr=Wa,tc}function uo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Qi():536870912,e.lanes|=t,qr|=t)}function Fn(e,t){if(!He)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 tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,n=0;if(t)for(var l=e.child;l!==null;)s|=l.lanes|l.childLanes,n|=l.subtreeFlags&65011712,n|=l.flags&65011712,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)s|=l.lanes|l.childLanes,n|=l.subtreeFlags,n|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=n,e.childLanes=s,t}function kg(e,t,s){var n=t.pendingProps;switch(Gl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return tt(t),null;case 3:return s=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),os(St),ce(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Mr(t)?hs(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Yl())),tt(t),null;case 26:var l=t.type,_=t.memoizedState;return e===null?(hs(t),_!==null?(tt(t),Rd(t,_)):(tt(t),Hc(t,l,null,n,s))):_?_!==e.memoizedState?(hs(t),tt(t),Rd(t,_)):(tt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&hs(t),tt(t),Hc(t,l,e,n,s)),null;case 27:if(ve(t),s=me.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&hs(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return tt(t),null}e=re.current,Mr(t)?of(t):(e=B_(l,n,s),t.stateNode=e,hs(t))}return tt(t),null;case 5:if(ve(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&hs(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return tt(t),null}if(_=re.current,Mr(t))of(t);else{var D=To(me.current);switch(_){case 1:_=D.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:_=D.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":_=D.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":_=D.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":_=D.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof n.is=="string"?D.createElement("select",{is:n.is}):D.createElement("select"),n.multiple?_.multiple=!0:n.size&&(_.size=n.size);break;default:_=typeof n.is=="string"?D.createElement(l,{is:n.is}):D.createElement(l)}}_[yt]=t,_[it]=n;e:for(D=t.child;D!==null;){if(D.tag===5||D.tag===6)_.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===t)break e;for(;D.sibling===null;){if(D.return===null||D.return===t)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}t.stateNode=_;e:switch(It(_,l,n),l){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 tt(t),Hc(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=me.current,Mr(t)){if(e=t.stateNode,s=t.memoizedProps,n=null,l=jt,l!==null)switch(l.tag){case 27:case 5:n=l.memoizedProps}e[yt]=t,e=!!(e.nodeValue===s||n!==null&&n.suppressHydrationWarning===!0||w_(e.nodeValue,s)),e||Es(t,!0)}else e=To(e).createTextNode(n),e[yt]=t,t.stateNode=e}return tt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(n=Mr(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[yt]=t}else rr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(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 tt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=Mr(t),n!==null&&n.dehydrated!==null){if(e===null){if(!l)throw Error(o(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(o(317));l[yt]=t}else rr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),l=!1}else l=Yl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)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,l=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(l=n.alternate.memoizedState.cachePool.pool),_=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(_=n.memoizedState.cachePool.pool),_!==l&&(n.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),uo(t,t.updateQueue),tt(t),null);case 4:return ce(),e===null&&au(t.stateNode.containerInfo),tt(t),null;case 10:return os(t.type),tt(t),null;case 19:if(H(mt),n=t.memoizedState,n===null)return tt(t),null;if(l=(t.flags&128)!==0,_=n.rendering,_===null)if(l)Fn(n,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(_=Xa(e),_!==null){for(t.flags|=128,Fn(n,!1),e=_.updateQueue,t.updateQueue=e,uo(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)tf(s,e),s=s.sibling;return V(mt,mt.current&1|2),He&&ns(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&nt()>po&&(t.flags|=128,l=!0,Fn(n,!1),t.lanes=4194304)}else{if(!l)if(e=Xa(_),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,uo(t,e),Fn(n,!0),n.tail===null&&n.tailMode==="hidden"&&!_.alternate&&!He)return tt(t),null}else 2*nt()-n.renderingStartTime>po&&s!==536870912&&(t.flags|=128,l=!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=nt(),e.sibling=null,s=mt.current,V(mt,l?s&1|2:s&1),He&&ns(t,n.treeForkCount),e):(tt(t),null);case 22:case 23:return ui(t),oc(),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&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),s=t.updateQueue,s!==null&&uo(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(or),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),os(St),tt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Og(e,t){switch(Gl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return os(St),ce(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(ui(t),t.alternate===null)throw Error(o(340));rr()}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));rr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(mt),null;case 4:return ce(),null;case 10:return os(t.type),null;case 22:case 23:return ui(t),oc(),e!==null&&H(or),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return os(St),null;case 25:return null;default:return null}}function Dd(e,t){switch(Gl(t),t.tag){case 3:os(St),ce();break;case 26:case 27:case 5:ve(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&ui(t);break;case 13:ui(t);break;case 19:H(mt);break;case 10:os(t.type);break;case 22:case 23:ui(t),oc(),e!==null&&H(or);break;case 24:os(St)}}function Zn(e,t){try{var s=t.updateQueue,n=s!==null?s.lastEffect:null;if(n!==null){var l=n.next;s=l;do{if((s.tag&e)===e){n=void 0;var _=s.create,D=s.inst;n=_(),D.destroy=n}s=s.next}while(s!==l)}}catch(z){Ge(t,t.return,z)}}function Ms(e,t,s){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var _=l.next;n=_;do{if((n.tag&e)===e){var D=n.inst,z=D.destroy;if(z!==void 0){D.destroy=void 0,l=t;var Z=s,ee=z;try{ee()}catch(le){Ge(l,Z,le)}}}n=n.next}while(n!==_)}}catch(le){Ge(t,t.return,le)}}function kd(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Sf(t,s)}catch(n){Ge(e,e.return,n)}}}function Od(e,t,s){s.props=fr(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(n){Ge(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(l){Ge(e,t,l)}}function Fi(e,t){var s=e.ref,n=e.refCleanup;if(s!==null)if(typeof n=="function")try{n()}catch(l){Ge(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(l){Ge(e,t,l)}else s.current=null}function Md(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(l){Ge(e,e.return,l)}}function Uc(e,t,s){try{var n=e.stateNode;Qg(n,e.type,s,t),n[it]=t}catch(l){Ge(e,e.return,l)}}function Ld(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Us(e.type)||e.tag===4}function Ic(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ld(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&&Us(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Pc(e,t,s){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=is));else if(n!==4&&(n===27&&Us(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Pc(e,t,s),e=e.sibling;e!==null;)Pc(e,t,s),e=e.sibling}function ho(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&&Us(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(ho(e,t,s),e=e.sibling;e!==null;)ho(e,t,s),e=e.sibling}function Nd(e){var t=e.stateNode,s=e.memoizedProps;try{for(var n=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);It(t,n,s),t[yt]=e,t[it]=s}catch(_){Ge(e,e.return,_)}}var fs=!1,xt=!1,$c=!1,Bd=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function Mg(e,t){if(e=e.containerInfo,cu=Lo,e=Gh(e),Bl(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 l=n.anchorOffset,_=n.focusNode;n=n.focusOffset;try{s.nodeType,_.nodeType}catch{s=null;break e}var D=0,z=-1,Z=-1,ee=0,le=0,de=e,ie=null;t:for(;;){for(var ne;de!==s||l!==0&&de.nodeType!==3||(z=D+l),de!==_||n!==0&&de.nodeType!==3||(Z=D+n),de.nodeType===3&&(D+=de.nodeValue.length),(ne=de.firstChild)!==null;)ie=de,de=ne;for(;;){if(de===e)break t;if(ie===s&&++ee===l&&(z=D),ie===_&&++le===n&&(Z=D),(ne=de.nextSibling)!==null)break;de=ie,ie=de.parentNode}de=ne}s=z===-1||Z===-1?null:{start:z,end:Z}}else s=null}s=s||{start:0,end:0}}else s=null;for(uu={focusedElem:e,selectionRange:s},Lo=!1,Ot=t;Ot!==null;)if(t=Ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ot=e;else for(;Ot!==null;){switch(t=Ot,_=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++)l=e[s],l.ref.impl=l.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&_!==null){e=void 0,s=t,l=_.memoizedProps,_=_.memoizedState,n=s.stateNode;try{var ye=fr(s.type,l);e=n.getSnapshotBeforeUpdate(ye,_),n.__reactInternalSnapshotBeforeUpdate=e}catch(we){Ge(s,s.return,we)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)du(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":du(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,Ot=e;break}Ot=t.return}}function zd(e,t,s){var n=s.flags;switch(s.tag){case 0:case 11:case 15:_s(e,s),n&4&&Zn(5,s);break;case 1:if(_s(e,s),n&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(D){Ge(s,s.return,D)}else{var l=fr(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(D){Ge(s,s.return,D)}}n&64&&kd(s),n&512&&qn(s,s.return);break;case 3:if(_s(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{Sf(e,t)}catch(D){Ge(s,s.return,D)}}break;case 27:t===null&&n&4&&Nd(s);case 26:case 5:_s(e,s),t===null&&n&4&&Md(s),n&512&&qn(s,s.return);break;case 12:_s(e,s);break;case 31:_s(e,s),n&4&&Ud(e,s);break;case 13:_s(e,s),n&4&&Id(e,s),n&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=Pg.bind(null,s),o0(e,s))));break;case 22:if(n=s.memoizedState!==null||fs,!n){t=t!==null&&t.memoizedState!==null||xt,l=fs;var _=xt;fs=n,(xt=t)&&!_?ms(e,s,(s.subtreeFlags&8772)!==0):_s(e,s),fs=l,xt=_}break;case 30:break;default:_s(e,s)}}function jd(e){var t=e.alternate;t!==null&&(e.alternate=null,jd(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 st=null,ei=!1;function ds(e,t,s){for(s=s.child;s!==null;)Hd(e,t,s),s=s.sibling}function Hd(e,t,s){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(vi,s)}catch{}switch(s.tag){case 26:xt||Fi(s,t),ds(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:xt||Fi(s,t);var n=st,l=ei;Us(s.type)&&(st=s.stateNode,ei=!1),ds(e,t,s),ea(s.stateNode),st=n,ei=l;break;case 5:xt||Fi(s,t);case 6:if(n=st,l=ei,st=null,ds(e,t,s),st=n,ei=l,st!==null)if(ei)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(s.stateNode)}catch(_){Ge(s,t,_)}else try{st.removeChild(s.stateNode)}catch(_){Ge(s,t,_)}break;case 18:st!==null&&(ei?(e=st,k_(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Qr(e)):k_(st,s.stateNode));break;case 4:n=st,l=ei,st=s.stateNode.containerInfo,ei=!0,ds(e,t,s),st=n,ei=l;break;case 0:case 11:case 14:case 15:Ms(2,s,t),xt||Ms(4,s,t),ds(e,t,s);break;case 1:xt||(Fi(s,t),n=s.stateNode,typeof n.componentWillUnmount=="function"&&Od(s,t,n)),ds(e,t,s);break;case 21:ds(e,t,s);break;case 22:xt=(n=xt)||s.memoizedState!==null,ds(e,t,s),xt=n;break;default:ds(e,t,s)}}function Ud(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qr(e)}catch(s){Ge(t,t.return,s)}}}function Id(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qr(e)}catch(s){Ge(t,t.return,s)}}function Lg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Bd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Bd),t;default:throw Error(o(435,e.tag))}}function fo(e,t){var s=Lg(e);t.forEach(function(n){if(!s.has(n)){s.add(n);var l=$g.bind(null,e,n);n.then(l,l)}})}function ti(e,t){var s=t.deletions;if(s!==null)for(var n=0;n<s.length;n++){var l=s[n],_=e,D=t,z=D;e:for(;z!==null;){switch(z.tag){case 27:if(Us(z.type)){st=z.stateNode,ei=!1;break e}break;case 5:st=z.stateNode,ei=!1;break e;case 3:case 4:st=z.stateNode.containerInfo,ei=!0;break e}z=z.return}if(st===null)throw Error(o(160));Hd(_,D,l),st=null,ei=!1,_=l.alternate,_!==null&&(_.return=null),l.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Pd(t,e),t=t.sibling}var zi=null;function Pd(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&&(Ms(3,e,e.return),Zn(3,e),Ms(5,e,e.return));break;case 1:ti(t,e),ii(e),n&512&&(xt||s===null||Fi(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 l=zi;if(ti(t,e),ii(e),n&512&&(xt||s===null||Fi(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,l=l.ownerDocument||l;t:switch(n){case"title":_=l.getElementsByTagName("title")[0],(!_||_[Se]||_[yt]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=l.createElement(n),l.head.insertBefore(_,l.querySelector("head > title"))),It(_,n,s),_[yt]=e,ke(_),n=_;break e;case"link":var D=P_("link","href",l).get(n+(s.href||""));if(D){for(var z=0;z<D.length;z++)if(_=D[z],_.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)){D.splice(z,1);break t}}_=l.createElement(n),It(_,n,s),l.head.appendChild(_);break;case"meta":if(D=P_("meta","content",l).get(n+(s.content||""))){for(z=0;z<D.length;z++)if(_=D[z],_.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)){D.splice(z,1);break t}}_=l.createElement(n),It(_,n,s),l.head.appendChild(_);break;default:throw Error(o(468,n))}_[yt]=e,ke(_),n=_}e.stateNode=n}else $_(l,e.type,e.stateNode);else e.stateNode=I_(l,n,e.memoizedProps);else _!==n?(_===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):_.count--,n===null?$_(l,e.type,e.stateNode):I_(l,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Uc(e,e.memoizedProps,s.memoizedProps)}break;case 27:ti(t,e),ii(e),n&512&&(xt||s===null||Fi(s,s.return)),s!==null&&n&4&&Uc(e,e.memoizedProps,s.memoizedProps);break;case 5:if(ti(t,e),ii(e),n&512&&(xt||s===null||Fi(s,s.return)),e.flags&32){l=e.stateNode;try{Cr(l,"")}catch(ye){Ge(e,e.return,ye)}}n&4&&e.stateNode!=null&&(l=e.memoizedProps,Uc(e,l,s!==null?s.memoizedProps:l)),n&1024&&($c=!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){Ge(e,e.return,ye)}}break;case 3:if(Do=null,l=zi,zi=Ao(t.containerInfo),ti(t,e),zi=l,ii(e),n&4&&s!==null&&s.memoizedState.isDehydrated)try{Qr(t.containerInfo)}catch(ye){Ge(e,e.return,ye)}$c&&($c=!1,$d(e));break;case 4:n=zi,zi=Ao(e.stateNode.containerInfo),ti(t,e),ii(e),zi=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,fo(e,n)));break;case 13:ti(t,e),ii(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(mo=nt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,fo(e,n)));break;case 22:l=e.memoizedState!==null;var Z=s!==null&&s.memoizedState!==null,ee=fs,le=xt;if(fs=ee||l,xt=le||Z,ti(t,e),xt=le,fs=ee,ii(e),n&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(s===null||Z||fs||xt||dr(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){Z=s=t;try{if(_=Z.stateNode,l)D=_.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{z=Z.stateNode;var de=Z.memoizedProps.style,ie=de!=null&&de.hasOwnProperty("display")?de.display:null;z.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(ye){Ge(Z,Z.return,ye)}}}else if(t.tag===6){if(s===null){Z=t;try{Z.stateNode.nodeValue=l?"":Z.memoizedProps}catch(ye){Ge(Z,Z.return,ye)}}}else if(t.tag===18){if(s===null){Z=t;try{var ne=Z.stateNode;l?O_(ne,!0):O_(Z.stateNode,!1)}catch(ye){Ge(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,fo(e,s))));break;case 19:ti(t,e),ii(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,fo(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(Ld(n)){s=n;break}n=n.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var l=s.stateNode,_=Ic(e);ho(e,_,l);break;case 5:var D=s.stateNode;s.flags&32&&(Cr(D,""),s.flags&=-33);var z=Ic(e);ho(e,z,D);break;case 3:case 4:var Z=s.stateNode.containerInfo,ee=Ic(e);Pc(e,ee,Z);break;default:throw Error(o(161))}}catch(le){Ge(e,e.return,le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function $d(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;$d(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function _s(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)zd(e,t.alternate,t),t=t.sibling}function dr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ms(4,t,t.return),dr(t);break;case 1:Fi(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&Od(t,t.return,s),dr(t);break;case 27:ea(t.stateNode);case 26:case 5:Fi(t,t.return),dr(t);break;case 22:t.memoizedState===null&&dr(t);break;case 30:dr(t);break;default:dr(t)}e=e.sibling}}function ms(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,l=e,_=t,D=_.flags;switch(_.tag){case 0:case 11:case 15:ms(l,_,s),Zn(4,_);break;case 1:if(ms(l,_,s),n=_,l=n.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(ee){Ge(n,n.return,ee)}if(n=_,l=n.updateQueue,l!==null){var z=n.stateNode;try{var Z=l.shared.hiddenCallbacks;if(Z!==null)for(l.shared.hiddenCallbacks=null,l=0;l<Z.length;l++)yf(Z[l],z)}catch(ee){Ge(n,n.return,ee)}}s&&D&64&&kd(_),qn(_,_.return);break;case 27:Nd(_);case 26:case 5:ms(l,_,s),s&&n===null&&D&4&&Md(_),qn(_,_.return);break;case 12:ms(l,_,s);break;case 31:ms(l,_,s),s&&D&4&&Ud(l,_);break;case 13:ms(l,_,s),s&&D&4&&Id(l,_);break;case 22:_.memoizedState===null&&ms(l,_,s),qn(_,_.return);break;case 30:break;default:ms(l,_,s)}t=t.sibling}}function Fc(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 Zc(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 ji(e,t,s,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fd(e,t,s,n),t=t.sibling}function Fd(e,t,s,n){var l=t.flags;switch(t.tag){case 0:case 11:case 15:ji(e,t,s,n),l&2048&&Zn(9,t);break;case 1:ji(e,t,s,n);break;case 3:ji(e,t,s,n),l&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(l&2048){ji(e,t,s,n),e=t.stateNode;try{var _=t.memoizedProps,D=_.id,z=_.onPostCommit;typeof z=="function"&&z(D,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Z){Ge(t,t.return,Z)}}else ji(e,t,s,n);break;case 31:ji(e,t,s,n);break;case 13:ji(e,t,s,n);break;case 23:break;case 22:_=t.stateNode,D=t.alternate,t.memoizedState!==null?_._visibility&2?ji(e,t,s,n):Gn(e,t):_._visibility&2?ji(e,t,s,n):(_._visibility|=2,$r(e,t,s,n,(t.subtreeFlags&10256)!==0||!1)),l&2048&&Fc(D,t);break;case 24:ji(e,t,s,n),l&2048&&Zc(t.alternate,t);break;default:ji(e,t,s,n)}}function $r(e,t,s,n,l){for(l=l&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var _=e,D=t,z=s,Z=n,ee=D.flags;switch(D.tag){case 0:case 11:case 15:$r(_,D,z,Z,l),Zn(8,D);break;case 23:break;case 22:var le=D.stateNode;D.memoizedState!==null?le._visibility&2?$r(_,D,z,Z,l):Gn(_,D):(le._visibility|=2,$r(_,D,z,Z,l)),l&&ee&2048&&Fc(D.alternate,D);break;case 24:$r(_,D,z,Z,l),l&&ee&2048&&Zc(D.alternate,D);break;default:$r(_,D,z,Z,l)}t=t.sibling}}function Gn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,n=t,l=n.flags;switch(n.tag){case 22:Gn(s,n),l&2048&&Fc(n.alternate,n);break;case 24:Gn(s,n),l&2048&&Zc(n.alternate,n);break;default:Gn(s,n)}t=t.sibling}}var Wn=8192;function Fr(e,t,s){if(e.subtreeFlags&Wn)for(e=e.child;e!==null;)Zd(e,t,s),e=e.sibling}function Zd(e,t,s){switch(e.tag){case 26:Fr(e,t,s),e.flags&Wn&&e.memoizedState!==null&&y0(s,zi,e.memoizedState,e.memoizedProps);break;case 5:Fr(e,t,s);break;case 3:case 4:var n=zi;zi=Ao(e.stateNode.containerInfo),Fr(e,t,s),zi=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Wn,Wn=16777216,Fr(e,t,s),Wn=n):Fr(e,t,s));break;default:Fr(e,t,s)}}function qd(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 Yn(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];Ot=n,Wd(n,e)}qd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gd(e),e=e.sibling}function Gd(e){switch(e.tag){case 0:case 11:case 15:Yn(e),e.flags&2048&&Ms(9,e,e.return);break;case 3:Yn(e);break;case 12:Yn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,_o(e)):Yn(e);break;default:Yn(e)}}function _o(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];Ot=n,Wd(n,e)}qd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ms(8,t,t.return),_o(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,_o(t));break;default:_o(t)}e=e.sibling}}function Wd(e,t){for(;Ot!==null;){var s=Ot;switch(s.tag){case 0:case 11:case 15:Ms(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,Ot=n;else e:for(s=e;Ot!==null;){n=Ot;var l=n.sibling,_=n.return;if(jd(n),n===s){Ot=null;break e}if(l!==null){l.return=_,Ot=l;break e}Ot=_}}}var Ng={getCacheForType:function(e){var t=Ht(St),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Ht(St).controller.signal}},Bg=typeof WeakMap=="function"?WeakMap:Map,Fe=0,Je=null,Le=null,Be=0,qe=0,hi=null,Ls=!1,Zr=!1,qc=!1,ps=0,ht=0,Ns=0,_r=0,Gc=0,fi=0,qr=0,Vn=null,si=null,Wc=!1,mo=0,Yd=0,po=1/0,vo=null,Bs=null,Tt=0,zs=null,Gr=null,vs=0,Yc=0,Vc=null,Vd=null,Kn=0,Kc=null;function di(){return(Fe&2)!==0&&Be!==0?Be&-Be:G.T!==null?iu():pn()}function Kd(){if(fi===0)if((Be&536870912)===0||He){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===Je&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(Wr(e,0),js(e,Be,fi,!1)),bs(e,s),((Fe&2)===0||e!==Je)&&(e===Je&&((Fe&2)===0&&(_r|=s),ht===4&&js(e,Be,fi,!1)),Zi(e))}function Xd(e,t,s){if((Fe&6)!==0)throw Error(o(327));var n=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Js(e,t),l=n?Hg(e,t):Jc(e,t,!0),_=n;do{if(l===0){Zr&&!n&&js(e,t,0,!1);break}else{if(s=e.current.alternate,_&&!zg(s)){l=Jc(e,t,!1),_=!1;continue}if(l===2){if(_=t,e.errorRecoveryDisabledLanes&_)var D=0;else D=e.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){t=D;e:{var z=e;l=Vn;var Z=z.current.memoizedState.isDehydrated;if(Z&&(Wr(z,D).flags|=256),D=Jc(z,D,!1),D!==2){if(qc&&!Z){z.errorRecoveryDisabledLanes|=_,_r|=_,l=4;break e}_=si,si=l,_!==null&&(si===null?si=_:si.push.apply(si,_))}l=D}if(_=!1,l!==2)continue}}if(l===1){Wr(e,0),js(e,t,0,!0);break}e:{switch(n=e,_=l,_){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:js(n,t,fi,!Ls);break e;case 2:si=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(l=mo+300-nt(),10<l)){if(js(n,t,fi,!Ls),yr(n,0,!0)!==0)break e;vs=t,n.timeoutHandle=R_(Jd.bind(null,n,s,si,vo,Wc,t,fi,_r,qr,Ls,_,"Throttled",-0,0),l);break e}Jd(n,s,si,vo,Wc,t,fi,_r,qr,Ls,_,null,-0,0)}}break}while(!0);Zi(e)}function Jd(e,t,s,n,l,_,D,z,Z,ee,le,de,ie,ne){if(e.timeoutHandle=-1,de=t.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:is},Zd(t,_,de);var ye=(_&62914560)===_?mo-nt():(_&4194048)===_?Yd-nt():0;if(ye=S0(de,ye),ye!==null){vs=_,e.cancelPendingCommit=ye(a_.bind(null,e,t,_,s,n,l,D,z,Z,le,de,null,ie,ne)),js(e,_,D,!ee);return}}a_(e,t,_,s,n,l,D,z,Z)}function zg(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 l=s[n],_=l.getSnapshot;l=l.value;try{if(!oi(_(),l))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 js(e,t,s,n){t&=~Gc,t&=~_r,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var l=t;0<l;){var _=31-gt(l),D=1<<_;n[_]=-1,l&=~D}s!==0&&_n(e,s,t)}function go(){return(Fe&6)===0?(Xn(0),!1):!0}function Xc(){if(Le!==null){if(qe===0)var e=Le.return;else e=Le,as=nr=null,dc(e),jr=null,Ln=0,e=Le;for(;e!==null;)Dd(e.alternate,e),e=e.return;Le=null}}function Wr(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,i0(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),vs=0,Xc(),Je=e,Le=s=rs(e.current,null),Be=t,qe=0,hi=null,Ls=!1,Zr=Js(e,t),qc=!1,qr=fi=Gc=_r=Ns=ht=0,si=Vn=null,Wc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var l=31-gt(n),_=1<<l;t|=e[l],n&=~_}return ps=t,Ha(),s}function Qd(e,t){Re=null,G.H=Pn,t===zr||t===Ga?(t=mf(),qe=3):t===tc?(t=mf(),qe=4):qe=t===Dc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hi=t,Le===null&&(ht=1,ao(e,xi(t,e.current)))}function e_(){var e=ci.current;return e===null?!0:(Be&4194048)===Be?Ai===null:(Be&62914560)===Be||(Be&536870912)!==0?e===Ai:!1}function t_(){var e=G.H;return G.H=Pn,e===null?Pn:e}function i_(){var e=G.A;return G.A=Ng,e}function yo(){ht=4,Ls||(Be&4194048)!==Be&&ci.current!==null||(Zr=!0),(Ns&134217727)===0&&(_r&134217727)===0||Je===null||js(Je,Be,fi,!1)}function Jc(e,t,s){var n=Fe;Fe|=2;var l=t_(),_=i_();(Je!==e||Be!==t)&&(vo=null,Wr(e,t)),t=!1;var D=ht;e:do try{if(qe!==0&&Le!==null){var z=Le,Z=hi;switch(qe){case 8:Xc(),D=6;break e;case 3:case 2:case 9:case 6:ci.current===null&&(t=!0);var ee=qe;if(qe=0,hi=null,Yr(e,z,Z,ee),s&&Zr){D=0;break e}break;default:ee=qe,qe=0,hi=null,Yr(e,z,Z,ee)}}jg(),D=ht;break}catch(le){Qd(e,le)}while(!0);return t&&e.shellSuspendCounter++,as=nr=null,Fe=n,G.H=l,G.A=_,Le===null&&(Je=null,Be=0,Ha()),D}function jg(){for(;Le!==null;)s_(Le)}function Hg(e,t){var s=Fe;Fe|=2;var n=t_(),l=i_();Je!==e||Be!==t?(vo=null,po=nt()+500,Wr(e,t)):Zr=Js(e,t);e:do try{if(qe!==0&&Le!==null){t=Le;var _=hi;t:switch(qe){case 1:qe=0,hi=null,Yr(e,t,_,1);break;case 2:case 9:if(df(_)){qe=0,hi=null,r_(t);break}t=function(){qe!==2&&qe!==9||Je!==e||(qe=7),Zi(e)},_.then(t,t);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:df(_)?(qe=0,hi=null,r_(t)):(qe=0,hi=null,Yr(e,t,_,7));break;case 5:var D=null;switch(Le.tag){case 26:D=Le.memoizedState;case 5:case 27:var z=Le;if(D?F_(D):z.stateNode.complete){qe=0,hi=null;var Z=z.sibling;if(Z!==null)Le=Z;else{var ee=z.return;ee!==null?(Le=ee,So(ee)):Le=null}break t}}qe=0,hi=null,Yr(e,t,_,5);break;case 6:qe=0,hi=null,Yr(e,t,_,6);break;case 8:Xc(),ht=6;break e;default:throw Error(o(462))}}Ug();break}catch(le){Qd(e,le)}while(!0);return as=nr=null,G.H=n,G.A=l,Fe=s,Le!==null?0:(Je=null,Be=0,Ha(),ht)}function Ug(){for(;Le!==null&&!Vi();)s_(Le)}function s_(e){var t=Ad(e.alternate,e,ps);e.memoizedProps=e.pendingProps,t===null?So(e):Le=t}function r_(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=bd(s,t,t.pendingProps,t.type,void 0,Be);break;case 11:t=bd(s,t,t.pendingProps,t.type.render,t.ref,Be);break;case 5:dc(t);default:Dd(s,t),t=Le=tf(t,ps),t=Ad(s,t,ps)}e.memoizedProps=e.pendingProps,t===null?So(e):Le=t}function Yr(e,t,s,n){as=nr=null,dc(t),jr=null,Ln=0;var l=t.return;try{if(Ag(e,l,t,s,Be)){ht=1,ao(e,xi(s,e.current)),Le=null;return}}catch(_){if(l!==null)throw Le=l,_;ht=1,ao(e,xi(s,e.current)),Le=null;return}t.flags&32768?(He||n===1?e=!0:Zr||(Be&536870912)!==0?e=!1:(Ls=e=!0,(n===2||n===9||n===3||n===6)&&(n=ci.current,n!==null&&n.tag===13&&(n.flags|=16384))),n_(t,e)):So(t)}function So(e){var t=e;do{if((t.flags&32768)!==0){n_(t,Ls);return}e=t.return;var s=kg(t.alternate,t,ps);if(s!==null){Le=s;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);ht===0&&(ht=5)}function n_(e,t){do{var s=Og(e.alternate,e);if(s!==null){s.flags&=32767,Le=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Le=e;return}Le=e=s}while(e!==null);ht=6,Le=null}function a_(e,t,s,n,l,_,D,z,Z){e.cancelPendingCommit=null;do bo();while(Tt!==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,_|=Il,dn(e,s,_,D,z,Z),e===Je&&(Le=Je=null,Be=0),Gr=t,zs=e,vs=s,Yc=_,Vc=l,Vd=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Fg(Bt,function(){return h_(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=G.T,G.T=null,l=se.p,se.p=2,D=Fe,Fe|=4;try{Mg(e,t,s)}finally{Fe=D,se.p=l,G.T=n}}Tt=1,o_(),l_(),c_()}}function o_(){if(Tt===1){Tt=0;var e=zs,t=Gr,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=G.T,G.T=null;var n=se.p;se.p=2;var l=Fe;Fe|=4;try{Pd(t,e);var _=uu,D=Gh(e.containerInfo),z=_.focusedElem,Z=_.selectionRange;if(D!==z&&z&&z.ownerDocument&&qh(z.ownerDocument.documentElement,z)){if(Z!==null&&Bl(z)){var ee=Z.start,le=Z.end;if(le===void 0&&(le=ee),"selectionStart"in z)z.selectionStart=ee,z.selectionEnd=Math.min(le,z.value.length);else{var de=z.ownerDocument||document,ie=de&&de.defaultView||window;if(ie.getSelection){var ne=ie.getSelection(),ye=z.textContent.length,we=Math.min(Z.start,ye),Xe=Z.end===void 0?we:Math.min(Z.end,ye);!ne.extend&&we>Xe&&(D=Xe,Xe=we,we=D);var X=Zh(z,we),K=Zh(z,Xe);if(X&&K&&(ne.rangeCount!==1||ne.anchorNode!==X.node||ne.anchorOffset!==X.offset||ne.focusNode!==K.node||ne.focusOffset!==K.offset)){var Q=de.createRange();Q.setStart(X.node,X.offset),ne.removeAllRanges(),we>Xe?(ne.addRange(Q),ne.extend(K.node,K.offset)):(Q.setEnd(K.node,K.offset),ne.addRange(Q))}}}}for(de=[],ne=z;ne=ne.parentNode;)ne.nodeType===1&&de.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<de.length;z++){var he=de[z];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}Lo=!!cu,uu=cu=null}finally{Fe=l,se.p=n,G.T=s}}e.current=t,Tt=2}}function l_(){if(Tt===2){Tt=0;var e=zs,t=Gr,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=G.T,G.T=null;var n=se.p;se.p=2;var l=Fe;Fe|=4;try{zd(e,t.alternate,t)}finally{Fe=l,se.p=n,G.T=s}}Tt=3}}function c_(){if(Tt===4||Tt===3){Tt=0,Pt();var e=zs,t=Gr,s=vs,n=Vd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Tt=5:(Tt=0,Gr=zs=null,u_(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(Bs=null),Ni(s),t=t.stateNode,Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(vi,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=G.T,l=se.p,se.p=2,G.T=null;try{for(var _=e.onRecoverableError,D=0;D<n.length;D++){var z=n[D];_(z.value,{componentStack:z.stack})}}finally{G.T=t,se.p=l}}(vs&3)!==0&&bo(),Zi(e),l=e.pendingLanes,(s&261930)!==0&&(l&42)!==0?e===Kc?Kn++:(Kn=0,Kc=e):Kn=0,Xn(0)}}function u_(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,On(t)))}function bo(){return o_(),l_(),c_(),h_()}function h_(){if(Tt!==5)return!1;var e=zs,t=Yc;Yc=0;var s=Ni(vs),n=G.T,l=se.p;try{se.p=32>s?32:s,G.T=null,s=Vc,Vc=null;var _=zs,D=vs;if(Tt=0,Gr=zs=null,vs=0,(Fe&6)!==0)throw Error(o(331));var z=Fe;if(Fe|=4,Gd(_.current),Fd(_,_.current,D,s),Fe=z,Xn(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(vi,_)}catch{}return!0}finally{se.p=l,G.T=n,u_(e,t)}}function f_(e,t,s){t=xi(s,t),t=Rc(e.stateNode,t,2),e=Ds(e,t,2),e!==null&&(bs(e,2),Zi(e))}function Ge(e,t,s){if(e.tag===3)f_(e,e,s);else for(;t!==null;){if(t.tag===3){f_(t,e,s);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Bs===null||!Bs.has(n))){e=xi(s,e),s=dd(2),n=Ds(t,s,2),n!==null&&(_d(s,n,t,e),bs(n,2),Zi(n));break}}t=t.return}}function Qc(e,t,s){var n=e.pingCache;if(n===null){n=e.pingCache=new Bg;var l=new Set;n.set(t,l)}else l=n.get(t),l===void 0&&(l=new Set,n.set(t,l));l.has(s)||(qc=!0,l.add(s),e=Ig.bind(null,e,t,s),t.then(e,e))}function Ig(e,t,s){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Je===e&&(Be&s)===s&&(ht===4||ht===3&&(Be&62914560)===Be&&300>nt()-mo?(Fe&2)===0&&Wr(e,0):Gc|=s,qr===Be&&(qr=0)),Zi(e)}function d_(e,t){t===0&&(t=Qi()),e=ir(e,t),e!==null&&(bs(e,t),Zi(e))}function Pg(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),d_(e,s)}function $g(e,t){var s=0;switch(e.tag){case 31:case 13:var n=e.stateNode,l=e.memoizedState;l!==null&&(s=l.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),d_(e,s)}function Fg(e,t){return pi(e,t)}var Co=null,Vr=null,eu=!1,xo=!1,tu=!1,Hs=0;function Zi(e){e!==Vr&&e.next===null&&(Vr===null?Co=Vr=e:Vr=Vr.next=e),xo=!0,eu||(eu=!0,qg())}function Xn(e,t){if(!tu&&xo){tu=!0;do for(var s=!1,n=Co;n!==null;){if(e!==0){var l=n.pendingLanes;if(l===0)var _=0;else{var D=n.suspendedLanes,z=n.pingedLanes;_=(1<<31-gt(42|e)+1)-1,_&=l&~(D&~z),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(s=!0,v_(n,_))}else _=Be,_=yr(n,n===Je?_:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(_&3)===0||Js(n,_)||(s=!0,v_(n,_));n=n.next}while(s);tu=!1}}function Zg(){__()}function __(){xo=eu=!1;var e=0;Hs!==0&&t0()&&(e=Hs);for(var t=nt(),s=null,n=Co;n!==null;){var l=n.next,_=m_(n,t);_===0?(n.next=null,s===null?Co=l:s.next=l,l===null&&(Vr=s)):(s=n,(e!==0||(_&3)!==0)&&(xo=!0)),n=l}Tt!==0&&Tt!==5||Xn(e),Hs!==0&&(Hs=0)}function m_(e,t){for(var s=e.suspendedLanes,n=e.pingedLanes,l=e.expirationTimes,_=e.pendingLanes&-62914561;0<_;){var D=31-gt(_),z=1<<D,Z=l[D];Z===-1?((z&s)===0||(z&n)!==0)&&(l[D]=_t(z,t)):Z<=t&&(e.expiredLanes|=z),_&=~z}if(t=Je,s=Be,s=yr(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,s===0||e===t&&(qe===2||qe===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Ui(n),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Js(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(n!==null&&Ui(n),Ni(s)){case 2:case 8:s=Nt;break;case 32:s=Bt;break;case 268435456:s=Kt;break;default:s=Bt}return n=p_.bind(null,e),s=pi(s,n),e.callbackPriority=t,e.callbackNode=s,t}return n!==null&&n!==null&&Ui(n),e.callbackPriority=2,e.callbackNode=null,2}function p_(e,t){if(Tt!==0&&Tt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(bo()&&e.callbackNode!==s)return null;var n=Be;return n=yr(e,e===Je?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Xd(e,n,t),m_(e,nt()),e.callbackNode!=null&&e.callbackNode===s?p_.bind(null,e):null)}function v_(e,t){if(bo())return null;Xd(e,t,!0)}function qg(){s0(function(){(Fe&6)!==0?pi(Zt,Zg):__()})}function iu(){if(Hs===0){var e=Nr;e===0&&(e=Xi,Xi<<=1,(Xi&261888)===0&&(Xi=256)),Hs=e}return Hs}function g_(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ka(""+e)}function y_(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 Gg(e,t,s,n,l){if(t==="submit"&&s&&s.stateNode===l){var _=g_((l[it]||null).action),D=n.submitter;D&&(t=(t=D[it]||null)?g_(t.formAction):D.getAttribute("formAction"),t!==null&&(_=t,D=null));var z=new Na("action","action",null,n,l);e.push({event:z,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Hs!==0){var Z=D?y_(l,D):new FormData(l);Cc(s,{pending:!0,data:Z,method:l.method,action:_},null,Z)}}else typeof _=="function"&&(z.preventDefault(),Z=D?y_(l,D):new FormData(l),Cc(s,{pending:!0,data:Z,method:l.method,action:_},_,Z))},currentTarget:l}]})}}for(var su=0;su<Ul.length;su++){var ru=Ul[su],Wg=ru.toLowerCase(),Yg=ru[0].toUpperCase()+ru.slice(1);Bi(Wg,"on"+Yg)}Bi(Vh,"onAnimationEnd"),Bi(Kh,"onAnimationIteration"),Bi(Xh,"onAnimationStart"),Bi("dblclick","onDoubleClick"),Bi("focusin","onFocus"),Bi("focusout","onBlur"),Bi(ug,"onTransitionRun"),Bi(hg,"onTransitionStart"),Bi(fg,"onTransitionCancel"),Bi(Jh,"onTransitionEnd"),Ii("onMouseEnter",["mouseout","mouseover"]),Ii("onMouseLeave",["mouseout","mouseover"]),Ii("onPointerEnter",["pointerout","pointerover"]),Ii("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(" "),Vg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jn));function S_(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var n=e[s],l=n.event;n=n.listeners;e:{var _=void 0;if(t)for(var D=n.length-1;0<=D;D--){var z=n[D],Z=z.instance,ee=z.currentTarget;if(z=z.listener,Z!==_&&l.isPropagationStopped())break e;_=z,l.currentTarget=ee;try{_(l)}catch(le){ja(le)}l.currentTarget=null,_=Z}else for(D=0;D<n.length;D++){if(z=n[D],Z=z.instance,ee=z.currentTarget,z=z.listener,Z!==_&&l.isPropagationStopped())break e;_=z,l.currentTarget=ee;try{_(l)}catch(le){ja(le)}l.currentTarget=null,_=Z}}}}function Ne(e,t){var s=t[Sr];s===void 0&&(s=t[Sr]=new Set);var n=e+"__bubble";s.has(n)||(b_(t,e,2,!1),s.add(n))}function nu(e,t,s){var n=0;t&&(n|=4),b_(s,e,n,t)}var wo="_reactListening"+Math.random().toString(36).slice(2);function au(e){if(!e[wo]){e[wo]=!0,zt.forEach(function(s){s!=="selectionchange"&&(Vg.has(s)||nu(s,!1,e),nu(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wo]||(t[wo]=!0,nu("selectionchange",!1,t))}}function b_(e,t,s,n){switch(K_(t)){case 2:var l=x0;break;case 8:l=w0;break;default:l=bu}s=l.bind(null,t,s,e),l=void 0,!Tl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),n?l!==void 0?e.addEventListener(t,s,{capture:!0,passive:l}):e.addEventListener(t,s,!0):l!==void 0?e.addEventListener(t,s,{passive:l}):e.addEventListener(t,s,!1)}function ou(e,t,s,n,l){var _=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var D=n.tag;if(D===3||D===4){var z=n.stateNode.containerInfo;if(z===l)break;if(D===4)for(D=n.return;D!==null;){var Z=D.tag;if((Z===3||Z===4)&&D.stateNode.containerInfo===l)return;D=D.return}for(;z!==null;){if(D=_e(z),D===null)return;if(Z=D.tag,Z===5||Z===6||Z===26||Z===27){n=_=D;continue e}z=z.parentNode}}n=n.return}Eh(function(){var ee=_,le=wl(s),de=[];e:{var ie=Qh.get(e);if(ie!==void 0){var ne=Na,ye=e;switch(e){case"keypress":if(Ma(s)===0)break e;case"keydown":case"keyup":ne=$v;break;case"focusin":ye="focus",ne=kl;break;case"focusout":ye="blur",ne=kl;break;case"beforeblur":case"afterblur":ne=kl;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":ne=Rh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=kv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=qv;break;case Vh:case Kh:case Xh:ne=Lv;break;case Jh:ne=Wv;break;case"scroll":case"scrollend":ne=Rv;break;case"wheel":ne=Vv;break;case"copy":case"cut":case"paste":ne=Bv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=kh;break;case"toggle":case"beforetoggle":ne=Xv}var we=(t&4)!==0,Xe=!we&&(e==="scroll"||e==="scrollend"),X=we?ie!==null?ie+"Capture":null:ie;we=[];for(var K=ee,Q;K!==null;){var he=K;if(Q=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||Q===null||X===null||(he=Sn(K,X),he!=null&&we.push(Qn(K,he,Q))),Xe)break;K=K.return}0<we.length&&(ie=new ne(ie,ye,null,s,le),de.push({event:ie,listeners:we}))}}if((t&7)===0){e:{if(ie=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",ie&&s!==xl&&(ye=s.relatedTarget||s.fromElement)&&(_e(ye)||ye[es]))break e;if((ne||ie)&&(ie=le.window===le?le:(ie=le.ownerDocument)?ie.defaultView||ie.parentWindow:window,ne?(ye=s.relatedTarget||s.toElement,ne=ee,ye=ye?_e(ye):null,ye!==null&&(Xe=x(ye),we=ye.tag,ye!==Xe||we!==5&&we!==27&&we!==6)&&(ye=null)):(ne=null,ye=ee),ne!==ye)){if(we=Rh,he="onMouseLeave",X="onMouseEnter",K="mouse",(e==="pointerout"||e==="pointerover")&&(we=kh,he="onPointerLeave",X="onPointerEnter",K="pointer"),Xe=ne==null?ie:Ze(ne),Q=ye==null?ie:Ze(ye),ie=new we(he,K+"leave",ne,s,le),ie.target=Xe,ie.relatedTarget=Q,he=null,_e(le)===ee&&(we=new we(X,K+"enter",ye,s,le),we.target=Q,we.relatedTarget=Xe,he=we),Xe=he,ne&&ye)t:{for(we=Kg,X=ne,K=ye,Q=0,he=X;he;he=we(he))Q++;he=0;for(var Ce=K;Ce;Ce=we(Ce))he++;for(;0<Q-he;)X=we(X),Q--;for(;0<he-Q;)K=we(K),he--;for(;Q--;){if(X===K||K!==null&&X===K.alternate){we=X;break t}X=we(X),K=we(K)}we=null}else we=null;ne!==null&&C_(de,ie,ne,we,!1),ye!==null&&Xe!==null&&C_(de,Xe,ye,we,!0)}}e:{if(ie=ee?Ze(ee):window,ne=ie.nodeName&&ie.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ie.type==="file")var Pe=Hh;else if(zh(ie))if(Uh)Pe=og;else{Pe=ng;var be=rg}else ne=ie.nodeName,!ne||ne.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?ee&&Cl(ee.elementType)&&(Pe=Hh):Pe=ag;if(Pe&&(Pe=Pe(e,ee))){jh(de,Pe,s,le);break e}be&&be(e,ie,ee),e==="focusout"&&ee&&ie.type==="number"&&ee.memoizedProps.value!=null&&bl(ie,"number",ie.value)}switch(be=ee?Ze(ee):window,e){case"focusin":(zh(be)||be.contentEditable==="true")&&(Tr=be,zl=ee,Rn=null);break;case"focusout":Rn=zl=Tr=null;break;case"mousedown":jl=!0;break;case"contextmenu":case"mouseup":case"dragend":jl=!1,Wh(de,s,le);break;case"selectionchange":if(cg)break;case"keydown":case"keyup":Wh(de,s,le)}var De;if(Ml)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 Er?Nh(e,s)&&(ze="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(ze="onCompositionStart");ze&&(Oh&&s.locale!=="ko"&&(Er||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Er&&(De=Th()):(Cs=le,Al="value"in Cs?Cs.value:Cs.textContent,Er=!0)),be=Eo(ee,ze),0<be.length&&(ze=new Dh(ze,e,null,s,le),de.push({event:ze,listeners:be}),De?ze.data=De:(De=Bh(s),De!==null&&(ze.data=De)))),(De=Qv?eg(e,s):tg(e,s))&&(ze=Eo(ee,"onBeforeInput"),0<ze.length&&(be=new Dh("onBeforeInput","beforeinput",null,s,le),de.push({event:be,listeners:ze}),be.data=De)),Gg(de,e,ee,s,le)}S_(de,t)})}function Qn(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Eo(e,t){for(var s=t+"Capture",n=[];e!==null;){var l=e,_=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||_===null||(l=Sn(e,s),l!=null&&n.unshift(Qn(e,l,_)),l=Sn(e,t),l!=null&&n.push(Qn(e,l,_))),e.tag===3)return n;e=e.return}return[]}function Kg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function C_(e,t,s,n,l){for(var _=t._reactName,D=[];s!==null&&s!==n;){var z=s,Z=z.alternate,ee=z.stateNode;if(z=z.tag,Z!==null&&Z===n)break;z!==5&&z!==26&&z!==27||ee===null||(Z=ee,l?(ee=Sn(s,_),ee!=null&&D.unshift(Qn(s,ee,Z))):l||(ee=Sn(s,_),ee!=null&&D.push(Qn(s,ee,Z)))),s=s.return}D.length!==0&&e.push({event:t,listeners:D})}var Xg=/\r\n?/g,Jg=/\u0000|\uFFFD/g;function x_(e){return(typeof e=="string"?e:""+e).replace(Xg,`
49
+ `).replace(Jg,"")}function w_(e,t){return t=x_(t),x_(e)===t}function Ke(e,t,s,n,l,_){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":Ra(e,"class",n);break;case"tabIndex":Ra(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Ra(e,s,n);break;case"style":xh(e,n,_);break;case"data":if(t!=="object"){Ra(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=ka(""+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"&&Ke(e,t,"name",l.name,l,null),Ke(e,t,"formEncType",l.formEncType,l,null),Ke(e,t,"formMethod",l.formMethod,l,null),Ke(e,t,"formTarget",l.formTarget,l,null)):(Ke(e,t,"encType",l.encType,l,null),Ke(e,t,"method",l.method,l,null),Ke(e,t,"target",l.target,l,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(s);break}n=ka(""+n),e.setAttribute(s,n);break;case"onClick":n!=null&&(e.onclick=is);break;case"onScroll":n!=null&&Ne("scroll",e);break;case"onScrollEnd":n!=null&&Ne("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(l.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=ka(""+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":Ne("beforetoggle",e),Ne("toggle",e),Aa(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":Aa(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=Tv.get(s)||s,Aa(e,s,n))}}function lu(e,t,s,n,l,_){switch(s){case"style":xh(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(l.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&&Ne("scroll",e);break;case"onScrollEnd":n!=null&&Ne("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"&&(l=s.endsWith("Capture"),t=s.slice(2,l?s.length-7:void 0),_=e[it]||null,_=_!=null?_[s]:null,typeof _=="function"&&e.removeEventListener(t,_,l),typeof n=="function")){typeof _!="function"&&_!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,n,l);break e}s in e?e[s]=n:n===!0?e.setAttribute(s,""):Aa(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":Ne("error",e),Ne("load",e);var n=!1,l=!1,_;for(_ in s)if(s.hasOwnProperty(_)){var D=s[_];if(D!=null)switch(_){case"src":n=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ke(e,t,_,D,s,null)}}l&&Ke(e,t,"srcSet",s.srcSet,s,null),n&&Ke(e,t,"src",s.src,s,null);return;case"input":Ne("invalid",e);var z=_=D=l=null,Z=null,ee=null;for(n in s)if(s.hasOwnProperty(n)){var le=s[n];if(le!=null)switch(n){case"name":l=le;break;case"type":D=le;break;case"checked":Z=le;break;case"defaultChecked":ee=le;break;case"value":_=le;break;case"defaultValue":z=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(o(137,t));break;default:Ke(e,t,n,le,s,null)}}yh(e,_,z,Z,ee,D,l,!1);return;case"select":Ne("invalid",e),n=D=_=null;for(l in s)if(s.hasOwnProperty(l)&&(z=s[l],z!=null))switch(l){case"value":_=z;break;case"defaultValue":D=z;break;case"multiple":n=z;default:Ke(e,t,l,z,s,null)}t=_,s=D,e.multiple=!!n,t!=null?br(e,!!n,t,!1):s!=null&&br(e,!!n,s,!0);return;case"textarea":Ne("invalid",e),_=l=n=null;for(D in s)if(s.hasOwnProperty(D)&&(z=s[D],z!=null))switch(D){case"value":n=z;break;case"defaultValue":l=z;break;case"children":_=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(o(91));break;default:Ke(e,t,D,z,s,null)}bh(e,n,l,_);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:Ke(e,t,Z,n,s,null)}return;case"dialog":Ne("beforetoggle",e),Ne("toggle",e),Ne("cancel",e),Ne("close",e);break;case"iframe":case"object":Ne("load",e);break;case"video":case"audio":for(n=0;n<Jn.length;n++)Ne(Jn[n],e);break;case"image":Ne("error",e),Ne("load",e);break;case"details":Ne("toggle",e);break;case"embed":case"source":case"link":Ne("error",e),Ne("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(ee in s)if(s.hasOwnProperty(ee)&&(n=s[ee],n!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ke(e,t,ee,n,s,null)}return;default:if(Cl(t)){for(le in s)s.hasOwnProperty(le)&&(n=s[le],n!==void 0&&lu(e,t,le,n,s,void 0));return}}for(z in s)s.hasOwnProperty(z)&&(n=s[z],n!=null&&Ke(e,t,z,n,s,null))}function Qg(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 l=null,_=null,D=null,z=null,Z=null,ee=null,le=null;for(ne in s){var de=s[ne];if(s.hasOwnProperty(ne)&&de!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":Z=de;default:n.hasOwnProperty(ne)||Ke(e,t,ne,null,n,de)}}for(var ie in n){var ne=n[ie];if(de=s[ie],n.hasOwnProperty(ie)&&(ne!=null||de!=null))switch(ie){case"type":_=ne;break;case"name":l=ne;break;case"checked":ee=ne;break;case"defaultChecked":le=ne;break;case"value":D=ne;break;case"defaultValue":z=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(o(137,t));break;default:ne!==de&&Ke(e,t,ie,ne,n,de)}}Sl(e,D,z,Z,ee,le,_,l);return;case"select":ne=D=z=ie=null;for(_ in s)if(Z=s[_],s.hasOwnProperty(_)&&Z!=null)switch(_){case"value":break;case"multiple":ne=Z;default:n.hasOwnProperty(_)||Ke(e,t,_,null,n,Z)}for(l in n)if(_=n[l],Z=s[l],n.hasOwnProperty(l)&&(_!=null||Z!=null))switch(l){case"value":ie=_;break;case"defaultValue":z=_;break;case"multiple":D=_;default:_!==Z&&Ke(e,t,l,_,n,Z)}t=z,s=D,n=ne,ie!=null?br(e,!!s,ie,!1):!!n!=!!s&&(t!=null?br(e,!!s,t,!0):br(e,!!s,s?[]:"",!1));return;case"textarea":ne=ie=null;for(z in s)if(l=s[z],s.hasOwnProperty(z)&&l!=null&&!n.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:Ke(e,t,z,null,n,l)}for(D in n)if(l=n[D],_=s[D],n.hasOwnProperty(D)&&(l!=null||_!=null))switch(D){case"value":ie=l;break;case"defaultValue":ne=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(o(91));break;default:l!==_&&Ke(e,t,D,l,n,_)}Sh(e,ie,ne);return;case"option":for(var ye in s)if(ie=s[ye],s.hasOwnProperty(ye)&&ie!=null&&!n.hasOwnProperty(ye))switch(ye){case"selected":e.selected=!1;break;default:Ke(e,t,ye,null,n,ie)}for(Z in n)if(ie=n[Z],ne=s[Z],n.hasOwnProperty(Z)&&ie!==ne&&(ie!=null||ne!=null))switch(Z){case"selected":e.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:Ke(e,t,Z,ie,n,ne)}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)ie=s[we],s.hasOwnProperty(we)&&ie!=null&&!n.hasOwnProperty(we)&&Ke(e,t,we,null,n,ie);for(ee in n)if(ie=n[ee],ne=s[ee],n.hasOwnProperty(ee)&&ie!==ne&&(ie!=null||ne!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(o(137,t));break;default:Ke(e,t,ee,ie,n,ne)}return;default:if(Cl(t)){for(var Xe in s)ie=s[Xe],s.hasOwnProperty(Xe)&&ie!==void 0&&!n.hasOwnProperty(Xe)&&lu(e,t,Xe,void 0,n,ie);for(le in n)ie=n[le],ne=s[le],!n.hasOwnProperty(le)||ie===ne||ie===void 0&&ne===void 0||lu(e,t,le,ie,n,ne);return}}for(var X in s)ie=s[X],s.hasOwnProperty(X)&&ie!=null&&!n.hasOwnProperty(X)&&Ke(e,t,X,null,n,ie);for(de in n)ie=n[de],ne=s[de],!n.hasOwnProperty(de)||ie===ne||ie==null&&ne==null||Ke(e,t,de,ie,n,ne)}function E_(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function e0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),n=0;n<s.length;n++){var l=s[n],_=l.transferSize,D=l.initiatorType,z=l.duration;if(_&&z&&E_(D)){for(D=0,z=l.responseEnd,n+=1;n<s.length;n++){var Z=s[n],ee=Z.startTime;if(ee>z)break;var le=Z.transferSize,de=Z.initiatorType;le&&E_(de)&&(Z=Z.responseEnd,D+=le*(Z<z?1:(z-ee)/(Z-ee)))}if(--n,t+=8*(_+D)/(l.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 cu=null,uu=null;function To(e){return e.nodeType===9?e:e.ownerDocument}function T_(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 A_(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 hu(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 fu=null;function t0(){var e=window.event;return e&&e.type==="popstate"?e===fu?!1:(fu=e,!0):(fu=null,!1)}var R_=typeof setTimeout=="function"?setTimeout:void 0,i0=typeof clearTimeout=="function"?clearTimeout:void 0,D_=typeof Promise=="function"?Promise:void 0,s0=typeof queueMicrotask=="function"?queueMicrotask:typeof D_<"u"?function(e){return D_.resolve(null).then(e).catch(r0)}:R_;function r0(e){setTimeout(function(){throw e})}function Us(e){return e==="head"}function k_(e,t){var s=t,n=0;do{var l=s.nextSibling;if(e.removeChild(s),l&&l.nodeType===8)if(s=l.data,s==="/$"||s==="/&"){if(n===0){e.removeChild(l),Qr(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 D=_.nextSibling,z=_.nodeName;_[Se]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&_.rel.toLowerCase()==="stylesheet"||s.removeChild(_),_=D}}else s==="body"&&ea(e.ownerDocument.body);s=l}while(s);Qr(t)}function O_(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 du(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":du(s),W(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function n0(e,t,s,n){for(;e.nodeType===1;){var l=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(_!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(_=e.getAttribute("src"),(_!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&_&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var _=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===_)return e}else return e;if(e=Ri(e.nextSibling),e===null)break}return null}function a0(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 M_(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ri(e.nextSibling),e===null))return null;return e}function _u(e){return e.data==="$?"||e.data==="$~"}function mu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function o0(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 pu=null;function L_(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 N_(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 B_(e,t,s){switch(t=To(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,z_=new Set;function Ao(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var gs=se.d;se.d={f:l0,r:c0,D:u0,C:h0,L:f0,m:d0,X:m0,S:_0,M:p0};function l0(){var e=gs.f(),t=go();return e||t}function c0(e){var t=ge(e);t!==null&&t.tag===5&&t.type==="form"?Qf(t):gs.r(e)}var Kr=typeof document>"u"?null:document;function j_(e,t,s){var n=Kr;if(n&&typeof t=="string"&&t){var l=bi(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof s=="string"&&(l+='[crossorigin="'+s+'"]'),z_.has(l)||(z_.add(l),e={rel:e,crossOrigin:s,href:t},n.querySelector(l)===null&&(t=n.createElement("link"),It(t,"link",e),ke(t),n.head.appendChild(t)))}}function u0(e){gs.D(e),j_("dns-prefetch",e,null)}function h0(e,t){gs.C(e,t),j_("preconnect",e,t)}function f0(e,t,s){gs.L(e,t,s);var n=Kr;if(n&&e&&t){var l='link[rel="preload"][as="'+bi(t)+'"]';t==="image"&&s&&s.imageSrcSet?(l+='[imagesrcset="'+bi(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(l+='[imagesizes="'+bi(s.imageSizes)+'"]')):l+='[href="'+bi(e)+'"]';var _=l;switch(t){case"style":_=Xr(e);break;case"script":_=Jr(e)}Di.has(_)||(e=d({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Di.set(_,e),n.querySelector(l)!==null||t==="style"&&n.querySelector(ta(_))||t==="script"&&n.querySelector(ia(_))||(t=n.createElement("link"),It(t,"link",e),ke(t),n.head.appendChild(t)))}}function d0(e,t){gs.m(e,t);var s=Kr;if(s&&e){var n=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+bi(n)+'"][href="'+bi(e)+'"]',_=l;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Jr(e)}if(!Di.has(_)&&(e=d({rel:"modulepreload",href:e},t),Di.set(_,e),s.querySelector(l)===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),ke(n),s.head.appendChild(n)}}}function _0(e,t,s){gs.S(e,t,s);var n=Kr;if(n&&e){var l=at(n).hoistableStyles,_=Xr(e);t=t||"default";var D=l.get(_);if(!D){var z={loading:0,preload:null};if(D=n.querySelector(ta(_)))z.loading=5;else{e=d({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Di.get(_))&&vu(e,s);var Z=D=n.createElement("link");ke(Z),It(Z,"link",e),Z._p=new Promise(function(ee,le){Z.onload=ee,Z.onerror=le}),Z.addEventListener("load",function(){z.loading|=1}),Z.addEventListener("error",function(){z.loading|=2}),z.loading|=4,Ro(D,t,n)}D={type:"stylesheet",instance:D,count:1,state:z},l.set(_,D)}}}function m0(e,t){gs.X(e,t);var s=Kr;if(s&&e){var n=at(s).hoistableScripts,l=Jr(e),_=n.get(l);_||(_=s.querySelector(ia(l)),_||(e=d({src:e,async:!0},t),(t=Di.get(l))&&gu(e,t),_=s.createElement("script"),ke(_),It(_,"link",e),s.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},n.set(l,_))}}function p0(e,t){gs.M(e,t);var s=Kr;if(s&&e){var n=at(s).hoistableScripts,l=Jr(e),_=n.get(l);_||(_=s.querySelector(ia(l)),_||(e=d({src:e,async:!0,type:"module"},t),(t=Di.get(l))&&gu(e,t),_=s.createElement("script"),ke(_),It(_,"link",e),s.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},n.set(l,_))}}function H_(e,t,s,n){var l=(l=me.current)?Ao(l):null;if(!l)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Xr(s.href),s=at(l).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=Xr(s.href);var _=at(l).hoistableStyles,D=_.get(e);if(D||(l=l.ownerDocument||l,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(e,D),(_=l.querySelector(ta(e)))&&!_._p&&(D.instance=_,D.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),_||v0(l,e,s,D.state))),t&&n===null)throw Error(o(528,""));return D}if(t&&n!==null)throw Error(o(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Jr(s),s=at(l).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 Xr(e){return'href="'+bi(e)+'"'}function ta(e){return'link[rel="stylesheet"]['+e+"]"}function U_(e){return d({},e,{"data-precedence":e.precedence,precedence:null})}function v0(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),ke(t),e.head.appendChild(t))}function Jr(e){return'[src="'+bi(e)+'"]'}function ia(e){return"script[async]"+e}function I_(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,ke(n),n;var l=d({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),ke(n),It(n,"style",l),Ro(n,s.precedence,e),t.instance=n;case"stylesheet":l=Xr(s.href);var _=e.querySelector(ta(l));if(_)return t.state.loading|=4,t.instance=_,ke(_),_;n=U_(s),(l=Di.get(l))&&vu(n,l),_=(e.ownerDocument||e).createElement("link"),ke(_);var D=_;return D._p=new Promise(function(z,Z){D.onload=z,D.onerror=Z}),It(_,"link",n),t.state.loading|=4,Ro(_,s.precedence,e),t.instance=_;case"script":return _=Jr(s.src),(l=e.querySelector(ia(_)))?(t.instance=l,ke(l),l):(n=s,(l=Di.get(_))&&(n=d({},s),gu(n,l)),e=e.ownerDocument||e,l=e.createElement("script"),ke(l),It(l,"link",n),e.head.appendChild(l),t.instance=l);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,Ro(n,s.precedence,e));return t.instance}function Ro(e,t,s){for(var n=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=n.length?n[n.length-1]:null,_=l,D=0;D<n.length;D++){var z=n[D];if(z.dataset.precedence===t)_=z;else if(_!==l)break}_?_.parentNode.insertBefore(e,_.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function vu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function gu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Do=null;function P_(e,t,s){if(Do===null){var n=new Map,l=Do=new Map;l.set(s,n)}else l=Do,n=l.get(s),n||(n=new Map,l.set(s,n));if(n.has(e))return n;for(n.set(e,null),s=s.getElementsByTagName(e),l=0;l<s.length;l++){var _=s[l];if(!(_[Se]||_[yt]||e==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var D=_.getAttribute(t)||"";D=e+D;var z=n.get(D);z?z.push(_):n.set(D,[_])}}return n}function $_(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function g0(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 F_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function y0(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 l=Xr(n.href),_=t.querySelector(ta(l));if(_){t=_._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ko.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=_,ke(_);return}_=t.ownerDocument||t,n=U_(n),(l=Di.get(l))&&vu(n,l),_=_.createElement("link"),ke(_);var D=_;D._p=new Promise(function(z,Z){D.onload=z,D.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=ko.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var yu=0;function S0(e,t){return e.stylesheets&&e.count===0&&Mo(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var n=setTimeout(function(){if(e.stylesheets&&Mo(e,e.stylesheets),e.unsuspend){var _=e.unsuspend;e.unsuspend=null,_()}},6e4+t);0<e.imgBytes&&yu===0&&(yu=62500*e0());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Mo(e,e.stylesheets),e.unsuspend)){var _=e.unsuspend;e.unsuspend=null,_()}},(e.imgBytes>yu?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(l)}}:null}function ko(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Oo=null;function Mo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Oo=new Map,t.forEach(b0,e),Oo=null,ko.call(e))}function b0(e,t){if(!(t.state.loading&4)){var s=Oo.get(e);if(s)var n=s.get(null);else{s=new Map,Oo.set(e,s);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<l.length;_++){var D=l[_];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(s.set(D.dataset.precedence,D),n=D)}n&&s.set(null,n)}l=t.instance,D=l.getAttribute("data-precedence"),_=s.get(D)||n,_===n&&s.set(null,l),s.set(D,l),this.count++,n=ko.bind(this),l.addEventListener("load",n),l.addEventListener("error",n),_?_.parentNode.insertBefore(l,_.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var sa={$$typeof:p,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function C0(e,t,s,n,l,_,D,z,Z){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=fn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fn(0),this.hiddenUpdates=fn(null),this.identifierPrefix=n,this.onUncaughtError=l,this.onCaughtError=_,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function Z_(e,t,s,n,l,_,D,z,Z,ee,le,de){return e=new C0(e,t,s,D,Z,ee,le,de,z),t=1,_===!0&&(t|=24),_=li(3,null,null,t),e.current=_,_.stateNode=e,t=Jl(),t.refCount++,e.pooledCache=t,t.refCount++,_.memoizedState={element:n,isDehydrated:s,cache:t},ic(_),e}function q_(e){return e?(e=Dr,e):Dr}function G_(e,t,s,n,l,_){l=q_(l),n.context===null?n.context=l:n.pendingContext=l,n=Rs(t),n.payload={element:s},_=_===void 0?null:_,_!==null&&(n.callback=_),s=Ds(e,n,t),s!==null&&(ri(s,e,t),Bn(s,e,t))}function W_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Su(e,t){W_(e,t),(e=e.alternate)&&W_(e,t)}function Y_(e){if(e.tag===13||e.tag===31){var t=ir(e,67108864);t!==null&&ri(t,e,67108864),Su(e,67108864)}}function V_(e){if(e.tag===13||e.tag===31){var t=di();t=Xt(t);var s=ir(e,t);s!==null&&ri(s,e,t),Su(e,t)}}var Lo=!0;function x0(e,t,s,n){var l=G.T;G.T=null;var _=se.p;try{se.p=2,bu(e,t,s,n)}finally{se.p=_,G.T=l}}function w0(e,t,s,n){var l=G.T;G.T=null;var _=se.p;try{se.p=8,bu(e,t,s,n)}finally{se.p=_,G.T=l}}function bu(e,t,s,n){if(Lo){var l=Cu(n);if(l===null)ou(e,t,n,No,s),X_(e,n);else if(T0(l,e,t,s,n))n.stopPropagation();else if(X_(e,n),t&4&&-1<E0.indexOf(e)){for(;l!==null;){var _=ge(l);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var D=ai(_.pendingLanes);if(D!==0){var z=_;for(z.pendingLanes|=2,z.entangledLanes|=2;D;){var Z=1<<31-gt(D);z.entanglements[1]|=Z,D&=~Z}Zi(_),(Fe&6)===0&&(po=nt()+500,Xn(0))}}break;case 31:case 13:z=ir(_,2),z!==null&&ri(z,_,2),go(),Su(_,2)}if(_=Cu(n),_===null&&ou(e,t,n,No,s),_===l)break;l=_}l!==null&&n.stopPropagation()}else ou(e,t,n,null,s)}}function Cu(e){return e=wl(e),xu(e)}var No=null;function xu(e){if(No=null,e=_e(e),e!==null){var t=x(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=T(t),e!==null)return e;e=null}else if(s===31){if(e=c(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 No=e,null}function K_(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(Rt()){case Zt:return 2;case Nt:return 8;case Bt:case Ki:return 32;case Kt:return 268435456;default:return 32}default:return 32}}var wu=!1,Is=null,Ps=null,$s=null,ra=new Map,na=new Map,Fs=[],E0="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 X_(e,t){switch(e){case"focusin":case"focusout":Is=null;break;case"dragenter":case"dragleave":Ps=null;break;case"mouseover":case"mouseout":$s=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,l,_){return e===null||e.nativeEvent!==_?(e={blockedOn:t,domEventName:s,eventSystemFlags:n,nativeEvent:_,targetContainers:[l]},t!==null&&(t=ge(t),t!==null&&Y_(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function T0(e,t,s,n,l){switch(t){case"focusin":return Is=aa(Is,e,t,s,n,l),!0;case"dragenter":return Ps=aa(Ps,e,t,s,n,l),!0;case"mouseover":return $s=aa($s,e,t,s,n,l),!0;case"pointerover":var _=l.pointerId;return ra.set(_,aa(ra.get(_)||null,e,t,s,n,l)),!0;case"gotpointercapture":return _=l.pointerId,na.set(_,aa(na.get(_)||null,e,t,s,n,l)),!0}return!1}function J_(e){var t=_e(e.target);if(t!==null){var s=x(t);if(s!==null){if(t=s.tag,t===13){if(t=T(s),t!==null){e.blockedOn=t,vn(e.priority,function(){V_(s)});return}}else if(t===31){if(t=c(s),t!==null){e.blockedOn=t,vn(e.priority,function(){V_(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 Bo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Cu(e.nativeEvent);if(s===null){s=e.nativeEvent;var n=new s.constructor(s.type,s);xl=n,s.target.dispatchEvent(n),xl=null}else return t=ge(s),t!==null&&Y_(t),e.blockedOn=s,!1;t.shift()}return!0}function Q_(e,t,s){Bo(e)&&s.delete(t)}function A0(){wu=!1,Is!==null&&Bo(Is)&&(Is=null),Ps!==null&&Bo(Ps)&&(Ps=null),$s!==null&&Bo($s)&&($s=null),ra.forEach(Q_),na.forEach(Q_)}function zo(e,t){e.blockedOn===t&&(e.blockedOn=null,wu||(wu=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,A0)))}var jo=null;function em(e){jo!==e&&(jo=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){jo===e&&(jo=null);for(var t=0;t<e.length;t+=3){var s=e[t],n=e[t+1],l=e[t+2];if(typeof n!="function"){if(xu(n||s)===null)continue;break}var _=ge(s);_!==null&&(e.splice(t,3),t-=3,Cc(_,{pending:!0,data:l,method:s.method,action:n},n,l))}}))}function Qr(e){function t(Z){return zo(Z,e)}Is!==null&&zo(Is,e),Ps!==null&&zo(Ps,e),$s!==null&&zo($s,e),ra.forEach(t),na.forEach(t);for(var s=0;s<Fs.length;s++){var n=Fs[s];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Fs.length&&(s=Fs[0],s.blockedOn===null);)J_(s),s.blockedOn===null&&Fs.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(n=0;n<s.length;n+=3){var l=s[n],_=s[n+1],D=l[it]||null;if(typeof _=="function")D||em(s);else if(D){var z=null;if(_&&_.hasAttribute("formAction")){if(l=_,D=_[it]||null)z=D.formAction;else if(xu(l)!==null)continue}else z=D.action;typeof z=="function"?s[n+1]=z:(s.splice(n,3),n-=3),em(s)}}}function tm(){function e(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(D){return l=D})},focusReset:"manual",scroll:"manual"})}function t(){l!==null&&(l(),l=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,l=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),l!==null&&(l(),l=null)}}}function Eu(e){this._internalRoot=e}Ho.prototype.render=Eu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,n=di();G_(s,n,e,t,null,null)},Ho.prototype.unmount=Eu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;G_(e.current,2,null,e,null,null),go(),t[es]=null}};function Ho(e){this._internalRoot=e}Ho.prototype.unstable_scheduleHydration=function(e){if(e){var t=pn();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Fs.length&&t!==0&&t<Fs[s].priority;s++);Fs.splice(s,0,e),s===0&&J_(e)}};var im=r.version;if(im!=="19.2.4")throw Error(o(527,im,"19.2.4"));se.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=h(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var R0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Uo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Uo.isDisabled&&Uo.supportsFiber)try{vi=Uo.inject(R0),Dt=Uo}catch{}}return la.createRoot=function(e,t){if(!g(e))throw Error(o(299));var s=!1,n="",l=cd,_=ud,D=hd;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(_=t.onCaughtError),t.onRecoverableError!==void 0&&(D=t.onRecoverableError)),t=Z_(e,1,!1,null,null,s,n,null,l,_,D,tm),e[es]=t.current,au(e),new Eu(t)},la.hydrateRoot=function(e,t,s){if(!g(e))throw Error(o(299));var n=!1,l="",_=cd,D=ud,z=hd,Z=null;return s!=null&&(s.unstable_strictMode===!0&&(n=!0),s.identifierPrefix!==void 0&&(l=s.identifierPrefix),s.onUncaughtError!==void 0&&(_=s.onUncaughtError),s.onCaughtError!==void 0&&(D=s.onCaughtError),s.onRecoverableError!==void 0&&(z=s.onRecoverableError),s.formState!==void 0&&(Z=s.formState)),t=Z_(e,1,!0,t,s??null,n,l,Z,_,D,z,tm),t.context=q_(null),s=t.current,n=di(),n=Xt(n),l=Rs(n),l.callback=null,Ds(s,l,n),s=n,t.current.lanes=s,bs(t,s),Zi(t),e[es]=t.current,au(e),new Ho(t)},la.version="19.2.4",la}var fm;function I0(){if(fm)return Ru.exports;fm=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(),Ru.exports=U0(),Ru.exports}var P0=I0();const $0=lp(P0);/**
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 dm="popstate";function _m(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function F0(i={}){function r(o,g){var h;let x=(h=g.state)==null?void 0:h.masked,{pathname:T,search:c,hash:u}=x||o.location;return Yu("",{pathname:T,search:c,hash:u},g.state&&g.state.usr||null,g.state&&g.state.key||"default",x?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,g){return typeof g=="string"?g:ga(g)}return q0(r,a,null,i)}function ot(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function Yi(i,r){if(!i){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function Z0(){return Math.random().toString(36).substring(2,10)}function mm(i,r){return{usr:i.state,key:i.key,idx:r,masked:i.unstable_mask?{pathname:i.pathname,search:i.search,hash:i.hash}:void 0}}function Yu(i,r,a=null,o,g){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof r=="string"?on(r):r,state:a,key:r&&r.key||o||Z0(),unstable_mask:g}}function ga({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 q0(i,r,a,o={}){let{window:g=document.defaultView,v5Compat:x=!1}=o,T=g.history,c="POP",u=null,h=y();h==null&&(h=0,T.replaceState({...T.state,idx:h},""));function y(){return(T.state||{idx:null}).idx}function d(){c="POP";let m=y(),v=m==null?null:m-h;h=m,u&&u({action:c,location:b.location,delta:v})}function C(m,v){c="PUSH";let f=_m(m)?m:Yu(b.location,m,v);h=y()+1;let p=mm(f,h),S=b.createHref(f.unstable_mask||f);try{T.pushState(p,"",S)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;g.location.assign(S)}x&&u&&u({action:c,location:b.location,delta:1})}function w(m,v){c="REPLACE";let f=_m(m)?m:Yu(b.location,m,v);h=y();let p=mm(f,h),S=b.createHref(f.unstable_mask||f);T.replaceState(p,"",S),x&&u&&u({action:c,location:b.location,delta:0})}function k(m){return G0(m)}let b={get action(){return c},get location(){return i(g,T)},listen(m){if(u)throw new Error("A history only accepts one active listener");return g.addEventListener(dm,d),u=m,()=>{g.removeEventListener(dm,d),u=null}},createHref(m){return r(g,m)},createURL:k,encodeLocation(m){let v=k(m);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:C,replace:w,go(m){return T.go(m)}};return b}function G0(i,r=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),ot(a,"No window.location.(origin|href) available to create URL");let o=typeof i=="string"?i:ga(i);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function cp(i,r,a="/"){return W0(i,r,a,!1)}function W0(i,r,a,o){let g=typeof r=="string"?on(r):r,x=Ss(g.pathname||"/",a);if(x==null)return null;let T=up(i);Y0(T);let c=null;for(let u=0;c==null&&u<T.length;++u){let h=ny(x);c=sy(T[u],h,o)}return c}function up(i,r=[],a=[],o="",g=!1){let x=(T,c,u=g,h)=>{let y={relativePath:h===void 0?T.path||"":h,caseSensitive:T.caseSensitive===!0,childrenIndex:c,route:T};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&u)return;ot(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=Gi([o,y.relativePath]),C=a.concat(y);T.children&&T.children.length>0&&(ot(T.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),up(T.children,r,C,d,u)),!(T.path==null&&!T.index)&&r.push({path:d,score:ty(d,T.index),routesMeta:C})};return i.forEach((T,c)=>{var u;if(T.path===""||!((u=T.path)!=null&&u.includes("?")))x(T,c);else for(let h of hp(T.path))x(T,c,!0,h)}),r}function hp(i){let r=i.split("/");if(r.length===0)return[];let[a,...o]=r,g=a.endsWith("?"),x=a.replace(/\?$/,"");if(o.length===0)return g?[x,""]:[x];let T=hp(o.join("/")),c=[];return c.push(...T.map(u=>u===""?x:[x,u].join("/"))),g&&c.push(...T),c.map(u=>i.startsWith("/")&&u===""?"/":u)}function Y0(i){i.sort((r,a)=>r.score!==a.score?a.score-r.score:iy(r.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var V0=/^:[\w-]+$/,K0=3,X0=2,J0=1,Q0=10,ey=-2,pm=i=>i==="*";function ty(i,r){let a=i.split("/"),o=a.length;return a.some(pm)&&(o+=ey),r&&(o+=X0),a.filter(g=>!pm(g)).reduce((g,x)=>g+(V0.test(x)?K0:x===""?J0:Q0),o)}function iy(i,r){return i.length===r.length&&i.slice(0,-1).every((o,g)=>o===r[g])?i[i.length-1]-r[r.length-1]:0}function sy(i,r,a=!1){let{routesMeta:o}=i,g={},x="/",T=[];for(let c=0;c<o.length;++c){let u=o[c],h=c===o.length-1,y=x==="/"?r:r.slice(x.length)||"/",d=Qo({path:u.relativePath,caseSensitive:u.caseSensitive,end:h},y),C=u.route;if(!d&&h&&a&&!o[o.length-1].route.index&&(d=Qo({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},y)),!d)return null;Object.assign(g,d.params),T.push({params:g,pathname:Gi([x,d.pathname]),pathnameBase:cy(Gi([x,d.pathnameBase])),route:C}),d.pathnameBase!=="/"&&(x=Gi([x,d.pathnameBase]))}return T}function Qo(i,r){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[a,o]=ry(i.path,i.caseSensitive,i.end),g=r.match(a);if(!g)return null;let x=g[0],T=x.replace(/(.)\/+$/,"$1"),c=g.slice(1);return{params:o.reduce((h,{paramName:y,isOptional:d},C)=>{if(y==="*"){let k=c[C]||"";T=x.slice(0,x.length-k.length).replace(/(.)\/+$/,"$1")}const w=c[C];return d&&!w?h[y]=void 0:h[y]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:x,pathnameBase:T,pattern:i}}function ry(i,r=!1,a=!0){Yi(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let o=[],g="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(T,c,u,h,y)=>{if(o.push({paramName:c,isOptional:u!=null}),u){let d=y.charAt(h+T.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(o.push({paramName:"*"}),g+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?g+="\\/*$":i!==""&&i!=="/"&&(g+="(?:(?=\\/|$))"),[new RegExp(g,r?void 0:"i"),o]}function ny(i){try{return i.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Yi(!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 ay=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function oy(i,r="/"){let{pathname:a,search:o="",hash:g=""}=typeof i=="string"?on(i):i,x;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?x=vm(a.substring(1),"/"):x=vm(a,r)):x=r,{pathname:x,search:uy(o),hash:hy(g)}}function vm(i,r){let a=r.replace(/\/+$/,"").split("/");return i.split("/").forEach(g=>{g===".."?a.length>1&&a.pop():g!=="."&&a.push(g)}),a.length>1?a.join("/"):"/"}function Mu(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 ly(i){return i.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function fp(i){let r=ly(i);return r.map((a,o)=>o===r.length-1?a.pathname:a.pathnameBase)}function sh(i,r,a,o=!1){let g;typeof i=="string"?g=on(i):(g={...i},ot(!g.pathname||!g.pathname.includes("?"),Mu("?","pathname","search",g)),ot(!g.pathname||!g.pathname.includes("#"),Mu("#","pathname","hash",g)),ot(!g.search||!g.search.includes("#"),Mu("#","search","hash",g)));let x=i===""||g.pathname==="",T=x?"/":g.pathname,c;if(T==null)c=a;else{let d=r.length-1;if(!o&&T.startsWith("..")){let C=T.split("/");for(;C[0]==="..";)C.shift(),d-=1;g.pathname=C.join("/")}c=d>=0?r[d]:"/"}let u=oy(g,c),h=T&&T!=="/"&&T.endsWith("/"),y=(x||T===".")&&a.endsWith("/");return!u.pathname.endsWith("/")&&(h||y)&&(u.pathname+="/"),u}var Gi=i=>i.join("/").replace(/\/\/+/g,"/"),cy=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),uy=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,hy=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,fy=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 dy(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function _y(i){return i.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var dp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function _p(i,r){let a=i;if(typeof a!="string"||!ay.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,g=!1;if(dp)try{let x=new URL(window.location.href),T=a.startsWith("//")?new URL(x.protocol+a):new URL(a),c=Ss(T.pathname,r);T.origin===x.origin&&c!=null?a=c+T.search+T.hash:g=!0}catch{Yi(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:g,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var mp=["POST","PUT","PATCH","DELETE"];new Set(mp);var my=["GET",...mp];new Set(my);var ln=F.createContext(null);ln.displayName="DataRouter";var ol=F.createContext(null);ol.displayName="DataRouterState";var py=F.createContext(!1),pp=F.createContext({isTransitioning:!1});pp.displayName="ViewTransition";var vy=F.createContext(new Map);vy.displayName="Fetchers";var gy=F.createContext(null);gy.displayName="Await";var Oi=F.createContext(null);Oi.displayName="Navigation";var Sa=F.createContext(null);Sa.displayName="Location";var Hi=F.createContext({outlet:null,matches:[],isDataRoute:!1});Hi.displayName="Route";var rh=F.createContext(null);rh.displayName="RouteError";var vp="REACT_ROUTER_ERROR",yy="REDIRECT",Sy="ROUTE_ERROR_RESPONSE";function by(i){if(i.startsWith(`${vp}:${yy}:{`))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 Cy(i){if(i.startsWith(`${vp}:${Sy}:{`))try{let r=JSON.parse(i.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new fy(r.status,r.statusText,r.data)}catch{}}function xy(i,{relative:r}={}){ot(ba(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:o}=F.useContext(Oi),{hash:g,pathname:x,search:T}=Ca(i,{relative:r}),c=x;return a!=="/"&&(c=x==="/"?a:Gi([a,x])),o.createHref({pathname:c,search:T,hash:g})}function ba(){return F.useContext(Sa)!=null}function Ys(){return ot(ba(),"useLocation() may be used only in the context of a <Router> component."),F.useContext(Sa).location}var gp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function yp(i){F.useContext(Oi).static||F.useLayoutEffect(i)}function ll(){let{isDataRoute:i}=F.useContext(Hi);return i?Hy():wy()}function wy(){ot(ba(),"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(Hi),{pathname:g}=Ys(),x=JSON.stringify(fp(o)),T=F.useRef(!1);return yp(()=>{T.current=!0}),F.useCallback((u,h={})=>{if(Yi(T.current,gp),!T.current)return;if(typeof u=="number"){a.go(u);return}let y=sh(u,JSON.parse(x),g,h.relative==="path");i==null&&r!=="/"&&(y.pathname=y.pathname==="/"?r:Gi([r,y.pathname])),(h.replace?a.replace:a.push)(y,h.state,h)},[r,a,x,g,i])}var Ey=F.createContext(null);function Ty(i){let r=F.useContext(Hi).outlet;return F.useMemo(()=>r&&F.createElement(Ey.Provider,{value:i},r),[r,i])}function Sp(){let{matches:i}=F.useContext(Hi),r=i[i.length-1];return r?r.params:{}}function Ca(i,{relative:r}={}){let{matches:a}=F.useContext(Hi),{pathname:o}=Ys(),g=JSON.stringify(fp(a));return F.useMemo(()=>sh(i,JSON.parse(g),o,r==="path"),[i,g,o,r])}function Ay(i,r){return bp(i,r)}function bp(i,r,a){var m;ot(ba(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=F.useContext(Oi),{matches:g}=F.useContext(Hi),x=g[g.length-1],T=x?x.params:{},c=x?x.pathname:"/",u=x?x.pathnameBase:"/",h=x&&x.route;{let v=h&&h.path||"";xp(c,!h||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let y=Ys(),d;if(r){let v=typeof r=="string"?on(r):r;ot(u==="/"||((m=v.pathname)==null?void 0:m.startsWith(u)),`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 "${u}" but pathname "${v.pathname}" was given in the \`location\` prop.`),d=v}else d=y;let C=d.pathname||"/",w=C;if(u!=="/"){let v=u.replace(/^\//,"").split("/");w="/"+C.replace(/^\//,"").split("/").slice(v.length).join("/")}let k=cp(i,{pathname:w});Yi(h||k!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Yi(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 b=My(k&&k.map(v=>Object.assign({},v,{params:Object.assign({},T,v.params),pathname:Gi([u,o.encodeLocation?o.encodeLocation(v.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?u:Gi([u,o.encodeLocation?o.encodeLocation(v.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathnameBase])})),g,a);return r&&b?F.createElement(Sa.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...d},navigationType:"POP"}},b):b}function Ry(){let i=jy(),r=dy(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),a=i instanceof Error?i.stack:null,o="rgba(200,200,200, 0.5)",g={padding:"0.5rem",backgroundColor:o},x={padding:"2px 4px",backgroundColor:o},T=null;return console.error("Error handled by React Router default ErrorBoundary:",i),T=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:x},"ErrorBoundary")," or"," ",F.createElement("code",{style:x},"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:g},a):null,T)}var Dy=F.createElement(Ry,null),Cp=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=Cy(i.digest);a&&(i=a)}let r=i!==void 0?F.createElement(Hi.Provider,{value:this.props.routeContext},F.createElement(rh.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?F.createElement(ky,{error:i},r):r}};Cp.contextType=py;var Lu=new WeakMap;function ky({children:i,error:r}){let{basename:a}=F.useContext(Oi);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let o=by(r.digest);if(o){let g=Lu.get(r);if(g)throw g;let x=_p(o.location,a);if(dp&&!Lu.get(r))if(x.isExternal||o.reloadDocument)window.location.href=x.absoluteURL||x.to;else{const T=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(x.to,{replace:o.replace}));throw Lu.set(r,T),T}return F.createElement("meta",{httpEquiv:"refresh",content:`0;url=${x.absoluteURL||x.to}`})}}return i}function Oy({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(Hi.Provider,{value:i},a)}function My(i,r=[],a){let o=a==null?void 0:a.state;if(i==null){if(!o)return null;if(o.errors)i=o.matches;else if(r.length===0&&!o.initialized&&o.matches.length>0)i=o.matches;else return null}let g=i,x=o==null?void 0:o.errors;if(x!=null){let y=g.findIndex(d=>d.route.id&&(x==null?void 0:x[d.route.id])!==void 0);ot(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(x).join(",")}`),g=g.slice(0,Math.min(g.length,y+1))}let T=!1,c=-1;if(a&&o){T=o.renderFallback;for(let y=0;y<g.length;y++){let d=g[y];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=y),d.route.id){let{loaderData:C,errors:w}=o,k=d.route.loader&&!C.hasOwnProperty(d.route.id)&&(!w||w[d.route.id]===void 0);if(d.route.lazy||k){a.isStatic&&(T=!0),c>=0?g=g.slice(0,c+1):g=[g[0]];break}}}}let u=a==null?void 0:a.onError,h=o&&u?(y,d)=>{var C,w;u(y,{location:o.location,params:((w=(C=o.matches)==null?void 0:C[0])==null?void 0:w.params)??{},unstable_pattern:_y(o.matches),errorInfo:d})}:void 0;return g.reduceRight((y,d,C)=>{let w,k=!1,b=null,m=null;o&&(w=x&&d.route.id?x[d.route.id]:void 0,b=d.route.errorElement||Dy,T&&(c<0&&C===0?(xp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,m=null):c===C&&(k=!0,m=d.route.hydrateFallbackElement||null)));let v=r.concat(g.slice(0,C+1)),f=()=>{let p;return w?p=b:k?p=m:d.route.Component?p=F.createElement(d.route.Component,null):d.route.element?p=d.route.element:p=y,F.createElement(Oy,{match:d,routeContext:{outlet:y,matches:v,isDataRoute:o!=null},children:p})};return o&&(d.route.ErrorBoundary||d.route.errorElement||C===0)?F.createElement(Cp,{location:o.location,revalidation:o.revalidation,component:b,error:w,children:f(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:h}):f()},null)}function nh(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ly(i){let r=F.useContext(ln);return ot(r,nh(i)),r}function Ny(i){let r=F.useContext(ol);return ot(r,nh(i)),r}function By(i){let r=F.useContext(Hi);return ot(r,nh(i)),r}function ah(i){let r=By(i),a=r.matches[r.matches.length-1];return ot(a.route.id,`${i} can only be used on routes that contain a unique "id"`),a.route.id}function zy(){return ah("useRouteId")}function jy(){var o;let i=F.useContext(rh),r=Ny("useRouteError"),a=ah("useRouteError");return i!==void 0?i:(o=r.errors)==null?void 0:o[a]}function Hy(){let{router:i}=Ly("useNavigate"),r=ah("useNavigate"),a=F.useRef(!1);return yp(()=>{a.current=!0}),F.useCallback(async(g,x={})=>{Yi(a.current,gp),a.current&&(typeof g=="number"?await i.navigate(g):await i.navigate(g,{fromRouteId:r,...x}))},[i,r])}var gm={};function xp(i,r,a){!r&&!gm[i]&&(gm[i]=!0,Yi(!1,a))}F.memo(Uy);function Uy({routes:i,future:r,state:a,isStatic:o,onError:g}){return bp(i,void 0,{state:a,isStatic:o,onError:g})}function Iy(i){return Ty(i.context)}function en(i){ot(!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 Py({basename:i="/",children:r=null,location:a,navigationType:o="POP",navigator:g,static:x=!1,unstable_useTransitions:T}){ot(!ba(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=i.replace(/^\/*/,"/"),u=F.useMemo(()=>({basename:c,navigator:g,static:x,unstable_useTransitions:T,future:{}}),[c,g,x,T]);typeof a=="string"&&(a=on(a));let{pathname:h="/",search:y="",hash:d="",state:C=null,key:w="default",unstable_mask:k}=a,b=F.useMemo(()=>{let m=Ss(h,c);return m==null?null:{location:{pathname:m,search:y,hash:d,state:C,key:w,unstable_mask:k},navigationType:o}},[c,h,y,d,C,w,o,k]);return Yi(b!=null,`<Router basename="${c}"> is not able to match the URL "${h}${y}${d}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:F.createElement(Oi.Provider,{value:u},F.createElement(Sa.Provider,{children:r,value:b}))}function $y({children:i,location:r}){return Ay(Vu(i),r)}function Vu(i,r=[]){let a=[];return F.Children.forEach(i,(o,g)=>{if(!F.isValidElement(o))return;let x=[...r,g];if(o.type===F.Fragment){a.push.apply(a,Vu(o.props.children,x));return}ot(o.type===en,`[${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>`),ot(!o.props.index||!o.props.children,"An index route cannot have child routes.");let T={id:o.props.id||x.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&&(T.children=Vu(o.props.children,x)),a.push(T)}),a}var Vo="get",Ko="application/x-www-form-urlencoded";function cl(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function Fy(i){return cl(i)&&i.tagName.toLowerCase()==="button"}function Zy(i){return cl(i)&&i.tagName.toLowerCase()==="form"}function qy(i){return cl(i)&&i.tagName.toLowerCase()==="input"}function Gy(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function Wy(i,r){return i.button===0&&(!r||r==="_self")&&!Gy(i)}var Io=null;function Yy(){if(Io===null)try{new FormData(document.createElement("form"),0),Io=!1}catch{Io=!0}return Io}var Vy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Nu(i){return i!=null&&!Vy.has(i)?(Yi(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ko}"`),null):i}function Ky(i,r){let a,o,g,x,T;if(Zy(i)){let c=i.getAttribute("action");o=c?Ss(c,r):null,a=i.getAttribute("method")||Vo,g=Nu(i.getAttribute("enctype"))||Ko,x=new FormData(i)}else if(Fy(i)||qy(i)&&(i.type==="submit"||i.type==="image")){let c=i.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=i.getAttribute("formaction")||c.getAttribute("action");if(o=u?Ss(u,r):null,a=i.getAttribute("formmethod")||c.getAttribute("method")||Vo,g=Nu(i.getAttribute("formenctype"))||Nu(c.getAttribute("enctype"))||Ko,x=new FormData(c,i),!Yy()){let{name:h,type:y,value:d}=i;if(y==="image"){let C=h?`${h}.`:"";x.append(`${C}x`,"0"),x.append(`${C}y`,"0")}else h&&x.append(h,d)}}else{if(cl(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Vo,o=null,g=Ko,T=i}return x&&g==="text/plain"&&(T=x,x=void 0),{action:o,method:a.toLowerCase(),encType:g,formData:x,body:T}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function oh(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function Xy(i,r,a,o){let g=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return a?g.pathname.endsWith("/")?g.pathname=`${g.pathname}_.${o}`:g.pathname=`${g.pathname}.${o}`:g.pathname==="/"?g.pathname=`_root.${o}`:r&&Ss(g.pathname,r)==="/"?g.pathname=`${r.replace(/\/$/,"")}/_root.${o}`:g.pathname=`${g.pathname.replace(/\/$/,"")}.${o}`,g}async function Jy(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 Qy(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 eS(i,r,a){let o=await Promise.all(i.map(async g=>{let x=r.routes[g.route.id];if(x){let T=await Jy(x,a);return T.links?T.links():[]}return[]}));return rS(o.flat(1).filter(Qy).filter(g=>g.rel==="stylesheet"||g.rel==="preload").map(g=>g.rel==="stylesheet"?{...g,rel:"prefetch",as:"style"}:{...g,rel:"prefetch"}))}function ym(i,r,a,o,g,x){let T=(u,h)=>a[h]?u.route.id!==a[h].route.id:!0,c=(u,h)=>{var y;return a[h].pathname!==u.pathname||((y=a[h].route.path)==null?void 0:y.endsWith("*"))&&a[h].params["*"]!==u.params["*"]};return x==="assets"?r.filter((u,h)=>T(u,h)||c(u,h)):x==="data"?r.filter((u,h)=>{var d;let y=o.routes[u.route.id];if(!y||!y.hasLoader)return!1;if(T(u,h)||c(u,h))return!0;if(u.route.shouldRevalidate){let C=u.route.shouldRevalidate({currentUrl:new URL(g.pathname+g.search+g.hash,window.origin),currentParams:((d=a[0])==null?void 0:d.params)||{},nextUrl:new URL(i,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof C=="boolean")return C}return!0}):[]}function tS(i,r,{includeHydrateFallback:a}={}){return iS(i.map(o=>{let g=r.routes[o.route.id];if(!g)return[];let x=[g.module];return g.clientActionModule&&(x=x.concat(g.clientActionModule)),g.clientLoaderModule&&(x=x.concat(g.clientLoaderModule)),a&&g.hydrateFallbackModule&&(x=x.concat(g.hydrateFallbackModule)),g.imports&&(x=x.concat(g.imports)),x}).flat(1))}function iS(i){return[...new Set(i)]}function sS(i){let r={},a=Object.keys(i).sort();for(let o of a)r[o]=i[o];return r}function rS(i,r){let a=new Set;return new Set(r),i.reduce((o,g)=>{let x=JSON.stringify(sS(g));return a.has(x)||(a.add(x),o.push({key:x,link:g})),o},[])}function wp(){let i=F.useContext(ln);return oh(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function nS(){let i=F.useContext(ol);return oh(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var lh=F.createContext(void 0);lh.displayName="FrameworkContext";function Ep(){let i=F.useContext(lh);return oh(i,"You must render this element inside a <HydratedRouter> element"),i}function aS(i,r){let a=F.useContext(lh),[o,g]=F.useState(!1),[x,T]=F.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:h,onMouseLeave:y,onTouchStart:d}=r,C=F.useRef(null);F.useEffect(()=>{if(i==="render"&&T(!0),i==="viewport"){let b=v=>{v.forEach(f=>{T(f.isIntersecting)})},m=new IntersectionObserver(b,{threshold:.5});return C.current&&m.observe(C.current),()=>{m.disconnect()}}},[i]),F.useEffect(()=>{if(o){let b=setTimeout(()=>{T(!0)},100);return()=>{clearTimeout(b)}}},[o]);let w=()=>{g(!0)},k=()=>{g(!1),T(!1)};return a?i!=="intent"?[x,C,{}]:[x,C,{onFocus:ca(c,w),onBlur:ca(u,k),onMouseEnter:ca(h,w),onMouseLeave:ca(y,k),onTouchStart:ca(d,w)}]:[!1,C,{}]}function ca(i,r){return a=>{i&&i(a),a.defaultPrevented||r(a)}}function oS({page:i,...r}){let{router:a}=wp(),o=F.useMemo(()=>cp(a.routes,i,a.basename),[a.routes,i,a.basename]);return o?F.createElement(cS,{page:i,matches:o,...r}):null}function lS(i){let{manifest:r,routeModules:a}=Ep(),[o,g]=F.useState([]);return F.useEffect(()=>{let x=!1;return eS(i,r,a).then(T=>{x||g(T)}),()=>{x=!0}},[i,r,a]),o}function cS({page:i,matches:r,...a}){let o=Ys(),{future:g,manifest:x,routeModules:T}=Ep(),{basename:c}=wp(),{loaderData:u,matches:h}=nS(),y=F.useMemo(()=>ym(i,r,h,x,o,"data"),[i,r,h,x,o]),d=F.useMemo(()=>ym(i,r,h,x,o,"assets"),[i,r,h,x,o]),C=F.useMemo(()=>{if(i===o.pathname+o.search+o.hash)return[];let b=new Set,m=!1;if(r.forEach(f=>{var S;let p=x.routes[f.route.id];!p||!p.hasLoader||(!y.some(A=>A.route.id===f.route.id)&&f.route.id in u&&((S=T[f.route.id])!=null&&S.shouldRevalidate)||p.hasClientLoader?m=!0:b.add(f.route.id))}),b.size===0)return[];let v=Xy(i,c,g.unstable_trailingSlashAwareDataRequests,"data");return m&&b.size>0&&v.searchParams.set("_routes",r.filter(f=>b.has(f.route.id)).map(f=>f.route.id).join(",")),[v.pathname+v.search]},[c,g.unstable_trailingSlashAwareDataRequests,u,o,x,y,r,i,T]),w=F.useMemo(()=>tS(d,x),[d,x]),k=lS(d);return F.createElement(F.Fragment,null,C.map(b=>F.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...a})),w.map(b=>F.createElement("link",{key:b,rel:"modulepreload",href:b,...a})),k.map(({key:b,link:m})=>F.createElement("link",{key:b,nonce:a.nonce,...m,crossOrigin:m.crossOrigin??a.crossOrigin})))}function uS(...i){return r=>{i.forEach(a=>{typeof a=="function"?a(r):a!=null&&(a.current=r)})}}var hS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{hS&&(window.__reactRouterVersion="7.13.2")}catch{}function fS({basename:i,children:r,unstable_useTransitions:a,window:o}){let g=F.useRef();g.current==null&&(g.current=F0({window:o,v5Compat:!0}));let x=g.current,[T,c]=F.useState({action:x.action,location:x.location}),u=F.useCallback(h=>{a===!1?c(h):F.startTransition(()=>c(h))},[a]);return F.useLayoutEffect(()=>x.listen(u),[x,u]),F.createElement(Py,{basename:i,children:r,location:T.location,navigationType:T.action,navigator:x,unstable_useTransitions:a})}var Tp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wi=F.forwardRef(function({onClick:r,discover:a="render",prefetch:o="none",relative:g,reloadDocument:x,replace:T,unstable_mask:c,state:u,target:h,to:y,preventScrollReset:d,viewTransition:C,unstable_defaultShouldRevalidate:w,...k},b){let{basename:m,navigator:v,unstable_useTransitions:f}=F.useContext(Oi),p=typeof y=="string"&&Tp.test(y),S=_p(y,m);y=S.to;let A=xy(y,{relative:g}),R=Ys(),M=null;if(c){let te=sh(c,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);m!=="/"&&(te.pathname=te.pathname==="/"?m:Gi([m,te.pathname])),M=v.createHref(te)}let[E,B,$]=aS(o,k),I=mS(y,{replace:T,unstable_mask:c,state:u,target:h,preventScrollReset:d,relative:g,viewTransition:C,unstable_defaultShouldRevalidate:w,unstable_useTransitions:f});function q(te){r&&r(te),te.defaultPrevented||I(te)}let P=!(S.isExternal||x),J=F.createElement("a",{...k,...$,href:(P?M:void 0)||S.absoluteURL||A,onClick:P?q:r,ref:uS(b,B),target:h,"data-discover":!p&&a==="render"?"true":void 0});return E&&!p?F.createElement(F.Fragment,null,J,F.createElement(oS,{page:A})):J});Wi.displayName="Link";var Ap=F.forwardRef(function({"aria-current":r="page",caseSensitive:a=!1,className:o="",end:g=!1,style:x,to:T,viewTransition:c,children:u,...h},y){let d=Ca(T,{relative:h.relative}),C=Ys(),w=F.useContext(ol),{navigator:k,basename:b}=F.useContext(Oi),m=w!=null&&SS(d)&&c===!0,v=k.encodeLocation?k.encodeLocation(d).pathname:d.pathname,f=C.pathname,p=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;a||(f=f.toLowerCase(),p=p?p.toLowerCase():null,v=v.toLowerCase()),p&&b&&(p=Ss(p,b)||p);const S=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let A=f===v||!g&&f.startsWith(v)&&f.charAt(S)==="/",R=p!=null&&(p===v||!g&&p.startsWith(v)&&p.charAt(v.length)==="/"),M={isActive:A,isPending:R,isTransitioning:m},E=A?r:void 0,B;typeof o=="function"?B=o(M):B=[o,A?"active":null,R?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let $=typeof x=="function"?x(M):x;return F.createElement(Wi,{...h,"aria-current":E,className:B,ref:y,style:$,to:T,viewTransition:c},typeof u=="function"?u(M):u)});Ap.displayName="NavLink";var dS=F.forwardRef(({discover:i="render",fetcherKey:r,navigate:a,reloadDocument:o,replace:g,state:x,method:T=Vo,action:c,onSubmit:u,relative:h,preventScrollReset:y,viewTransition:d,unstable_defaultShouldRevalidate:C,...w},k)=>{let{unstable_useTransitions:b}=F.useContext(Oi),m=gS(),v=yS(c,{relative:h}),f=T.toLowerCase()==="get"?"get":"post",p=typeof c=="string"&&Tp.test(c),S=A=>{if(u&&u(A),A.defaultPrevented)return;A.preventDefault();let R=A.nativeEvent.submitter,M=(R==null?void 0:R.getAttribute("formmethod"))||T,E=()=>m(R||A.currentTarget,{fetcherKey:r,method:M,navigate:a,replace:g,state:x,relative:h,preventScrollReset:y,viewTransition:d,unstable_defaultShouldRevalidate:C});b&&a!==!1?F.startTransition(()=>E()):E()};return F.createElement("form",{ref:k,method:f,action:v,onSubmit:o?u:S,...w,"data-discover":!p&&i==="render"?"true":void 0})});dS.displayName="Form";function _S(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Rp(i){let r=F.useContext(ln);return ot(r,_S(i)),r}function mS(i,{target:r,replace:a,unstable_mask:o,state:g,preventScrollReset:x,relative:T,viewTransition:c,unstable_defaultShouldRevalidate:u,unstable_useTransitions:h}={}){let y=ll(),d=Ys(),C=Ca(i,{relative:T});return F.useCallback(w=>{if(Wy(w,r)){w.preventDefault();let k=a!==void 0?a:ga(d)===ga(C),b=()=>y(i,{replace:k,unstable_mask:o,state:g,preventScrollReset:x,relative:T,viewTransition:c,unstable_defaultShouldRevalidate:u});h?F.startTransition(()=>b()):b()}},[d,y,C,a,o,g,r,i,x,T,c,u,h])}var pS=0,vS=()=>`__${String(++pS)}__`;function gS(){let{router:i}=Rp("useSubmit"),{basename:r}=F.useContext(Oi),a=zy(),o=i.fetch,g=i.navigate;return F.useCallback(async(x,T={})=>{let{action:c,method:u,encType:h,formData:y,body:d}=Ky(x,r);if(T.navigate===!1){let C=T.fetcherKey||vS();await o(C,a,T.action||c,{unstable_defaultShouldRevalidate:T.unstable_defaultShouldRevalidate,preventScrollReset:T.preventScrollReset,formData:y,body:d,formMethod:T.method||u,formEncType:T.encType||h,flushSync:T.flushSync})}else await g(T.action||c,{unstable_defaultShouldRevalidate:T.unstable_defaultShouldRevalidate,preventScrollReset:T.preventScrollReset,formData:y,body:d,formMethod:T.method||u,formEncType:T.encType||h,replace:T.replace,state:T.state,fromRouteId:a,flushSync:T.flushSync,viewTransition:T.viewTransition})},[o,g,r,a])}function yS(i,{relative:r}={}){let{basename:a}=F.useContext(Oi),o=F.useContext(Hi);ot(o,"useFormAction must be used inside a RouteContext");let[g]=o.matches.slice(-1),x={...Ca(i||".",{relative:r})},T=Ys();if(i==null){x.search=T.search;let c=new URLSearchParams(x.search),u=c.getAll("index");if(u.some(y=>y==="")){c.delete("index"),u.filter(d=>d).forEach(d=>c.append("index",d));let y=c.toString();x.search=y?`?${y}`:""}}return(!i||i===".")&&g.route.index&&(x.search=x.search?x.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(x.pathname=x.pathname==="/"?a:Gi([a,x.pathname])),ga(x)}function SS(i,{relative:r}={}){let a=F.useContext(pp);ot(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=Rp("useViewTransitionState"),g=Ca(i,{relative:r});if(!a.isTransitioning)return!1;let x=Ss(a.currentLocation.pathname,o)||a.currentLocation.pathname,T=Ss(a.nextLocation.pathname,o)||a.nextLocation.pathname;return Qo(g.pathname,T)!=null||Qo(g.pathname,x)!=null}class bS extends F.Component{constructor(){super(...arguments);At(this,"state",{hasError:!1,error:null});At(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?O.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-center px-4",children:[O.jsx("div",{className:"text-6xl mb-4",children:"⚠"}),O.jsx("h1",{className:"text-lg text-[#e0e0e0] mb-2",children:"Something went wrong"}),O.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."}),O.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 CS=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Dp=(...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 xS={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 wS=F.forwardRef(({color:i="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:g="",children:x,iconNode:T,...c},u)=>F.createElement("svg",{ref:u,...xS,width:r,height:r,stroke:i,strokeWidth:o?Number(a)*24/Number(r):a,className:Dp("lucide",g),...c},[...T.map(([h,y])=>F.createElement(h,y)),...Array.isArray(x)?x:[x]]));/**
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 Qe=(i,r)=>{const a=F.forwardRef(({className:o,...g},x)=>F.createElement(wS,{ref:x,iconNode:r,className:Dp(`lucide-${CS(i)}`,o),...g}));return a.displayName=`${i}`,a};/**
81
+ * @license lucide-react v0.474.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const ES=[["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"}]],kp=Qe("Activity",ES);/**
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 TS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],Sm=Qe("Ban",TS);/**
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 AS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],bm=Qe("CircleCheck",AS);/**
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 RS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],DS=Qe("CirclePlus",RS);/**
101
+ * @license lucide-react v0.474.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const kS=[["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"}]],Po=Qe("CircleX",kS);/**
106
+ * @license lucide-react v0.474.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const OS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],MS=Qe("Clock",OS);/**
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 LS=[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]],NS=Qe("CornerDownLeft",LS);/**
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 BS=[["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"}]],zS=Qe("Layers",BS);/**
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 jS=[["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"}]],HS=Qe("LayoutDashboard",jS);/**
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 US=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ku=Qe("LoaderCircle",US);/**
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 IS=[["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"}]],PS=Qe("MessageSquare",IS);/**
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 $S=[["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"}]],FS=Qe("Octagon",$S);/**
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 ZS=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Cm=Qe("Play",ZS);/**
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 qS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ul=Qe("Plus",qS);/**
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 GS=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],WS=Qe("Power",GS);/**
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 YS=[["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"}]],VS=Qe("RefreshCw",YS);/**
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 KS=[["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"}]],XS=Qe("Send",KS);/**
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 JS=[["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"}]],QS=Qe("ShieldAlert",JS);/**
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 eb=[["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"}]],tb=Qe("Shield",eb);/**
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 ib=[["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"}]],sb=Qe("Skull",ib);/**
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 rb=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],nb=Qe("Terminal",rb);/**
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 ab=[["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"}]],Op=Qe("Trash2",ab);/**
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 ob=[["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"}]],lb=Qe("TriangleAlert",ob);/**
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 cb=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]],ub=Qe("UserCheck",cb);/**
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 hb=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["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"}]],fb=Qe("Users",hb);/**
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 db=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],hl=Qe("X",db);/**
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 _b=[["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"}]],mb=Qe("Zap",_b),xm=i=>{let r;const a=new Set,o=(h,y)=>{const d=typeof h=="function"?h(r):h;if(!Object.is(d,r)){const C=r;r=y??(typeof d!="object"||d===null)?d:Object.assign({},r,d),a.forEach(w=>w(r,C))}},g=()=>r,c={setState:o,getState:g,getInitialState:()=>u,subscribe:h=>(a.add(h),()=>a.delete(h))},u=r=i(o,g,c);return c},pb=(i=>i?xm(i):xm),vb=i=>i;function gb(i,r=vb){const a=pa.useSyncExternalStore(i.subscribe,pa.useCallback(()=>r(i.getState()),[i,r]),pa.useCallback(()=>r(i.getInitialState()),[i,r]));return pa.useDebugValue(a),a}const wm=i=>{const r=pb(i),a=o=>gb(r,o);return Object.assign(a,r),a},Mp=(i=>i?wm(i):wm),Mt=Mp(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}),activities:[],addActivity:r=>i(a=>({activities:[r,...a.activities].slice(0,200)})),clearActivities:()=>i({activities:[]}),activityFilterSession:null,setActivityFilterSession:r=>i({activityFilterSession:r}),activityFilterType:null,setActivityFilterType:r=>i({activityFilterType:r})}));function fe(i,r,a){function o(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:T,traits:new Set},enumerable:!1}),c._zod.traits.has(i))return;c._zod.traits.add(i),r(c,u);const h=T.prototype,y=Object.keys(h);for(let d=0;d<y.length;d++){const C=y[d];C in c||(c[C]=h[C].bind(c))}}const g=(a==null?void 0:a.Parent)??Object;class x extends g{}Object.defineProperty(x,"name",{value:i});function T(c){var u;const h=a!=null&&a.Parent?new x:this;o(h,c),(u=h._zod).deferred??(u.deferred=[]);for(const y of h._zod.deferred)y();return h}return Object.defineProperty(T,"init",{value:o}),Object.defineProperty(T,Symbol.hasInstance,{value:c=>{var u,h;return a!=null&&a.Parent&&c instanceof a.Parent?!0:(h=(u=c==null?void 0:c._zod)==null?void 0:u.traits)==null?void 0:h.has(i)}}),Object.defineProperty(T,"name",{value:i}),T}class rn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Lp extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const Np={};function Gs(i){return Np}function Bp(i){const r=Object.values(i).filter(o=>typeof o=="number");return Object.entries(i).filter(([o,g])=>r.indexOf(+o)===-1).map(([o,g])=>g)}function Xu(i,r){return typeof r=="bigint"?r.toString():r}function ch(i){return{get value(){{const r=i();return Object.defineProperty(this,"value",{value:r}),r}}}}function uh(i){return i==null}function hh(i){const r=i.startsWith("^")?1:0,a=i.endsWith("$")?i.length-1:i.length;return i.slice(r,a)}function yb(i,r){const a=(i.toString().split(".")[1]||"").length,o=r.toString();let g=(o.split(".")[1]||"").length;if(g===0&&/\d?e-\d?/.test(o)){const u=o.match(/\d?e-(\d?)/);u!=null&&u[1]&&(g=Number.parseInt(u[1]))}const x=a>g?a:g,T=Number.parseInt(i.toFixed(x).replace(".","")),c=Number.parseInt(r.toFixed(x).replace(".",""));return T%c/10**x}const Em=Symbol("evaluating");function We(i,r,a){let o;Object.defineProperty(i,r,{get(){if(o!==Em)return o===void 0&&(o=Em,o=a()),o},set(g){Object.defineProperty(i,r,{value:g})},configurable:!0})}function vr(i,r,a){Object.defineProperty(i,r,{value:a,writable:!0,enumerable:!0,configurable:!0})}function Vs(...i){const r={};for(const a of i){const o=Object.getOwnPropertyDescriptors(a);Object.assign(r,o)}return Object.defineProperties({},r)}function Tm(i){return JSON.stringify(i)}function Sb(i){return i.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const zp="captureStackTrace"in Error?Error.captureStackTrace:(...i)=>{};function el(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}const bb=ch(()=>{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(el(i)===!1)return!1;const r=i.constructor;if(r===void 0||typeof r!="function")return!0;const a=r.prototype;return!(el(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function jp(i){return nn(i)?{...i}:Array.isArray(i)?[...i]:i}const Cb=new Set(["string","number","symbol"]);function fl(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ks(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 xe(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 xb(i){return Object.keys(i).filter(r=>i[r]._zod.optin==="optional"&&i[r]._zod.optout==="optional")}const wb={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 Eb(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 x=Vs(i._zod.def,{get shape(){const T={};for(const c in r){if(!(c in a.shape))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(T[c]=a.shape[c])}return vr(this,"shape",T),T},checks:[]});return Ks(i,x)}function Tb(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 x=Vs(i._zod.def,{get shape(){const T={...i._zod.def.shape};for(const c in r){if(!(c in a.shape))throw new Error(`Unrecognized key: "${c}"`);r[c]&&delete T[c]}return vr(this,"shape",T),T},checks:[]});return Ks(i,x)}function Ab(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 x=i._zod.def.shape;for(const T in r)if(Object.getOwnPropertyDescriptor(x,T)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const g=Vs(i._zod.def,{get shape(){const x={...i._zod.def.shape,...r};return vr(this,"shape",x),x}});return Ks(i,g)}function Rb(i,r){if(!nn(r))throw new Error("Invalid input to safeExtend: expected a plain object");const a=Vs(i._zod.def,{get shape(){const o={...i._zod.def.shape,...r};return vr(this,"shape",o),o}});return Ks(i,a)}function Db(i,r){const a=Vs(i._zod.def,{get shape(){const o={...i._zod.def.shape,...r._zod.def.shape};return vr(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:[]});return Ks(i,a)}function kb(i,r,a){const g=r._zod.def.checks;if(g&&g.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const T=Vs(r._zod.def,{get shape(){const c=r._zod.def.shape,u={...c};if(a)for(const h in a){if(!(h in c))throw new Error(`Unrecognized key: "${h}"`);a[h]&&(u[h]=i?new i({type:"optional",innerType:c[h]}):c[h])}else for(const h in c)u[h]=i?new i({type:"optional",innerType:c[h]}):c[h];return vr(this,"shape",u),u},checks:[]});return Ks(r,T)}function Ob(i,r,a){const o=Vs(r._zod.def,{get shape(){const g=r._zod.def.shape,x={...g};if(a)for(const T in a){if(!(T in x))throw new Error(`Unrecognized key: "${T}"`);a[T]&&(x[T]=new i({type:"nonoptional",innerType:g[T]}))}else for(const T in g)x[T]=new i({type:"nonoptional",innerType:g[T]});return vr(this,"shape",x),x}});return Ks(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 $o(i){return typeof i=="string"?i:i==null?void 0:i.message}function Ws(i,r,a){var g,x,T,c,u,h;const o={...i,path:i.path??[]};if(!i.message){const y=$o((T=(x=(g=i.inst)==null?void 0:g._zod.def)==null?void 0:x.error)==null?void 0:T.call(x,i))??$o((c=r==null?void 0:r.error)==null?void 0:c.call(r,i))??$o((u=a.customError)==null?void 0:u.call(a,i))??$o((h=a.localeError)==null?void 0:h.call(a,i))??"Invalid input";o.message=y}return delete o.inst,delete o.continue,r!=null&&r.reportInput||delete o.input,o}function fh(i){return Array.isArray(i)?"array":typeof i=="string"?"string":"unknown"}function ya(...i){const[r,a,o]=i;return typeof r=="string"?{message:r,code:"custom",input:a,inst:o}:{...r}}const Hp=(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,Xu,2),Object.defineProperty(i,"toString",{value:()=>i.message,enumerable:!1})},Up=fe("$ZodError",Hp),Ip=fe("$ZodError",Hp,{Parent:Error});function Mb(i,r=a=>a.message){const a={},o=[];for(const g of i.issues)g.path.length>0?(a[g.path[0]]=a[g.path[0]]||[],a[g.path[0]].push(r(g))):o.push(r(g));return{formErrors:o,fieldErrors:a}}function Lb(i,r=a=>a.message){const a={_errors:[]},o=g=>{for(const x of g.issues)if(x.code==="invalid_union"&&x.errors.length)x.errors.map(T=>o({issues:T}));else if(x.code==="invalid_key")o({issues:x.issues});else if(x.code==="invalid_element")o({issues:x.issues});else if(x.path.length===0)a._errors.push(r(x));else{let T=a,c=0;for(;c<x.path.length;){const u=x.path[c];c===x.path.length-1?(T[u]=T[u]||{_errors:[]},T[u]._errors.push(r(x))):T[u]=T[u]||{_errors:[]},T=T[u],c++}}};return o(i),a}const dh=i=>(r,a,o,g)=>{const x=o?Object.assign(o,{async:!1}):{async:!1},T=r._zod.run({value:a,issues:[]},x);if(T instanceof Promise)throw new rn;if(T.issues.length){const c=new((g==null?void 0:g.Err)??i)(T.issues.map(u=>Ws(u,x,Gs())));throw zp(c,g==null?void 0:g.callee),c}return T.value},_h=i=>async(r,a,o,g)=>{const x=o?Object.assign(o,{async:!0}):{async:!0};let T=r._zod.run({value:a,issues:[]},x);if(T instanceof Promise&&(T=await T),T.issues.length){const c=new((g==null?void 0:g.Err)??i)(T.issues.map(u=>Ws(u,x,Gs())));throw zp(c,g==null?void 0:g.callee),c}return T.value},dl=i=>(r,a,o)=>{const g=o?{...o,async:!1}:{async:!1},x=r._zod.run({value:a,issues:[]},g);if(x instanceof Promise)throw new rn;return x.issues.length?{success:!1,error:new(i??Up)(x.issues.map(T=>Ws(T,g,Gs())))}:{success:!0,data:x.value}},Nb=dl(Ip),_l=i=>async(r,a,o)=>{const g=o?Object.assign(o,{async:!0}):{async:!0};let x=r._zod.run({value:a,issues:[]},g);return x instanceof Promise&&(x=await x),x.issues.length?{success:!1,error:new i(x.issues.map(T=>Ws(T,g,Gs())))}:{success:!0,data:x.value}},Bb=_l(Ip),zb=i=>(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return dh(i)(r,a,g)},jb=i=>(r,a,o)=>dh(i)(r,a,o),Hb=i=>async(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return _h(i)(r,a,g)},Ub=i=>async(r,a,o)=>_h(i)(r,a,o),Ib=i=>(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return dl(i)(r,a,g)},Pb=i=>(r,a,o)=>dl(i)(r,a,o),$b=i=>async(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return _l(i)(r,a,g)},Fb=i=>async(r,a,o)=>_l(i)(r,a,o),Zb=/^[cC][^\s-]{8,}$/,qb=/^[0-9a-z]+$/,Gb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Wb=/^[0-9a-vA-V]{20}$/,Yb=/^[A-Za-z0-9]{27}$/,Vb=/^[a-zA-Z0-9_-]{21}$/,Kb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Xb=/^([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})$/,Am=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)$/,Jb=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Qb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function e1(){return new RegExp(Qb,"u")}const t1=/^(?:(?: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])$/,i1=/^(([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}|:))$/,s1=/^((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])$/,r1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,n1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Pp=/^[A-Za-z0-9_-]*$/,a1=/^\+[1-9]\d{6,14}$/,$p="(?:(?:\\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])))",o1=new RegExp(`^${$p}$`);function Fp(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 l1(i){return new RegExp(`^${Fp(i)}$`)}function c1(i){const r=Fp({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(`^${$p}T(?:${o})$`)}const u1=i=>{const r=i?`[\\s\\S]{${(i==null?void 0:i.minimum)??0},${(i==null?void 0:i.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},h1=/^-?\d+$/,Zp=/^-?\d+(?:\.\d+)?$/,f1=/^(?:true|false)$/i,d1=/^[^A-Z]*$/,_1=/^[^a-z]*$/,ni=fe("$ZodCheck",(i,r)=>{var a;i._zod??(i._zod={}),i._zod.def=r,(a=i._zod).onattach??(a.onattach=[])}),qp={number:"number",bigint:"bigint",object:"date"},Gp=fe("$ZodCheckLessThan",(i,r)=>{ni.init(i,r);const a=qp[typeof r.value];i._zod.onattach.push(o=>{const g=o._zod.bag,x=(r.inclusive?g.maximum:g.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<x&&(r.inclusive?g.maximum=r.value:g.exclusiveMaximum=r.value)}),i._zod.check=o=>{(r.inclusive?o.value<=r.value:o.value<r.value)||o.issues.push({origin:a,code:"too_big",maximum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:i,continue:!r.abort})}}),Wp=fe("$ZodCheckGreaterThan",(i,r)=>{ni.init(i,r);const a=qp[typeof r.value];i._zod.onattach.push(o=>{const g=o._zod.bag,x=(r.inclusive?g.minimum:g.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>x&&(r.inclusive?g.minimum=r.value:g.exclusiveMinimum=r.value)}),i._zod.check=o=>{(r.inclusive?o.value>=r.value:o.value>r.value)||o.issues.push({origin:a,code:"too_small",minimum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:i,continue:!r.abort})}}),m1=fe("$ZodCheckMultipleOf",(i,r)=>{ni.init(i,r),i._zod.onattach.push(a=>{var o;(o=a._zod.bag).multipleOf??(o.multipleOf=r.value)}),i._zod.check=a=>{if(typeof a.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof a.value=="bigint"?a.value%r.value===BigInt(0):yb(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})}}),p1=fe("$ZodCheckNumberFormat",(i,r)=>{var T;ni.init(i,r),r.format=r.format||"float64";const a=(T=r.format)==null?void 0:T.includes("int"),o=a?"int":"number",[g,x]=wb[r.format];i._zod.onattach.push(c=>{const u=c._zod.bag;u.format=r.format,u.minimum=g,u.maximum=x,a&&(u.pattern=h1)}),i._zod.check=c=>{const u=c.value;if(a){if(!Number.isInteger(u)){c.issues.push({expected:o,format:r.format,code:"invalid_type",continue:!1,input:u,inst:i});return}if(!Number.isSafeInteger(u)){u>0?c.issues.push({input:u,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}):c.issues.push({input:u,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}}u<g&&c.issues.push({origin:"number",input:u,code:"too_small",minimum:g,inclusive:!0,inst:i,continue:!r.abort}),u>x&&c.issues.push({origin:"number",input:u,code:"too_big",maximum:x,inclusive:!0,inst:i,continue:!r.abort})}}),v1=fe("$ZodCheckMaxLength",(i,r)=>{var a;ni.init(i,r),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!uh(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<g&&(o._zod.bag.maximum=r.maximum)}),i._zod.check=o=>{const g=o.value;if(g.length<=r.maximum)return;const T=fh(g);o.issues.push({origin:T,code:"too_big",maximum:r.maximum,inclusive:!0,input:g,inst:i,continue:!r.abort})}}),g1=fe("$ZodCheckMinLength",(i,r)=>{var a;ni.init(i,r),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!uh(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>g&&(o._zod.bag.minimum=r.minimum)}),i._zod.check=o=>{const g=o.value;if(g.length>=r.minimum)return;const T=fh(g);o.issues.push({origin:T,code:"too_small",minimum:r.minimum,inclusive:!0,input:g,inst:i,continue:!r.abort})}}),y1=fe("$ZodCheckLengthEquals",(i,r)=>{var a;ni.init(i,r),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!uh(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag;g.minimum=r.length,g.maximum=r.length,g.length=r.length}),i._zod.check=o=>{const g=o.value,x=g.length;if(x===r.length)return;const T=fh(g),c=x>r.length;o.issues.push({origin:T,...c?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:i,continue:!r.abort})}}),ml=fe("$ZodCheckStringFormat",(i,r)=>{var a,o;ni.init(i,r),i._zod.onattach.push(g=>{const x=g._zod.bag;x.format=r.format,r.pattern&&(x.patterns??(x.patterns=new Set),x.patterns.add(r.pattern))}),r.pattern?(a=i._zod).check??(a.check=g=>{r.pattern.lastIndex=0,!r.pattern.test(g.value)&&g.issues.push({origin:"string",code:"invalid_format",format:r.format,input:g.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:i,continue:!r.abort})}):(o=i._zod).check??(o.check=()=>{})}),S1=fe("$ZodCheckRegex",(i,r)=>{ml.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})}}),b1=fe("$ZodCheckLowerCase",(i,r)=>{r.pattern??(r.pattern=d1),ml.init(i,r)}),C1=fe("$ZodCheckUpperCase",(i,r)=>{r.pattern??(r.pattern=_1),ml.init(i,r)}),x1=fe("$ZodCheckIncludes",(i,r)=>{ni.init(i,r);const a=fl(r.includes),o=new RegExp(typeof r.position=="number"?`^.{${r.position}}${a}`:a);r.pattern=o,i._zod.onattach.push(g=>{const x=g._zod.bag;x.patterns??(x.patterns=new Set),x.patterns.add(o)}),i._zod.check=g=>{g.value.includes(r.includes,r.position)||g.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:g.value,inst:i,continue:!r.abort})}}),w1=fe("$ZodCheckStartsWith",(i,r)=>{ni.init(i,r);const a=new RegExp(`^${fl(r.prefix)}.*`);r.pattern??(r.pattern=a),i._zod.onattach.push(o=>{const g=o._zod.bag;g.patterns??(g.patterns=new Set),g.patterns.add(a)}),i._zod.check=o=>{o.value.startsWith(r.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:o.value,inst:i,continue:!r.abort})}}),E1=fe("$ZodCheckEndsWith",(i,r)=>{ni.init(i,r);const a=new RegExp(`.*${fl(r.suffix)}$`);r.pattern??(r.pattern=a),i._zod.onattach.push(o=>{const g=o._zod.bag;g.patterns??(g.patterns=new Set),g.patterns.add(a)}),i._zod.check=o=>{o.value.endsWith(r.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:o.value,inst:i,continue:!r.abort})}}),T1=fe("$ZodCheckOverwrite",(i,r)=>{ni.init(i,r),i._zod.check=a=>{a.value=r.tx(a.value)}});class A1{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(`
216
+ `).filter(T=>T),g=Math.min(...o.map(T=>T.length-T.trimStart().length)),x=o.map(T=>T.slice(g)).map(T=>" ".repeat(this.indent*2)+T);for(const T of x)this.content.push(T)}compile(){const r=Function,a=this==null?void 0:this.args,g=[...((this==null?void 0:this.content)??[""]).map(x=>` ${x}`)];return new r(...a,g.join(`
217
+ `))}}const R1={major:4,minor:3,patch:6},ft=fe("$ZodType",(i,r)=>{var g;var a;i??(i={}),i._zod.def=r,i._zod.bag=i._zod.bag||{},i._zod.version=R1;const o=[...i._zod.def.checks??[]];i._zod.traits.has("$ZodCheck")&&o.unshift(i);for(const x of o)for(const T of x._zod.onattach)T(i);if(o.length===0)(a=i._zod).deferred??(a.deferred=[]),(g=i._zod.deferred)==null||g.push(()=>{i._zod.run=i._zod.parse});else{const x=(c,u,h)=>{let y=tn(c),d;for(const C of u){if(C._zod.def.when){if(!C._zod.def.when(c))continue}else if(y)continue;const w=c.issues.length,k=C._zod.check(c);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new rn;if(d||k instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await k,c.issues.length!==w&&(y||(y=tn(c,w)))});else{if(c.issues.length===w)continue;y||(y=tn(c,w))}}return d?d.then(()=>c):c},T=(c,u,h)=>{if(tn(c))return c.aborted=!0,c;const y=x(u,o,h);if(y instanceof Promise){if(h.async===!1)throw new rn;return y.then(d=>i._zod.parse(d,h))}return i._zod.parse(y,h)};i._zod.run=(c,u)=>{if(u.skipChecks)return i._zod.parse(c,u);if(u.direction==="backward"){const y=i._zod.parse({value:c.value,issues:[]},{...u,skipChecks:!0});return y instanceof Promise?y.then(d=>T(d,c,u)):T(y,c,u)}const h=i._zod.parse(c,u);if(h instanceof Promise){if(u.async===!1)throw new rn;return h.then(y=>x(y,o,u))}return x(h,o,u)}}We(i,"~standard",()=>({validate:x=>{var T;try{const c=Nb(i,x);return c.success?{value:c.data}:{issues:(T=c.error)==null?void 0:T.issues}}catch{return Bb(i,x).then(u=>{var h;return u.success?{value:u.data}:{issues:(h=u.error)==null?void 0:h.issues}})}},vendor:"zod",version:1}))}),mh=fe("$ZodString",(i,r)=>{var a;ft.init(i,r),i._zod.pattern=[...((a=i==null?void 0:i._zod.bag)==null?void 0:a.patterns)??[]].pop()??u1(i._zod.bag),i._zod.parse=(o,g)=>{if(r.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:i}),o}}),rt=fe("$ZodStringFormat",(i,r)=>{ml.init(i,r),mh.init(i,r)}),D1=fe("$ZodGUID",(i,r)=>{r.pattern??(r.pattern=Xb),rt.init(i,r)}),k1=fe("$ZodUUID",(i,r)=>{if(r.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(o===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=Am(o))}else r.pattern??(r.pattern=Am());rt.init(i,r)}),O1=fe("$ZodEmail",(i,r)=>{r.pattern??(r.pattern=Jb),rt.init(i,r)}),M1=fe("$ZodURL",(i,r)=>{rt.init(i,r),i._zod.check=a=>{try{const o=a.value.trim(),g=new URL(o);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(g.hostname)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:r.hostname.source,input:a.value,inst:i,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(g.protocol.endsWith(":")?g.protocol.slice(0,-1):g.protocol)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:a.value,inst:i,continue:!r.abort})),r.normalize?a.value=g.href:a.value=o;return}catch{a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:i,continue:!r.abort})}}}),L1=fe("$ZodEmoji",(i,r)=>{r.pattern??(r.pattern=e1()),rt.init(i,r)}),N1=fe("$ZodNanoID",(i,r)=>{r.pattern??(r.pattern=Vb),rt.init(i,r)}),B1=fe("$ZodCUID",(i,r)=>{r.pattern??(r.pattern=Zb),rt.init(i,r)}),z1=fe("$ZodCUID2",(i,r)=>{r.pattern??(r.pattern=qb),rt.init(i,r)}),j1=fe("$ZodULID",(i,r)=>{r.pattern??(r.pattern=Gb),rt.init(i,r)}),H1=fe("$ZodXID",(i,r)=>{r.pattern??(r.pattern=Wb),rt.init(i,r)}),U1=fe("$ZodKSUID",(i,r)=>{r.pattern??(r.pattern=Yb),rt.init(i,r)}),I1=fe("$ZodISODateTime",(i,r)=>{r.pattern??(r.pattern=c1(r)),rt.init(i,r)}),P1=fe("$ZodISODate",(i,r)=>{r.pattern??(r.pattern=o1),rt.init(i,r)}),$1=fe("$ZodISOTime",(i,r)=>{r.pattern??(r.pattern=l1(r)),rt.init(i,r)}),F1=fe("$ZodISODuration",(i,r)=>{r.pattern??(r.pattern=Kb),rt.init(i,r)}),Z1=fe("$ZodIPv4",(i,r)=>{r.pattern??(r.pattern=t1),rt.init(i,r),i._zod.bag.format="ipv4"}),q1=fe("$ZodIPv6",(i,r)=>{r.pattern??(r.pattern=i1),rt.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})}}}),G1=fe("$ZodCIDRv4",(i,r)=>{r.pattern??(r.pattern=s1),rt.init(i,r)}),W1=fe("$ZodCIDRv6",(i,r)=>{r.pattern??(r.pattern=r1),rt.init(i,r),i._zod.check=a=>{const o=a.value.split("/");try{if(o.length!==2)throw new Error;const[g,x]=o;if(!x)throw new Error;const T=Number(x);if(`${T}`!==x)throw new Error;if(T<0||T>128)throw new Error;new URL(`http://[${g}]`)}catch{a.issues.push({code:"invalid_format",format:"cidrv6",input:a.value,inst:i,continue:!r.abort})}}});function Yp(i){if(i==="")return!0;if(i.length%4!==0)return!1;try{return atob(i),!0}catch{return!1}}const Y1=fe("$ZodBase64",(i,r)=>{r.pattern??(r.pattern=n1),rt.init(i,r),i._zod.bag.contentEncoding="base64",i._zod.check=a=>{Yp(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:i,continue:!r.abort})}});function V1(i){if(!Pp.test(i))return!1;const r=i.replace(/[-_]/g,o=>o==="-"?"+":"/"),a=r.padEnd(Math.ceil(r.length/4)*4,"=");return Yp(a)}const K1=fe("$ZodBase64URL",(i,r)=>{r.pattern??(r.pattern=Pp),rt.init(i,r),i._zod.bag.contentEncoding="base64url",i._zod.check=a=>{V1(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:i,continue:!r.abort})}}),X1=fe("$ZodE164",(i,r)=>{r.pattern??(r.pattern=a1),rt.init(i,r)});function J1(i,r=null){try{const a=i.split(".");if(a.length!==3)return!1;const[o]=a;if(!o)return!1;const g=JSON.parse(atob(o));return!("typ"in g&&(g==null?void 0:g.typ)!=="JWT"||!g.alg||r&&(!("alg"in g)||g.alg!==r))}catch{return!1}}const Q1=fe("$ZodJWT",(i,r)=>{rt.init(i,r),i._zod.check=a=>{J1(a.value,r.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:i,continue:!r.abort})}}),Vp=fe("$ZodNumber",(i,r)=>{ft.init(i,r),i._zod.pattern=i._zod.bag.pattern??Zp,i._zod.parse=(a,o)=>{if(r.coerce)try{a.value=Number(a.value)}catch{}const g=a.value;if(typeof g=="number"&&!Number.isNaN(g)&&Number.isFinite(g))return a;const x=typeof g=="number"?Number.isNaN(g)?"NaN":Number.isFinite(g)?void 0:"Infinity":void 0;return a.issues.push({expected:"number",code:"invalid_type",input:g,inst:i,...x?{received:x}:{}}),a}}),eC=fe("$ZodNumberFormat",(i,r)=>{p1.init(i,r),Vp.init(i,r)}),tC=fe("$ZodBoolean",(i,r)=>{ft.init(i,r),i._zod.pattern=f1,i._zod.parse=(a,o)=>{if(r.coerce)try{a.value=!!a.value}catch{}const g=a.value;return typeof g=="boolean"||a.issues.push({expected:"boolean",code:"invalid_type",input:g,inst:i}),a}}),iC=fe("$ZodUnknown",(i,r)=>{ft.init(i,r),i._zod.parse=a=>a}),sC=fe("$ZodNever",(i,r)=>{ft.init(i,r),i._zod.parse=(a,o)=>(a.issues.push({expected:"never",code:"invalid_type",input:a.value,inst:i}),a)});function Rm(i,r,a){i.issues.length&&r.issues.push(...sn(a,i.issues)),r.value[a]=i.value}const rC=fe("$ZodArray",(i,r)=>{ft.init(i,r),i._zod.parse=(a,o)=>{const g=a.value;if(!Array.isArray(g))return a.issues.push({expected:"array",code:"invalid_type",input:g,inst:i}),a;a.value=Array(g.length);const x=[];for(let T=0;T<g.length;T++){const c=g[T],u=r.element._zod.run({value:c,issues:[]},o);u instanceof Promise?x.push(u.then(h=>Rm(h,a,T))):Rm(u,a,T)}return x.length?Promise.all(x).then(()=>a):a}});function tl(i,r,a,o,g){if(i.issues.length){if(g&&!(a in o))return;r.issues.push(...sn(a,i.issues))}i.value===void 0?a in o&&(r.value[a]=void 0):r.value[a]=i.value}function Kp(i){var o,g,x,T;const r=Object.keys(i.shape);for(const c of r)if(!((T=(x=(g=(o=i.shape)==null?void 0:o[c])==null?void 0:g._zod)==null?void 0:x.traits)!=null&&T.has("$ZodType")))throw new Error(`Invalid element at key "${c}": expected a Zod schema`);const a=xb(i.shape);return{...i,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(a)}}function Xp(i,r,a,o,g,x){const T=[],c=g.keySet,u=g.catchall._zod,h=u.def.type,y=u.optout==="optional";for(const d in r){if(c.has(d))continue;if(h==="never"){T.push(d);continue}const C=u.run({value:r[d],issues:[]},o);C instanceof Promise?i.push(C.then(w=>tl(w,a,d,r,y))):tl(C,a,d,r,y)}return T.length&&a.issues.push({code:"unrecognized_keys",keys:T,input:r,inst:x}),i.length?Promise.all(i).then(()=>a):a}const nC=fe("$ZodObject",(i,r)=>{ft.init(i,r);const a=Object.getOwnPropertyDescriptor(r,"shape");if(!(a!=null&&a.get)){const c=r.shape;Object.defineProperty(r,"shape",{get:()=>{const u={...c};return Object.defineProperty(r,"shape",{value:u}),u}})}const o=ch(()=>Kp(r));We(i._zod,"propValues",()=>{const c=r.shape,u={};for(const h in c){const y=c[h]._zod;if(y.values){u[h]??(u[h]=new Set);for(const d of y.values)u[h].add(d)}}return u});const g=el,x=r.catchall;let T;i._zod.parse=(c,u)=>{T??(T=o.value);const h=c.value;if(!g(h))return c.issues.push({expected:"object",code:"invalid_type",input:h,inst:i}),c;c.value={};const y=[],d=T.shape;for(const C of T.keys){const w=d[C],k=w._zod.optout==="optional",b=w._zod.run({value:h[C],issues:[]},u);b instanceof Promise?y.push(b.then(m=>tl(m,c,C,h,k))):tl(b,c,C,h,k)}return x?Xp(y,h,c,u,o.value,i):y.length?Promise.all(y).then(()=>c):c}}),aC=fe("$ZodObjectJIT",(i,r)=>{nC.init(i,r);const a=i._zod.parse,o=ch(()=>Kp(r)),g=C=>{var p;const w=new A1(["shape","payload","ctx"]),k=o.value,b=S=>{const A=Tm(S);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};w.write("const input = payload.value;");const m=Object.create(null);let v=0;for(const S of k.keys)m[S]=`key_${v++}`;w.write("const newResult = {};");for(const S of k.keys){const A=m[S],R=Tm(S),M=C[S],E=((p=M==null?void 0:M._zod)==null?void 0:p.optout)==="optional";w.write(`const ${A} = ${b(S)};`),E?w.write(`
218
+ if (${A}.issues.length) {
219
+ if (${R} in input) {
220
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
221
+ ...iss,
222
+ path: iss.path ? [${R}, ...iss.path] : [${R}]
223
+ })));
224
+ }
225
+ }
226
+
227
+ if (${A}.value === undefined) {
228
+ if (${R} in input) {
229
+ newResult[${R}] = undefined;
230
+ }
231
+ } else {
232
+ newResult[${R}] = ${A}.value;
233
+ }
234
+
235
+ `):w.write(`
236
+ if (${A}.issues.length) {
237
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
238
+ ...iss,
239
+ path: iss.path ? [${R}, ...iss.path] : [${R}]
240
+ })));
241
+ }
242
+
243
+ if (${A}.value === undefined) {
244
+ if (${R} in input) {
245
+ newResult[${R}] = undefined;
246
+ }
247
+ } else {
248
+ newResult[${R}] = ${A}.value;
249
+ }
250
+
251
+ `)}w.write("payload.value = newResult;"),w.write("return payload;");const f=w.compile();return(S,A)=>f(C,S,A)};let x;const T=el,c=!Np.jitless,h=c&&bb.value,y=r.catchall;let d;i._zod.parse=(C,w)=>{d??(d=o.value);const k=C.value;return T(k)?c&&h&&(w==null?void 0:w.async)===!1&&w.jitless!==!0?(x||(x=g(r.shape)),C=x(C,w),y?Xp([],k,C,w,d,i):C):a(C,w):(C.issues.push({expected:"object",code:"invalid_type",input:k,inst:i}),C)}});function Dm(i,r,a,o){for(const x of i)if(x.issues.length===0)return r.value=x.value,r;const g=i.filter(x=>!tn(x));return g.length===1?(r.value=g[0].value,g[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:a,errors:i.map(x=>x.issues.map(T=>Ws(T,o,Gs())))}),r)}const oC=fe("$ZodUnion",(i,r)=>{ft.init(i,r),We(i._zod,"optin",()=>r.options.some(g=>g._zod.optin==="optional")?"optional":void 0),We(i._zod,"optout",()=>r.options.some(g=>g._zod.optout==="optional")?"optional":void 0),We(i._zod,"values",()=>{if(r.options.every(g=>g._zod.values))return new Set(r.options.flatMap(g=>Array.from(g._zod.values)))}),We(i._zod,"pattern",()=>{if(r.options.every(g=>g._zod.pattern)){const g=r.options.map(x=>x._zod.pattern);return new RegExp(`^(${g.map(x=>hh(x.source)).join("|")})$`)}});const a=r.options.length===1,o=r.options[0]._zod.run;i._zod.parse=(g,x)=>{if(a)return o(g,x);let T=!1;const c=[];for(const u of r.options){const h=u._zod.run({value:g.value,issues:[]},x);if(h instanceof Promise)c.push(h),T=!0;else{if(h.issues.length===0)return h;c.push(h)}}return T?Promise.all(c).then(u=>Dm(u,g,i,x)):Dm(c,g,i,x)}}),lC=fe("$ZodIntersection",(i,r)=>{ft.init(i,r),i._zod.parse=(a,o)=>{const g=a.value,x=r.left._zod.run({value:g,issues:[]},o),T=r.right._zod.run({value:g,issues:[]},o);return x instanceof Promise||T instanceof Promise?Promise.all([x,T]).then(([u,h])=>km(a,u,h)):km(a,x,T)}});function Ju(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(x=>a.indexOf(x)!==-1),g={...i,...r};for(const x of o){const T=Ju(i[x],r[x]);if(!T.valid)return{valid:!1,mergeErrorPath:[x,...T.mergeErrorPath]};g[x]=T.data}return{valid:!0,data:g}}if(Array.isArray(i)&&Array.isArray(r)){if(i.length!==r.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let o=0;o<i.length;o++){const g=i[o],x=r[o],T=Ju(g,x);if(!T.valid)return{valid:!1,mergeErrorPath:[o,...T.mergeErrorPath]};a.push(T.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function km(i,r,a){const o=new Map;let g;for(const c of r.issues)if(c.code==="unrecognized_keys"){g??(g=c);for(const u of c.keys)o.has(u)||o.set(u,{}),o.get(u).l=!0}else i.issues.push(c);for(const c of a.issues)if(c.code==="unrecognized_keys")for(const u of c.keys)o.has(u)||o.set(u,{}),o.get(u).r=!0;else i.issues.push(c);const x=[...o].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(x.length&&g&&i.issues.push({...g,keys:x}),tn(i))return i;const T=Ju(r.value,a.value);if(!T.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(T.mergeErrorPath)}`);return i.value=T.data,i}const cC=fe("$ZodRecord",(i,r)=>{ft.init(i,r),i._zod.parse=(a,o)=>{const g=a.value;if(!nn(g))return a.issues.push({expected:"record",code:"invalid_type",input:g,inst:i}),a;const x=[],T=r.keyType._zod.values;if(T){a.value={};const c=new Set;for(const h of T)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){c.add(typeof h=="number"?h.toString():h);const y=r.valueType._zod.run({value:g[h],issues:[]},o);y instanceof Promise?x.push(y.then(d=>{d.issues.length&&a.issues.push(...sn(h,d.issues)),a.value[h]=d.value})):(y.issues.length&&a.issues.push(...sn(h,y.issues)),a.value[h]=y.value)}let u;for(const h in g)c.has(h)||(u=u??[],u.push(h));u&&u.length>0&&a.issues.push({code:"unrecognized_keys",input:g,inst:i,keys:u})}else{a.value={};for(const c of Reflect.ownKeys(g)){if(c==="__proto__")continue;let u=r.keyType._zod.run({value:c,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&Zp.test(c)&&u.issues.length){const d=r.keyType._zod.run({value:Number(c),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(u=d)}if(u.issues.length){r.mode==="loose"?a.value[c]=g[c]:a.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(d=>Ws(d,o,Gs())),input:c,path:[c],inst:i});continue}const y=r.valueType._zod.run({value:g[c],issues:[]},o);y instanceof Promise?x.push(y.then(d=>{d.issues.length&&a.issues.push(...sn(c,d.issues)),a.value[u.value]=d.value})):(y.issues.length&&a.issues.push(...sn(c,y.issues)),a.value[u.value]=y.value)}}return x.length?Promise.all(x).then(()=>a):a}}),uC=fe("$ZodEnum",(i,r)=>{ft.init(i,r);const a=Bp(r.entries),o=new Set(a);i._zod.values=o,i._zod.pattern=new RegExp(`^(${a.filter(g=>Cb.has(typeof g)).map(g=>typeof g=="string"?fl(g):g.toString()).join("|")})$`),i._zod.parse=(g,x)=>{const T=g.value;return o.has(T)||g.issues.push({code:"invalid_value",values:a,input:T,inst:i}),g}}),hC=fe("$ZodTransform",(i,r)=>{ft.init(i,r),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new Lp(i.constructor.name);const g=r.transform(a.value,a);if(o.async)return(g instanceof Promise?g:Promise.resolve(g)).then(T=>(a.value=T,a));if(g instanceof Promise)throw new rn;return a.value=g,a}});function Om(i,r){return i.issues.length&&r===void 0?{issues:[],value:void 0}:i}const Jp=fe("$ZodOptional",(i,r)=>{ft.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(`^(${hh(a.source)})?$`):void 0}),i._zod.parse=(a,o)=>{if(r.innerType._zod.optin==="optional"){const g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(x=>Om(x,a.value)):Om(g,a.value)}return a.value===void 0?a:r.innerType._zod.run(a,o)}}),fC=fe("$ZodExactOptional",(i,r)=>{Jp.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)}),dC=fe("$ZodNullable",(i,r)=>{ft.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(`^(${hh(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)}),_C=fe("$ZodDefault",(i,r)=>{ft.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 g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(x=>Mm(x,r)):Mm(g,r)}});function Mm(i,r){return i.value===void 0&&(i.value=r.defaultValue),i}const mC=fe("$ZodPrefault",(i,r)=>{ft.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))}),pC=fe("$ZodNonOptional",(i,r)=>{ft.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 g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(x=>Lm(x,i)):Lm(g,i)}});function Lm(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 vC=fe("$ZodCatch",(i,r)=>{ft.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 g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(x=>(a.value=x.value,x.issues.length&&(a.value=r.catchValue({...a,error:{issues:x.issues.map(T=>Ws(T,o,Gs()))},input:a.value}),a.issues=[]),a)):(a.value=g.value,g.issues.length&&(a.value=r.catchValue({...a,error:{issues:g.issues.map(x=>Ws(x,o,Gs()))},input:a.value}),a.issues=[]),a)}}),gC=fe("$ZodPipe",(i,r)=>{ft.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 x=r.out._zod.run(a,o);return x instanceof Promise?x.then(T=>Fo(T,r.in,o)):Fo(x,r.in,o)}const g=r.in._zod.run(a,o);return g instanceof Promise?g.then(x=>Fo(x,r.out,o)):Fo(g,r.out,o)}});function Fo(i,r,a){return i.issues.length?(i.aborted=!0,i):r._zod.run({value:i.value,issues:i.issues},a)}const yC=fe("$ZodReadonly",(i,r)=>{ft.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 g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(Nm):Nm(g)}});function Nm(i){return i.value=Object.freeze(i.value),i}const SC=fe("$ZodCustom",(i,r)=>{ni.init(i,r),ft.init(i,r),i._zod.parse=(a,o)=>a,i._zod.check=a=>{const o=a.value,g=r.fn(o);if(g instanceof Promise)return g.then(x=>Bm(x,a,o,i));Bm(g,a,o,i)}});function Bm(i,r,a,o){if(!i){const g={code:"custom",input:a,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(g.params=o._zod.def.params),r.issues.push(ya(g))}}var zm;class bC{constructor(){this._map=new WeakMap,this._idmap=new Map}add(r,...a){const o=a[0];return this._map.set(r,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,r),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(r){const a=this._map.get(r);return a&&typeof a=="object"&&"id"in a&&this._idmap.delete(a.id),this._map.delete(r),this}get(r){const a=r._zod.parent;if(a){const o={...this.get(a)??{}};delete o.id;const g={...o,...this._map.get(r)};return Object.keys(g).length?g:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function CC(){return new bC}(zm=globalThis).__zod_globalRegistry??(zm.__zod_globalRegistry=CC());const va=globalThis.__zod_globalRegistry;function xC(i,r){return new i({type:"string",...xe(r)})}function wC(i,r){return new i({type:"string",format:"email",check:"string_format",abort:!1,...xe(r)})}function jm(i,r){return new i({type:"string",format:"guid",check:"string_format",abort:!1,...xe(r)})}function EC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,...xe(r)})}function TC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xe(r)})}function AC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xe(r)})}function RC(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xe(r)})}function DC(i,r){return new i({type:"string",format:"url",check:"string_format",abort:!1,...xe(r)})}function kC(i,r){return new i({type:"string",format:"emoji",check:"string_format",abort:!1,...xe(r)})}function OC(i,r){return new i({type:"string",format:"nanoid",check:"string_format",abort:!1,...xe(r)})}function MC(i,r){return new i({type:"string",format:"cuid",check:"string_format",abort:!1,...xe(r)})}function LC(i,r){return new i({type:"string",format:"cuid2",check:"string_format",abort:!1,...xe(r)})}function NC(i,r){return new i({type:"string",format:"ulid",check:"string_format",abort:!1,...xe(r)})}function BC(i,r){return new i({type:"string",format:"xid",check:"string_format",abort:!1,...xe(r)})}function zC(i,r){return new i({type:"string",format:"ksuid",check:"string_format",abort:!1,...xe(r)})}function jC(i,r){return new i({type:"string",format:"ipv4",check:"string_format",abort:!1,...xe(r)})}function HC(i,r){return new i({type:"string",format:"ipv6",check:"string_format",abort:!1,...xe(r)})}function UC(i,r){return new i({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xe(r)})}function IC(i,r){return new i({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xe(r)})}function PC(i,r){return new i({type:"string",format:"base64",check:"string_format",abort:!1,...xe(r)})}function $C(i,r){return new i({type:"string",format:"base64url",check:"string_format",abort:!1,...xe(r)})}function FC(i,r){return new i({type:"string",format:"e164",check:"string_format",abort:!1,...xe(r)})}function ZC(i,r){return new i({type:"string",format:"jwt",check:"string_format",abort:!1,...xe(r)})}function qC(i,r){return new i({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xe(r)})}function GC(i,r){return new i({type:"string",format:"date",check:"string_format",...xe(r)})}function WC(i,r){return new i({type:"string",format:"time",check:"string_format",precision:null,...xe(r)})}function YC(i,r){return new i({type:"string",format:"duration",check:"string_format",...xe(r)})}function VC(i,r){return new i({type:"number",checks:[],...xe(r)})}function KC(i,r){return new i({type:"number",check:"number_format",abort:!1,format:"safeint",...xe(r)})}function XC(i,r){return new i({type:"boolean",...xe(r)})}function JC(i){return new i({type:"unknown"})}function QC(i,r){return new i({type:"never",...xe(r)})}function Hm(i,r){return new Gp({check:"less_than",...xe(r),value:i,inclusive:!1})}function Bu(i,r){return new Gp({check:"less_than",...xe(r),value:i,inclusive:!0})}function Um(i,r){return new Wp({check:"greater_than",...xe(r),value:i,inclusive:!1})}function zu(i,r){return new Wp({check:"greater_than",...xe(r),value:i,inclusive:!0})}function Im(i,r){return new m1({check:"multiple_of",...xe(r),value:i})}function Qp(i,r){return new v1({check:"max_length",...xe(r),maximum:i})}function il(i,r){return new g1({check:"min_length",...xe(r),minimum:i})}function ev(i,r){return new y1({check:"length_equals",...xe(r),length:i})}function ex(i,r){return new S1({check:"string_format",format:"regex",...xe(r),pattern:i})}function tx(i){return new b1({check:"string_format",format:"lowercase",...xe(i)})}function ix(i){return new C1({check:"string_format",format:"uppercase",...xe(i)})}function sx(i,r){return new x1({check:"string_format",format:"includes",...xe(r),includes:i})}function rx(i,r){return new w1({check:"string_format",format:"starts_with",...xe(r),prefix:i})}function nx(i,r){return new E1({check:"string_format",format:"ends_with",...xe(r),suffix:i})}function cn(i){return new T1({check:"overwrite",tx:i})}function ax(i){return cn(r=>r.normalize(i))}function ox(){return cn(i=>i.trim())}function lx(){return cn(i=>i.toLowerCase())}function cx(){return cn(i=>i.toUpperCase())}function ux(){return cn(i=>Sb(i))}function hx(i,r,a){return new i({type:"array",element:r,...xe(a)})}function fx(i,r,a){return new i({type:"custom",check:"custom",fn:r,...xe(a)})}function dx(i){const r=_x(a=>(a.addIssue=o=>{if(typeof o=="string")a.issues.push(ya(o,a.value,r._zod.def));else{const g=o;g.fatal&&(g.continue=!1),g.code??(g.code="custom"),g.input??(g.input=a.value),g.inst??(g.inst=r),g.continue??(g.continue=!r._zod.def.abort),a.issues.push(ya(g))}},i(a.value,a)));return r}function _x(i,r){const a=new ni({check:"custom",...xe(r)});return a._zod.check=i,a}function tv(i){let r=(i==null?void 0:i.target)??"draft-2020-12";return r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),{processors:i.processors??{},metadataRegistry:(i==null?void 0:i.metadata)??va,target:r,unrepresentable:(i==null?void 0:i.unrepresentable)??"throw",override:(i==null?void 0:i.override)??(()=>{}),io:(i==null?void 0:i.io)??"output",counter:0,seen:new Map,cycles:(i==null?void 0:i.cycles)??"ref",reused:(i==null?void 0:i.reused)??"inline",external:(i==null?void 0:i.external)??void 0}}function wt(i,r,a={path:[],schemaPath:[]}){var y,d;var o;const g=i._zod.def,x=r.seen.get(i);if(x)return x.count++,a.schemaPath.includes(i)&&(x.cycle=a.path),x.schema;const T={schema:{},count:1,cycle:void 0,path:a.path};r.seen.set(i,T);const c=(d=(y=i._zod).toJSONSchema)==null?void 0:d.call(y);if(c)T.schema=c;else{const C={...a,schemaPath:[...a.schemaPath,i],path:a.path};if(i._zod.processJSONSchema)i._zod.processJSONSchema(r,T.schema,C);else{const k=T.schema,b=r.processors[g.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${g.type}`);b(i,r,k,C)}const w=i._zod.parent;w&&(T.ref||(T.ref=w),wt(w,r,C),r.seen.get(w).isParent=!0)}const u=r.metadataRegistry.get(i);return u&&Object.assign(T.schema,u),r.io==="input"&&Wt(i)&&(delete T.schema.examples,delete T.schema.default),r.io==="input"&&T.schema._prefault&&((o=T.schema).default??(o.default=T.schema._prefault)),delete T.schema._prefault,r.seen.get(i).schema}function iv(i,r){var T,c,u,h;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=(T=i.metadataRegistry.get(y[0]))==null?void 0:T.id;if(d){const C=o.get(d);if(C&&C!==y[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(d,y[0])}}const g=y=>{var b;const d=i.target==="draft-2020-12"?"$defs":"definitions";if(i.external){const m=(b=i.external.registry.get(y[0]))==null?void 0:b.id,v=i.external.uri??(p=>p);if(m)return{ref:v(m)};const f=y[1].defId??y[1].schema.id??`schema${i.counter++}`;return y[1].defId=f,{defId:f,ref:`${v("__shared")}#/${d}/${f}`}}if(y[1]===a)return{ref:"#"};const w=`#/${d}/`,k=y[1].schema.id??`__schema${i.counter++}`;return{defId:k,ref:w+k}},x=y=>{if(y[1].schema.$ref)return;const d=y[1],{ref:C,defId:w}=g(y);d.def={...d.schema},w&&(d.defId=w);const k=d.schema;for(const b in k)delete k[b];k.$ref=C};if(i.cycles==="throw")for(const y of i.seen.entries()){const d=y[1];if(d.cycle)throw new Error(`Cycle detected: #/${(c=d.cycle)==null?void 0:c.join("/")}/<root>
252
+
253
+ 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]){x(y);continue}if(i.external){const w=(u=i.external.registry.get(y[0]))==null?void 0:u.id;if(r!==y[0]&&w){x(y);continue}}if((h=i.metadataRegistry.get(y[0]))==null?void 0:h.id){x(y);continue}if(d.cycle){x(y);continue}if(d.count>1&&i.reused==="ref"){x(y);continue}}}function sv(i,r){var T,c,u;const a=i.seen.get(r);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=h=>{const y=i.seen.get(h);if(y.ref===null)return;const d=y.def??y.schema,C={...d},w=y.ref;if(y.ref=null,w){o(w);const b=i.seen.get(w),m=b.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,C),h._zod.parent===w)for(const f in d)f==="$ref"||f==="allOf"||f in C||delete d[f];if(m.$ref&&b.def)for(const f in d)f==="$ref"||f==="allOf"||f in b.def&&JSON.stringify(d[f])===JSON.stringify(b.def[f])&&delete d[f]}const k=h._zod.parent;if(k&&k!==w){o(k);const b=i.seen.get(k);if(b!=null&&b.schema.$ref&&(d.$ref=b.schema.$ref,b.def))for(const m in d)m==="$ref"||m==="allOf"||m in b.def&&JSON.stringify(d[m])===JSON.stringify(b.def[m])&&delete d[m]}i.override({zodSchema:h,jsonSchema:d,path:y.path??[]})};for(const h of[...i.seen.entries()].reverse())o(h[0]);const g={};if(i.target==="draft-2020-12"?g.$schema="https://json-schema.org/draft/2020-12/schema":i.target==="draft-07"?g.$schema="http://json-schema.org/draft-07/schema#":i.target==="draft-04"?g.$schema="http://json-schema.org/draft-04/schema#":i.target,(T=i.external)!=null&&T.uri){const h=(c=i.external.registry.get(r))==null?void 0:c.id;if(!h)throw new Error("Schema is missing an `id` property");g.$id=i.external.uri(h)}Object.assign(g,a.def??a.schema);const x=((u=i.external)==null?void 0:u.defs)??{};for(const h of i.seen.entries()){const y=h[1];y.def&&y.defId&&(x[y.defId]=y.def)}i.external||Object.keys(x).length>0&&(i.target==="draft-2020-12"?g.$defs=x:g.definitions=x);try{const h=JSON.parse(JSON.stringify(g));return Object.defineProperty(h,"~standard",{value:{...r["~standard"],jsonSchema:{input:sl(r,"input",i.processors),output:sl(r,"output",i.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function Wt(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 Wt(o.element,a);if(o.type==="set")return Wt(o.valueType,a);if(o.type==="lazy")return Wt(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 Wt(o.innerType,a);if(o.type==="intersection")return Wt(o.left,a)||Wt(o.right,a);if(o.type==="record"||o.type==="map")return Wt(o.keyType,a)||Wt(o.valueType,a);if(o.type==="pipe")return Wt(o.in,a)||Wt(o.out,a);if(o.type==="object"){for(const g in o.shape)if(Wt(o.shape[g],a))return!0;return!1}if(o.type==="union"){for(const g of o.options)if(Wt(g,a))return!0;return!1}if(o.type==="tuple"){for(const g of o.items)if(Wt(g,a))return!0;return!!(o.rest&&Wt(o.rest,a))}return!1}const mx=(i,r={})=>a=>{const o=tv({...a,processors:r});return wt(i,o),iv(o,i),sv(o,i)},sl=(i,r,a={})=>o=>{const{libraryOptions:g,target:x}=o??{},T=tv({...g??{},target:x,io:r,processors:a});return wt(i,T),iv(T,i),sv(T,i)},px={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},vx=(i,r,a,o)=>{const g=a;g.type="string";const{minimum:x,maximum:T,format:c,patterns:u,contentEncoding:h}=i._zod.bag;if(typeof x=="number"&&(g.minLength=x),typeof T=="number"&&(g.maxLength=T),c&&(g.format=px[c]??c,g.format===""&&delete g.format,c==="time"&&delete g.format),h&&(g.contentEncoding=h),u&&u.size>0){const y=[...u];y.length===1?g.pattern=y[0].source:y.length>1&&(g.allOf=[...y.map(d=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},gx=(i,r,a,o)=>{const g=a,{minimum:x,maximum:T,format:c,multipleOf:u,exclusiveMaximum:h,exclusiveMinimum:y}=i._zod.bag;typeof c=="string"&&c.includes("int")?g.type="integer":g.type="number",typeof y=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(g.minimum=y,g.exclusiveMinimum=!0):g.exclusiveMinimum=y),typeof x=="number"&&(g.minimum=x,typeof y=="number"&&r.target!=="draft-04"&&(y>=x?delete g.minimum:delete g.exclusiveMinimum)),typeof h=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(g.maximum=h,g.exclusiveMaximum=!0):g.exclusiveMaximum=h),typeof T=="number"&&(g.maximum=T,typeof h=="number"&&r.target!=="draft-04"&&(h<=T?delete g.maximum:delete g.exclusiveMaximum)),typeof u=="number"&&(g.multipleOf=u)},yx=(i,r,a,o)=>{a.type="boolean"},Sx=(i,r,a,o)=>{a.not={}},bx=(i,r,a,o)=>{},Cx=(i,r,a,o)=>{const g=i._zod.def,x=Bp(g.entries);x.every(T=>typeof T=="number")&&(a.type="number"),x.every(T=>typeof T=="string")&&(a.type="string"),a.enum=x},xx=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},wx=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Ex=(i,r,a,o)=>{const g=a,x=i._zod.def,{minimum:T,maximum:c}=i._zod.bag;typeof T=="number"&&(g.minItems=T),typeof c=="number"&&(g.maxItems=c),g.type="array",g.items=wt(x.element,r,{...o,path:[...o.path,"items"]})},Tx=(i,r,a,o)=>{var h;const g=a,x=i._zod.def;g.type="object",g.properties={};const T=x.shape;for(const y in T)g.properties[y]=wt(T[y],r,{...o,path:[...o.path,"properties",y]});const c=new Set(Object.keys(T)),u=new Set([...c].filter(y=>{const d=x.shape[y]._zod;return r.io==="input"?d.optin===void 0:d.optout===void 0}));u.size>0&&(g.required=Array.from(u)),((h=x.catchall)==null?void 0:h._zod.def.type)==="never"?g.additionalProperties=!1:x.catchall?x.catchall&&(g.additionalProperties=wt(x.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(g.additionalProperties=!1)},Ax=(i,r,a,o)=>{const g=i._zod.def,x=g.inclusive===!1,T=g.options.map((c,u)=>wt(c,r,{...o,path:[...o.path,x?"oneOf":"anyOf",u]}));x?a.oneOf=T:a.anyOf=T},Rx=(i,r,a,o)=>{const g=i._zod.def,x=wt(g.left,r,{...o,path:[...o.path,"allOf",0]}),T=wt(g.right,r,{...o,path:[...o.path,"allOf",1]}),c=h=>"allOf"in h&&Object.keys(h).length===1,u=[...c(x)?x.allOf:[x],...c(T)?T.allOf:[T]];a.allOf=u},Dx=(i,r,a,o)=>{const g=a,x=i._zod.def;g.type="object";const T=x.keyType,c=T._zod.bag,u=c==null?void 0:c.patterns;if(x.mode==="loose"&&u&&u.size>0){const y=wt(x.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});g.patternProperties={};for(const d of u)g.patternProperties[d.source]=y}else(r.target==="draft-07"||r.target==="draft-2020-12")&&(g.propertyNames=wt(x.keyType,r,{...o,path:[...o.path,"propertyNames"]})),g.additionalProperties=wt(x.valueType,r,{...o,path:[...o.path,"additionalProperties"]});const h=T._zod.values;if(h){const y=[...h].filter(d=>typeof d=="string"||typeof d=="number");y.length>0&&(g.required=y)}},kx=(i,r,a,o)=>{const g=i._zod.def,x=wt(g.innerType,r,o),T=r.seen.get(i);r.target==="openapi-3.0"?(T.ref=g.innerType,a.nullable=!0):a.anyOf=[x,{type:"null"}]},Ox=(i,r,a,o)=>{const g=i._zod.def;wt(g.innerType,r,o);const x=r.seen.get(i);x.ref=g.innerType},Mx=(i,r,a,o)=>{const g=i._zod.def;wt(g.innerType,r,o);const x=r.seen.get(i);x.ref=g.innerType,a.default=JSON.parse(JSON.stringify(g.defaultValue))},Lx=(i,r,a,o)=>{const g=i._zod.def;wt(g.innerType,r,o);const x=r.seen.get(i);x.ref=g.innerType,r.io==="input"&&(a._prefault=JSON.parse(JSON.stringify(g.defaultValue)))},Nx=(i,r,a,o)=>{const g=i._zod.def;wt(g.innerType,r,o);const x=r.seen.get(i);x.ref=g.innerType;let T;try{T=g.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}a.default=T},Bx=(i,r,a,o)=>{const g=i._zod.def,x=r.io==="input"?g.in._zod.def.type==="transform"?g.out:g.in:g.out;wt(x,r,o);const T=r.seen.get(i);T.ref=x},zx=(i,r,a,o)=>{const g=i._zod.def;wt(g.innerType,r,o);const x=r.seen.get(i);x.ref=g.innerType,a.readOnly=!0},rv=(i,r,a,o)=>{const g=i._zod.def;wt(g.innerType,r,o);const x=r.seen.get(i);x.ref=g.innerType},jx=fe("ZodISODateTime",(i,r)=>{I1.init(i,r),lt.init(i,r)});function Hx(i){return qC(jx,i)}const Ux=fe("ZodISODate",(i,r)=>{P1.init(i,r),lt.init(i,r)});function Ix(i){return GC(Ux,i)}const Px=fe("ZodISOTime",(i,r)=>{$1.init(i,r),lt.init(i,r)});function $x(i){return WC(Px,i)}const Fx=fe("ZodISODuration",(i,r)=>{F1.init(i,r),lt.init(i,r)});function Zx(i){return YC(Fx,i)}const qx=(i,r)=>{Up.init(i,r),i.name="ZodError",Object.defineProperties(i,{format:{value:a=>Lb(i,a)},flatten:{value:a=>Mb(i,a)},addIssue:{value:a=>{i.issues.push(a),i.message=JSON.stringify(i.issues,Xu,2)}},addIssues:{value:a=>{i.issues.push(...a),i.message=JSON.stringify(i.issues,Xu,2)}},isEmpty:{get(){return i.issues.length===0}}})},Mi=fe("ZodError",qx,{Parent:Error}),Gx=dh(Mi),Wx=_h(Mi),Yx=dl(Mi),Vx=_l(Mi),Kx=zb(Mi),Xx=jb(Mi),Jx=Hb(Mi),Qx=Ub(Mi),ew=Ib(Mi),tw=Pb(Mi),iw=$b(Mi),sw=Fb(Mi),dt=fe("ZodType",(i,r)=>(ft.init(i,r),Object.assign(i["~standard"],{jsonSchema:{input:sl(i,"input"),output:sl(i,"output")}}),i.toJSONSchema=mx(i,{}),i.def=r,i.type=r.type,Object.defineProperty(i,"_def",{value:r}),i.check=(...a)=>i.clone(Vs(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)=>Ks(i,a,o),i.brand=()=>i,i.register=((a,o)=>(a.add(i,o),i)),i.parse=(a,o)=>Gx(i,a,o,{callee:i.parse}),i.safeParse=(a,o)=>Yx(i,a,o),i.parseAsync=async(a,o)=>Wx(i,a,o,{callee:i.parseAsync}),i.safeParseAsync=async(a,o)=>Vx(i,a,o),i.spa=i.safeParseAsync,i.encode=(a,o)=>Kx(i,a,o),i.decode=(a,o)=>Xx(i,a,o),i.encodeAsync=async(a,o)=>Jx(i,a,o),i.decodeAsync=async(a,o)=>Qx(i,a,o),i.safeEncode=(a,o)=>ew(i,a,o),i.safeDecode=(a,o)=>tw(i,a,o),i.safeEncodeAsync=async(a,o)=>iw(i,a,o),i.safeDecodeAsync=async(a,o)=>sw(i,a,o),i.refine=(a,o)=>i.check(Kw(a,o)),i.superRefine=a=>i.check(Xw(a)),i.overwrite=a=>i.check(cn(a)),i.optional=()=>Fm(i),i.exactOptional=()=>jw(i),i.nullable=()=>Zm(i),i.nullish=()=>Fm(Zm(i)),i.nonoptional=a=>Fw(i,a),i.array=()=>pl(i),i.or=a=>kw([i,a]),i.and=a=>Mw(i,a),i.transform=a=>qm(i,Bw(a)),i.default=a=>Iw(i,a),i.prefault=a=>$w(i,a),i.catch=a=>qw(i,a),i.pipe=a=>qm(i,a),i.readonly=()=>Yw(i),i.describe=a=>{const o=i.clone();return va.add(o,{description:a}),o},Object.defineProperty(i,"description",{get(){var a;return(a=va.get(i))==null?void 0:a.description},configurable:!0}),i.meta=(...a)=>{if(a.length===0)return va.get(i);const o=i.clone();return va.add(o,a[0]),o},i.isOptional=()=>i.safeParse(void 0).success,i.isNullable=()=>i.safeParse(null).success,i.apply=a=>a(i),i)),nv=fe("_ZodString",(i,r)=>{mh.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(o,g,x)=>vx(i,o,g);const a=i._zod.bag;i.format=a.format??null,i.minLength=a.minimum??null,i.maxLength=a.maximum??null,i.regex=(...o)=>i.check(ex(...o)),i.includes=(...o)=>i.check(sx(...o)),i.startsWith=(...o)=>i.check(rx(...o)),i.endsWith=(...o)=>i.check(nx(...o)),i.min=(...o)=>i.check(il(...o)),i.max=(...o)=>i.check(Qp(...o)),i.length=(...o)=>i.check(ev(...o)),i.nonempty=(...o)=>i.check(il(1,...o)),i.lowercase=o=>i.check(tx(o)),i.uppercase=o=>i.check(ix(o)),i.trim=()=>i.check(ox()),i.normalize=(...o)=>i.check(ax(...o)),i.toLowerCase=()=>i.check(lx()),i.toUpperCase=()=>i.check(cx()),i.slugify=()=>i.check(ux())}),rw=fe("ZodString",(i,r)=>{mh.init(i,r),nv.init(i,r),i.email=a=>i.check(wC(nw,a)),i.url=a=>i.check(DC(aw,a)),i.jwt=a=>i.check(ZC(bw,a)),i.emoji=a=>i.check(kC(ow,a)),i.guid=a=>i.check(jm(Pm,a)),i.uuid=a=>i.check(EC(Zo,a)),i.uuidv4=a=>i.check(TC(Zo,a)),i.uuidv6=a=>i.check(AC(Zo,a)),i.uuidv7=a=>i.check(RC(Zo,a)),i.nanoid=a=>i.check(OC(lw,a)),i.guid=a=>i.check(jm(Pm,a)),i.cuid=a=>i.check(MC(cw,a)),i.cuid2=a=>i.check(LC(uw,a)),i.ulid=a=>i.check(NC(hw,a)),i.base64=a=>i.check(PC(gw,a)),i.base64url=a=>i.check($C(yw,a)),i.xid=a=>i.check(BC(fw,a)),i.ksuid=a=>i.check(zC(dw,a)),i.ipv4=a=>i.check(jC(_w,a)),i.ipv6=a=>i.check(HC(mw,a)),i.cidrv4=a=>i.check(UC(pw,a)),i.cidrv6=a=>i.check(IC(vw,a)),i.e164=a=>i.check(FC(Sw,a)),i.datetime=a=>i.check(Hx(a)),i.date=a=>i.check(Ix(a)),i.time=a=>i.check($x(a)),i.duration=a=>i.check(Zx(a))});function Ie(i){return xC(rw,i)}const lt=fe("ZodStringFormat",(i,r)=>{rt.init(i,r),nv.init(i,r)}),nw=fe("ZodEmail",(i,r)=>{O1.init(i,r),lt.init(i,r)}),Pm=fe("ZodGUID",(i,r)=>{D1.init(i,r),lt.init(i,r)}),Zo=fe("ZodUUID",(i,r)=>{k1.init(i,r),lt.init(i,r)}),aw=fe("ZodURL",(i,r)=>{M1.init(i,r),lt.init(i,r)}),ow=fe("ZodEmoji",(i,r)=>{L1.init(i,r),lt.init(i,r)}),lw=fe("ZodNanoID",(i,r)=>{N1.init(i,r),lt.init(i,r)}),cw=fe("ZodCUID",(i,r)=>{B1.init(i,r),lt.init(i,r)}),uw=fe("ZodCUID2",(i,r)=>{z1.init(i,r),lt.init(i,r)}),hw=fe("ZodULID",(i,r)=>{j1.init(i,r),lt.init(i,r)}),fw=fe("ZodXID",(i,r)=>{H1.init(i,r),lt.init(i,r)}),dw=fe("ZodKSUID",(i,r)=>{U1.init(i,r),lt.init(i,r)}),_w=fe("ZodIPv4",(i,r)=>{Z1.init(i,r),lt.init(i,r)}),mw=fe("ZodIPv6",(i,r)=>{q1.init(i,r),lt.init(i,r)}),pw=fe("ZodCIDRv4",(i,r)=>{G1.init(i,r),lt.init(i,r)}),vw=fe("ZodCIDRv6",(i,r)=>{W1.init(i,r),lt.init(i,r)}),gw=fe("ZodBase64",(i,r)=>{Y1.init(i,r),lt.init(i,r)}),yw=fe("ZodBase64URL",(i,r)=>{K1.init(i,r),lt.init(i,r)}),Sw=fe("ZodE164",(i,r)=>{X1.init(i,r),lt.init(i,r)}),bw=fe("ZodJWT",(i,r)=>{Q1.init(i,r),lt.init(i,r)}),av=fe("ZodNumber",(i,r)=>{Vp.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(o,g,x)=>gx(i,o,g),i.gt=(o,g)=>i.check(Um(o,g)),i.gte=(o,g)=>i.check(zu(o,g)),i.min=(o,g)=>i.check(zu(o,g)),i.lt=(o,g)=>i.check(Hm(o,g)),i.lte=(o,g)=>i.check(Bu(o,g)),i.max=(o,g)=>i.check(Bu(o,g)),i.int=o=>i.check($m(o)),i.safe=o=>i.check($m(o)),i.positive=o=>i.check(Um(0,o)),i.nonnegative=o=>i.check(zu(0,o)),i.negative=o=>i.check(Hm(0,o)),i.nonpositive=o=>i.check(Bu(0,o)),i.multipleOf=(o,g)=>i.check(Im(o,g)),i.step=(o,g)=>i.check(Im(o,g)),i.finite=()=>i;const a=i._zod.bag;i.minValue=Math.max(a.minimum??Number.NEGATIVE_INFINITY,a.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,i.maxValue=Math.min(a.maximum??Number.POSITIVE_INFINITY,a.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,i.isInt=(a.format??"").includes("int")||Number.isSafeInteger(a.multipleOf??.5),i.isFinite=!0,i.format=a.format??null});function Oe(i){return VC(av,i)}const Cw=fe("ZodNumberFormat",(i,r)=>{eC.init(i,r),av.init(i,r)});function $m(i){return KC(Cw,i)}const xw=fe("ZodBoolean",(i,r)=>{tC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>yx(i,a,o)});function ys(i){return XC(xw,i)}const ww=fe("ZodUnknown",(i,r)=>{iC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>bx()});function rl(){return JC(ww)}const Ew=fe("ZodNever",(i,r)=>{sC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Sx(i,a,o)});function Tw(i){return QC(Ew,i)}const Aw=fe("ZodArray",(i,r)=>{rC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Ex(i,a,o,g),i.element=r.element,i.min=(a,o)=>i.check(il(a,o)),i.nonempty=a=>i.check(il(1,a)),i.max=(a,o)=>i.check(Qp(a,o)),i.length=(a,o)=>i.check(ev(a,o)),i.unwrap=()=>i.element});function pl(i,r){return hx(Aw,i,r)}const Rw=fe("ZodObject",(i,r)=>{aC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Tx(i,a,o,g),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:rl()}),i.loose=()=>i.clone({...i._zod.def,catchall:rl()}),i.strict=()=>i.clone({...i._zod.def,catchall:Tw()}),i.strip=()=>i.clone({...i._zod.def,catchall:void 0}),i.extend=a=>Ab(i,a),i.safeExtend=a=>Rb(i,a),i.merge=a=>Db(i,a),i.pick=a=>Eb(i,a),i.omit=a=>Tb(i,a),i.partial=(...a)=>kb(ov,i,a[0]),i.required=(...a)=>Ob(lv,i,a[0])});function Lt(i,r){const a={type:"object",shape:i??{},...xe(r)};return new Rw(a)}const Dw=fe("ZodUnion",(i,r)=>{oC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Ax(i,a,o,g),i.options=r.options});function kw(i,r){return new Dw({type:"union",options:i,...xe(r)})}const Ow=fe("ZodIntersection",(i,r)=>{lC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Rx(i,a,o,g)});function Mw(i,r){return new Ow({type:"intersection",left:i,right:r})}const Lw=fe("ZodRecord",(i,r)=>{cC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Dx(i,a,o,g),i.keyType=r.keyType,i.valueType=r.valueType});function vl(i,r,a){return new Lw({type:"record",keyType:i,valueType:r,...xe(a)})}const Qu=fe("ZodEnum",(i,r)=>{uC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(o,g,x)=>Cx(i,o,g),i.enum=r.entries,i.options=Object.values(r.entries);const a=new Set(Object.keys(r.entries));i.extract=(o,g)=>{const x={};for(const T of o)if(a.has(T))x[T]=r.entries[T];else throw new Error(`Key ${T} not found in enum`);return new Qu({...r,checks:[],...xe(g),entries:x})},i.exclude=(o,g)=>{const x={...r.entries};for(const T of o)if(a.has(T))delete x[T];else throw new Error(`Key ${T} not found in enum`);return new Qu({...r,checks:[],...xe(g),entries:x})}});function an(i,r){const a=Array.isArray(i)?Object.fromEntries(i.map(o=>[o,o])):i;return new Qu({type:"enum",entries:a,...xe(r)})}const Nw=fe("ZodTransform",(i,r)=>{hC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>wx(i,a),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new Lp(i.constructor.name);a.addIssue=x=>{if(typeof x=="string")a.issues.push(ya(x,a.value,r));else{const T=x;T.fatal&&(T.continue=!1),T.code??(T.code="custom"),T.input??(T.input=a.value),T.inst??(T.inst=i),a.issues.push(ya(T))}};const g=r.transform(a.value,a);return g instanceof Promise?g.then(x=>(a.value=x,a)):(a.value=g,a)}});function Bw(i){return new Nw({type:"transform",transform:i})}const ov=fe("ZodOptional",(i,r)=>{Jp.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>rv(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Fm(i){return new ov({type:"optional",innerType:i})}const zw=fe("ZodExactOptional",(i,r)=>{fC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>rv(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function jw(i){return new zw({type:"optional",innerType:i})}const Hw=fe("ZodNullable",(i,r)=>{dC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>kx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Zm(i){return new Hw({type:"nullable",innerType:i})}const Uw=fe("ZodDefault",(i,r)=>{_C.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Mx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType,i.removeDefault=i.unwrap});function Iw(i,r){return new Uw({type:"default",innerType:i,get defaultValue(){return typeof r=="function"?r():jp(r)}})}const Pw=fe("ZodPrefault",(i,r)=>{mC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Lx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function $w(i,r){return new Pw({type:"prefault",innerType:i,get defaultValue(){return typeof r=="function"?r():jp(r)}})}const lv=fe("ZodNonOptional",(i,r)=>{pC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Ox(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Fw(i,r){return new lv({type:"nonoptional",innerType:i,...xe(r)})}const Zw=fe("ZodCatch",(i,r)=>{vC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Nx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType,i.removeCatch=i.unwrap});function qw(i,r){return new Zw({type:"catch",innerType:i,catchValue:typeof r=="function"?r:()=>r})}const Gw=fe("ZodPipe",(i,r)=>{gC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Bx(i,a,o,g),i.in=r.in,i.out=r.out});function qm(i,r){return new Gw({type:"pipe",in:i,out:r})}const Ww=fe("ZodReadonly",(i,r)=>{yC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>zx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Yw(i){return new Ww({type:"readonly",innerType:i})}const Vw=fe("ZodCustom",(i,r)=>{SC.init(i,r),dt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>xx(i,a)});function Kw(i,r={}){return fx(Vw,i,r)}function Xw(i){return dx(i)}const ph=an(["idle","working","permission_prompt","plan_mode","ask_question","bash_approval","settings","unknown"]),cv=Lt({ok:ys()}),Jw=cv.extend({delivered:ys(),attempts:Oe()}),Qw=Lt({status:Ie(),version:Ie(),uptime:Oe(),sessions:Lt({active:Oe(),total:Oe()}),timestamp:Ie()}),uv=Lt({id:Ie(),windowId:Ie(),windowName:Ie(),workDir:Ie(),claudeSessionId:Ie().optional(),jsonlPath:Ie().optional(),byteOffset:Oe(),monitorOffset:Oe(),status:ph,createdAt:Oe(),lastActivity:Oe(),stallThresholdMs:Oe(),permissionMode:Ie(),autoApprove:ys().optional(),settingsPatched:ys().optional(),promptDelivery:Lt({delivered:ys(),attempts:Oe()}).optional(),actionHints:vl(Ie(),Lt({method:Ie(),url:Ie(),description:Ie()})).optional()}),e2=Lt({sessions:pl(uv),pagination:Lt({page:Oe(),limit:Oe(),total:Oe(),totalPages:Oe()})}),t2=Lt({alive:ys(),windowExists:ys(),claudeRunning:ys(),paneCommand:Ie().nullable(),status:ph,hasTranscript:ys(),lastActivity:Oe(),lastActivityAgo:Oe(),sessionAge:Oe(),details:Ie(),actionHints:vl(Ie(),Lt({method:Ie(),url:Ie(),description:Ie()})).optional()}),i2=Lt({durationSec:Oe(),messages:Oe(),toolCalls:Oe(),approvals:Oe(),autoApprovals:Oe(),statusChanges:pl(Ie())}),s2=Lt({role:an(["user","assistant","system"]),contentType:an(["text","thinking","tool_use","tool_result","permission_request"]),text:Ie(),toolName:Ie().optional(),toolUseId:Ie().optional(),timestamp:Ie().optional()}),r2=Lt({messages:pl(s2),status:ph,statusText:Ie().nullable(),interactiveContent:Ie().nullable()}),n2=Lt({uptime:Oe(),sessions:Lt({total_created:Oe(),currently_active:Oe(),completed:Oe(),failed:Oe(),avg_duration_sec:Oe(),avg_messages_per_session:Oe()}),auto_approvals:Oe(),webhooks_sent:Oe(),webhooks_failed:Oe(),screenshots_taken:Oe(),pipelines_created:Oe(),batches_created:Oe(),prompt_delivery:Lt({sent:Oe(),delivered:Oe(),failed:Oe(),success_rate:Oe().nullable()})}),a2=an(["status","message","approval","ended","heartbeat","stall","dead","system","hook","subagent_start","subagent_stop"]),o2=Lt({event:a2,sessionId:Ie(),timestamp:Ie(),data:vl(Ie(),rl()).optional()}),l2=an(["session_status_change","session_message","session_approval","session_ended","session_created","session_stall","session_dead","session_subagent_start","session_subagent_stop"]),c2=Lt({event:l2,sessionId:Ie(),timestamp:Ie(),data:vl(Ie(),rl())}),u2=3e4,h2=300*1e3;class nl{constructor(r,a,o={}){At(this,"eventSource",null);At(this,"consecutiveFailures",0);At(this,"failStartTime",null);At(this,"destroyed",!1);At(this,"reconnectTimer",null);At(this,"url");At(this,"callbacks");At(this,"onMessage");this.url=r,this.onMessage=a,this.callbacks=o,this.connect()}connect(){this.destroyed||(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,(a=(r=this.callbacks).onOpen)==null||a.call(r))},this.eventSource.onerror=()=>{var a,o,g,x,T,c,u,h,y;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>=h2){(g=(o=this.callbacks).onGiveUp)==null||g.call(o),(T=(x=this.callbacks).onClose)==null||T.call(x);return}this.consecutiveFailures++;const r=Math.min(u2,1e3*Math.pow(2,this.consecutiveFailures-1));(u=(c=this.callbacks).onReconnecting)==null||u.call(c,this.consecutiveFailures,r),(y=(h=this.callbacks).onClose)==null||y.call(h),this.reconnectTimer=setTimeout(()=>this.connect(),r)})}close(){var r;this.destroyed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(r=this.eventSource)==null||r.close(),this.eventSource=null}}const f2="";function d2(i){if(!i)return{};if(i instanceof Headers){const r={};return i.forEach((a,o)=>{r[o]=a}),r}return i}function _2(i,r,a){const o=r.safeParse(i);if(o.success)return o.data;throw console.error(`[aegis] API response validation failed (${a}):`,o.error.issues),new Error(`API response validation failed for ${a}: ${o.error.issues.map(g=>g.message).join(", ")}`)}function m2(i){return!(i.name==="AbortError"||!i.message||i.message.includes("HTTP "))}async function vt(i,r={}){const a=localStorage.getItem("aegis_token"),o={"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{},...d2(r.headers)},{retries:g=0,schema:x,schemaContext:T,...c}=r;let u=null;for(let h=0;h<=g;h++)try{const y=await fetch(`${f2}${i}`,{...c,headers:o});if(!y.ok){const C=await y.json().catch(()=>({error:y.statusText})),w=new Error(C.error??`HTTP ${y.status}`);throw w.statusCode=y.status,w}const d=await y.json();return x?_2(d,x,T??i):d}catch(y){if(u=y,h<g&&m2(u))await new Promise(d=>setTimeout(d,1e3*Math.pow(2,h)));else throw u}throw u}function p2(){return vt("/v1/health",{schema:Qw,schemaContext:"getHealth"})}function v2(){return vt("/v1/metrics",{schema:n2,schemaContext:"getMetrics"})}function g2(){return vt("/v1/sessions",{schema:e2,schemaContext:"getSessions"})}function y2(i){return vt(`/v1/sessions/${encodeURIComponent(i)}`,{schema:uv,schemaContext:"getSession"})}function S2(i){const{signal:r,...a}=i;return vt("/v1/sessions",{method:"POST",body:JSON.stringify(a),signal:r})}function hv(i){return vt(`/v1/sessions/${encodeURIComponent(i)}`,{method:"DELETE",schema:cv,schemaContext:"killSession"})}function b2(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/health`,{schema:t2,schemaContext:"getSessionHealth"})}function C2(){return vt("/v1/sessions/health")}function x2(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/read`,{schema:r2,schemaContext:"getSessionMessages"})}function w2(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/metrics`,{schema:i2,schemaContext:"getSessionMetrics"})}function E2(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/pane`)}function T2(i,r){return vt(`/v1/sessions/${encodeURIComponent(i)}/send`,{method:"POST",body:JSON.stringify({text:r}),schema:Jw,schemaContext:"sendMessage"})}function fv(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/approve`,{method:"POST"})}function A2(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/reject`,{method:"POST"})}function dv(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/interrupt`,{method:"POST"})}function R2(i){return vt(`/v1/sessions/${encodeURIComponent(i)}/escape`,{method:"POST"})}const Gm=3,D2=1e3;async function _v(i,r){for(let a=0;a<Gm;a++){if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");try{return await B2(r)}catch{if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");if(a<Gm-1){const o=D2*Math.pow(2,a);await new Promise(g=>{const x=setTimeout(g,o);r==null||r.addEventListener("abort",()=>{clearTimeout(x),g(void 0)},{once:!0})})}}}throw i==null||i(),new Error("Real-time updates unavailable")}function mv(i,r,a,o){const g=`/v1/sessions/${encodeURIComponent(i)}/events`;let x=null,T=!1;const c=new AbortController;return a?_v(o==null?void 0:o.onGiveUp,c.signal).then(u=>{if(T)return;const h=`${g}?token=${encodeURIComponent(u.token)}`;x=new nl(h,r,o)}).catch(()=>{}):x=new nl(g,r,o),()=>{T=!0,c.abort(),x==null||x.close()}}function k2(i,r,a){const o="/v1/events";let g=null,x=!1;const T=new AbortController,c=u=>{try{const h=c2.safeParse(JSON.parse(u.data));if(!h.success){console.warn("Global SSE event failed validation",h.error.message);return}i(h.data)}catch{}};return r?_v(a==null?void 0:a.onGiveUp,T.signal).then(u=>{if(x)return;const h=`${o}?token=${encodeURIComponent(u.token)}`;g=new nl(h,c,a)}).catch(()=>{}):g=new nl(o,c,a),()=>{var u;x=!0,T.abort(),(u=a==null?void 0:a.onClose)==null||u.call(a),g==null||g.close()}}function O2(i){return vt("/v1/sessions/batch",{method:"POST",signal:i.signal,body:JSON.stringify(i)})}function M2(i){return vt("/v1/pipelines",{method:"POST",body:JSON.stringify(i)})}function L2(){return vt("/v1/pipelines")}function N2(i){return vt(`/v1/pipelines/${encodeURIComponent(i)}`)}function B2(i){return vt("/v1/auth/sse-token",{method:"POST",signal:i})}const qo=new Map;let z2=0;const Xs=Mp(i=>({toasts:[],addToast:(r,a,o)=>{const g=`toast-${++z2}`,x=setTimeout(()=>{qo.delete(g),i(T=>({toasts:T.toasts.filter(c=>c.id!==g)}))},4e3);return qo.set(g,x),i(T=>({toasts:[...T.toasts,{id:g,type:r,title:a,description:o}]})),g},removeToast:r=>{const a=qo.get(r);a&&(clearTimeout(a),qo.delete(r)),i(o=>({toasts:o.toasts.filter(g=>g.id!==r)}))}})),j2={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 H2({id:i,type:r,title:a,description:o}){const g=Xs(x=>x.removeToast);return O.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 ${j2[r]}`,children:[O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("p",{className:"text-sm font-medium",children:a}),o&&O.jsx("p",{className:"mt-0.5 text-xs opacity-80",children:o})]}),O.jsx("button",{onClick:()=>g(i),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:O.jsx(hl,{className:"h-3.5 w-3.5"})})]})}function U2(){const i=Xs(r=>r.toasts);return i.length===0?null:O.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=>O.jsx("div",{className:"pointer-events-auto",children:O.jsx(H2,{id:r.id,type:r.type,title:r.title,description:r.description})},r.id))})}const I2=[{to:"/",label:"Overview",icon:HS},{to:"/pipelines",label:"Pipelines",icon:kp}];function P2(){const i=Mt(x=>x.sseConnected),r=Mt(x=>x.setSseConnected),a=Mt(x=>x.addActivity),o=Mt(x=>x.token),g=F.useRef(null);return F.useEffect(()=>{const x=k2(T=>{T.sessionId&&a(T)},o,{onOpen:()=>{g.current&&(clearTimeout(g.current),g.current=null),r(!0)},onClose:()=>{g.current=setTimeout(()=>{r(!1)},2e3)}});return()=>{g.current&&clearTimeout(g.current),x()}},[r,a,o]),O.jsxs("div",{className:"flex h-screen overflow-hidden bg-void",children:[O.jsxs("aside",{className:"flex w-56 flex-col border-r border-void-lighter bg-void-light shrink-0",children:[O.jsxs("div",{className:"flex items-center gap-2 px-4 py-5 border-b border-void-lighter",children:[O.jsx(tb,{className:"h-6 w-6 text-cyan glow-text-cyan"}),O.jsx("span",{className:"text-lg font-semibold tracking-tight text-gray-100",children:"Aegis"})]}),O.jsxs("nav",{className:"flex flex-col gap-1 px-2 py-4 flex-1",children:[I2.map(({to:x,label:T,icon:c})=>O.jsxs(Ap,{to:x,end:x==="/",className:({isActive:u})=>`flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${u?"bg-cyan/10 text-cyan":"text-gray-400 hover:bg-void-lighter hover:text-gray-200"}`,children:[O.jsx(c,{className:"h-4 w-4"}),T]},x)),O.jsx("div",{className:"mt-4 border-t border-void-lighter pt-4 opacity-40",children:O.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 text-sm text-gray-500",children:[O.jsx(nb,{className:"h-4 w-4"}),"Sessions"]})})]})]}),O.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[O.jsxs("header",{className:"flex items-center justify-between border-b border-void-lighter bg-void-light px-6 py-3 shrink-0",children:[O.jsx("h1",{className:"text-sm font-medium text-gray-300",children:"Aegis Dashboard"}),O.jsx("div",{className:"flex items-center gap-3",children:O.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[O.jsx("span",{className:`status-dot ${i?"status-dot--idle":""}`,style:i?void 0:{backgroundColor:"#666"}}),i?"SSE Live":"SSE Off"]})})]}),O.jsx("main",{className:"flex-1 overflow-auto p-6",children:O.jsx(Iy,{})})]}),O.jsx(U2,{})]})}function $2(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 pr(i){const r=Date.now()-i;if(r<0)return"just now";const a=Math.floor(r/1e3);if(a<60)return`${a}s ago`;const o=Math.floor(a/60);if(o<60)return`${o}m ago`;const g=Math.floor(o/60);return g<24?`${g}h ago`:`${Math.floor(g/24)}d ago`}function F2(i){if(i<0)return"0s";const r=Math.floor(i/1e3);if(r<60)return`${r}s`;const a=Math.floor(r/60),o=r%60;if(a<60)return`${a}m ${o.toString().padStart(2,"0")}s`;const g=Math.floor(a/60),x=a%60;return`${g}h ${x.toString().padStart(2,"0")}m`}function qs({label:i,value:r,icon:a,suffix:o}){return O.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[O.jsxs("div",{className:"mb-2 flex items-center gap-2 text-sm text-[#888]",children:[a,i]}),O.jsxs("div",{className:"font-mono text-2xl text-[#00e5ff]",children:[r,o&&O.jsx("span",{className:"ml-1 text-base text-[#666]",children:o})]})]})}function Z2(){const i=Mt(y=>y.metrics),r=Mt(y=>y.setMetrics),[a,o]=F.useState(null),g=Xs(y=>y.addToast),x=F.useCallback(async()=>{try{const[y,d]=await Promise.all([v2(),p2()]);r(y),o(d)}catch(y){g("error","Failed to load metrics",y instanceof Error?y.message:void 0)}},[r,o,g]);F.useEffect(()=>{x();const y=setInterval(x,1e4);return()=>clearInterval(y)},[x]);const T=(i==null?void 0:i.sessions.currently_active)??(a==null?void 0:a.sessions.active)??0,c=(i==null?void 0:i.sessions.total_created)??(a==null?void 0:a.sessions.total)??0,u=i==null?void 0:i.prompt_delivery.success_rate,h=(a==null?void 0:a.uptime)??(i==null?void 0:i.uptime)??0;return O.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:[O.jsx(qs,{label:"Active Sessions",value:T,icon:O.jsx(kp,{className:"h-4 w-4"})}),O.jsx(qs,{label:"Total Created",value:c,icon:O.jsx(zS,{className:"h-4 w-4"})}),O.jsx(qs,{label:"Delivery Rate",value:u!=null?u.toFixed(1):"—",suffix:"%",icon:O.jsx(mb,{className:"h-4 w-4"})}),O.jsx(qs,{label:"Uptime",value:$2(h),icon:O.jsx(MS,{className:"h-4 w-4"})})]})}const Wm={idle:"#00ff88",working:"#00e5ff",permission_prompt:"#ffaa00",bash_approval:"#ffaa00",plan_mode:"#ff8800",ask_question:"#ff3366",settings:"#00e5ff",unknown:"#666666"},q2=new Set(["working","permission_prompt","bash_approval","ask_question"]);function al({status:i}){const r=Wm[i]??Wm.unknown,a=q2.has(i);return O.jsx("span",{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}})}function G2(){const i=Mt(y=>y.sessions),r=Mt(y=>y.healthMap),a=Mt(y=>y.setSessionsAndHealth),o=Xs(y=>y.addToast),g=F.useCallback(async()=>{try{const y=await g2();let d={};try{const C=await C2(),w=new Set(y.sessions.map(k=>k.id));for(const[k,b]of Object.entries(C))w.has(k)&&(d[k]={alive:b.alive,loading:!1})}catch{}a(y.sessions,d)}catch(y){o("error","Failed to fetch sessions",y instanceof Error?y.message:void 0)}},[o,a]);F.useEffect(()=>{g();const y=setInterval(g,5e3);return()=>clearInterval(y)},[g]);const x=async(y,d)=>{y.preventDefault();try{await fv(d)}catch(C){o("error","Approve failed",C instanceof Error?C.message:void 0)}},T=async(y,d)=>{y.preventDefault();try{await dv(d)}catch(C){o("error","Interrupt failed",C instanceof Error?C.message:void 0)}},c=async(y,d)=>{if(y.preventDefault(),!!confirm("Kill this session?"))try{await hv(d)}catch(C){o("error","Failed to kill session",C instanceof Error?C.message:void 0)}};if(i.length===0)return O.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:O.jsx("p",{className:"text-gray-500",children:"No active sessions"})});const u=y=>y.status==="permission_prompt"||y.status==="bash_approval",h=(y,d=40)=>y.length>d?`…${y.slice(y.length-d+1)}`:y;return O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"md:hidden space-y-3",children:i.map(y=>{const d=r[y.id],C=d?d.alive:!0;return O.jsxs(Wi,{to:`/sessions/${encodeURIComponent(y.id)}`,className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 active:bg-[#1a1a2e]/50 transition-colors",children:[O.jsxs("div",{className:"flex items-center justify-between mb-2",children:[O.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[O.jsx(al,{status:y.status}),O.jsx("span",{className:"font-medium text-gray-200 truncate",children:y.windowName||y.id}),!C&&O.jsx(Po,{className:"h-3.5 w-3.5 text-red-400 shrink-0"})]}),O.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[u(y)&&O.jsx("button",{onClick:w=>x(w,y.id),className:"min-h-[44px] min-w-[44px] flex items-center justify-center rounded-md bg-green-900/30 p-2 text-green-400 transition-colors hover:bg-green-900/50",title:"Approve",children:O.jsx(Cm,{className:"h-4 w-4"})}),O.jsx("button",{onClick:w=>T(w,y.id),className:"min-h-[44px] min-w-[44px] flex items-center justify-center rounded-md bg-yellow-900/30 p-2 text-yellow-400 transition-colors hover:bg-yellow-900/50",title:"Interrupt",children:O.jsx(Sm,{className:"h-4 w-4"})}),O.jsx("button",{onClick:w=>c(w,y.id),className:"min-h-[44px] min-w-[44px] flex items-center justify-center rounded-md bg-red-900/30 p-2 text-red-400 transition-colors hover:bg-red-900/50",title:"Kill",children:O.jsx(Po,{className:"h-4 w-4"})})]})]}),O.jsx("div",{className:"font-mono text-xs text-gray-500 truncate mb-1.5",children:h(y.workDir,50)}),O.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-500",children:[O.jsxs("span",{children:["Age: ",pr(y.createdAt)]}),O.jsxs("span",{children:["Active: ",pr(y.lastActivity)]}),y.permissionMode&&y.permissionMode!=="default"?O.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-900/30 px-2 py-0.5 text-green-400",children:[O.jsx(bm,{className:"h-3 w-3"})," ",y.permissionMode]}):null]})]},y.id)})}),O.jsx("div",{className:"hidden md:block overflow-x-auto rounded-lg border border-void-lighter bg-[#111118]",children:O.jsxs("table",{className:"w-full text-left text-sm",children:[O.jsx("thead",{children:O.jsxs("tr",{className:"border-b border-void-lighter text-[#666]",children:[O.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"WorkDir"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Age"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Last Activity"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Permission"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Actions"})]})}),O.jsx("tbody",{children:i.map(y=>{const d=r[y.id],C=d?d.alive:!0;return O.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[O.jsx("td",{className:"px-4 py-3",children:O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(al,{status:y.status}),!C&&O.jsx(Po,{className:"h-3.5 w-3.5 text-red-400"})]})}),O.jsx("td",{className:"px-4 py-3",children:O.jsx(Wi,{to:`/sessions/${encodeURIComponent(y.id)}`,className:"font-medium text-gray-200 hover:text-cyan transition-colors",children:y.windowName||y.id})}),O.jsx("td",{className:"px-4 py-3 max-w-[200px] truncate font-mono text-xs text-gray-400",title:y.workDir,children:h(y.workDir)}),O.jsx("td",{className:"px-4 py-3 whitespace-nowrap text-gray-400",children:pr(y.createdAt)}),O.jsx("td",{className:"px-4 py-3 whitespace-nowrap text-gray-400",children:pr(y.lastActivity)}),O.jsx("td",{className:"px-4 py-3",children:y.permissionMode&&y.permissionMode!=="default"?O.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:[O.jsx(bm,{className:"h-3 w-3"}),y.permissionMode]}):O.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"})}),O.jsx("td",{className:"px-4 py-3",children:O.jsxs("div",{className:"flex items-center gap-1.5",children:[u(y)&&O.jsx("button",{onClick:w=>x(w,y.id),className:"min-h-[44px] min-w-[44px] flex items-center justify-center rounded-md bg-green-900/30 text-xs font-medium text-green-400 transition-colors hover:bg-green-900/50",title:"Approve",children:O.jsx(Cm,{className:"h-3 w-3"})}),O.jsx("button",{onClick:w=>T(w,y.id),className:"min-h-[44px] min-w-[44px] flex items-center justify-center rounded-md bg-yellow-900/30 text-xs font-medium text-yellow-400 transition-colors hover:bg-yellow-900/50",title:"Interrupt",children:O.jsx(Sm,{className:"h-3 w-3"})}),O.jsx("button",{onClick:w=>c(w,y.id),className:"min-h-[44px] min-w-[44px] flex items-center justify-center rounded-md bg-red-900/30 text-xs font-medium text-red-400 transition-colors hover:bg-red-900/50",title:"Kill",children:O.jsx(Po,{className:"h-3 w-3"})})]})})]},y.id)})})]})})]})}const ju={session_status_change:{icon:VS,label:"Status",color:"#00e5ff"},session_message:{icon:PS,label:"Message",color:"#00ff88"},session_approval:{icon:QS,label:"Approval",color:"#ffaa00"},session_ended:{icon:WS,label:"Ended",color:"#ff3366"},session_created:{icon:DS,label:"Created",color:"#a78bfa"},session_stall:{icon:lb,label:"Stall",color:"#ff6600"},session_dead:{icon:sb,label:"Dead",color:"#ff0044"},session_subagent_start:{icon:fb,label:"Subagent",color:"#38bdf8"},session_subagent_stop:{icon:ub,label:"Subagent Done",color:"#34d399"}};function mr(i,r="unknown"){return typeof i=="string"?i:r}function W2(i){const r=i.data;switch(i.event){case"session_status_change":{const a=mr(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}: ${Ym(o,80)}`}case"session_approval":{const a=typeof r.prompt=="string"?r.prompt:JSON.stringify(r.prompt??"");return`Approval needed: ${Ym(a,80)}`}case"session_ended":return`Session ended: ${mr(r.reason)}`;case"session_created":return`Created in ${mr(r.workDir,"unknown dir")}`;case"session_stall":return`Session stalled: ${mr(r.stallType)}`;case"session_dead":return`Session dead: ${mr(r.stallType)}`;case"session_subagent_start":return`Subagent started: ${mr(r.name)}`;case"session_subagent_stop":return`Subagent finished: ${mr(r.name)}`;default:return JSON.stringify(r)}}function Ym(i,r){return i.length>r?i.slice(0,r)+"...":i}function Y2(i){try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function V2(){const i=Mt(h=>h.activities),r=Mt(h=>h.activityFilterSession),a=Mt(h=>h.activityFilterType),o=Mt(h=>h.setActivityFilterSession),g=Mt(h=>h.setActivityFilterType),x=Mt(h=>h.sessions),T=F.useMemo(()=>i.filter(h=>!(r&&h.sessionId!==r||a&&h.event!==a)),[i,r,a]),c=F.useMemo(()=>{const h=new Map;for(const y of x)h.set(y.id,y.windowName??y.id.slice(0,8));return h},[x]),u=h=>c.get(h)??(h??"unknown").slice(0,8);return O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg w-full",children:[O.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:[O.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Activity Stream"}),O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsxs("select",{value:r??"",onChange:h=>o(h.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:[O.jsx("option",{value:"",children:"All sessions"}),x.map(h=>O.jsx("option",{value:h.id,children:h.windowName||h.id.slice(0,8)},h.id))]}),O.jsxs("select",{value:a??"",onChange:h=>g(h.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:[O.jsx("option",{value:"",children:"All types"}),Object.entries(ju).map(([h,y])=>O.jsx("option",{value:h,children:y.label},h))]}),(r||a)&&O.jsx("button",{onClick:()=>{o(null),g(null)},className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300",children:O.jsx(hl,{className:"h-4 w-4"})})]})]}),O.jsxs("div",{className:"max-h-[360px] overflow-y-auto divide-y divide-[#1a1a2e]/50",children:[T.length===0&&O.jsx("div",{className:"px-4 py-8 text-center text-sm text-[#555]",children:"No activity yet"}),T.map((h,y)=>{const d=ju[h.event]??ju.session_status_change,C=d.icon;return O.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:[O.jsx(C,{className:"h-4 w-4 mt-0.5 shrink-0",style:{color:d.color}}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[O.jsx("span",{className:"text-xs font-medium text-gray-300 truncate",children:u(h.sessionId)}),O.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})]}),O.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:W2(h)})]}),O.jsx("span",{className:"text-[10px] text-[#444] shrink-0 tabular-nums mt-0.5",children:Y2(h.timestamp)})]},`${h.sessionId}-${h.timestamp}-${y}`)})]})]})}function K2({open:i,onClose:r}){const a=ll(),o=F.useRef(null),g=F.useRef(null),x=F.useCallback(()=>{P(),r()},[r]),T=F.useRef(null);F.useEffect(()=>{if(!i)return;const N=U=>{var L;U.key==="Escape"&&((L=g.current)==null||L.abort(),x())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[i,x]),F.useEffect(()=>{if(!i)return;const N=T.current;if(!N)return;const U='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',L=H=>{if(H.key!=="Tab")return;const V=Array.from(N.querySelectorAll(U));if(V.length===0)return;const re=V[0],ue=V[V.length-1];H.shiftKey?document.activeElement===re&&(H.preventDefault(),ue.focus()):document.activeElement===ue&&(H.preventDefault(),re.focus())};return N.addEventListener("keydown",L),()=>N.removeEventListener("keydown",L)},[i]),F.useEffect(()=>{if(i){const N=setTimeout(()=>{var U;return(U=o.current)==null?void 0:U.focus()},50);return()=>clearTimeout(N)}},[i]);const[c,u]=F.useState(""),[h,y]=F.useState(""),[d,C]=F.useState(""),[w,k]=F.useState("default"),[b,m]=F.useState(!1),[v,f]=F.useState(null);let p=0;function S(){return{workDir:"",name:"",prompt:"",_key:p++}}const[A,R]=F.useState("single"),[M,E]=F.useState([S(),S()]),[B,$]=F.useState(""),[I,q]=F.useState(null);function P(){u(""),y(""),C(""),k("default"),m(!1),f(null),E([S(),S()]),$(""),q(null),R("single")}function J(){M.length>=10||E([...M,S()])}function te(N){M.length<=1||E(M.filter((U,L)=>L!==N))}function G(N,U,L){E(M.map((H,V)=>V===N?{...H,[U]:L}:H))}async function se(N){var H;N.preventDefault(),f(null),q(null);const U=M.filter(V=>V.workDir.trim());if(U.length===0){f("At least one working directory is required");return}m(!0),(H=g.current)==null||H.abort();const L=new AbortController;g.current=L;try{const V=await O2({sessions:U.map(re=>({workDir:re.workDir.trim(),name:re.name.trim()||void 0,prompt:re.prompt.trim()||B.trim()||void 0,permissionMode:w})),signal:L.signal});q(V)}catch(V){if(L.signal.aborted)return;f(V instanceof Error?V.message:"Failed to create sessions")}finally{g.current===L&&(g.current=null,m(!1))}}if(!i)return null;async function ae(N){var L;if(N.preventDefault(),f(null),!c.trim()){f("Working directory is required");return}m(!0),(L=g.current)==null||L.abort();const U=new AbortController;g.current=U;try{const H=await S2({workDir:c.trim(),name:h.trim()||void 0,prompt:d.trim()||void 0,permissionMode:w,signal:U.signal});P(),r(),a(`/sessions/${H.id}`)}catch(H){if(U.signal.aborted)return;f(H instanceof Error?H.message:"Failed to create session")}finally{g.current===U&&(g.current=null,m(!1))}}return O.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[O.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:x}),O.jsxs("div",{ref:T,role:"dialog","aria-modal":"true","aria-label":"Create new session",className:`relative w-full ${A==="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:[O.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[O.jsxs("div",{className:"flex items-center gap-4",children:[O.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Session"}),O.jsxs("div",{className:"flex rounded bg-[#0a0a0f] p-0.5",children:[O.jsx("button",{type:"button",onClick:()=>R("single"),className:`px-3 py-1 text-xs rounded transition-colors ${A==="single"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Single"}),O.jsx("button",{type:"button",onClick:()=>R("batch"),className:`px-3 py-1 text-xs rounded transition-colors ${A==="batch"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Batch"})]})]}),O.jsx("button",{onClick:x,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:O.jsx(hl,{className:"h-4 w-4"})})]}),A==="single"&&O.jsxs("form",{onSubmit:ae,className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{children:[O.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Working Directory ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("input",{type:"text",ref:o,value:c,onChange:N=>u(N.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"})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Session Name"}),O.jsx("input",{type:"text",value:h,onChange:N=>y(N.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]"})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Initial Prompt"}),O.jsx("textarea",{value:d,onChange:N=>C(N.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"})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),O.jsxs("select",{value:w,onChange:N=>k(N.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:[O.jsx("option",{value:"default",children:"default — asks for everything"}),O.jsx("option",{value:"plan",children:"plan — auto-reads, asks for writes"}),O.jsx("option",{value:"acceptEdits",children:"acceptEdits — auto-edits, asks for bash"}),O.jsx("option",{value:"bypassPermissions",children:"bypassPermissions — never asks"}),O.jsx("option",{value:"auto",children:"auto — auto-approve in sandbox"})]})]}),v&&O.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:v}),O.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[O.jsx("button",{type:"button",onClick:x,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"}),O.jsxs("button",{type:"submit",disabled:b||!c.trim(),className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[b&&O.jsx(Ku,{className:"h-3 w-3 animate-spin"}),"Create Session"]})]})]}),A==="batch"&&!I&&O.jsxs("form",{onSubmit:se,className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Shared Prompt"}),O.jsx("textarea",{value:B,onChange:N=>$(N.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"})]}),O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[O.jsxs("span",{children:["Working Directory ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("span",{children:"Name"}),O.jsx("span",{children:"Prompt (override)"}),O.jsx("span",{})]}),O.jsx("div",{className:"space-y-2",children:M.map((N,U)=>O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[O.jsx("input",{type:"text",value:N.workDir,onChange:L=>G(U,"workDir",L.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"}),O.jsx("input",{type:"text",value:N.name,onChange:L=>G(U,"name",L.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]"}),O.jsx("input",{type:"text",value:N.prompt,onChange:L=>G(U,"prompt",L.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]"}),O.jsx("button",{type:"button",onClick:()=>te(U),disabled:M.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:O.jsx(Op,{className:"h-3.5 w-3.5"})})]},N._key))}),M.length<10&&O.jsxs("button",{type:"button",onClick:J,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[O.jsx(ul,{className:"h-3.5 w-3.5"}),"Add session"]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),O.jsxs("select",{value:w,onChange:N=>k(N.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:[O.jsx("option",{value:"default",children:"default — asks for everything"}),O.jsx("option",{value:"plan",children:"plan — auto-reads, asks for writes"}),O.jsx("option",{value:"acceptEdits",children:"acceptEdits — auto-edits, asks for bash"}),O.jsx("option",{value:"bypassPermissions",children:"bypassPermissions — never asks"}),O.jsx("option",{value:"auto",children:"auto — auto-approve in sandbox"})]})]}),v&&O.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:v}),O.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[O.jsx("button",{type:"button",onClick:x,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"}),O.jsxs("button",{type:"submit",disabled:b||!M.some(N=>N.workDir.trim()),className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[b&&O.jsx(Ku,{className:"h-3 w-3 animate-spin"}),"Create ",M.filter(N=>N.workDir.trim()).length," Session(s)"]})]})]}),I&&O.jsxs("div",{className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{className:"flex items-center gap-3",children:[I.created>0&&O.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:[I.created," created"]}),I.failed>0&&O.jsxs("span",{className:"text-xs font-medium text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-1.5",children:[I.failed," failed"]})]}),I.sessions.length>0&&O.jsxs("div",{className:"space-y-1",children:[O.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Created sessions"}),O.jsx("ul",{className:"space-y-1",children:I.sessions.map(N=>O.jsx("li",{children:O.jsxs("button",{type:"button",onClick:()=>{x(),a(`/sessions/${N.id}`)},className:"text-xs text-[#00e5ff] hover:underline font-mono",children:[N.id.slice(0,8),"...",N.name?` — ${N.name}`:""]})},N.id))})]}),I.errors.length>0&&O.jsxs("div",{className:"space-y-1",children:[O.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Errors"}),O.jsx("ul",{className:"space-y-1",children:I.errors.map((N,U)=>O.jsx("li",{className:"text-xs text-[#ff3366]",children:N},U))})]}),O.jsx("div",{className:"flex justify-end pt-2",children:O.jsx("button",{type:"button",onClick:x,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 X2(){const[i,r]=F.useState(!1);return O.jsxs("div",{className:"flex flex-col gap-6",children:[O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{children:[O.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Overview"}),O.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Aegis session monitoring and metrics"})]}),O.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:[O.jsx(ul,{className:"h-3.5 w-3.5"}),"New Session"]})]}),O.jsx(Z2,{}),O.jsxs("div",{children:[O.jsx("h3",{className:"mb-3 text-lg font-semibold text-gray-200",children:"Sessions"}),O.jsx(G2,{})]}),O.jsx(V2,{}),O.jsx(K2,{open:i,onClose:()=>r(!1)})]})}function Vm(i){return i instanceof Error&&"statusCode"in i}function J2(i){const r=Mt(J=>J.token),a=Xs(J=>J.addToast),[o,g]=F.useState(null),[x,T]=F.useState(null),[c,u]=F.useState(!1),[h,y]=F.useState(!0),[d,C]=F.useState(""),[w,k]=F.useState(!0),[b,m]=F.useState(null),[v,f]=F.useState(!0),p=F.useRef(i);p.current=i;const S=F.useRef(!1),A=F.useRef(0),R=F.useRef(void 0),M=F.useRef(void 0),E=F.useCallback(async()=>{try{const[J,te]=await Promise.allSettled([y2(p.current),b2(p.current)]);if(J.status==="rejected"&&Vm(J.reason)&&J.reason.statusCode===404||te.status==="rejected"&&Vm(te.reason)&&te.reason.statusCode===404){u(!0);return}J.status==="fulfilled"&&g(J.value),te.status==="fulfilled"&&T(te.value)}catch(J){a("error","Failed to load session",J instanceof Error?J.message:void 0)}finally{y(!1)}},[a]);R.current=E;const B=F.useCallback(async()=>{if(S.current)return;const J=p.current;try{const te=await E2(J);S.current||C(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 w2(J);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=B,F.useEffect(()=>(S.current=!1,A.current++,y(!0),k(!0),f(!0),E(),B(),()=>{S.current=!0,$.current&&clearTimeout($.current),I.current&&clearTimeout(I.current)}),[i,E,B]);const $=F.useRef(void 0),I=F.useRef(void 0),q=F.useCallback(()=>{$.current&&clearTimeout($.current);const J=A.current;$.current=setTimeout(()=>{var te;A.current===J&&((te=M.current)==null||te.call(M))},1e3)},[]),P=F.useCallback(()=>{I.current&&clearTimeout(I.current);const J=A.current;I.current=setTimeout(()=>{var te;A.current===J&&((te=R.current)==null||te.call(R))},1e3)},[]);return F.useEffect(()=>{if(!i)return;const J=mv(i,te=>{var G,se;try{const ae=o2.safeParse(JSON.parse(te.data));if(!ae.success){console.warn("SSE event failed validation",ae.error.message);return}switch(ae.data.event){case"status":case"approval":case"stall":case"dead":P(),q();break;case"message":q();break;case"ended":(G=R.current)==null||G.call(R),(se=M.current)==null||se.call(M);break}}catch{}},r);return()=>J()},[i,r,P,q]),{session:o,health:x,notFound:c,loading:h,paneContent:d,paneLoading:w,metrics:b,metricsLoading:v,refetchPaneAndMetrics:B}}const Q2={idle:"Idle",working:"Working",permission_prompt:"Permission",plan_mode:"Planning",ask_question:"Question",bash_approval:"Bash Approval",settings:"Settings",unknown:"Unknown"};function Km(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 Xm(i){return new Date(i).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function eE({session:i,health:r,onApprove:a,onReject:o,onInterrupt:g,onKill:x}){const[T,c]=F.useState(!1),u=r.status==="permission_prompt"||r.status==="bash_approval";return O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3 sm:p-4",children:[O.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[O.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[O.jsx(al,{status:r.status}),O.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:Q2[r.status]})]}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("h1",{className:"text-base sm:text-lg font-semibold text-[#e0e0e0] truncate",children:i.windowName||"Untitled Session"}),O.jsx("div",{className:"text-xs text-[#555] font-mono truncate mt-0.5",children:Km(i.workDir,40)})]}),O.jsxs("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[i.permissionMode&&i.permissionMode!=="default"&&O.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?O.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"}):O.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"})]})]}),O.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 text-[11px] text-[#555] mb-3 flex-wrap",children:[O.jsxs("span",{children:["Created: ",Xm(i.createdAt)]}),O.jsxs("span",{className:"hidden sm:inline",children:["Last activity: ",Xm(i.lastActivity)]}),O.jsxs("span",{className:"font-mono hidden sm:inline",children:["ID: ",Km(i.id,16)]}),r.details&&O.jsx("span",{className:"text-[#888] italic",children:r.details})]}),O.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u&&O.jsxs(O.Fragment,{children:[O.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"}),O.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"})]}),O.jsx("button",{onClick:g,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors",children:"Interrupt"}),T?O.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[O.jsx("span",{className:"text-xs text-[#ff3366]",children:"Confirm kill?"}),O.jsx("button",{onClick:()=>{x==null||x(),c(!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"}),O.jsx("button",{onClick:()=>c(!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"})]}):O.jsx("button",{onClick:()=>c(!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:pv,setPrototypeOf:Jm,isFrozen:tE,getPrototypeOf:iE,getOwnPropertyDescriptor:sE}=Object;let{freeze:Yt,seal:ki,create:Xo}=Object,{apply:eh,construct:th}=typeof Reflect<"u"&&Reflect;Yt||(Yt=function(r){return r});ki||(ki=function(r){return r});eh||(eh=function(r,a){for(var o=arguments.length,g=new Array(o>2?o-2:0),x=2;x<o;x++)g[x-2]=arguments[x];return r.apply(a,g)});th||(th=function(r){for(var a=arguments.length,o=new Array(a>1?a-1:0),g=1;g<a;g++)o[g-1]=arguments[g];return new r(...o)});const Go=Vt(Array.prototype.forEach),rE=Vt(Array.prototype.lastIndexOf),Qm=Vt(Array.prototype.pop),ua=Vt(Array.prototype.push),nE=Vt(Array.prototype.splice),Jo=Vt(String.prototype.toLowerCase),Hu=Vt(String.prototype.toString),Uu=Vt(String.prototype.match),ha=Vt(String.prototype.replace),aE=Vt(String.prototype.indexOf),oE=Vt(String.prototype.trim),_i=Vt(Object.prototype.hasOwnProperty),Gt=Vt(RegExp.prototype.test),fa=lE(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),g=1;g<a;g++)o[g-1]=arguments[g];return eh(i,r,o)}}function lE(i){return function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return th(i,a)}}function Me(i,r){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Jo;Jm&&Jm(i,null);let o=r.length;for(;o--;){let g=r[o];if(typeof g=="string"){const x=a(g);x!==g&&(tE(r)||(r[o]=x),g=x)}i[g]=!0}return i}function cE(i){for(let r=0;r<i.length;r++)_i(i,r)||(i[r]=null);return i}function qi(i){const r=Xo(null);for(const[a,o]of pv(i))_i(i,a)&&(Array.isArray(o)?r[a]=cE(o):o&&typeof o=="object"&&o.constructor===Object?r[a]=qi(o):r[a]=o);return r}function da(i,r){for(;i!==null;){const o=sE(i,r);if(o){if(o.get)return Vt(o.get);if(typeof o.value=="function")return Vt(o.value)}i=iE(i)}function a(){return null}return a}const ep=Yt(["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"]),Iu=Yt(["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"]),Pu=Yt(["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"]),uE=Yt(["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"]),$u=Yt(["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"]),hE=Yt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),tp=Yt(["#text"]),ip=Yt(["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"]),Fu=Yt(["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"]),sp=Yt(["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"]),Wo=Yt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),fE=ki(/\{\{[\w\W]*|[\w\W]*\}\}/gm),dE=ki(/<%[\w\W]*|[\w\W]*%>/gm),_E=ki(/\$\{[\w\W]*/gm),mE=ki(/^data-[\-\w.\u00B7-\uFFFF]+$/),pE=ki(/^aria-[\-\w]+$/),vv=ki(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vE=ki(/^(?:\w+script|data):/i),gE=ki(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gv=ki(/^html$/i),yE=ki(/^[a-z][.\w]*(-[.\w]+)+$/i);var rp=Object.freeze({__proto__:null,ARIA_ATTR:pE,ATTR_WHITESPACE:gE,CUSTOM_ELEMENT:yE,DATA_ATTR:mE,DOCTYPE_NAME:gv,ERB_EXPR:dE,IS_ALLOWED_URI:vv,IS_SCRIPT_OR_DATA:vE,MUSTACHE_EXPR:fE,TMPLIT_EXPR:_E});const _a={element:1,text:3,progressingInstruction:7,comment:8,document:9},SE=function(){return typeof window>"u"?null:window},bE=function(r,a){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let o=null;const g="data-tt-policy-suffix";a&&a.hasAttribute(g)&&(o=a.getAttribute(g));const x="dompurify"+(o?"#"+o:"");try{return r.createPolicy(x,{createHTML(T){return T},createScriptURL(T){return T}})}catch{return console.warn("TrustedTypes policy "+x+" could not be created."),null}},np=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function yv(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:SE();const r=Se=>yv(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,g=o.currentScript,{DocumentFragment:x,HTMLTemplateElement:T,Node:c,Element:u,NodeFilter:h,NamedNodeMap:y=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:C,trustedTypes:w}=i,k=u.prototype,b=da(k,"cloneNode"),m=da(k,"remove"),v=da(k,"nextSibling"),f=da(k,"childNodes"),p=da(k,"parentNode");if(typeof T=="function"){const Se=a.createElement("template");Se.content&&Se.content.ownerDocument&&(a=Se.content.ownerDocument)}let S,A="";const{implementation:R,createNodeIterator:M,createDocumentFragment:E,getElementsByTagName:B}=a,{importNode:$}=o;let I=np();r.isSupported=typeof pv=="function"&&typeof p=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:q,ERB_EXPR:P,TMPLIT_EXPR:J,DATA_ATTR:te,ARIA_ATTR:G,IS_SCRIPT_OR_DATA:se,ATTR_WHITESPACE:ae,CUSTOM_ELEMENT:N}=rp;let{IS_ALLOWED_URI:U}=rp,L=null;const H=Me({},[...ep,...Iu,...Pu,...$u,...tp]);let V=null;const re=Me({},[...ip,...Fu,...sp,...Wo]);let ue=Object.seal(Xo(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}})),me=null,Y=null;const j=Object.seal(Xo(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ce=!0,oe=!0,ve=!1,pe=!0,Te=!1,je=!0,Ue=!1,ct=!1,Ee=!1,Ft=!1,mi=!1,pi=!1,Ui=!0,Vi=!1;const Pt="user-content-";let nt=!0,Rt=!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 Ki=null;const Kt=Me({},["audio","video","img","source","image","track"]);let Li=null;const Ye=Me({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vi="http://www.w3.org/1998/Math/MathML",Dt="http://www.w3.org/2000/svg",kt="http://www.w3.org/1999/xhtml";let gt=kt,un=!1,hn=null;const gl=Me({},[vi,Dt,kt],Hu);let Xi=Me({},["mi","mo","mn","ms","mtext"]),Ji=Me({},["annotation-xml"]);const gr=Me({},["title","style","font","a","script"]);let ai=null;const yr=["application/xhtml+xml","text/html"],Js="text/html";let _t=null,Qi=null;const fn=a.createElement("form"),bs=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=qi(W),ai=yr.indexOf(W.PARSER_MEDIA_TYPE)===-1?Js:W.PARSER_MEDIA_TYPE,_t=ai==="application/xhtml+xml"?Hu:Jo,L=_i(W,"ALLOWED_TAGS")?Me({},W.ALLOWED_TAGS,_t):H,V=_i(W,"ALLOWED_ATTR")?Me({},W.ALLOWED_ATTR,_t):re,hn=_i(W,"ALLOWED_NAMESPACES")?Me({},W.ALLOWED_NAMESPACES,Hu):gl,Li=_i(W,"ADD_URI_SAFE_ATTR")?Me(qi(Ye),W.ADD_URI_SAFE_ATTR,_t):Ye,Ki=_i(W,"ADD_DATA_URI_TAGS")?Me(qi(Kt),W.ADD_DATA_URI_TAGS,_t):Kt,Nt=_i(W,"FORBID_CONTENTS")?Me({},W.FORBID_CONTENTS,_t):Bt,me=_i(W,"FORBID_TAGS")?Me({},W.FORBID_TAGS,_t):qi({}),Y=_i(W,"FORBID_ATTR")?Me({},W.FORBID_ATTR,_t):qi({}),Zt=_i(W,"USE_PROFILES")?W.USE_PROFILES:!1,ce=W.ALLOW_ARIA_ATTR!==!1,oe=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,je=W.SAFE_FOR_XML!==!1,Ue=W.WHOLE_DOCUMENT||!1,Ft=W.RETURN_DOM||!1,mi=W.RETURN_DOM_FRAGMENT||!1,pi=W.RETURN_TRUSTED_TYPE||!1,Ee=W.FORCE_BODY||!1,Ui=W.SANITIZE_DOM!==!1,Vi=W.SANITIZE_NAMED_PROPS||!1,nt=W.KEEP_CONTENT!==!1,Rt=W.IN_PLACE||!1,U=W.ALLOWED_URI_REGEXP||vv,gt=W.NAMESPACE||kt,Xi=W.MATHML_TEXT_INTEGRATION_POINTS||Xi,Ji=W.HTML_INTEGRATION_POINTS||Ji,ue=W.CUSTOM_ELEMENT_HANDLING||{},W.CUSTOM_ELEMENT_HANDLING&&bs(W.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ue.tagNameCheck=W.CUSTOM_ELEMENT_HANDLING.tagNameCheck),W.CUSTOM_ELEMENT_HANDLING&&bs(W.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ue.attributeNameCheck=W.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),W.CUSTOM_ELEMENT_HANDLING&&typeof W.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ue.allowCustomizedBuiltInElements=W.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Te&&(oe=!1),mi&&(Ft=!0),Zt&&(L=Me({},tp),V=Xo(null),Zt.html===!0&&(Me(L,ep),Me(V,ip)),Zt.svg===!0&&(Me(L,Iu),Me(V,Fu),Me(V,Wo)),Zt.svgFilters===!0&&(Me(L,Pu),Me(V,Fu),Me(V,Wo)),Zt.mathMl===!0&&(Me(L,$u),Me(V,sp),Me(V,Wo))),_i(W,"ADD_TAGS")||(j.tagCheck=null),_i(W,"ADD_ATTR")||(j.attributeCheck=null),W.ADD_TAGS&&(typeof W.ADD_TAGS=="function"?j.tagCheck=W.ADD_TAGS:(L===H&&(L=qi(L)),Me(L,W.ADD_TAGS,_t))),W.ADD_ATTR&&(typeof W.ADD_ATTR=="function"?j.attributeCheck=W.ADD_ATTR:(V===re&&(V=qi(V)),Me(V,W.ADD_ATTR,_t))),W.ADD_URI_SAFE_ATTR&&Me(Li,W.ADD_URI_SAFE_ATTR,_t),W.FORBID_CONTENTS&&(Nt===Bt&&(Nt=qi(Nt)),Me(Nt,W.FORBID_CONTENTS,_t)),W.ADD_FORBID_CONTENTS&&(Nt===Bt&&(Nt=qi(Nt)),Me(Nt,W.ADD_FORBID_CONTENTS,_t)),nt&&(L["#text"]=!0),Ue&&Me(L,["html","head","body"]),L.table&&(Me(L,["tbody"]),delete me.tbody),W.TRUSTED_TYPES_POLICY){if(typeof W.TRUSTED_TYPES_POLICY.createHTML!="function")throw fa('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof W.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw fa('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=W.TRUSTED_TYPES_POLICY,A=S.createHTML("")}else S===void 0&&(S=bE(w,g)),S!==null&&typeof A=="string"&&(A=S.createHTML(""));Yt&&Yt(W),Qi=W}},_n=Me({},[...Iu,...Pu,...uE]),mn=Me({},[...$u,...hE]),xa=function(W){let _e=p(W);(!_e||!_e.tagName)&&(_e={namespaceURI:gt,tagName:"template"});const ge=Jo(W.tagName),Ze=Jo(_e.tagName);return hn[W.namespaceURI]?W.namespaceURI===Dt?_e.namespaceURI===kt?ge==="svg":_e.namespaceURI===vi?ge==="svg"&&(Ze==="annotation-xml"||Xi[Ze]):!!_n[ge]:W.namespaceURI===vi?_e.namespaceURI===kt?ge==="math":_e.namespaceURI===Dt?ge==="math"&&Ji[Ze]:!!mn[ge]:W.namespaceURI===kt?_e.namespaceURI===Dt&&!Ji[Ze]||_e.namespaceURI===vi&&!Xi[Ze]?!1:!mn[ge]&&(gr[ge]||!_n[ge]):!!(ai==="application/xhtml+xml"&&hn[W.namespaceURI]):!1},Xt=function(W){ua(r.removed,{element:W});try{p(W).removeChild(W)}catch{m(W)}},Ni=function(W,_e){try{ua(r.removed,{attribute:_e.getAttributeNode(W),from:_e})}catch{ua(r.removed,{attribute:null,from:_e})}if(_e.removeAttribute(W),W==="is")if(Ft||mi)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 ke=Uu(W,/^[\r\n\t ]+/);ge=ke&&ke[0]}ai==="application/xhtml+xml"&&gt===kt&&(W='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+W+"</body></html>");const Ze=S?S.createHTML(W):W;if(gt===kt)try{_e=new C().parseFromString(Ze,ai)}catch{}if(!_e||!_e.documentElement){_e=R.createDocument(gt,"template",null);try{_e.documentElement.innerHTML=un?A:Ze}catch{}}const at=_e.body||_e.documentElement;return W&&ge&&at.insertBefore(a.createTextNode(ge),at.childNodes[0]||null),gt===kt?B.call(_e,Ue?"html":"body")[0]:Ue?_e.documentElement:at},vn=function(W){return M.call(W.ownerDocument||W,W,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.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")},yt=function(W){return typeof c=="function"&&W instanceof c};function it(Se,W,_e){Go(Se,ge=>{ge.call(r,W,_e,Qi)})}const es=function(W){let _e=null;if(it(I.beforeSanitizeElements,W,null),gi(W))return Xt(W),!0;const ge=_t(W.nodeName);if(it(I.uponSanitizeElement,W,{tagName:ge,allowedTags:L}),je&&W.hasChildNodes()&&!yt(W.firstElementChild)&&Gt(/<[/\w!]/g,W.innerHTML)&&Gt(/<[/\w!]/g,W.textContent)||W.nodeType===_a.progressingInstruction||je&&W.nodeType===_a.comment&&Gt(/<[/\w]/g,W.data))return Xt(W),!0;if(!(j.tagCheck instanceof Function&&j.tagCheck(ge))&&(!L[ge]||me[ge])){if(!me[ge]&&wa(ge)&&(ue.tagNameCheck instanceof RegExp&&Gt(ue.tagNameCheck,ge)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(ge)))return!1;if(nt&&!Nt[ge]){const Ze=p(W)||W.parentNode,at=f(W)||W.childNodes;if(at&&Ze){const ke=at.length;for(let zt=ke-1;zt>=0;--zt){const yi=b(at[zt],!0);yi.__removalCount=(W.__removalCount||0)+1,Ze.insertBefore(yi,v(W))}}}return Xt(W),!0}return W instanceof u&&!xa(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,Go([q,P,J],Ze=>{_e=ha(_e,Ze," ")}),W.textContent!==_e&&(ua(r.removed,{element:W.cloneNode()}),W.textContent=_e)),it(I.afterSanitizeElements,W,null),!1)},Sr=function(W,_e,ge){if(Y[_e]||Ui&&(_e==="id"||_e==="name")&&(ge in a||ge in fn))return!1;if(!(oe&&!Y[_e]&&Gt(te,_e))){if(!(ce&&Gt(G,_e))){if(!(j.attributeCheck instanceof Function&&j.attributeCheck(_e,W))){if(!V[_e]||Y[_e]){if(!(wa(W)&&(ue.tagNameCheck instanceof RegExp&&Gt(ue.tagNameCheck,W)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(W))&&(ue.attributeNameCheck instanceof RegExp&&Gt(ue.attributeNameCheck,_e)||ue.attributeNameCheck instanceof Function&&ue.attributeNameCheck(_e,W))||_e==="is"&&ue.allowCustomizedBuiltInElements&&(ue.tagNameCheck instanceof RegExp&&Gt(ue.tagNameCheck,ge)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(ge))))return!1}else if(!Li[_e]){if(!Gt(U,ha(ge,ae,""))){if(!((_e==="src"||_e==="xlink:href"||_e==="href")&&W!=="script"&&aE(ge,"data:")===0&&Ki[W])){if(!(ve&&!Gt(se,ha(ge,ae,"")))){if(ge)return!1}}}}}}}return!0},wa=function(W){return W!=="annotation-xml"&&Uu(W,N)},Ea=function(W){it(I.beforeSanitizeAttributes,W,null);const{attributes:_e}=W;if(!_e||gi(W))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V,forceKeepAttr:void 0};let Ze=_e.length;for(;Ze--;){const at=_e[Ze],{name:ke,namespaceURI:zt,value:yi}=at,Jt=_t(ke),Ii=yi;let Et=ke==="value"?Ii:oE(Ii);if(ge.attrName=Jt,ge.attrValue=Et,ge.keepAttr=!0,ge.forceKeepAttr=void 0,it(I.uponSanitizeAttribute,W,ge),Et=ge.attrValue,Vi&&(Jt==="id"||Jt==="name")&&(Ni(ke,W),Et=Pt+Et),je&&Gt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Et)){Ni(ke,W);continue}if(Jt==="attributename"&&Uu(Et,"href")){Ni(ke,W);continue}if(ge.forceKeepAttr)continue;if(!ge.keepAttr){Ni(ke,W);continue}if(!pe&&Gt(/\/>/i,Et)){Ni(ke,W);continue}Te&&Go([q,P,J],yn=>{Et=ha(Et,yn," ")});const gn=_t(W.nodeName);if(!Sr(gn,Jt,Et)){Ni(ke,W);continue}if(S&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!zt)switch(w.getAttributeType(gn,Jt)){case"TrustedHTML":{Et=S.createHTML(Et);break}case"TrustedScriptURL":{Et=S.createScriptURL(Et);break}}if(Et!==Ii)try{zt?W.setAttributeNS(zt,ke,Et):W.setAttribute(ke,Et),gi(W)?Xt(W):Qm(r.removed)}catch{Ni(ke,W)}}it(I.afterSanitizeAttributes,W,null)},Ta=function Se(W){let _e=null;const ge=vn(W);for(it(I.beforeSanitizeShadowDOM,W,null);_e=ge.nextNode();)it(I.uponSanitizeShadowNode,_e,null),es(_e),Ea(_e),_e.content instanceof x&&Se(_e.content);it(I.afterSanitizeShadowDOM,W,null)};return r.sanitize=function(Se){let W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_e=null,ge=null,Ze=null,at=null;if(un=!Se,un&&(Se="<!-->"),typeof Se!="string"&&!yt(Se))if(typeof Se.toString=="function"){if(Se=Se.toString(),typeof Se!="string")throw fa("dirty is not a string, aborting")}else throw fa("toString is not a function");if(!r.isSupported)return Se;if(ct||dn(W),r.removed=[],typeof Se=="string"&&(Rt=!1),Rt){if(Se.nodeName){const yi=_t(Se.nodeName);if(!L[yi]||me[yi])throw fa("root node is forbidden and cannot be sanitized in-place")}}else if(Se instanceof c)_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&&!Ue&&Se.indexOf("<")===-1)return S&&pi?S.createHTML(Se):Se;if(_e=pn(Se),!_e)return Ft?null:pi?A:""}_e&&Ee&&Xt(_e.firstChild);const ke=vn(Rt?Se:_e);for(;Ze=ke.nextNode();)es(Ze),Ea(Ze),Ze.content instanceof x&&Ta(Ze.content);if(Rt)return Se;if(Ft){if(mi)for(at=E.call(_e.ownerDocument);_e.firstChild;)at.appendChild(_e.firstChild);else at=_e;return(V.shadowroot||V.shadowrootmode)&&(at=$.call(o,at,!0)),at}let zt=Ue?_e.outerHTML:_e.innerHTML;return Ue&&L["!doctype"]&&_e.ownerDocument&&_e.ownerDocument.doctype&&_e.ownerDocument.doctype.name&&Gt(gv,_e.ownerDocument.doctype.name)&&(zt="<!DOCTYPE "+_e.ownerDocument.doctype.name+`>
254
+ `+zt),Te&&Go([q,P,J],yi=>{zt=ha(zt,yi," ")}),S&&pi?S.createHTML(zt):zt},r.setConfig=function(){let Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dn(Se),ct=!0},r.clearConfig=function(){Qi=null,ct=!1},r.isValidAttribute=function(Se,W,_e){Qi||dn({});const ge=_t(Se),Ze=_t(W);return Sr(ge,Ze,_e)},r.addHook=function(Se,W){typeof W=="function"&&ua(I[Se],W)},r.removeHook=function(Se,W){if(W!==void 0){const _e=rE(I[Se],W);return _e===-1?void 0:nE(I[Se],_e,1)[0]}return Qm(I[Se])},r.removeHooks=function(Se){I[Se]=[]},r.removeAllHooks=function(){I=np()},r}var CE=yv();function xE(i){return CE.sanitize(i,{ALLOWED_TAGS:[]})}const wE={Read:"📖",Edit:"✏️",Write:"📝",Bash:"💻",Search:"🔍"};function EE(i){return i?wE[i]??"❓":"❓"}function TE(i){if(!i)return"";try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function Zu({entry:i}){const r=i.role==="user";return O.jsx("div",{className:`flex ${r?"justify-end":"justify-start"} mb-3`,children:O.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:[O.jsx("div",{className:"whitespace-pre-wrap break-words",children:i.text}),i.timestamp&&O.jsx("div",{className:`text-[10px] mt-1 ${r?"text-[#555]":"text-[#444]"}`,children:TE(i.timestamp)})]})})}function AE({entry:i}){const[r,a]=F.useState(!1);return O.jsx("div",{className:"flex justify-start mb-3",children:O.jsxs("div",{className:"max-w-[80%] w-full",children:[O.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:[O.jsx("span",{className:"inline-block transition-transform duration-200",style:{transform:r?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),O.jsx("span",{className:"italic",children:"Thinking…"})]}),r&&O.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:i.text})]})})}function RE({entry:i}){const r=i.text.length>100?i.text.slice(0,100)+"…":i.text;return O.jsx("div",{className:"flex justify-start mb-3",children:O.jsxs("div",{className:"max-w-[80%] w-full bg-[#0d0d12] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[O.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-[#1a1a2e]",children:[O.jsx("span",{className:"text-base",children:EE(i.toolName)}),O.jsx("span",{className:"text-xs font-semibold text-[#00e5ff] font-mono",children:i.toolName??"Tool"}),O.jsx("span",{className:"text-[10px] text-[#555] ml-auto",children:"tool_use"})]}),O.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:r})]})})}function DE({entry:i}){const r=i.text.toLowerCase().startsWith("error")||i.text.length===0;return O.jsx("div",{className:"flex justify-start mb-3",children:O.jsxs("div",{className:`max-w-[80%] w-full bg-[#0d0d12] rounded-lg overflow-hidden ${r?"border border-[#ff3366]/40":"border border-[#00ff88]/30"}`,children:[O.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-[#1a1a2e]",children:[O.jsx("span",{className:"text-xs font-semibold text-[#888]",children:r?"✗ Result":"✓ Result"}),i.toolName&&O.jsx("span",{className:"text-[10px] text-[#555] font-mono",children:i.toolName})]}),O.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:i.text||"(empty)"})]})})}function kE({entry:i}){if(i.role==="user")return O.jsx(Zu,{entry:i});switch(i.contentType){case"text":return O.jsx(Zu,{entry:i});case"thinking":return O.jsx(AE,{entry:i});case"tool_use":return O.jsx(RE,{entry:i});case"tool_result":return O.jsx(DE,{entry:i});case"permission_request":return O.jsxs("div",{className:"text-red-400 text-sm font-semibold px-3 py-2",children:["Permission Request: ",xE(i.text)]});default:return O.jsx(Zu,{entry:i})}}const Yo=1e3;function qu(i){return`${i.timestamp??""}:${i.role}:${i.contentType}:${i.text.length}:${i.text.slice(0,80)}`}function OE({sessionId:i}){const[r,a]=F.useState([]),[o,g]=F.useState(!0),[x,T]=F.useState(null),c=Mt(S=>S.token),[u,h]=F.useState({thinking:!1,tool_use:!0,tool_result:!0}),[y,d]=F.useState(!1),C=F.useRef(null),w=F.useRef(null),k=F.useRef(!1),b=F.useRef(new Set);F.useEffect(()=>{let S=!1;return x2(i).then(A=>{if(!S){const R=A.messages??[],M=R.length>Yo?R.slice(R.length-Yo):R;a(M),b.current=new Set(M.map(qu))}}).catch(A=>{S||T(A instanceof Error?A.message:"Failed to load")}).finally(()=>{S||g(!1)}),()=>{S=!0}},[i]),F.useEffect(()=>{const S=mv(i,A=>{try{const R=JSON.parse(A.data);if(R.event!=="message")return;const M=R.data;a(E=>{const B=qu(M);if(b.current.has(B))return E;b.current.add(B);const $=[...E,M];if($.length>Yo){const I=$.slice($.length-Yo),q=new Set(I.map(qu));return b.current=q,I}return $})}catch{}},c);return()=>S()},[i,c]),F.useEffect(()=>{var S;k.current||(S=C.current)==null||S.scrollIntoView({behavior:"smooth"})},[r]);const m=F.useCallback(()=>{const S=w.current;if(!S)return;const A=S.scrollHeight-S.scrollTop-S.clientHeight<60;k.current=!A,d(!A)},[]),v=F.useCallback(()=>{var S;k.current=!1,(S=C.current)==null||S.scrollIntoView({behavior:"smooth"})},[]),f=F.useCallback(S=>{h(A=>({...A,[S]:!A[S]}))},[]),p=F.useMemo(()=>r.filter(S=>S.role==="user"?!0:!(S.contentType==="thinking"&&!u.thinking||S.contentType==="tool_use"&&!u.tool_use||S.contentType==="tool_result"&&!u.tool_result)),[r,u]);return o?O.jsx("div",{className:"flex items-center justify-center h-full text-[#555] text-sm",children:O.jsx("div",{className:"animate-pulse",children:"Loading transcript…"})}):x?O.jsxs("div",{className:"flex items-center justify-center h-full text-[#ff3366] text-sm",children:["⚠ ",x]}):O.jsxs("div",{className:"flex flex-col h-full relative",children:[O.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-[#1a1a2e] bg-[#0a0a0f] shrink-0",children:[O.jsx("span",{className:"text-[10px] text-[#555] uppercase tracking-wider",children:"Filter:"}),["thinking","tool_use","tool_result"].map(S=>O.jsx("button",{onClick:()=>f(S),"aria-pressed":u[S],className:`text-xs px-2 py-0.5 rounded border transition-colors ${u[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)),O.jsxs("span",{className:"text-[10px] text-[#444] ml-auto",children:[p.length," / ",r.length]})]}),O.jsxs("div",{ref:w,onScroll:m,className:"flex-1 overflow-y-auto px-4 py-3",children:[p.length===0&&O.jsx("div",{className:"flex items-center justify-center h-full text-[#555] text-sm",children:"No messages yet"}),p.map((S,A)=>O.jsx(kE,{entry:S},S.toolUseId??`${S.role}-${S.timestamp??A}`)),O.jsx("div",{ref:C})]}),y&&O.jsx("button",{onClick:v,className:"absolute bottom-4 right-4 bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#00e5ff] rounded-full w-10 h-10 flex items-center justify-center shadow-lg border border-[#1a1a2e] transition-colors z-10",title:"Scroll to bottom",children:"↓"})]})}var Gu={exports:{}},ap;function ME(){return ap||(ap=1,(function(i,r){(function(a,o){i.exports=o()})(globalThis,(()=>(()=>{var a={4567:function(T,c,u){var h=this&&this.__decorate||function(f,p,S,A){var R,M=arguments.length,E=M<3?p:A===null?A=Object.getOwnPropertyDescriptor(p,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,p,S,A);else for(var B=f.length-1;B>=0;B--)(R=f[B])&&(E=(M<3?R(E):M>3?R(p,S,E):R(p,S))||E);return M>3&&E&&Object.defineProperty(p,S,E),E},y=this&&this.__param||function(f,p){return function(S,A){p(S,A,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const d=u(9042),C=u(9924),w=u(844),k=u(4725),b=u(2585),m=u(3656);let v=c.AccessibilityManager=class extends w.Disposable{constructor(f,p,S,A){super(),this._terminal=f,this._coreBrowserService=S,this._renderService=A,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new C.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
255
+ `)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,m.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,w.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===`
256
+ `&&(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,A=S.lines.length.toString();for(let R=f;R<=p;R++){const M=S.lines.get(S.ydisp+R),E=[],B=(M==null?void 0:M.translateToString(!0,void 0,void 0,E))||"",$=(S.ydisp+R+1).toString(),I=this._rowElements[R];I&&(B.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=B,this._rowColumns.set(I,E)),I.setAttribute("aria-posinset",$),I.setAttribute("aria-setsize",A))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(f,p){const S=f.target,A=this._rowElements[p===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(p===0?"1":`${this._terminal.buffer.lines.length}`)||f.relatedTarget!==A)return;let R,M;if(p===0?(R=S,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(R=this._rowElements.shift(),M=S,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),p===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}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 B;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 A=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(A)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:A,offset:((B=A.textContent)==null?void 0:B.length)??0}),!this._rowContainer.contains(S.node))return;const R=({node:$,offset:I})=>{const q=$ instanceof Text?$.parentNode:$;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 J=this._rowColumns.get(q);if(!J)return console.warn("columns is null. Race condition?"),null;let te=I<J.length?J[I]:J.slice(-1)[0]+1;return te>=this._terminal.cols&&(++P,te=0),{row:P,column:te}},M=R(p),E=R(S);if(M&&E){if(M.row>E.row||M.row===E.row&&M.column>=E.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(E.row-M.row)*this._terminal.cols-M.column+E.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`}};c.AccessibilityManager=v=h([y(1,b.IInstantiationService),y(2,k.ICoreBrowserService),y(3,k.IRenderService)],v)},3614:(T,c)=>{function u(C){return C.replace(/\r?\n/g,"\r")}function h(C,w){return w?"\x1B[200~"+C+"\x1B[201~":C}function y(C,w,k,b){C=h(C=u(C),k.decPrivateModes.bracketedPasteMode&&b.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(C,!0),w.value=""}function d(C,w,k){const b=k.getBoundingClientRect(),m=C.clientX-b.left-10,v=C.clientY-b.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${m}px`,w.style.top=`${v}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(c,"__esModule",{value:!0}),c.rightClickHandler=c.moveTextAreaUnderMouseCursor=c.paste=c.handlePasteEvent=c.copyHandler=c.bracketTextForPaste=c.prepareTextForTerminal=void 0,c.prepareTextForTerminal=u,c.bracketTextForPaste=h,c.copyHandler=function(C,w){C.clipboardData&&C.clipboardData.setData("text/plain",w.selectionText),C.preventDefault()},c.handlePasteEvent=function(C,w,k,b){C.stopPropagation(),C.clipboardData&&y(C.clipboardData.getData("text/plain"),w,k,b)},c.paste=y,c.moveTextAreaUnderMouseCursor=d,c.rightClickHandler=function(C,w,k,b,m){d(C,w,k),m&&b.rightClickSelect(C),w.value=b.selectionText,w.select()}},7239:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;const h=u(1505);c.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(y,d,C){this._css.set(y,d,C)}getCss(y,d){return this._css.get(y,d)}setColor(y,d,C){this._color.set(y,d,C)}getColor(y,d){return this._color.get(y,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(u,h,y,d){u.addEventListener(h,y,d);let C=!1;return{dispose:()=>{C||(C=!0,u.removeEventListener(h,y,d))}}}},3551:function(T,c,u){var h=this&&this.__decorate||function(v,f,p,S){var A,R=arguments.length,M=R<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,f,p,S);else for(var E=v.length-1;E>=0;E--)(A=v[E])&&(M=(R<3?A(M):R>3?A(f,p,M):A(f,p))||M);return R>3&&M&&Object.defineProperty(f,p,M),M},y=this&&this.__param||function(v,f){return function(p,S){f(p,S,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const d=u(3656),C=u(8460),w=u(844),k=u(2585),b=u(4725);let m=c.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(v,f,p,S,A){super(),this._element=v,this._mouseService=f,this._renderService=p,this._bufferService=S,this._linkProviderService=A,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new C.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new C.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(v){this._lastMouseEvent=v;const f=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const p=v.composedPath();for(let S=0;S<p.length;S++){const A=p[S];if(A.classList.contains("xterm"))break;if(A.classList.contains("xterm-hover"))return}this._lastBufferCell&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_handleHover(v){if(this._activeLine!==v.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(v,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,v)||(this._clearCurrentLink(),this._askForLink(v,!0))}_askForLink(v,f){var S,A;this._activeProviderReplies&&f||((S=this._activeProviderReplies)==null||S.forEach((R=>{R==null||R.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let p=!1;for(const[R,M]of this._linkProviderService.linkProviders.entries())f?(A=this._activeProviderReplies)!=null&&A.get(R)&&(p=this._checkLinkProviderResult(R,v,p)):M.provideLinks(v.y,(E=>{var $,I;if(this._isMouseOut)return;const B=E==null?void 0:E.map((q=>({link:q})));($=this._activeProviderReplies)==null||$.set(R,B),p=this._checkLinkProviderResult(R,v,p),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,f){const p=new Set;for(let S=0;S<f.size;S++){const A=f.get(S);if(A)for(let R=0;R<A.length;R++){const M=A[R],E=M.link.range.start.y<v?0:M.link.range.start.x,B=M.link.range.end.y>v?this._bufferService.cols:M.link.range.end.x;for(let $=E;$<=B;$++){if(p.has($)){A.splice(R--,1);break}p.add($)}}}}_checkLinkProviderResult(v,f,p){var R;if(!this._activeProviderReplies)return p;const S=this._activeProviderReplies.get(v);let A=!1;for(let M=0;M<v;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(A=!0);if(!A&&S){const M=S.find((E=>this._linkAtPosition(E.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 E=(R=this._activeProviderReplies.get(M))==null?void 0:R.find((B=>this._linkAtPosition(B.link,f)));if(E){p=!0,this._handleNewLink(E);break}}return p}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const f=this._positionFromMouseEvent(v,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,f){this._currentLink&&this._lastMouseEvent&&(!v||!f||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(v.link,f)&&(this._currentLink=v,this._currentLink.state={decorations:{underline:v.link.decorations===void 0||v.link.decorations.underline,pointerCursor:v.link.decorations===void 0||v.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,v.link,this._lastMouseEvent),v.link.decorations={},Object.defineProperties(v.link.decorations,{pointerCursor:{get:()=>{var 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,A,R;(S=this._currentLink)!=null&&S.state&&((R=(A=this._currentLink)==null?void 0:A.state)==null?void 0:R.decorations.underline)!==p&&(this._currentLink.state.decorations.underline=p,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.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,A=this._bufferService.buffer.ydisp+1+p.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=A&&(this._clearCurrentLink(S,A),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(v,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&&v.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(p,f.text)}_fireUnderlineEvent(v,f){const p=v.range,S=this._bufferService.buffer.ydisp,A=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(A)}_linkLeave(v,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&&v.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(p,f.text)}_linkAtPosition(v,f){const p=v.range.start.y*this._bufferService.cols+v.range.start.x,S=v.range.end.y*this._bufferService.cols+v.range.end.x,A=f.y*this._bufferService.cols+f.x;return p<=A&&A<=S}_positionFromMouseEvent(v,f,p){const S=p.getCoords(v,f,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,f,p,S,A){return{x1:v,y1:f,x2:p,y2:S,cols:this._bufferService.cols,fg:A}}};c.Linkifier=m=h([y(1,b.IMouseService),y(2,b.IRenderService),y(3,k.IBufferService),y(4,b.ILinkProviderService)],m)},9042:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.tooMuchOutput=c.promptLabel=void 0,c.promptLabel="Terminal input",c.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(T,c,u){var h=this&&this.__decorate||function(b,m,v,f){var p,S=arguments.length,A=S<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,v):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,m,v,f);else for(var R=b.length-1;R>=0;R--)(p=b[R])&&(A=(S<3?p(A):S>3?p(m,v,A):p(m,v))||A);return S>3&&A&&Object.defineProperty(m,v,A),A},y=this&&this.__param||function(b,m){return function(v,f){m(v,f,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const d=u(511),C=u(2585);let w=c.OscLinkProvider=class{constructor(b,m,v){this._bufferService=b,this._optionsService=m,this._oscLinkService=v}provideLinks(b,m){var B;const v=this._bufferService.buffer.lines.get(b-1);if(!v)return void m(void 0);const f=[],p=this._optionsService.rawOptions.linkHandler,S=new d.CellData,A=v.getTrimmedLength();let R=-1,M=-1,E=!1;for(let $=0;$<A;$++)if(M!==-1||v.hasContent($)){if(v.loadCell($,S),S.hasExtendedAttrs()&&S.extended.urlId){if(M===-1){M=$,R=S.extended.urlId;continue}E=S.extended.urlId!==R}else M!==-1&&(E=!0);if(E||M!==-1&&$===A-1){const I=(B=this._oscLinkService.getLinkData(R))==null?void 0:B.uri;if(I){const q={start:{x:M+1,y:b},end:{x:$+(E||$!==A-1?0:1),y:b}};let P=!1;if(!(p!=null&&p.allowNonHttpProtocols))try{const J=new URL(I);["http:","https:"].includes(J.protocol)||(P=!0)}catch{P=!0}P||f.push({text:I,range:q,activate:(J,te)=>p?p.activate(J,te,q):k(0,te),hover:(J,te)=>{var G;return(G=p==null?void 0:p.hover)==null?void 0:G.call(p,J,te,q)},leave:(J,te)=>{var G;return(G=p==null?void 0:p.leave)==null?void 0:G.call(p,J,te,q)}})}E=!1,S.hasExtendedAttrs()&&S.extended.urlId?(M=$,R=S.extended.urlId):(M=-1,R=-1)}}m(f)}};function k(b,m){if(confirm(`Do you want to navigate to ${m}?
257
+
258
+ WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=m}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=w=h([y(0,C.IBufferService),y(1,C.IOptionsService),y(2,C.IOscLinkService)],w)},6193:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.RenderDebouncer=void 0,c.RenderDebouncer=class{constructor(u,h){this._renderCallback=u,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,h,y){this._rowCount=y,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const h=u(3614),y=u(3656),d=u(3551),C=u(9042),w=u(3730),k=u(1680),b=u(3107),m=u(5744),v=u(2950),f=u(1296),p=u(428),S=u(4269),A=u(5114),R=u(8934),M=u(3230),E=u(9312),B=u(4725),$=u(6731),I=u(8055),q=u(8969),P=u(8460),J=u(844),te=u(6114),G=u(8437),se=u(2584),ae=u(7399),N=u(5941),U=u(9074),L=u(2585),H=u(5435),V=u(4567),re=u(779);class ue 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(Y={}){super(Y),this.browser=te,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new J.MutableDisposable),this._onCursorMove=this.register(new 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(re.LinkProviderService),this._instantiationService.setService(B.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((j,ce)=>this.refresh(j,ce)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((j=>this._reportWindowsOptions(j)))),this.register(this._inputHandler.onColor((j=>this._handleColorEvent(j)))),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((j=>this._afterResize(j.cols,j.rows)))),this.register((0,J.toDisposable)((()=>{var j,ce;this._customKeyEventHandler=void 0,(ce=(j=this.element)==null?void 0:j.parentNode)==null||ce.removeChild(this.element)})))}_handleColorEvent(Y){if(this._themeService)for(const j of Y){let ce,oe="";switch(j.index){case 256:ce="foreground",oe="10";break;case 257:ce="background",oe="11";break;case 258:ce="cursor",oe="12";break;default:ce="ansi",oe="4;"+j.index}switch(j.type){case 0:const ve=I.color.toColorRGB(ce==="ansi"?this._themeService.colors.ansi[j.index]:this._themeService.colors[ce]);this.coreService.triggerDataEvent(`${se.C0.ESC}]${oe};${(0,N.toRgbString)(ve)}${se.C1_ESCAPED.ST}`);break;case 1:if(ce==="ansi")this._themeService.modifyColors((pe=>pe.ansi[j.index]=I.channels.toColor(...j.color)));else{const pe=ce;this._themeService.modifyColors((Te=>Te[pe]=I.channels.toColor(...j.color)))}break;case 2:this._themeService.restoreColor(j.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Y){Y?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Y){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(se.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Y;return(Y=this.textarea)==null?void 0:Y.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(se.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 Y=this.buffer.ybase+this.buffer.y,j=this.buffer.lines.get(Y);if(!j)return;const ce=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,ve=j.getWidth(ce),pe=this._renderService.dimensions.css.cell.width*ve,Te=this.buffer.y*this._renderService.dimensions.css.cell.height,je=ce*this._renderService.dimensions.css.cell.width;this.textarea.style.left=je+"px",this.textarea.style.top=Te+"px",this.textarea.style.width=pe+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(j=>{this.hasSelection()&&(0,h.copyHandler)(j,this._selectionService)})));const Y=j=>(0,h.handlePasteEvent)(j,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",Y)),this.register((0,y.addDisposableDomListener)(this.element,"paste",Y)),te.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(j=>{j.button===2&&(0,h.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(j=>{(0,h.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),te.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(j=>{j.button===1&&(0,h.moveTextAreaUnderMouseCursor)(j,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(Y=>this._keyUp(Y)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(Y=>this._keyDown(Y)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(Y=>this._keyPress(Y)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(Y=>this._compositionHelper.compositionupdate(Y)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(Y=>this._inputEvent(Y)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Y){var ce;if(!Y)throw new Error("Terminal requires a parent element.");if(Y.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ce=this.element)==null?void 0:ce.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Y.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"),Y.appendChild(this.element);const j=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),j.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,y.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),j.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",C.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(A.CoreBrowserService,this.textarea,Y.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(B.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(p.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(B.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance($.ThemeService),this._instantiationService.setService(B.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(B.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(B.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(B.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(j);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((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(E.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(B.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(b.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&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 Y=this,j=this.element;function ce(pe){const Te=Y._mouseService.getMouseReportCoords(pe,Y.screenElement);if(!Te)return!1;let je,Ue;switch(pe.overrideType||pe.type){case"mousemove":Ue=32,pe.buttons===void 0?(je=3,pe.button!==void 0&&(je=pe.button<3?pe.button:3)):je=1&pe.buttons?0:4&pe.buttons?1:2&pe.buttons?2:3;break;case"mouseup":Ue=0,je=pe.button<3?pe.button:3;break;case"mousedown":Ue=1,je=pe.button<3?pe.button:3;break;case"wheel":if(Y._customWheelEventHandler&&Y._customWheelEventHandler(pe)===!1||Y.viewport.getLinesScrolled(pe)===0)return!1;Ue=pe.deltaY<0?0:1,je=4;break;default:return!1}return!(Ue===void 0||je===void 0||je>4)&&Y.coreMouseService.triggerMouseEvent({col:Te.col,row:Te.row,x:Te.x,y:Te.y,button:je,action:Ue,ctrl:pe.ctrlKey,alt:pe.altKey,shift:pe.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ve={mouseup:pe=>(ce(pe),pe.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(pe)),wheel:pe=>(ce(pe),this.cancel(pe,!0)),mousedrag:pe=>{pe.buttons&&ce(pe)},mousemove:pe=>{pe.buttons||ce(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?oe.mousemove||(j.addEventListener("mousemove",ve.mousemove),oe.mousemove=ve.mousemove):(j.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&pe?oe.wheel||(j.addEventListener("wheel",ve.wheel,{passive:!1}),oe.wheel=ve.wheel):(j.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&pe?oe.mouseup||(oe.mouseup=ve.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&pe?oe.mousedrag||(oe.mousedrag=ve.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(j,"mousedown",(pe=>{if(pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(pe))return ce(pe),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(pe)}))),this.register((0,y.addDisposableDomListener)(j,"wheel",(pe=>{if(!oe.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 je=se.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(pe.deltaY<0?"A":"B");let Ue="";for(let ct=0;ct<Math.abs(Te);ct++)Ue+=je;return this.coreService.triggerDataEvent(Ue,!0),this.cancel(pe,!0)}return this.viewport.handleWheel(pe)?this.cancel(pe):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(j,"touchstart",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(pe),this.cancel(pe)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(j,"touchmove",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(pe)?void 0:this.cancel(pe)}),{passive:!1}))}refresh(Y,j){var ce;(ce=this._renderService)==null||ce.refreshRows(Y,j)}updateCursorStyle(Y){var j;(j=this._selectionService)!=null&&j.shouldColumnSelect(Y)?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(Y,j,ce=0){var oe;ce===1?(super.scrollLines(Y,j,ce),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(Y)}paste(Y){(0,h.paste)(Y,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Y){this._customKeyEventHandler=Y}attachCustomWheelEventHandler(Y){this._customWheelEventHandler=Y}registerLinkProvider(Y){return this._linkProviderService.registerLinkProvider(Y)}registerCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const j=this._characterJoinerService.register(Y);return this.refresh(0,this.rows-1),j}deregisterCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Y)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Y){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Y)}registerDecoration(Y){return this._decorationService.registerDecoration(Y)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Y,j,ce){this._selectionService.setSelection(Y,j,ce)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var Y;(Y=this._selectionService)==null||Y.clearSelection()}selectAll(){var Y;(Y=this._selectionService)==null||Y.selectAll()}selectLines(Y,j){var ce;(ce=this._selectionService)==null||ce.selectLines(Y,j)}_keyDown(Y){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;const j=this.browser.isMac&&this.options.macOptionIsMeta&&Y.altKey;if(!j&&!this._compositionHelper.keydown(Y))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;j||Y.key!=="Dead"&&Y.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ce=(0,ae.evaluateKeyboardEvent)(Y,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Y),ce.type===3||ce.type===2){const oe=this.rows-1;return this.scrollLines(ce.type===2?-oe:oe),this.cancel(Y,!0)}return ce.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Y)||(ce.cancel&&this.cancel(Y,!0),!ce.key||!!(Y.key&&!Y.ctrlKey&&!Y.altKey&&!Y.metaKey&&Y.key.length===1&&Y.key.charCodeAt(0)>=65&&Y.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ce.key!==se.C0.ETX&&ce.key!==se.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ce.key,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(ce.key,!0),!this.optionsService.rawOptions.screenReaderMode||Y.altKey||Y.ctrlKey?this.cancel(Y,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Y,j){const ce=Y.isMac&&!this.options.macOptionIsMeta&&j.altKey&&!j.ctrlKey&&!j.metaKey||Y.isWindows&&j.altKey&&j.ctrlKey&&!j.metaKey||Y.isWindows&&j.getModifierState("AltGraph");return j.type==="keypress"?ce:ce&&(!j.keyCode||j.keyCode>47)}_keyUp(Y){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1||((function(j){return j.keyCode===16||j.keyCode===17||j.keyCode===18})(Y)||this.focus(),this.updateCursorStyle(Y),this._keyPressHandled=!1)}_keyPress(Y){let j;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;if(this.cancel(Y),Y.charCode)j=Y.charCode;else if(Y.which===null||Y.which===void 0)j=Y.keyCode;else{if(Y.which===0||Y.charCode===0)return!1;j=Y.which}return!(!j||(Y.altKey||Y.ctrlKey||Y.metaKey)&&!this._isThirdLevelShift(this.browser,Y)||(j=String.fromCharCode(j),this._onKey.fire({key:j,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(j,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Y){if(Y.data&&Y.inputType==="insertText"&&(!Y.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const j=Y.data;return this.coreService.triggerDataEvent(j,!0),this.cancel(Y),!0}return!1}resize(Y,j){Y!==this.cols||j!==this.rows?super.resize(Y,j):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Y,j){var ce,oe;(ce=this._charSizeService)==null||ce.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var Y;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 j=1;j<this.rows;j++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Y=this.viewport)==null||Y.reset(),this.refresh(0,this.rows-1)}}reset(){var j,ce;this.options.rows=this.rows,this.options.cols=this.cols;const Y=this._customKeyEventHandler;this._setup(),super.reset(),(j=this._selectionService)==null||j.reset(),this._decorationService.reset(),(ce=this.viewport)==null||ce.reset(),this._customKeyEventHandler=Y,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Y;(Y=this._renderService)==null||Y.clearTextureAtlas()}_reportFocus(){var Y;(Y=this.element)!=null&&Y.classList.contains("focus")?this.coreService.triggerDataEvent(se.C0.ESC+"[I"):this.coreService.triggerDataEvent(se.C0.ESC+"[O")}_reportWindowsOptions(Y){if(this._renderService)switch(Y){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const j=this._renderService.dimensions.css.canvas.width.toFixed(0),ce=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${se.C0.ESC}[4;${ce};${j}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const oe=this._renderService.dimensions.css.cell.width.toFixed(0),ve=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${se.C0.ESC}[6;${ve};${oe}t`)}}cancel(Y,j){if(this.options.cancelEvents||j)return Y.preventDefault(),Y.stopPropagation(),!1}}c.Terminal=ue},9924:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TimeBasedDebouncer=void 0,c.TimeBasedDebouncer=class{constructor(u,h=1e3){this._renderCallback=u,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,h,y){this._rowCount=y,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const C=d-this._lastRefreshMs,w=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h)}}},1680:function(T,c,u){var h=this&&this.__decorate||function(v,f,p,S){var A,R=arguments.length,M=R<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,f,p,S);else for(var E=v.length-1;E>=0;E--)(A=v[E])&&(M=(R<3?A(M):R>3?A(f,p,M):A(f,p))||M);return R>3&&M&&Object.defineProperty(f,p,M),M},y=this&&this.__param||function(v,f){return function(p,S){f(p,S,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const d=u(3656),C=u(4725),w=u(8460),k=u(844),b=u(2585);let m=c.Viewport=class extends k.Disposable{constructor(v,f,p,S,A,R,M,E){super(),this._viewportElement=v,this._scrollArea=f,this._bufferService=p,this._optionsService=S,this._charSizeService=A,this._renderService=R,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 w.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((B=>this._activeBuffer=B.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((B=>this._renderDimensions=B))),this._handleThemeChange(E.colors),this.register(E.onChangeColors((B=>this._handleThemeChange(B)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(v){if(v)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(v,f){const p=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&p<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const f=this._getPixelsScrolled(v);return f!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+f:this._smoothScrollState.target+=f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=f,this._bubbleScroll(v,f))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=v*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!1})}_getPixelsScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let f=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(v,f){var E;let p,S="";const A=[],R=f??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let B=v;B<R;B++){const $=M.get(B);if(!$)continue;const I=(E=M.get(B+1))==null?void 0:E.isWrapped;if(S+=$.translateToString(!I),!I||B===M.length-1){const q=document.createElement("div");q.textContent=S,A.push(q),S.length>0&&(p=q),S=""}}return{bufferElements:A,cursorElement:p}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let f=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(v,f){const p=this._optionsService.rawOptions.fastScrollModifier;return p==="alt"&&f.altKey||p==="ctrl"&&f.ctrlKey||p==="shift"&&f.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const f=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(v,f))}};c.Viewport=m=h([y(2,b.IBufferService),y(3,b.IOptionsService),y(4,C.ICharSizeService),y(5,C.IRenderService),y(6,C.ICoreBrowserService),y(7,C.IThemeService)],m)},3107:function(T,c,u){var h=this&&this.__decorate||function(b,m,v,f){var p,S=arguments.length,A=S<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,v):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,m,v,f);else for(var R=b.length-1;R>=0;R--)(p=b[R])&&(A=(S<3?p(A):S>3?p(m,v,A):p(m,v))||A);return S>3&&A&&Object.defineProperty(m,v,A),A},y=this&&this.__param||function(b,m){return function(v,f){m(v,f,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const d=u(4725),C=u(844),w=u(2585);let k=c.BufferDecorationRenderer=class extends C.Disposable{constructor(b,m,v,f,p){super(),this._screenElement=b,this._bufferService=m,this._coreBrowserService=v,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,C.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const b of this._decorationService.decorations)this._renderDecoration(b);this._dimensionsChanged=!1}_renderDecoration(b){this._refreshStyle(b),this._dimensionsChanged&&this._refreshXPosition(b)}_createElement(b){var f;const m=this._coreBrowserService.mainDocument.createElement("div");m.classList.add("xterm-decoration"),m.classList.toggle("xterm-decoration-top-layer",((f=b==null?void 0:b.options)==null?void 0:f.layer)==="top"),m.style.width=`${Math.round((b.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,m.style.height=(b.options.height||1)*this._renderService.dimensions.css.cell.height+"px",m.style.top=(b.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 v=b.options.x??0;return v&&v>this._bufferService.cols&&(m.style.display="none"),this._refreshXPosition(b,m),m}_refreshStyle(b){const m=b.marker.line-this._bufferService.buffers.active.ydisp;if(m<0||m>=this._bufferService.rows)b.element&&(b.element.style.display="none",b.onRenderEmitter.fire(b.element));else{let v=this._decorationElements.get(b);v||(v=this._createElement(b),b.element=v,this._decorationElements.set(b,v),this._container.appendChild(v),b.onDispose((()=>{this._decorationElements.delete(b),v.remove()}))),v.style.top=m*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",b.onRenderEmitter.fire(v)}}_refreshXPosition(b,m=b.element){if(!m)return;const v=b.options.x??0;(b.options.anchor||"left")==="right"?m.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":m.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(b){var m;(m=this._decorationElements.get(b))==null||m.remove(),this._decorationElements.delete(b),b.dispose()}};c.BufferDecorationRenderer=k=h([y(1,w.IBufferService),y(2,d.ICoreBrowserService),y(3,w.IDecorationService),y(4,d.IRenderService)],k)},5871:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorZoneStore=void 0,c.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const h of this._zones)if(h.color===u.options.overviewRulerOptions.color&&h.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,u.marker.line))return;if(this._lineAdjacentToZone(h,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(h,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,h){return h>=u.startBufferLine&&h<=u.endBufferLine}_lineAdjacentToZone(u,h,y){return h>=u.startBufferLine-this._linePadding[y||"full"]&&h<=u.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(u,h){u.startBufferLine=Math.min(u.startBufferLine,h),u.endBufferLine=Math.max(u.endBufferLine,h)}}},5744:function(T,c,u){var h=this&&this.__decorate||function(p,S,A,R){var M,E=arguments.length,B=E<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,A):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(p,S,A,R);else for(var $=p.length-1;$>=0;$--)(M=p[$])&&(B=(E<3?M(B):E>3?M(S,A,B):M(S,A))||B);return E>3&&B&&Object.defineProperty(S,A,B),B},y=this&&this.__param||function(p,S){return function(A,R){S(A,R,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const d=u(5871),C=u(4725),w=u(844),k=u(2585),b={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let f=c.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(p,S,A,R,M,E,B){var I;super(),this._viewportElement=p,this._screenElement=S,this._bufferService=A,this._decorationService=R,this._renderService=M,this._optionsService=E,this._coreBrowserService=B,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(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const $=this._canvas.getContext("2d");if(!$)throw new Error("Ctx cannot be null");this._ctx=$,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,w.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(),v.full=0,v.left=0,v.center=m.left,v.right=m.left+m.center}_refreshDrawHeightConstants(){b.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);b.left=S,b.center=S,b.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const 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(v[p.position||"full"],Math.round((this._canvas.height-1)*(p.startBufferLine/this._bufferService.buffers.active.lines.length)-b[p.position||"full"]/2),m[p.position||"full"],Math.round((this._canvas.height-1)*((p.endBufferLine-p.startBufferLine)/this._bufferService.buffers.active.lines.length)+b[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})))}};c.OverviewRulerRenderer=f=h([y(2,k.IBufferService),y(3,k.IDecorationService),y(4,C.IRenderService),y(5,k.IOptionsService),y(6,C.ICoreBrowserService)],f)},2950:function(T,c,u){var h=this&&this.__decorate||function(b,m,v,f){var p,S=arguments.length,A=S<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,v):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,m,v,f);else for(var R=b.length-1;R>=0;R--)(p=b[R])&&(A=(S<3?p(A):S>3?p(m,v,A):p(m,v))||A);return S>3&&A&&Object.defineProperty(m,v,A),A},y=this&&this.__param||function(b,m){return function(v,f){m(v,f,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const d=u(4725),C=u(2585),w=u(2584);let k=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(b,m,v,f,p,S){this._textarea=b,this._compositionView=m,this._bufferService=v,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(b){this._compositionView.textContent=b.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(b){if(this._isComposing||this._isSendingComposition){if(b.keyCode===229||b.keyCode===16||b.keyCode===17||b.keyCode===18)return!1;this._finalizeComposition(!1)}return b.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(b){if(this._compositionView.classList.remove("active"),this._isComposing=!1,b){const m={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,m.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(m.start,m.end):this._textarea.value.substring(m.start),v.length>0&&this._coreService.triggerDataEvent(v,!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 b=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const m=this._textarea.value,v=m.replace(b,"");this._dataAlreadySent=v,m.length>b.length?this._coreService.triggerDataEvent(v,!0):m.length<b.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):m.length===b.length&&m!==b&&this._coreService.triggerDataEvent(m,!0)}}),0)}updateCompositionElements(b){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const m=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,p=m*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=p+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=v+"px",this._compositionView.style.lineHeight=v+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=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"}b||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=k=h([y(2,C.IBufferService),y(3,C.IOptionsService),y(4,C.ICoreService),y(5,d.IRenderService)],k)},9806:(T,c)=>{function u(h,y,d){const C=d.getBoundingClientRect(),w=h.getComputedStyle(d),k=parseInt(w.getPropertyValue("padding-left")),b=parseInt(w.getPropertyValue("padding-top"));return[y.clientX-C.left-k,y.clientY-C.top-b]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=u,c.getCoords=function(h,y,d,C,w,k,b,m,v){if(!k)return;const f=u(h,y,d);return f?(f[0]=Math.ceil((f[0]+(v?b/2:0))/b),f[1]=Math.ceil(f[1]/m),f[0]=Math.min(Math.max(f[0],1),C+(v?1:0)),f[1]=Math.min(Math.max(f[1],1),w),f):void 0}},9504:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const h=u(2584);function y(m,v,f,p){const S=m-d(m,f),A=v-d(v,f),R=Math.abs(S-A)-(function(M,E,B){let $=0;const I=M-d(M,B),q=E-d(E,B);for(let P=0;P<Math.abs(I-q);P++){const J=C(M,E)==="A"?-1:1,te=B.buffer.lines.get(I+J*P);te!=null&&te.isWrapped&&$++}return $})(m,v,f);return b(R,k(C(m,v),p))}function d(m,v){let f=0,p=v.buffer.lines.get(m),S=p==null?void 0:p.isWrapped;for(;S&&m>=0&&m<v.rows;)f++,p=v.buffer.lines.get(--m),S=p==null?void 0:p.isWrapped;return f}function C(m,v){return m>v?"A":"B"}function w(m,v,f,p,S,A){let R=m,M=v,E="";for(;R!==f||M!==p;)R+=S?1:-1,S&&R>A.cols-1?(E+=A.buffer.translateBufferLineToString(M,!1,m,R),R=0,m=0,M++):!S&&R<0&&(E+=A.buffer.translateBufferLineToString(M,!1,0,m+1),R=A.cols-1,m=R,M--);return E+A.buffer.translateBufferLineToString(M,!1,m,R)}function k(m,v){const f=v?"O":"[";return h.C0.ESC+f+m}function b(m,v){m=Math.floor(m);let f="";for(let p=0;p<m;p++)f+=v;return f}c.moveToCellSequence=function(m,v,f,p){const S=f.buffer.x,A=f.buffer.y;if(!f.buffer.hasScrollback)return(function(E,B,$,I,q,P){return y(B,I,q,P).length===0?"":b(w(E,B,E,B-d(B,q),!1,q).length,k("D",P))})(S,A,0,v,f,p)+y(A,v,f,p)+(function(E,B,$,I,q,P){let J;J=y(B,I,q,P).length>0?I-d(I,q):B;const te=I,G=(function(se,ae,N,U,L,H){let V;return V=y(N,U,L,H).length>0?U-d(U,L):ae,se<N&&V<=U||se>=N&&V<U?"C":"D"})(E,B,$,I,q,P);return b(w(E,J,$,te,G==="C",q).length,k(G,P))})(S,A,m,v,f,p);let R;if(A===v)return R=S>m?"D":"C",b(Math.abs(S-m),k(R,p));R=A>v?"D":"C";const M=Math.abs(A-v);return b((function(E,B){return B.cols-E})(A>v?m:S,f)+(M-1)*f.cols+1+((A>v?S:m)-1),k(R,p))}},1296:function(T,c,u){var h=this&&this.__decorate||function(P,J,te,G){var se,ae=arguments.length,N=ae<3?J:G===null?G=Object.getOwnPropertyDescriptor(J,te):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(P,J,te,G);else for(var U=P.length-1;U>=0;U--)(se=P[U])&&(N=(ae<3?se(N):ae>3?se(J,te,N):se(J,te))||N);return ae>3&&N&&Object.defineProperty(J,te,N),N},y=this&&this.__param||function(P,J){return function(te,G){J(te,G,P)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const d=u(3787),C=u(2550),w=u(2223),k=u(6171),b=u(6052),m=u(4725),v=u(8055),f=u(8460),p=u(844),S=u(2585),A="xterm-dom-renderer-owner-",R="xterm-rows",M="xterm-fg-",E="xterm-bg-",B="xterm-focus",$="xterm-selection";let I=1,q=c.DomRenderer=class extends p.Disposable{constructor(P,J,te,G,se,ae,N,U,L,H,V,re,ue){super(),this._terminal=P,this._document=J,this._element=te,this._screenElement=G,this._viewportElement=se,this._helperContainer=ae,this._linkifier2=N,this._charSizeService=L,this._optionsService=H,this._bufferService=V,this._coreBrowserService=re,this._themeService=ue,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,b.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add($),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((me=>this._injectCss(me)))),this._injectCss(this._themeService.colors),this._rowFactory=U.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(A+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((me=>this._handleLinkHover(me)))),this.register(this._linkifier2.onHideLinkUnderline((me=>this._handleLinkLeave(me)))),this.register((0,p.toDisposable)((()=>{this._element.classList.remove(A+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new C.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 J=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=J,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let J=`${this._terminalSelector} .${R} { color: ${P.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;J+=`${this._terminalSelector} .${R} .xterm-dim { color: ${v.color.multiplyOpacity(P.foreground,.5).css};}`,J+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const te=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,se=`blink_block_${this._terminalClass}`;J+=`@keyframes ${te} { 50% { border-bottom-style: hidden; }}`,J+=`@keyframes ${G} { 50% { box-shadow: none; }}`,J+=`@keyframes ${se} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,J+=`${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${te} 1s step-end infinite;}${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${se} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${P.cursor.css} !important; color: ${P.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,J+=`${this._terminalSelector} .${$} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${$} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${$} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[ae,N]of P.ansi.entries())J+=`${this._terminalSelector} .${M}${ae} { color: ${N.css}; }${this._terminalSelector} .${M}${ae}.xterm-dim { color: ${v.color.multiplyOpacity(N,.5).css}; }${this._terminalSelector} .${E}${ae} { background-color: ${N.css}; }`;J+=`${this._terminalSelector} .${M}${w.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(P.background).css}; }${this._terminalSelector} .${M}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${E}${w.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=J}_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,J){for(let te=this._rowElements.length;te<=J;te++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>J;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,J){this._refreshRowElements(P,J),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(B),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(B),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,J,te){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,J,te),this.renderRows(0,this._bufferService.rows-1),!P||!J)return;this._selectionRenderModel.update(this._terminal,P,J,te);const G=this._selectionRenderModel.viewportStartRow,se=this._selectionRenderModel.viewportEndRow,ae=this._selectionRenderModel.viewportCappedStartRow,N=this._selectionRenderModel.viewportCappedEndRow;if(ae>=this._bufferService.rows||N<0)return;const U=this._document.createDocumentFragment();if(te){const L=P[0]>J[0];U.appendChild(this._createSelectionElement(ae,L?J[0]:P[0],L?P[0]:J[0],N-ae+1))}else{const L=G===ae?P[0]:0,H=ae===se?J[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(ae,L,H));const V=N-ae-1;if(U.appendChild(this._createSelectionElement(ae+1,0,this._bufferService.cols,V)),ae!==N){const re=se===N?J[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(N,0,re))}}this._selectionContainer.appendChild(U)}_createSelectionElement(P,J,te,G=1){const se=this._document.createElement("div"),ae=J*this.dimensions.css.cell.width;let N=this.dimensions.css.cell.width*(te-J);return ae+N>this.dimensions.css.canvas.width&&(N=this.dimensions.css.canvas.width-ae),se.style.height=G*this.dimensions.css.cell.height+"px",se.style.top=P*this.dimensions.css.cell.height+"px",se.style.left=`${ae}px`,se.style.width=`${N}px`,se}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,J){const te=this._bufferService.buffer,G=te.ybase+te.y,se=Math.min(te.x,this._bufferService.cols-1),ae=this._optionsService.rawOptions.cursorBlink,N=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=P;L<=J;L++){const H=L+te.ydisp,V=this._rowElements[L],re=te.lines.get(H);if(!V||!re)break;V.replaceChildren(...this._rowFactory.createRow(re,H,H===G,N,U,se,ae,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${A}${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,J,te,G,se,ae){te<0&&(P=0),G<0&&(J=0);const N=this._bufferService.rows-1;te=Math.max(Math.min(te,N),0),G=Math.max(Math.min(G,N),0),se=Math.min(se,this._bufferService.cols);const U=this._bufferService.buffer,L=U.ybase+U.y,H=Math.min(U.x,se-1),V=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,ue=this._optionsService.rawOptions.cursorInactiveStyle;for(let me=te;me<=G;++me){const Y=me+U.ydisp,j=this._rowElements[me],ce=U.lines.get(Y);if(!j||!ce)break;j.replaceChildren(...this._rowFactory.createRow(ce,Y,Y===L,re,ue,H,V,this.dimensions.css.cell.width,this._widthCache,ae?me===te?P:0:-1,ae?(me===G?J:se)-1:-1))}}};c.DomRenderer=q=h([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(T,c,u){var h=this&&this.__decorate||function(R,M,E,B){var $,I=arguments.length,q=I<3?M:B===null?B=Object.getOwnPropertyDescriptor(M,E):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(R,M,E,B);else for(var P=R.length-1;P>=0;P--)($=R[P])&&(q=(I<3?$(q):I>3?$(M,E,q):$(M,E))||q);return I>3&&q&&Object.defineProperty(M,E,q),q},y=this&&this.__param||function(R,M){return function(E,B){M(E,B,R)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const d=u(2223),C=u(643),w=u(511),k=u(2585),b=u(8055),m=u(4725),v=u(4269),f=u(6171),p=u(3734);let S=c.DomRendererRowFactory=class{constructor(R,M,E,B,$,I,q){this._document=R,this._characterJoinerService=M,this._optionsService=E,this._coreBrowserService=B,this._coreService=$,this._decorationService=I,this._themeService=q,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,M,E){this._selectionStart=R,this._selectionEnd=M,this._columnSelectMode=E}createRow(R,M,E,B,$,I,q,P,J,te,G){const se=[],ae=this._characterJoinerService.getJoinedCharacters(M),N=this._themeService.colors;let U,L=R.getNoBgTrimmedLength();E&&L<I+1&&(L=I+1);let H=0,V="",re=0,ue=0,me=0,Y=!1,j=0,ce=!1,oe=0;const ve=[],pe=te!==-1&&G!==-1;for(let Te=0;Te<L;Te++){R.loadCell(Te,this._workCell);let je=this._workCell.getWidth();if(je===0)continue;let Ue=!1,ct=Te,Ee=this._workCell;if(ae.length>0&&Te===ae[0][0]){Ue=!0;const Ye=ae.shift();Ee=new v.JoinedCellData(this._workCell,R.translateToString(!0,Ye[0],Ye[1]),Ye[1]-Ye[0]),ct=Ye[1]-1,je=Ee.getWidth()}const Ft=this._isCellInSelection(Te,M),mi=E&&Te===I,pi=pe&&Te>=te&&Te<=G;let Ui=!1;this._decorationService.forEachDecorationAtCell(Te,M,void 0,(Ye=>{Ui=!0}));let Vi=Ee.getChars()||C.WHITESPACE_CELL_CHAR;if(Vi===" "&&(Ee.isUnderline()||Ee.isOverline())&&(Vi=" "),oe=je*P-J.get(Vi,Ee.isBold(),Ee.isItalic()),U){if(H&&(Ft&&ce||!Ft&&!ce&&Ee.bg===re)&&(Ft&&ce&&N.selectionForeground||Ee.fg===ue)&&Ee.extended.ext===me&&pi===Y&&oe===j&&!mi&&!Ue&&!Ui){Ee.isInvisible()?V+=C.WHITESPACE_CELL_CHAR:V+=Vi,H++;continue}H&&(U.textContent=V),U=this._document.createElement("span"),H=0,V=""}else U=this._document.createElement("span");if(re=Ee.bg,ue=Ee.fg,me=Ee.extended.ext,Y=pi,j=oe,ce=Ft,Ue&&I>=Te&&I<=ct&&(I=Te),!this._coreService.isCursorHidden&&mi&&this._coreService.isCursorInitialized){if(ve.push("xterm-cursor"),this._coreBrowserService.isFocused)q&&ve.push("xterm-cursor-blink"),ve.push(B==="bar"?"xterm-cursor-bar":B==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if($)switch($){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"),V=Ee.isInvisible()?C.WHITESPACE_CELL_CHAR:Ee.getChars()||C.WHITESPACE_CELL_CHAR,Ee.isUnderline()&&(ve.push(`xterm-underline-${Ee.extended.underlineStyle}`),V===" "&&(V=" "),!Ee.isUnderlineColorDefault()))if(Ee.isUnderlineColorRGB())U.style.textDecorationColor=`rgb(${p.AttributeData.toColorRGB(Ee.getUnderlineColor()).join(",")})`;else{let Ye=Ee.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ee.isBold()&&Ye<8&&(Ye+=8),U.style.textDecorationColor=N.ansi[Ye].css}Ee.isOverline()&&(ve.push("xterm-overline"),V===" "&&(V=" ")),Ee.isStrikethrough()&&ve.push("xterm-strikethrough"),pi&&(U.style.textDecoration="underline");let Pt=Ee.getFgColor(),nt=Ee.getFgColorMode(),Rt=Ee.getBgColor(),Zt=Ee.getBgColorMode();const Nt=!!Ee.isInverse();if(Nt){const Ye=Pt;Pt=Rt,Rt=Ye;const vi=nt;nt=Zt,Zt=vi}let Bt,Ki,Kt,Li=!1;switch(this._decorationService.forEachDecorationAtCell(Te,M,void 0,(Ye=>{Ye.options.layer!=="top"&&Li||(Ye.backgroundColorRGB&&(Zt=50331648,Rt=Ye.backgroundColorRGB.rgba>>8&16777215,Bt=Ye.backgroundColorRGB),Ye.foregroundColorRGB&&(nt=50331648,Pt=Ye.foregroundColorRGB.rgba>>8&16777215,Ki=Ye.foregroundColorRGB),Li=Ye.options.layer==="top")})),!Li&&Ft&&(Bt=this._coreBrowserService.isFocused?N.selectionBackgroundOpaque:N.selectionInactiveBackgroundOpaque,Rt=Bt.rgba>>8&16777215,Zt=50331648,Li=!0,N.selectionForeground&&(nt=50331648,Pt=N.selectionForeground.rgba>>8&16777215,Ki=N.selectionForeground)),Li&&ve.push("xterm-decoration-top"),Zt){case 16777216:case 33554432:Kt=N.ansi[Rt],ve.push(`xterm-bg-${Rt}`);break;case 50331648:Kt=b.channels.toColor(Rt>>16,Rt>>8&255,255&Rt),this._addStyle(U,`background-color:#${A((Rt>>>0).toString(16),"0",6)}`);break;default:Nt?(Kt=N.foreground,ve.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):Kt=N.background}switch(Bt||Ee.isDim()&&(Bt=b.color.multiplyOpacity(Kt,.5)),nt){case 16777216:case 33554432:Ee.isBold()&&Pt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Pt+=8),this._applyMinimumContrast(U,Kt,N.ansi[Pt],Ee,Bt,void 0)||ve.push(`xterm-fg-${Pt}`);break;case 50331648:const Ye=b.channels.toColor(Pt>>16&255,Pt>>8&255,255&Pt);this._applyMinimumContrast(U,Kt,Ye,Ee,Bt,Ki)||this._addStyle(U,`color:#${A(Pt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(U,Kt,N.foreground,Ee,Bt,Ki)||Nt&&ve.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ve.length&&(U.className=ve.join(" "),ve.length=0),mi||Ue||Ui?U.textContent=V:H++,oe!==this.defaultSpacing&&(U.style.letterSpacing=`${oe}px`),se.push(U),Te=ct}return U&&H&&(U.textContent=V),se}_applyMinimumContrast(R,M,E,B,$,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(B.getCode()))return!1;const q=this._getContrastCache(B);let P;if($||I||(P=q.getColor(M.rgba,E.rgba)),P===void 0){const J=this._optionsService.rawOptions.minimumContrastRatio/(B.isDim()?2:1);P=b.color.ensureContrastRatio($||M,I||E,J),q.setColor(($||M).rgba,(I||E).rgba,P??null)}return!!P&&(this._addStyle(R,`color:${P.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,M){R.setAttribute("style",`${R.getAttribute("style")||""}${M};`)}_isCellInSelection(R,M){const E=this._selectionStart,B=this._selectionEnd;return!(!E||!B)&&(this._columnSelectMode?E[0]<=B[0]?R>=E[0]&&M>=E[1]&&R<B[0]&&M<=B[1]:R<E[0]&&M>=E[1]&&R>=B[0]&&M<=B[1]:M>E[1]&&M<B[1]||E[1]===B[1]&&M===E[1]&&R>=E[0]&&R<B[0]||E[1]<B[1]&&M===B[1]&&R<B[0]||E[1]<B[1]&&M===E[1]&&R>=E[0])}};function A(R,M,E){for(;R.length<E;)R=M+R;return R}c.DomRendererRowFactory=S=h([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:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WidthCache=void 0,c.WidthCache=class{constructor(u,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const y=u.createElement("span");y.classList.add("xterm-char-measure-element");const d=u.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const C=u.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontStyle="italic";const w=u.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontWeight="bold",w.style.fontStyle="italic",this._measureElements=[y,d,C,w],this._container.appendChild(y),this._container.appendChild(d),this._container.appendChild(C),this._container.appendChild(w),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,h,y,d){u===this._font&&h===this._fontSize&&y===this._weight&&d===this._weightBold||(this._font=u,this._fontSize=h,this._weight=y,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(u,h,y){let d=0;if(!h&&!y&&u.length===1&&(d=u.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const k=this._measure(u,0);return k>0&&(this._flat[d]=k),k}let C=u;h&&(C+="B"),y&&(C+="I");let w=this._holey.get(C);if(w===void 0){let k=0;h&&(k|=1),y&&(k|=2),w=this._measure(u,k),w>0&&this._holey.set(C,w)}return w}_measure(u,h){const y=this._measureElements[h];return y.textContent=u.repeat(32),y.offsetWidth/32}}},2223:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TEXT_BASELINE=c.DIM_OPACITY=c.INVERTED_DEFAULT_COLOR=void 0;const h=u(6114);c.INVERTED_DEFAULT_COLOR=257,c.DIM_OPACITY=.5,c.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(T,c)=>{function u(y){return 57508<=y&&y<=57558}function h(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(c,"__esModule",{value:!0}),c.computeNextVariantOffset=c.createRenderDimensions=c.treatGlyphAsBackgroundColor=c.allowRescaling=c.isEmoji=c.isRestrictedPowerlineGlyph=c.isPowerlineGlyph=c.throwIfFalsy=void 0,c.throwIfFalsy=function(y){if(!y)throw new Error("value must not be falsy");return y},c.isPowerlineGlyph=u,c.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},c.isEmoji=h,c.allowRescaling=function(y,d,C,w){return d===1&&C>Math.ceil(1.5*w)&&y!==void 0&&y>255&&!h(y)&&!u(y)&&!(function(k){return 57344<=k&&k<=63743})(y)},c.treatGlyphAsBackgroundColor=function(y){return u(y)||(function(d){return 9472<=d&&d<=9631})(y)},c.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}}}},c.computeNextVariantOffset=function(y,d,C=0){return(y-(2*Math.round(d)-C))%(2*Math.round(d))}},6052:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(y,d,C,w=!1){if(this.selectionStart=d,this.selectionEnd=C,!d||!C||d[0]===C[0]&&d[1]===C[1])return void this.clear();const k=y.buffers.active.ydisp,b=d[1]-k,m=C[1]-k,v=Math.max(b,0),f=Math.min(m,y.rows-1);v>=y.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=b,this.viewportEndRow=m,this.viewportCappedStartRow=v,this.viewportCappedEndRow=f,this.startCol=d[0],this.endCol=C[0])}isCellSelected(y,d,C){return!!this.hasSelection&&(C-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&C>=this.viewportCappedStartRow&&d<this.endCol&&C<=this.viewportCappedEndRow:d<this.startCol&&C>=this.viewportCappedStartRow&&d>=this.endCol&&C<=this.viewportCappedEndRow:C>this.viewportStartRow&&C<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&C===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportStartRow&&d>=this.startCol)}}c.createSelectionRenderModel=function(){return new u}},456:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0,c.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,h=this.selectionEnd;return!(!u||!h)&&(u[1]>h[1]||u[1]===h[1]&&u[0]>h[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(T,c,u){var h=this&&this.__decorate||function(f,p,S,A){var R,M=arguments.length,E=M<3?p:A===null?A=Object.getOwnPropertyDescriptor(p,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,p,S,A);else for(var B=f.length-1;B>=0;B--)(R=f[B])&&(E=(M<3?R(E):M>3?R(p,S,E):R(p,S))||E);return M>3&&E&&Object.defineProperty(p,S,E),E},y=this&&this.__param||function(f,p){return function(S,A){p(S,A,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const d=u(2585),C=u(8460),w=u(844);let k=c.CharSizeService=class extends w.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 C.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(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())}};c.CharSizeService=k=h([y(2,d.IOptionsService)],k);class b extends w.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 b{constructor(p,S,A){super(),this._document=p,this._parentElement=S,this._optionsService=A,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class v extends b{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(T,c,u){var h=this&&this.__decorate||function(v,f,p,S){var A,R=arguments.length,M=R<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,f,p,S);else for(var E=v.length-1;E>=0;E--)(A=v[E])&&(M=(R<3?A(M):R>3?A(f,p,M):A(f,p))||M);return R>3&&M&&Object.defineProperty(f,p,M),M},y=this&&this.__param||function(v,f){return function(p,S){f(p,S,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const d=u(3734),C=u(643),w=u(511),k=u(2585);class b 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()]}}c.JoinedCellData=b;let m=c.CharacterJoinerService=class Sv{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.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=[],A=p.translateToString(!0);let R=0,M=0,E=0,B=p.getFg(0),$=p.getBg(0);for(let I=0;I<p.getTrimmedLength();I++)if(p.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==B||this._workCell.bg!==$){if(I-R>1){const q=this._getJoinedRanges(A,E,M,p,R);for(let P=0;P<q.length;P++)S.push(q[P])}R=I,E=M,B=this._workCell.fg,$=this._workCell.bg}M+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const I=this._getJoinedRanges(A,E,M,p,R);for(let q=0;q<I.length;q++)S.push(I[q])}return S}_getJoinedRanges(f,p,S,A,R){const M=f.substring(p,S);let E=[];try{E=this._characterJoiners[0].handler(M)}catch(B){console.error(B)}for(let B=1;B<this._characterJoiners.length;B++)try{const $=this._characterJoiners[B].handler(M);for(let I=0;I<$.length;I++)Sv._mergeRanges(E,$[I])}catch($){console.error($)}return this._stringRangesToCellRanges(E,A,R),E}_stringRangesToCellRanges(f,p,S){let A=0,R=!1,M=0,E=f[A];if(E){for(let B=S;B<this._bufferService.cols;B++){const $=p.getWidth(B),I=p.getString(B).length||C.WHITESPACE_CELL_CHAR.length;if($!==0){if(!R&&E[0]<=M&&(E[0]=B,R=!0),E[1]<=M){if(E[1]=B,E=f[++A],!E)break;E[0]<=M?(E[0]=B,R=!0):R=!1}M+=I}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(f,p){let S=!1;for(let A=0;A<f.length;A++){const R=f[A];if(S){if(p[1]<=R[0])return f[A-1][1]=p[1],f;if(p[1]<=R[1])return f[A-1][1]=Math.max(p[1],R[1]),f.splice(A,1),f;f.splice(A,1),A--}else{if(p[1]<=R[0])return f.splice(A,0,p),f;if(p[1]<=R[1])return R[0]=Math.min(p[0],R[0]),f;p[0]<R[1]&&(R[0]=Math.min(p[0],R[0]),S=!0)}}return S?f[f.length-1][1]=p[1]:f.push(p),f}};c.CharacterJoinerService=m=h([y(0,k.IBufferService)],m)},5114:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const h=u(844),y=u(8460),d=u(3656);class C extends h.Disposable{constructor(b,m,v){super(),this._textarea=b,this._window=m,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new w(this._window),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new y.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((f=>this._screenDprMonitor.setWindow(f)))),this.register((0,y.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(b){this._window!==b&&(this._window=b,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}c.CoreBrowserService=C;class w extends h.Disposable{constructor(b){super(),this._parentWindow=b,this._windowResizeListener=this.register(new h.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,h.toDisposable)((()=>this.clearListener())))}setWindow(b){this._parentWindow=b,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var b;this._outerListener&&((b=this._resolutionMediaMatchList)==null||b.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const h=u(844);class y extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(C){return this.linkProviders.push(C),{dispose:()=>{const w=this.linkProviders.indexOf(C);w!==-1&&this.linkProviders.splice(w,1)}}}}c.LinkProviderService=y},8934:function(T,c,u){var h=this&&this.__decorate||function(k,b,m,v){var f,p=arguments.length,S=p<3?b:v===null?v=Object.getOwnPropertyDescriptor(b,m):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(k,b,m,v);else for(var A=k.length-1;A>=0;A--)(f=k[A])&&(S=(p<3?f(S):p>3?f(b,m,S):f(b,m))||S);return p>3&&S&&Object.defineProperty(b,m,S),S},y=this&&this.__param||function(k,b){return function(m,v){b(m,v,k)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const d=u(4725),C=u(9806);let w=c.MouseService=class{constructor(k,b){this._renderService=k,this._charSizeService=b}getCoords(k,b,m,v,f){return(0,C.getCoords)(window,k,b,m,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(k,b){const m=(0,C.getCoordsRelativeToElement)(window,k,b);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])}}};c.MouseService=w=h([y(0,d.IRenderService),y(1,d.ICharSizeService)],w)},3230:function(T,c,u){var h=this&&this.__decorate||function(f,p,S,A){var R,M=arguments.length,E=M<3?p:A===null?A=Object.getOwnPropertyDescriptor(p,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,p,S,A);else for(var B=f.length-1;B>=0;B--)(R=f[B])&&(E=(M<3?R(E):M>3?R(p,S,E):R(p,S))||E);return M>3&&E&&Object.defineProperty(p,S,E),E},y=this&&this.__param||function(f,p){return function(S,A){p(S,A,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const d=u(6193),C=u(4725),w=u(8460),k=u(844),b=u(7226),m=u(2585);let v=c.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(f,p,S,A,R,M,E,B){super(),this._rowCount=f,this._charSizeService=A,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new b.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 w.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new w.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new w.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer((($,I)=>this._renderRows($,I)),E),this.register(this._renderDebouncer),this.register(E.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>{var $;return($=this._renderer.value)==null?void 0:$.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.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(B.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(E.window,p),this.register(E.onWindowChange(($=>this._registerIntersectionObserver($,p))))}_registerIntersectionObserver(f,p){if("IntersectionObserver"in f){const S=new f.IntersectionObserver((A=>this._handleIntersectionChange(A[A.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 A;this._selectionState.start=f,this._selectionState.end=p,this._selectionState.columnSelectMode=S,(A=this._renderer.value)==null||A.handleSelectionChanged(f,p,S)}handleCursorMove(){var f;(f=this._renderer.value)==null||f.handleCursorMove()}clear(){var f;(f=this._renderer.value)==null||f.clear()}};c.RenderService=v=h([y(2,m.IOptionsService),y(3,C.ICharSizeService),y(4,m.IDecorationService),y(5,m.IBufferService),y(6,C.ICoreBrowserService),y(7,C.IThemeService)],v)},9312:function(T,c,u){var h=this&&this.__decorate||function(E,B,$,I){var q,P=arguments.length,J=P<3?B:I===null?I=Object.getOwnPropertyDescriptor(B,$):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(E,B,$,I);else for(var te=E.length-1;te>=0;te--)(q=E[te])&&(J=(P<3?q(J):P>3?q(B,$,J):q(B,$))||J);return P>3&&J&&Object.defineProperty(B,$,J),J},y=this&&this.__param||function(E,B){return function($,I){B($,I,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const d=u(9806),C=u(9504),w=u(456),k=u(4725),b=u(8460),m=u(844),v=u(6114),f=u(4841),p=u(511),S=u(2585),A=" ",R=new RegExp(A,"g");let M=c.SelectionService=class extends m.Disposable{constructor(E,B,$,I,q,P,J,te,G){super(),this._element=E,this._screenElement=B,this._linkifier=$,this._bufferService=I,this._coreService=q,this._mouseService=P,this._optionsService=J,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 b.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new b.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new b.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=se=>this._handleMouseMove(se),this._mouseUpListener=se=>this._handleMouseUp(se),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((se=>this._handleTrim(se))),this.register(this._bufferService.buffers.onBufferActivate((se=>this._handleBufferActivate(se)))),this.enable(),this._model=new w.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 E=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!E||!B||E[0]===B[0]&&E[1]===B[1])}get selectionText(){const E=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;if(!E||!B)return"";const $=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(E[0]===B[0])return"";const q=E[0]<B[0]?E[0]:B[0],P=E[0]<B[0]?B[0]:E[0];for(let J=E[1];J<=B[1];J++){const te=$.translateBufferLineToString(J,!0,q,P);I.push(te)}}else{const q=E[1]===B[1]?B[0]:void 0;I.push($.translateBufferLineToString(E[1],!0,E[0],q));for(let P=E[1]+1;P<=B[1]-1;P++){const J=$.lines.get(P),te=$.translateBufferLineToString(P,!0);J!=null&&J.isWrapped?I[I.length-1]+=te:I.push(te)}if(E[1]!==B[1]){const P=$.lines.get(B[1]),J=$.translateBufferLineToString(B[1],!0,0,B[0]);P&&P.isWrapped?I[I.length-1]+=J:I.push(J)}}return I.map((q=>q.replace(R," "))).join(v.isWindows?`\r
259
+ `:`
260
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.isLinux&&E&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(E){const B=this._getMouseBufferCoords(E),$=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!($&&I&&B)&&this._areCoordsInSelection(B,$,I)}isCellInSelection(E,B){const $=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!$||!I)&&this._areCoordsInSelection([E,B],$,I)}_areCoordsInSelection(E,B,$){return E[1]>B[1]&&E[1]<$[1]||B[1]===$[1]&&E[1]===B[1]&&E[0]>=B[0]&&E[0]<$[0]||B[1]<$[1]&&E[1]===$[1]&&E[0]<$[0]||B[1]<$[1]&&E[1]===B[1]&&E[0]>=B[0]}_selectWordAtCursor(E,B){var q,P;const $=(P=(q=this._linkifier.currentLink)==null?void 0:q.link)==null?void 0:P.range;if($)return this._model.selectionStart=[$.start.x-1,$.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)($,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(E);return!!I&&(this._selectWordAt(I,B),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,B){this._model.clearSelection(),E=Math.max(E,0),B=Math.min(B,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,B],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const B=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(B)return B[0]--,B[1]--,B[1]+=this._bufferService.buffer.ydisp,B}_getMouseEventScrollAmount(E){let B=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const $=this._renderService.dimensions.css.canvas.height;return B>=0&&B<=$?0:(B>$&&(B-=$),B=Math.min(Math.max(B,-50),50),B/=50,B/Math.abs(B)+Math.round(14*B))}shouldForceSelection(E){return v.isMac?E.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:E.shiftKey}handleMouseDown(E){if(this._mouseDownTimeStamp=E.timeStamp,(E.button!==2||!this.hasSelection)&&E.button===0){if(!this._enabled){if(!this.shouldForceSelection(E))return;E.stopPropagation()}E.preventDefault(),this._dragScrollAmount=0,this._enabled&&E.shiftKey?this._handleIncrementalClick(E):E.detail===1?this._handleSingleClick(E):E.detail===2?this._handleDoubleClick(E):E.detail===3&&this._handleTripleClick(E),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),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(E){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(E))}_handleSingleClick(E){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(E)?3:0,this._model.selectionStart=this._getMouseBufferCoords(E),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const B=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);B&&B.length!==this._model.selectionStart[0]&&B.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const B=this._getMouseBufferCoords(E);B&&(this._activeSelectionMode=2,this._selectLineAt(B[1]))}shouldColumnSelect(E){return E.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.stopImmediatePropagation(),!this._model.selectionStart)return;const B=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(E),!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(E),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const $=this._bufferService.buffer;if(this._model.selectionEnd[1]<$.lines.length){const I=$.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}B&&B[0]===this._model.selectionEnd[0]&&B[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 E=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(E.ydisp+this._bufferService.rows,E.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=E.ydisp),this.refresh()}}_handleMouseUp(E){const B=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&B<500&&E.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const $=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if($&&$[0]!==void 0&&$[1]!==void 0){const I=(0,C.moveToCellSequence)($[0]-1,$[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,B=this._model.finalSelectionEnd,$=!(!E||!B||E[0]===B[0]&&E[1]===B[1]);$?E&&B&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&B[0]===this._oldSelectionEnd[0]&&B[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,B,$)):this._oldHasSelection&&this._fireOnSelectionChange(E,B,$)}_fireOnSelectionChange(E,B,$){this._oldSelectionStart=E,this._oldSelectionEnd=B,this._oldHasSelection=$,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim((B=>this._handleTrim(B)))}_convertViewportColToCharacterIndex(E,B){let $=B;for(let I=0;B>=I;I++){const q=E.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?$--:q>1&&B!==I&&($+=q-1)}return $}setSelection(E,B,$){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,B],this._model.selectionStartLength=$,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,B,$=!0,I=!0){if(E[0]>=this._bufferService.cols)return;const q=this._bufferService.buffer,P=q.lines.get(E[1]);if(!P)return;const J=q.translateBufferLineToString(E[1],!1);let te=this._convertViewportColToCharacterIndex(P,E[0]),G=te;const se=E[0]-te;let ae=0,N=0,U=0,L=0;if(J.charAt(te)===" "){for(;te>0&&J.charAt(te-1)===" ";)te--;for(;G<J.length&&J.charAt(G+1)===" ";)G++}else{let re=E[0],ue=E[0];P.getWidth(re)===0&&(ae++,re--),P.getWidth(ue)===2&&(N++,ue++);const me=P.getString(ue).length;for(me>1&&(L+=me-1,G+=me-1);re>0&&te>0&&!this._isCharWordSeparator(P.loadCell(re-1,this._workCell));){P.loadCell(re-1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===0?(ae++,re--):Y>1&&(U+=Y-1,te-=Y-1),te--,re--}for(;ue<P.length&&G+1<J.length&&!this._isCharWordSeparator(P.loadCell(ue+1,this._workCell));){P.loadCell(ue+1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===2?(N++,ue++):Y>1&&(L+=Y-1,G+=Y-1),G++,ue++}}G++;let H=te+se-ae+U,V=Math.min(this._bufferService.cols,G-te+ae+N-U-L);if(B||J.slice(te,G).trim()!==""){if($&&H===0&&P.getCodePoint(0)!==32){const re=q.lines.get(E[1]-1);if(re&&P.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const ue=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(ue){const me=this._bufferService.cols-ue.start;H-=me,V+=me}}}if(I&&H+V===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const re=q.lines.get(E[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const ue=this._getWordAt([0,E[1]+1],!1,!1,!0);ue&&(V+=ue.length)}}return{start:H,length:V}}}_selectWordAt(E,B){const $=this._getWordAt(E,B);if($){for(;$.start<0;)$.start+=this._bufferService.cols,E[1]--;this._model.selectionStart=[$.start,E[1]],this._model.selectionStartLength=$.length}}_selectToWordAt(E){const B=this._getWordAt(E,!0);if(B){let $=E[1];for(;B.start<0;)B.start+=this._bufferService.cols,$--;if(!this._model.areSelectionValuesReversed())for(;B.start+B.length>this._bufferService.cols;)B.length-=this._bufferService.cols,$++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?B.start:B.start+B.length,$]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const B=this._bufferService.buffer.getWrappedRangeForLine(E),$={start:{x:0,y:B.first},end:{x:this._bufferService.cols-1,y:B.last}};this._model.selectionStart=[0,B.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)($,this._bufferService.cols)}};c.SelectionService=M=h([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:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ILinkProviderService=c.IThemeService=c.ICharacterJoinerService=c.ISelectionService=c.IRenderService=c.IMouseService=c.ICoreBrowserService=c.ICharSizeService=void 0;const h=u(8343);c.ICharSizeService=(0,h.createDecorator)("CharSizeService"),c.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),c.IMouseService=(0,h.createDecorator)("MouseService"),c.IRenderService=(0,h.createDecorator)("RenderService"),c.ISelectionService=(0,h.createDecorator)("SelectionService"),c.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),c.IThemeService=(0,h.createDecorator)("ThemeService"),c.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(T,c,u){var h=this&&this.__decorate||function(M,E,B,$){var I,q=arguments.length,P=q<3?E:$===null?$=Object.getOwnPropertyDescriptor(E,B):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,E,B,$);else for(var J=M.length-1;J>=0;J--)(I=M[J])&&(P=(q<3?I(P):q>3?I(E,B,P):I(E,B))||P);return q>3&&P&&Object.defineProperty(E,B,P),P},y=this&&this.__param||function(M,E){return function(B,$){E(B,$,M)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const d=u(7239),C=u(8055),w=u(8460),k=u(844),b=u(2585),m=C.css.toColor("#ffffff"),v=C.css.toColor("#000000"),f=C.css.toColor("#ffffff"),p=C.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[C.css.toColor("#2e3436"),C.css.toColor("#cc0000"),C.css.toColor("#4e9a06"),C.css.toColor("#c4a000"),C.css.toColor("#3465a4"),C.css.toColor("#75507b"),C.css.toColor("#06989a"),C.css.toColor("#d3d7cf"),C.css.toColor("#555753"),C.css.toColor("#ef2929"),C.css.toColor("#8ae234"),C.css.toColor("#fce94f"),C.css.toColor("#729fcf"),C.css.toColor("#ad7fa8"),C.css.toColor("#34e2e2"),C.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let B=0;B<216;B++){const $=E[B/36%6|0],I=E[B/6%6|0],q=E[B%6];M.push({css:C.channels.toCss($,I,q),rgba:C.channels.toRgba($,I,q)})}for(let B=0;B<24;B++){const $=8+10*B;M.push({css:C.channels.toCss($,$,$),rgba:C.channels.toRgba($,$,$)})}return M})());let A=c.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 w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:m,background:v,cursor:f,cursorAccent:p,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:C.color.blend(v,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:C.color.blend(v,S),ansi:c.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 E=this._colors;if(E.foreground=R(M.foreground,m),E.background=R(M.background,v),E.cursor=R(M.cursor,f),E.cursorAccent=R(M.cursorAccent,p),E.selectionBackgroundTransparent=R(M.selectionBackground,S),E.selectionBackgroundOpaque=C.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=R(M.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=C.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=M.selectionForeground?R(M.selectionForeground,C.NULL_COLOR):void 0,E.selectionForeground===C.NULL_COLOR&&(E.selectionForeground=void 0),C.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=C.color.opacity(E.selectionBackgroundTransparent,.3)),C.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=C.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=c.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=R(M.black,c.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=R(M.red,c.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=R(M.green,c.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=R(M.yellow,c.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=R(M.blue,c.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=R(M.magenta,c.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=R(M.cyan,c.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=R(M.white,c.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=R(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=R(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=R(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=R(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=R(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=R(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=R(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=R(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const B=Math.min(E.ansi.length-16,M.extendedAnsi.length);for(let $=0;$<B;$++)E.ansi[$+16]=R(M.extendedAnsi[$],c.DEFAULT_ANSI_COLORS[$+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 E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}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 R(M,E){if(M!==void 0)try{return C.css.toColor(M)}catch{}return E}c.ThemeService=A=h([y(0,b.IOptionsService)],A)},6349:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const h=u(8460),y=u(844);class d extends y.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.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(w){if(this._maxLength===w)return;const k=new Array(w);for(let b=0;b<Math.min(w,this.length);b++)k[b]=this._array[this._getCyclicIndex(b)];this._array=k,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let k=this._length;k<w;k++)this._array[k]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,k){this._array[this._getCyclicIndex(w)]=k}push(w){this._array[this._getCyclicIndex(this._length)]=w,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(w,k,...b){if(k){for(let m=w;m<this._length-k;m++)this._array[this._getCyclicIndex(m)]=this._array[this._getCyclicIndex(m+k)];this._length-=k,this.onDeleteEmitter.fire({index:w,amount:k})}for(let m=this._length-1;m>=w;m--)this._array[this._getCyclicIndex(m+b.length)]=this._array[this._getCyclicIndex(m)];for(let m=0;m<b.length;m++)this._array[this._getCyclicIndex(w+m)]=b[m];if(b.length&&this.onInsertEmitter.fire({index:w,amount:b.length}),this._length+b.length>this._maxLength){const m=this._length+b.length-this._maxLength;this._startIndex+=m,this._length=this._maxLength,this.onTrimEmitter.fire(m)}else this._length+=b.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,k,b){if(!(k<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+b<0)throw new Error("Cannot shift elements in list beyond index 0");if(b>0){for(let v=k-1;v>=0;v--)this.set(w+v+b,this.get(w+v));const m=w+k+b-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(w+m+b,this.get(w+m))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}c.CircularList=d},1439:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function u(h,y=5){if(typeof h!="object")return h;const d=Array.isArray(h)?[]:{};for(const C in h)d[C]=y<=1?h[C]:h[C]&&u(h[C],y-1);return d}},8055:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.contrastRatio=c.toPaddedHex=c.rgba=c.rgb=c.css=c.color=c.channels=c.NULL_COLOR=void 0;let u=0,h=0,y=0,d=0;var C,w,k,b,m;function v(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)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(p){p.toCss=function(S,A,R,M){return M!==void 0?`#${v(S)}${v(A)}${v(R)}${v(M)}`:`#${v(S)}${v(A)}${v(R)}`},p.toRgba=function(S,A,R,M=255){return(S<<24|A<<16|R<<8|M)>>>0},p.toColor=function(S,A,R,M){return{css:p.toCss(S,A,R,M),rgba:p.toRgba(S,A,R,M)}}})(C||(c.channels=C={})),(function(p){function S(A,R){return d=Math.round(255*R),[u,h,y]=m.toChannels(A.rgba),{css:C.toCss(u,h,y,d),rgba:C.toRgba(u,h,y,d)}}p.blend=function(A,R){if(d=(255&R.rgba)/255,d===1)return{css:R.css,rgba:R.rgba};const M=R.rgba>>24&255,E=R.rgba>>16&255,B=R.rgba>>8&255,$=A.rgba>>24&255,I=A.rgba>>16&255,q=A.rgba>>8&255;return u=$+Math.round((M-$)*d),h=I+Math.round((E-I)*d),y=q+Math.round((B-q)*d),{css:C.toCss(u,h,y),rgba:C.toRgba(u,h,y)}},p.isOpaque=function(A){return(255&A.rgba)==255},p.ensureContrastRatio=function(A,R,M){const E=m.ensureContrastRatio(A.rgba,R.rgba,M);if(E)return C.toColor(E>>24&255,E>>16&255,E>>8&255)},p.opaque=function(A){const R=(255|A.rgba)>>>0;return[u,h,y]=m.toChannels(R),{css:C.toCss(u,h,y),rgba:R}},p.opacity=S,p.multiplyOpacity=function(A,R){return d=255&A.rgba,S(A,d*R/255)},p.toColorRGB=function(A){return[A.rgba>>24&255,A.rgba>>16&255,A.rgba>>8&255]}})(w||(c.color=w={})),(function(p){let S,A;try{const R=document.createElement("canvas");R.width=1,R.height=1;const M=R.getContext("2d",{willReadFrequently:!0});M&&(S=M,S.globalCompositeOperation="copy",A=S.createLinearGradient(0,0,1,1))}catch{}p.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return u=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),y=parseInt(R.slice(3,4).repeat(2),16),C.toColor(u,h,y);case 5:return u=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),y=parseInt(R.slice(3,4).repeat(2),16),d=parseInt(R.slice(4,5).repeat(2),16),C.toColor(u,h,y,d);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const M=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return u=parseInt(M[1]),h=parseInt(M[2]),y=parseInt(M[3]),d=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),C.toColor(u,h,y,d);if(!S||!A)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=A,S.fillStyle=R,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[u,h,y,d]=S.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(u,h,y,d),css:R}}})(k||(c.css=k={})),(function(p){function S(A,R,M){const E=A/255,B=R/255,$=M/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))+.0722*($<=.03928?$/12.92:Math.pow(($+.055)/1.055,2.4))}p.relativeLuminance=function(A){return S(A>>16&255,A>>8&255,255&A)},p.relativeLuminance2=S})(b||(c.rgb=b={})),(function(p){function S(R,M,E){const B=R>>24&255,$=R>>16&255,I=R>>8&255;let q=M>>24&255,P=M>>16&255,J=M>>8&255,te=f(b.relativeLuminance2(q,P,J),b.relativeLuminance2(B,$,I));for(;te<E&&(q>0||P>0||J>0);)q-=Math.max(0,Math.ceil(.1*q)),P-=Math.max(0,Math.ceil(.1*P)),J-=Math.max(0,Math.ceil(.1*J)),te=f(b.relativeLuminance2(q,P,J),b.relativeLuminance2(B,$,I));return(q<<24|P<<16|J<<8|255)>>>0}function A(R,M,E){const B=R>>24&255,$=R>>16&255,I=R>>8&255;let q=M>>24&255,P=M>>16&255,J=M>>8&255,te=f(b.relativeLuminance2(q,P,J),b.relativeLuminance2(B,$,I));for(;te<E&&(q<255||P<255||J<255);)q=Math.min(255,q+Math.ceil(.1*(255-q))),P=Math.min(255,P+Math.ceil(.1*(255-P))),J=Math.min(255,J+Math.ceil(.1*(255-J))),te=f(b.relativeLuminance2(q,P,J),b.relativeLuminance2(B,$,I));return(q<<24|P<<16|J<<8|255)>>>0}p.blend=function(R,M){if(d=(255&M)/255,d===1)return M;const E=M>>24&255,B=M>>16&255,$=M>>8&255,I=R>>24&255,q=R>>16&255,P=R>>8&255;return u=I+Math.round((E-I)*d),h=q+Math.round((B-q)*d),y=P+Math.round(($-P)*d),C.toRgba(u,h,y)},p.ensureContrastRatio=function(R,M,E){const B=b.relativeLuminance(R>>8),$=b.relativeLuminance(M>>8);if(f(B,$)<E){if($<B){const P=S(R,M,E),J=f(B,b.relativeLuminance(P>>8));if(J<E){const te=A(R,M,E);return J>f(B,b.relativeLuminance(te>>8))?P:te}return P}const I=A(R,M,E),q=f(B,b.relativeLuminance(I>>8));if(q<E){const P=S(R,M,E);return q>f(B,b.relativeLuminance(P>>8))?I:P}return I}},p.reduceLuminance=S,p.increaseLuminance=A,p.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(m||(c.rgba=m={})),c.toPaddedHex=v,c.contrastRatio=f},8969:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const h=u(844),y=u(2585),d=u(4348),C=u(7866),w=u(744),k=u(7302),b=u(6975),m=u(8460),v=u(1753),f=u(1480),p=u(7994),S=u(9282),A=u(5435),R=u(5981),M=u(2660);let E=!1;class B extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new m.EventEmitter),this._onScroll.event((I=>{var q;(q=this._onScrollApi)==null||q.fire(I.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(I){for(const q in I)this.optionsService.options[q]=I[q]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new h.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(I)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(C.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(b.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(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 A.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,m.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,m.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,m.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,m.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((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 R.WriteBuffer(((q,P)=>this._inputHandler.parse(q,P)))),this.register((0,m.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,q){this._writeBuffer.write(I,q)}writeSync(I,q){this._logService.logLevel<=y.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(I,q)}input(I,q=!0){this.coreService.triggerDataEvent(I,q)}resize(I,q){isNaN(I)||isNaN(q)||(I=Math.max(I,w.MINIMUM_COLS),q=Math.max(q,w.MINIMUM_ROWS),this._bufferService.resize(I,q))}scroll(I,q=!1){this._bufferService.scroll(I,q)}scrollLines(I,q,P){this._bufferService.scrollLines(I,q,P)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const q=I-this._bufferService.buffer.ydisp;q!==0&&this.scrollLines(q)}registerEscHandler(I,q){return this._inputHandler.registerEscHandler(I,q)}registerDcsHandler(I,q){return this._inputHandler.registerDcsHandler(I,q)}registerCsiHandler(I,q){return this._inputHandler.registerCsiHandler(I,q)}registerOscHandler(I,q){return this._inputHandler.registerOscHandler(I,q)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const q=this.optionsService.rawOptions.windowsPty;q&&q.buildNumber!==void 0&&q.buildNumber!==void 0?I=q.backend==="conpty"&&q.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const q of I)q.dispose()}))}}}c.CoreTerminal=B},8460:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===u)return void this._listeners.splice(h,1)}}})),this._event}fire(u,h){const y=[];for(let d=0;d<this._listeners.length;d++)y.push(this._listeners[d]);for(let d=0;d<y.length;d++)y[d].call(void 0,u,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(u,h){return u((y=>h.fire(y)))},c.runAndSubscribe=function(u,h){return h(void 0),u((y=>h(y)))}},5435:function(T,c,u){var h=this&&this.__decorate||function(ae,N,U,L){var H,V=arguments.length,re=V<3?N:L===null?L=Object.getOwnPropertyDescriptor(N,U):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(ae,N,U,L);else for(var ue=ae.length-1;ue>=0;ue--)(H=ae[ue])&&(re=(V<3?H(re):V>3?H(N,U,re):H(N,U))||re);return V>3&&re&&Object.defineProperty(N,U,re),re},y=this&&this.__param||function(ae,N){return function(U,L){N(U,L,ae)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const d=u(2584),C=u(7116),w=u(2015),k=u(844),b=u(482),m=u(8437),v=u(8460),f=u(643),p=u(511),S=u(3734),A=u(2585),R=u(1480),M=u(6242),E=u(6351),B=u(5941),$={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function q(ae,N){if(ae>24)return N.setWinLines||!1;switch(ae){case 1:return!!N.restoreWin;case 2:return!!N.minimizeWin;case 3:return!!N.setWinPosition;case 4:return!!N.setWinSizePixels;case 5:return!!N.raiseWin;case 6:return!!N.lowerWin;case 7:return!!N.refreshWin;case 8:return!!N.setWinSizeChars;case 9:return!!N.maximizeWin;case 10:return!!N.fullscreenWin;case 11:return!!N.getWinState;case 13:return!!N.getWinPosition;case 14:return!!N.getWinSizePixels;case 15:return!!N.getScreenSizePixels;case 16:return!!N.getCellSizePixels;case 18:return!!N.getWinSizeChars;case 19:return!!N.getScreenSizeChars;case 20:return!!N.getIconTitle;case 21:return!!N.getWinTitle;case 22:return!!N.pushTitle;case 23:return!!N.popTitle;case 24:return!!N.setWinLines}return!1}var P;(function(ae){ae[ae.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ae[ae.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(c.WindowsOptionsReportType=P={}));let J=0;class te extends k.Disposable{getAttrData(){return this._curAttrData}constructor(N,U,L,H,V,re,ue,me,Y=new w.EscapeSequenceParser){super(),this._bufferService=N,this._charsetService=U,this._coreService=L,this._logService=H,this._optionsService=V,this._oscLinkService=re,this._coreMouseService=ue,this._unicodeService=me,this._parser=Y,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new b.StringToUtf32,this._utf8Decoder=new b.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 v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._parser.setCsiHandlerFallback(((j,ce)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(j),params:ce.toArray()})})),this._parser.setEscHandlerFallback((j=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(j)})})),this._parser.setExecuteHandlerFallback((j=>{this._logService.debug("Unknown EXECUTE code: ",{code:j})})),this._parser.setOscHandlerFallback(((j,ce,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:j,action:ce,data:oe})})),this._parser.setDcsHandlerFallback(((j,ce,oe)=>{ce==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(j),action:ce,payload:oe})})),this._parser.setPrintHandler(((j,ce,oe)=>this.print(j,ce,oe))),this._parser.registerCsiHandler({final:"@"},(j=>this.insertChars(j))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(j=>this.scrollLeft(j))),this._parser.registerCsiHandler({final:"A"},(j=>this.cursorUp(j))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(j=>this.scrollRight(j))),this._parser.registerCsiHandler({final:"B"},(j=>this.cursorDown(j))),this._parser.registerCsiHandler({final:"C"},(j=>this.cursorForward(j))),this._parser.registerCsiHandler({final:"D"},(j=>this.cursorBackward(j))),this._parser.registerCsiHandler({final:"E"},(j=>this.cursorNextLine(j))),this._parser.registerCsiHandler({final:"F"},(j=>this.cursorPrecedingLine(j))),this._parser.registerCsiHandler({final:"G"},(j=>this.cursorCharAbsolute(j))),this._parser.registerCsiHandler({final:"H"},(j=>this.cursorPosition(j))),this._parser.registerCsiHandler({final:"I"},(j=>this.cursorForwardTab(j))),this._parser.registerCsiHandler({final:"J"},(j=>this.eraseInDisplay(j,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(j=>this.eraseInDisplay(j,!0))),this._parser.registerCsiHandler({final:"K"},(j=>this.eraseInLine(j,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(j=>this.eraseInLine(j,!0))),this._parser.registerCsiHandler({final:"L"},(j=>this.insertLines(j))),this._parser.registerCsiHandler({final:"M"},(j=>this.deleteLines(j))),this._parser.registerCsiHandler({final:"P"},(j=>this.deleteChars(j))),this._parser.registerCsiHandler({final:"S"},(j=>this.scrollUp(j))),this._parser.registerCsiHandler({final:"T"},(j=>this.scrollDown(j))),this._parser.registerCsiHandler({final:"X"},(j=>this.eraseChars(j))),this._parser.registerCsiHandler({final:"Z"},(j=>this.cursorBackwardTab(j))),this._parser.registerCsiHandler({final:"`"},(j=>this.charPosAbsolute(j))),this._parser.registerCsiHandler({final:"a"},(j=>this.hPositionRelative(j))),this._parser.registerCsiHandler({final:"b"},(j=>this.repeatPrecedingCharacter(j))),this._parser.registerCsiHandler({final:"c"},(j=>this.sendDeviceAttributesPrimary(j))),this._parser.registerCsiHandler({prefix:">",final:"c"},(j=>this.sendDeviceAttributesSecondary(j))),this._parser.registerCsiHandler({final:"d"},(j=>this.linePosAbsolute(j))),this._parser.registerCsiHandler({final:"e"},(j=>this.vPositionRelative(j))),this._parser.registerCsiHandler({final:"f"},(j=>this.hVPosition(j))),this._parser.registerCsiHandler({final:"g"},(j=>this.tabClear(j))),this._parser.registerCsiHandler({final:"h"},(j=>this.setMode(j))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(j=>this.setModePrivate(j))),this._parser.registerCsiHandler({final:"l"},(j=>this.resetMode(j))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(j=>this.resetModePrivate(j))),this._parser.registerCsiHandler({final:"m"},(j=>this.charAttributes(j))),this._parser.registerCsiHandler({final:"n"},(j=>this.deviceStatus(j))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(j=>this.deviceStatusPrivate(j))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(j=>this.softReset(j))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(j=>this.setCursorStyle(j))),this._parser.registerCsiHandler({final:"r"},(j=>this.setScrollRegion(j))),this._parser.registerCsiHandler({final:"s"},(j=>this.saveCursor(j))),this._parser.registerCsiHandler({final:"t"},(j=>this.windowOptions(j))),this._parser.registerCsiHandler({final:"u"},(j=>this.restoreCursor(j))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(j=>this.insertColumns(j))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(j=>this.deleteColumns(j))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(j=>this.selectProtected(j))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(j=>this.requestMode(j,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(j=>this.requestMode(j,!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((j=>(this.setTitle(j),this.setIconName(j),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((j=>this.setIconName(j)))),this._parser.registerOscHandler(2,new M.OscHandler((j=>this.setTitle(j)))),this._parser.registerOscHandler(4,new M.OscHandler((j=>this.setOrReportIndexedColor(j)))),this._parser.registerOscHandler(8,new M.OscHandler((j=>this.setHyperlink(j)))),this._parser.registerOscHandler(10,new M.OscHandler((j=>this.setOrReportFgColor(j)))),this._parser.registerOscHandler(11,new M.OscHandler((j=>this.setOrReportBgColor(j)))),this._parser.registerOscHandler(12,new M.OscHandler((j=>this.setOrReportCursorColor(j)))),this._parser.registerOscHandler(104,new M.OscHandler((j=>this.restoreIndexedColor(j)))),this._parser.registerOscHandler(110,new M.OscHandler((j=>this.restoreFgColor(j)))),this._parser.registerOscHandler(111,new M.OscHandler((j=>this.restoreBgColor(j)))),this._parser.registerOscHandler(112,new M.OscHandler((j=>this.restoreCursorColor(j)))),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 j in C.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:j},(()=>this.selectCharset("("+j))),this._parser.registerEscHandler({intermediates:")",final:j},(()=>this.selectCharset(")"+j))),this._parser.registerEscHandler({intermediates:"*",final:j},(()=>this.selectCharset("*"+j))),this._parser.registerEscHandler({intermediates:"+",final:j},(()=>this.selectCharset("+"+j))),this._parser.registerEscHandler({intermediates:"-",final:j},(()=>this.selectCharset("-"+j))),this._parser.registerEscHandler({intermediates:".",final:j},(()=>this.selectCharset("."+j))),this._parser.registerEscHandler({intermediates:"/",final:j},(()=>this.selectCharset("/"+j)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((j=>(this._logService.error("Parsing error: ",j),j))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler(((j,ce)=>this.requestStatusString(j,ce))))}_preserveStack(N,U,L,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=N,this._parseStack.cursorStartY=U,this._parseStack.decodedLength=L,this._parseStack.position=H}_logSlowResolvingAsync(N){this._logService.logLevel<=A.LogLevelEnum.WARN&&Promise.race([N,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(N,U){let L,H=this._activeBuffer.x,V=this._activeBuffer.y,re=0;const ue=this._parseStack.paused;if(ue){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,U))return this._logSlowResolvingAsync(L),L;H=this._parseStack.cursorStartX,V=this._parseStack.cursorStartY,this._parseStack.paused=!1,N.length>I&&(re=this._parseStack.position+I)}if(this._logService.logLevel<=A.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof N=="string"?` "${N}"`:` "${Array.prototype.map.call(N,(j=>String.fromCharCode(j))).join("")}"`),typeof N=="string"?N.split("").map((j=>j.charCodeAt(0))):N),this._parseBuffer.length<N.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(N.length,I))),ue||this._dirtyRowTracker.clearRange(),N.length>I)for(let j=re;j<N.length;j+=I){const ce=j+I<N.length?j+I:N.length,oe=typeof N=="string"?this._stringDecoder.decode(N.substring(j,ce),this._parseBuffer):this._utf8Decoder.decode(N.subarray(j,ce),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,oe))return this._preserveStack(H,V,oe,j),this._logSlowResolvingAsync(L),L}else if(!ue){const j=typeof N=="string"?this._stringDecoder.decode(N,this._parseBuffer):this._utf8Decoder.decode(N,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,j))return this._preserveStack(H,V,j,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===H&&this._activeBuffer.y===V||this._onCursorMove.fire();const me=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Y=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Y<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Y,this._bufferService.rows-1),Math.min(me,this._bufferService.rows-1))}print(N,U,L){let H,V;const re=this._charsetService.charset,ue=this._optionsService.rawOptions.screenReaderMode,me=this._bufferService.cols,Y=this._coreService.decPrivateModes.wraparound,j=this._coreService.modes.insertMode,ce=this._curAttrData;let oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-U>0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ce);let ve=this._parser.precedingJoinState;for(let pe=U;pe<L;++pe){if(H=N[pe],H<127&&re){const ct=re[String.fromCharCode(H)];ct&&(H=ct.charCodeAt(0))}const Te=this._unicodeService.charProperties(H,ve);V=R.UnicodeService.extractWidth(Te);const je=R.UnicodeService.extractShouldJoin(Te),Ue=je?R.UnicodeService.extractWidth(ve):0;if(ve=Te,ue&&this._onA11yChar.fire((0,b.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+V-Ue>me){if(Y){const ct=oe;let Ee=this._activeBuffer.x-Ue;for(this._activeBuffer.x=Ue,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ue>0&&oe instanceof m.BufferLine&&oe.copyCellsFrom(ct,Ee,0,Ue,!1);Ee<me;)ct.setCellFromCodepoint(Ee++,0,1,ce)}else if(this._activeBuffer.x=me-1,V===2)continue}if(je&&this._activeBuffer.x){const ct=oe.getWidth(this._activeBuffer.x-1)?1:2;oe.addCodepointToCell(this._activeBuffer.x-ct,H,V);for(let Ee=V-Ue;--Ee>=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}else if(j&&(oe.insertCells(this._activeBuffer.x,V-Ue,this._activeBuffer.getNullCell(ce)),oe.getWidth(me-1)===2&&oe.setCellFromCodepoint(me-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,ce)),oe.setCellFromCodepoint(this._activeBuffer.x++,H,V,ce),V>0)for(;--V;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}this._parser.precedingJoinState=ve,this._activeBuffer.x<me&&L-U>0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,ce),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(N,U){return N.final!=="t"||N.prefix||N.intermediates?this._parser.registerCsiHandler(N,U):this._parser.registerCsiHandler(N,(L=>!q(L.params[0],this._optionsService.rawOptions.windowOptions)||U(L)))}registerDcsHandler(N,U){return this._parser.registerDcsHandler(N,new E.DcsHandler(U))}registerEscHandler(N,U){return this._parser.registerEscHandler(N,U)}registerOscHandler(N,U){return this._parser.registerOscHandler(N,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 N;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&&((N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&N.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 N=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-N),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(N=this._bufferService.cols-1){this._activeBuffer.x=Math.min(N,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(N,U){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=N,this._activeBuffer.y=this._activeBuffer.scrollTop+U):(this._activeBuffer.x=N,this._activeBuffer.y=U),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(N,U){this._restrictCursor(),this._setCursor(this._activeBuffer.x+N,this._activeBuffer.y+U)}cursorUp(N){const U=this._activeBuffer.y-this._activeBuffer.scrollTop;return U>=0?this._moveCursor(0,-Math.min(U,N.params[0]||1)):this._moveCursor(0,-(N.params[0]||1)),!0}cursorDown(N){const U=this._activeBuffer.scrollBottom-this._activeBuffer.y;return U>=0?this._moveCursor(0,Math.min(U,N.params[0]||1)):this._moveCursor(0,N.params[0]||1),!0}cursorForward(N){return this._moveCursor(N.params[0]||1,0),!0}cursorBackward(N){return this._moveCursor(-(N.params[0]||1),0),!0}cursorNextLine(N){return this.cursorDown(N),this._activeBuffer.x=0,!0}cursorPrecedingLine(N){return this.cursorUp(N),this._activeBuffer.x=0,!0}cursorCharAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(N){return this._setCursor(N.length>=2?(N.params[1]||1)-1:0,(N.params[0]||1)-1),!0}charPosAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(N){return this._moveCursor(N.params[0]||1,0),!0}linePosAbsolute(N){return this._setCursor(this._activeBuffer.x,(N.params[0]||1)-1),!0}vPositionRelative(N){return this._moveCursor(0,N.params[0]||1),!0}hVPosition(N){return this.cursorPosition(N),!0}tabClear(N){const U=N.params[0];return U===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:U===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=N.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=N.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(N){const U=N.params[0];return U===1&&(this._curAttrData.bg|=536870912),U!==2&&U!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(N,U,L,H=!1,V=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);re.replaceCells(U,L,this._activeBuffer.getNullCell(this._eraseAttrData()),V),H&&(re.isWrapped=!1)}_resetBufferLine(N,U=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),U),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+N),L.isWrapped=!1)}eraseInDisplay(N,U=!1){let L;switch(this._restrictCursor(this._bufferService.cols),N.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(N,U=!1){switch(this._restrictCursor(this._bufferService.cols),N.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(N){this._restrictCursor();let U=N.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,V=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;U--;)this._activeBuffer.lines.splice(V-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(N){this._restrictCursor();let U=N.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(N){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.insertCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(N){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.deleteCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(N){let U=N.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(N){let U=N.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(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.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(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.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(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.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(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.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(N){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(N.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(N){const U=this._parser.precedingJoinState;if(!U)return!0;const L=N.params[0]||1,H=R.UnicodeService.extractWidth(U),V=this._activeBuffer.x-H,re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(V),ue=new Uint32Array(re.length*L);let me=0;for(let j=0;j<re.length;){const ce=re.codePointAt(j)||0;ue[me++]=ce,j+=ce>65535?2:1}let Y=me;for(let j=1;j<L;++j)ue.copyWithin(Y,0,me),Y+=me;return this.print(ue,0,Y),!0}sendDeviceAttributesPrimary(N){return N.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(N){return N.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(N.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(N){return(this._optionsService.rawOptions.termName+"").indexOf(N)===0}setMode(N){for(let U=0;U<N.length;U++)switch(N.params[U]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(N){for(let U=0;U<N.length;U++)switch(N.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,C.DEFAULT_CHARSET),this._charsetService.setgCharset(1,C.DEFAULT_CHARSET),this._charsetService.setgCharset(2,C.DEFAULT_CHARSET),this._charsetService.setgCharset(3,C.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(N){for(let U=0;U<N.length;U++)switch(N.params[U]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(N){for(let U=0;U<N.length;U++)switch(N.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(),N.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(N,U){const L=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:V}=this._coreMouseService,re=this._coreService,{buffers:ue,cols:me}=this._bufferService,{active:Y,alt:j}=ue,ce=this._optionsService.rawOptions,oe=je=>je?1:2,ve=N.params[0];return pe=ve,Te=U?ve===2?4:ve===4?oe(re.modes.insertMode):ve===12?3:ve===20?oe(ce.convertEol):0:ve===1?oe(L.applicationCursorKeys):ve===3?ce.windowOptions.setWinLines?me===80?2:me===132?1:0:0:ve===6?oe(L.origin):ve===7?oe(L.wraparound):ve===8?3:ve===9?oe(H==="X10"):ve===12?oe(ce.cursorBlink):ve===25?oe(!re.isCursorHidden):ve===45?oe(L.reverseWraparound):ve===66?oe(L.applicationKeypad):ve===67?4:ve===1e3?oe(H==="VT200"):ve===1002?oe(H==="DRAG"):ve===1003?oe(H==="ANY"):ve===1004?oe(L.sendFocus):ve===1005?4:ve===1006?oe(V==="SGR"):ve===1015?4:ve===1016?oe(V==="SGR_PIXELS"):ve===1048?1:ve===47||ve===1047||ve===1049?oe(Y===j):ve===2004?oe(L.bracketedPasteMode):0,re.triggerDataEvent(`${d.C0.ESC}[${U?"":"?"}${pe};${Te}$y`),!0;var pe,Te}_updateAttrColor(N,U,L,H,V){return U===2?(N|=50331648,N&=-16777216,N|=S.AttributeData.fromColorRGB([L,H,V])):U===5&&(N&=-50331904,N|=33554432|255&L),N}_extractColor(N,U,L){const H=[0,0,-1,0,0,0];let V=0,re=0;do{if(H[re+V]=N.params[U+re],N.hasSubParams(U+re)){const ue=N.getSubParams(U+re);let me=0;do H[1]===5&&(V=1),H[re+me+1+V]=ue[me];while(++me<ue.length&&me+re+1+V<H.length);break}if(H[1]===5&&re+V>=2||H[1]===2&&re+V>=5)break;H[1]&&(V=1)}while(++re+U<N.length&&re+V<H.length);for(let ue=2;ue<H.length;++ue)H[ue]===-1&&(H[ue]=0);switch(H[0]){case 38:L.fg=this._updateAttrColor(L.fg,H[1],H[3],H[4],H[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,H[1],H[3],H[4],H[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,H[1],H[3],H[4],H[5])}return re}_processUnderline(N,U){U.extended=U.extended.clone(),(!~N||N>5)&&(N=1),U.extended.underlineStyle=N,U.fg|=268435456,N===0&&(U.fg&=-268435457),U.updateExtended()}_processSGR0(N){N.fg=m.DEFAULT_ATTR_DATA.fg,N.bg=m.DEFAULT_ATTR_DATA.bg,N.extended=N.extended.clone(),N.extended.underlineStyle=0,N.extended.underlineColor&=-67108864,N.updateExtended()}charAttributes(N){if(N.length===1&&N.params[0]===0)return this._processSGR0(this._curAttrData),!0;const U=N.length;let L;const H=this._curAttrData;for(let V=0;V<U;V++)L=N.params[V],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(N.hasSubParams(V)?N.getSubParams(V)[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?V+=this._extractColor(N,V,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(N){switch(N.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(N){if(N.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(N){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(N){const U=N.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(N){const U=N.params[0]||1;let L;return(N.length<2||(L=N.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(N){if(!q(N.params[0],this._optionsService.rawOptions.windowOptions))return!0;const U=N.length>1?N.params[1]:0;switch(N.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(N){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(N){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(N){return this._windowTitle=N,this._onTitleChange.fire(N),!0}setIconName(N){return this._iconName=N,!0}setOrReportIndexedColor(N){const U=[],L=N.split(";");for(;L.length>1;){const H=L.shift(),V=L.shift();if(/^\d+$/.exec(H)){const re=parseInt(H);if(se(re))if(V==="?")U.push({type:0,index:re});else{const ue=(0,B.parseColor)(V);ue&&U.push({type:1,index:re,color:ue})}}}return U.length&&this._onColor.fire(U),!0}setHyperlink(N){const U=N.split(";");return!(U.length<2)&&(U[1]?this._createHyperlink(U[0],U[1]):!U[0]&&this._finishHyperlink())}_createHyperlink(N,U){this._getCurrentLinkId()&&this._finishHyperlink();const L=N.split(":");let H;const V=L.findIndex((re=>re.startsWith("id=")));return V!==-1&&(H=L[V].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(N,U){const L=N.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 V=(0,B.parseColor)(L[H]);V&&this._onColor.fire([{type:1,index:this._specialColors[U],color:V}])}return!0}setOrReportFgColor(N){return this._setOrReportSpecialColor(N,0)}setOrReportBgColor(N){return this._setOrReportSpecialColor(N,1)}setOrReportCursorColor(N){return this._setOrReportSpecialColor(N,2)}restoreIndexedColor(N){if(!N)return this._onColor.fire([{type:2}]),!0;const U=[],L=N.split(";");for(let H=0;H<L.length;++H)if(/^\d+$/.exec(L[H])){const V=parseInt(L[H]);se(V)&&U.push({type:2,index:V})}return U.length&&this._onColor.fire(U),!0}restoreFgColor(N){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(N){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(N){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,C.DEFAULT_CHARSET),!0}selectCharset(N){return N.length!==2?(this.selectDefaultCharset(),!0):(N[0]==="/"||this._charsetService.setgCharset($[N[0]],C.CHARSETS[N[1]]||C.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 N=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,N,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(N){return this._charsetService.setgLevel(N),!0}screenAlignmentPattern(){const N=new p.CellData;N.content=4194373,N.fg=this._curAttrData.fg,N.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(N),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(N,U){const L=this._bufferService.buffer,H=this._optionsService.rawOptions;return(V=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${V}${d.C0.ESC}\\`),!0))(N==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:N==='"p'?'P1$r61;1"p':N==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:N==="m"?"P1$r0m":N===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(N,U){this._dirtyRowTracker.markRangeDirty(N,U)}}c.InputHandler=te;let G=class{constructor(ae){this._bufferService=ae,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ae){ae<this.start?this.start=ae:ae>this.end&&(this.end=ae)}markRangeDirty(ae,N){ae>N&&(J=ae,ae=N,N=J),ae<this.start&&(this.start=ae),N>this.end&&(this.end=N)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function se(ae){return 0<=ae&&ae<256}G=h([y(0,A.IBufferService)],G)},844:(T,c)=>{function u(h){for(const y of h)y.dispose();h.length=0}Object.defineProperty(c,"__esModule",{value:!0}),c.getDisposeArrayDisposable=c.disposeArray=c.toDisposable=c.MutableDisposable=c.Disposable=void 0,c.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const y=this._disposables.indexOf(h);y!==-1&&this._disposables.splice(y,1)}},c.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var y;this._isDisposed||h===this._value||((y=this._value)==null||y.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},c.toDisposable=function(h){return{dispose:h}},c.disposeArray=u,c.getDisposeArrayDisposable=function(h){return{dispose:()=>u(h)}}},1505:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(y,d,C){this._data[y]||(this._data[y]={}),this._data[y][d]=C}get(y,d){return this._data[y]?this._data[y][d]:void 0}clear(){this._data={}}}c.TwoKeyMap=u,c.FourKeyMap=class{constructor(){this._data=new u}set(h,y,d,C,w){this._data.get(h,y)||this._data.set(h,y,new u),this._data.get(h,y).set(d,C,w)}get(h,y,d,C){var w;return(w=this._data.get(h,y))==null?void 0:w.get(d,C)}clear(){this._data.clear()}}},6114:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.isChromeOS=c.isLinux=c.isWindows=c.isIphone=c.isIpad=c.isMac=c.getSafariVersion=c.isSafari=c.isLegacyEdge=c.isFirefox=c.isNode=void 0,c.isNode=typeof process<"u"&&"title"in process;const u=c.isNode?"node":navigator.userAgent,h=c.isNode?"node":navigator.platform;c.isFirefox=u.includes("Firefox"),c.isLegacyEdge=u.includes("Edge"),c.isSafari=/^((?!chrome|android).)*safari/i.test(u),c.getSafariVersion=function(){if(!c.isSafari)return 0;const y=u.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},c.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),c.isIpad=h==="iPad",c.isIphone=h==="iPhone",c.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),c.isLinux=h.indexOf("Linux")>=0,c.isChromeOS=/\bCrOS\b/.test(u)},6106:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SortedList=void 0;let u=0;c.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(u=this._search(this._getKey(h)),this._array.splice(u,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const y=this._getKey(h);if(y===void 0||(u=this._search(y),u===-1)||this._getKey(this._array[u])!==y)return!1;do if(this._array[u]===h)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===y);return!1}*getKeyIterator(h){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===h)}forEachByKey(h,y){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do y(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===h)}values(){return[...this._array].values()}_search(h){let y=0,d=this._array.length-1;for(;d>=y;){let C=y+d>>1;const w=this._getKey(this._array[C]);if(w>h)d=C-1;else{if(!(w<h)){for(;C>0&&this._getKey(this._array[C-1])===h;)C--;return C}y=C+1}}return y}}},7226:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const h=u(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),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(w){this._idleCallback=void 0;let k=0,b=0,m=w.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),b=Math.max(k,b),v=w.timeRemaining(),1.5*b>v)return m-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(m-k))}ms`),void this._start();m=v}this.clear()}}class d extends y{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const k=Date.now()+w;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}c.PriorityTaskQueue=d,c.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(C){return requestIdleCallback(C)}_cancelCallback(C){cancelIdleCallback(C)}}:d,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(C){this._queue.clear(),this._queue.enqueue(C)}flush(){this._queue.flush()}}},9282:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const h=u(643);c.updateWindowsModeWrappedState=function(y){const d=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),C=d==null?void 0:d.get(y.cols-1),w=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);w&&C&&(w.isWrapped=C[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&C[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ExtendedAttrs=c.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new u;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}c.AttributeData=u;class h{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,C=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=C}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=h},9092:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const h=u(6349),y=u(7226),d=u(3734),C=u(8437),w=u(4634),k=u(511),b=u(643),m=u(4863),v=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.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=C.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,b.NULL_CELL_CHAR,b.NULL_CELL_WIDTH,b.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,b.WHITESPACE_CELL_CHAR,b.WHITESPACE_CELL_WIDTH,b.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new y.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.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 C.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>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:p}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=C.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 h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(f,p){const S=this.getNullCell(C.DEFAULT_ATTR_DATA);let A=0;const R=this._getCorrectBufferLength(p);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<f)for(let E=0;E<this.lines.length;E++)A+=+this.lines.get(E).resize(f,S);let M=0;if(this._rows<p)for(let E=this._rows;E<p;E++)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 C.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 C.BufferLine(f,S)));else for(let E=this._rows;E>p;E--)this.lines.length>p+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const E=this.lines.length-R;E>0&&(this.lines.trimStart(E),this.ybase=Math.max(this.ybase-E,0),this.ydisp=Math.max(this.ydisp-E,0),this.savedY=Math.max(this.savedY-E,0)),this.lines.maxLength=R}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++)A+=+this.lines.get(M).resize(f,S);this._cols=f,this._rows=p,this._memoryCleanupQueue.clear(),A>.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,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(S.length>0){const A=(0,w.reflowLargerCreateNewLayout)(this.lines,S);(0,w.reflowLargerApplyNewLayout)(this.lines,A.layout),this._reflowLargerAdjustViewport(f,p,A.countRemoved)}}_reflowLargerAdjustViewport(f,p,S){const A=this.getNullCell(C.DEFAULT_ATTR_DATA);let R=S;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<p&&this.lines.push(new C.BufferLine(f,A))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(f,p){const S=this.getNullCell(C.DEFAULT_ATTR_DATA),A=[];let R=0;for(let M=this.lines.length-1;M>=0;M--){let E=this.lines.get(M);if(!E||!E.isWrapped&&E.getTrimmedLength()<=f)continue;const B=[E];for(;E.isWrapped&&M>0;)E=this.lines.get(--M),B.unshift(E);const $=this.ybase+this.y;if($>=M&&$<M+B.length)continue;const I=B[B.length-1].getTrimmedLength(),q=(0,w.reflowSmallerGetNewLineLengths)(B,this._cols,f),P=q.length-B.length;let J;J=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(C.DEFAULT_ATTR_DATA,!0);te.push(H)}te.length>0&&(A.push({start:M+B.length+R,newLines:te}),R+=te.length),B.push(...te);let G=q.length-1,se=q[G];se===0&&(G--,se=q[G]);let ae=B.length-P-1,N=I;for(;ae>=0;){const L=Math.min(N,se);if(B[G]===void 0)break;if(B[G].copyCellsFrom(B[ae],N-L,se-L,L,!0),se-=L,se===0&&(G--,se=q[G]),N-=L,N===0){ae--;const H=Math.max(ae,0);N=(0,w.getWrappedLineTrimmedLength)(B,H,this._cols)}}for(let L=0;L<B.length;L++)q[L]<f&&B[L].setCell(q[L],S);let U=P-J;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+R)-p&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+p-1)}if(A.length>0){const M=[],E=[];for(let G=0;G<this.lines.length;G++)E.push(this.lines.get(G));const B=this.lines.length;let $=B-1,I=0,q=A[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let P=0;for(let G=Math.min(this.lines.maxLength-1,B+R-1);G>=0;G--)if(q&&q.start>$+P){for(let se=q.newLines.length-1;se>=0;se--)this.lines.set(G--,q.newLines[se]);G++,M.push({index:$+1,amount:q.newLines.length}),P+=q.newLines.length,q=A[++I]}else this.lines.set(G,E[$--]);let J=0;for(let G=M.length-1;G>=0;G--)M[G].index+=J,this.lines.onInsertEmitter.fire(M[G]),J+=M[G].amount;const te=Math.max(0,B+R-this.lines.maxLength);te>0&&this.lines.onTrimEmitter.fire(te)}}translateBufferLineToString(f,p,S=0,A){const R=this.lines.get(f);return R?R.translateToString(p,S,A):""}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:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const h=u(3734),y=u(511),d=u(643),C=u(482);c.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let w=0;class k{constructor(m,v,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*m);const p=v||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 v=this._data[3*m+0],f=2097151&v;return[this._data[3*m+1],2097152&v?this._combined[m]:f?(0,C.stringFromCodePoint)(f):"",v>>22,2097152&v?this._combined[m].charCodeAt(this._combined[m].length-1):f]}set(m,v){this._data[3*m+1]=v[d.CHAR_DATA_ATTR_INDEX],v[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[m]=v[1],this._data[3*m+0]=2097152|m|v[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*m+0]=v[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[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 v=this._data[3*m+0];return 2097152&v?this._combined[m].charCodeAt(this._combined[m].length-1):2097151&v}isCombined(m){return 2097152&this._data[3*m+0]}getString(m){const v=this._data[3*m+0];return 2097152&v?this._combined[m]:2097151&v?(0,C.stringFromCodePoint)(2097151&v):""}isProtected(m){return 536870912&this._data[3*m+2]}loadCell(m,v){return w=3*m,v.content=this._data[w+0],v.fg=this._data[w+1],v.bg=this._data[w+2],2097152&v.content&&(v.combinedData=this._combined[m]),268435456&v.bg&&(v.extended=this._extendedAttrs[m]),v}setCell(m,v){2097152&v.content&&(this._combined[m]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[m]=v.extended),this._data[3*m+0]=v.content,this._data[3*m+1]=v.fg,this._data[3*m+2]=v.bg}setCellFromCodepoint(m,v,f,p){268435456&p.bg&&(this._extendedAttrs[m]=p.extended),this._data[3*m+0]=v|f<<22,this._data[3*m+1]=p.fg,this._data[3*m+2]=p.bg}addCodepointToCell(m,v,f){let p=this._data[3*m+0];2097152&p?this._combined[m]+=(0,C.stringFromCodePoint)(v):2097151&p?(this._combined[m]=(0,C.stringFromCodePoint)(2097151&p)+(0,C.stringFromCodePoint)(v),p&=-2097152,p|=2097152):p=v|4194304,f&&(p&=-12582913,p|=f<<22),this._data[3*m+0]=p}insertCells(m,v,f){if((m%=this.length)&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,f),v<this.length-m){const p=new y.CellData;for(let S=this.length-m-v-1;S>=0;--S)this.setCell(m+v+S,this.loadCell(m+S,p));for(let S=0;S<v;++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,v,f){if(m%=this.length,v<this.length-m){const p=new y.CellData;for(let S=0;S<this.length-m-v;++S)this.setCell(m+S,this.loadCell(m+v+S,p));for(let S=this.length-v;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,v,f,p=!1){if(p)for(m&&this.getWidth(m-1)===2&&!this.isProtected(m-1)&&this.setCellFromCodepoint(m-1,0,1,f),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,f);m<v&&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),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,f);m<v&&m<this.length;)this.setCell(m++,f)}resize(m,v){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,v)}else{this._data=this._data.subarray(0,f);const p=Object.keys(this._combined);for(let A=0;A<p.length;A++){const R=parseInt(p[A],10);R>=m&&delete this._combined[R]}const S=Object.keys(this._extendedAttrs);for(let A=0;A<S.length;A++){const R=parseInt(S[A],10);R>=m&&delete this._extendedAttrs[R]}}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,v=!1){if(v)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 v in m._combined)this._combined[v]=m._combined[v];this._extendedAttrs={};for(const v in m._extendedAttrs)this._extendedAttrs[v]=m._extendedAttrs[v];this.isWrapped=m.isWrapped}clone(){const m=new k(0);m._data=new Uint32Array(this._data),m.length=this.length;for(const v in this._combined)m._combined[v]=this._combined[v];for(const v in this._extendedAttrs)m._extendedAttrs[v]=this._extendedAttrs[v];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,v,f,p,S){const A=m._data;if(S)for(let M=p-1;M>=0;M--){for(let E=0;E<3;E++)this._data[3*(f+M)+E]=A[3*(v+M)+E];268435456&A[3*(v+M)+2]&&(this._extendedAttrs[f+M]=m._extendedAttrs[v+M])}else for(let M=0;M<p;M++){for(let E=0;E<3;E++)this._data[3*(f+M)+E]=A[3*(v+M)+E];268435456&A[3*(v+M)+2]&&(this._extendedAttrs[f+M]=m._extendedAttrs[v+M])}const R=Object.keys(m._combined);for(let M=0;M<R.length;M++){const E=parseInt(R[M],10);E>=v&&(this._combined[E-v+f]=m._combined[E])}}translateToString(m,v,f,p){v=v??0,f=f??this.length,m&&(f=Math.min(f,this.getTrimmedLength())),p&&(p.length=0);let S="";for(;v<f;){const A=this._data[3*v+0],R=2097151&A,M=2097152&A?this._combined[v]:R?(0,C.stringFromCodePoint)(R):d.WHITESPACE_CELL_CHAR;if(S+=M,p)for(let E=0;E<M.length;++E)p.push(v);v+=A>>22||1}return p&&p.push(v),S}}c.BufferLine=k},4841:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.getRangeLength=void 0,c.getRangeLength=function(u,h){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return h*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(T,c)=>{function u(h,y,d){if(y===h.length-1)return h[y].getTrimmedLength();const C=!h[y].hasContent(d-1)&&h[y].getWidth(d-1)===1,w=h[y+1].getWidth(0)===2;return C&&w?d-1:d}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(h,y,d,C,w){const k=[];for(let b=0;b<h.length-1;b++){let m=b,v=h.get(++m);if(!v.isWrapped)continue;const f=[h.get(b)];for(;m<h.length&&v.isWrapped;)f.push(v),v=h.get(++m);if(C>=b&&C<m){b+=f.length-1;continue}let p=0,S=u(f,p,y),A=1,R=0;for(;A<f.length;){const E=u(f,A,y),B=E-R,$=d-S,I=Math.min(B,$);f[p].copyCellsFrom(f[A],R,S,I,!1),S+=I,S===d&&(p++,S=0),R+=I,R===E&&(A++,R=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,w))}f[p].replaceCells(S,d,w);let M=0;for(let E=f.length-1;E>0&&(E>p||f[E].getTrimmedLength()===0);E--)M++;M>0&&(k.push(b+f.length-M),k.push(M)),b+=f.length-1}return k},c.reflowLargerCreateNewLayout=function(h,y){const d=[];let C=0,w=y[C],k=0;for(let b=0;b<h.length;b++)if(w===b){const m=y[++C];h.onDeleteEmitter.fire({index:b-k,amount:m}),b+=m-1,k+=m,w=y[++C]}else d.push(b);return{layout:d,countRemoved:k}},c.reflowLargerApplyNewLayout=function(h,y){const d=[];for(let C=0;C<y.length;C++)d.push(h.get(y[C]));for(let C=0;C<d.length;C++)h.set(C,d[C]);h.length=y.length},c.reflowSmallerGetNewLineLengths=function(h,y,d){const C=[],w=h.map(((v,f)=>u(h,f,y))).reduce(((v,f)=>v+f));let k=0,b=0,m=0;for(;m<w;){if(w-m<d){C.push(w-m);break}k+=d;const v=u(h,b,y);k>v&&(k-=v,b++);const f=h[b].getWidth(k-1)===2;f&&k--;const p=f?d-1:d;C.push(p),m+=p}return C},c.getWrappedLineTrimmedLength=u},5295:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const h=u(8460),y=u(844),d=u(9092);class C extends y.Disposable{constructor(k,b){super(),this._optionsService=k,this._bufferService=b,this._onBufferActivate=this.register(new h.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,b){this._normal.resize(k,b),this._alt.resize(k,b),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}c.BufferSet=C},511:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const h=u(482),y=u(643),d=u(3734);class C 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 b=new C;return b.setFromCharData(k),b}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.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 b=!1;if(k[y.CHAR_DATA_CHAR_INDEX].length>2)b=!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 v=k[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(m-55296)+v-56320+65536|k[y.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=k[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[y.CHAR_DATA_WIDTH_INDEX]<<22;b&&(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()]}}c.CellData=C},643:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WHITESPACE_CELL_CODE=c.WHITESPACE_CELL_WIDTH=c.WHITESPACE_CELL_CHAR=c.NULL_CELL_CODE=c.NULL_CELL_WIDTH=c.NULL_CELL_CHAR=c.CHAR_DATA_CODE_INDEX=c.CHAR_DATA_WIDTH_INDEX=c.CHAR_DATA_CHAR_INDEX=c.CHAR_DATA_ATTR_INDEX=c.DEFAULT_EXT=c.DEFAULT_ATTR=c.DEFAULT_COLOR=void 0,c.DEFAULT_COLOR=0,c.DEFAULT_ATTR=256|c.DEFAULT_COLOR<<9,c.DEFAULT_EXT=0,c.CHAR_DATA_ATTR_INDEX=0,c.CHAR_DATA_CHAR_INDEX=1,c.CHAR_DATA_WIDTH_INDEX=2,c.CHAR_DATA_CODE_INDEX=3,c.NULL_CELL_CHAR="",c.NULL_CELL_WIDTH=1,c.NULL_CELL_CODE=0,c.WHITESPACE_CELL_CHAR=" ",c.WHITESPACE_CELL_WIDTH=1,c.WHITESPACE_CELL_CODE=32},4863:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const h=u(8460),y=u(844);class d{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new h.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(w){return this._disposables.push(w),w}}c.Marker=d,d._nextId=1},7116:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DEFAULT_CHARSET=c.CHARSETS=void 0,c.CHARSETS={},c.DEFAULT_CHARSET=c.CHARSETS.B,c.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:"≥","{":"π","|":"≠","}":"£","~":"·"},c.CHARSETS.A={"#":"£"},c.CHARSETS.B=void 0,c.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},c.CHARSETS.C=c.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},c.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},c.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},c.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},c.CHARSETS.E=c.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},c.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},c.CHARSETS.H=c.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(T,c)=>{var u,h,y;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.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=`
261
+ `,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(u||(c.C0=u={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(h||(c.C1=h={})),(function(d){d.ST=`${u.ESC}\\`})(y||(c.C1_ESCAPED=y={}))},7399:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const h=u(2584),y={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};c.evaluateKeyboardEvent=function(d,C,w,k){const b={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"?b.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?b.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?b.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(b.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:b.key=d.ctrlKey?"\b":h.C0.DEL,d.altKey&&(b.key=h.C0.ESC+b.key);break;case 9:if(d.shiftKey){b.key=h.C0.ESC+"[Z";break}b.key=h.C0.HT,b.cancel=!0;break;case 13:b.key=d.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,b.cancel=!0;break;case 27:b.key=h.C0.ESC,d.altKey&&(b.key=h.C0.ESC+h.C0.ESC),b.cancel=!0;break;case 37:if(d.metaKey)break;m?(b.key=h.C0.ESC+"[1;"+(m+1)+"D",b.key===h.C0.ESC+"[1;3D"&&(b.key=h.C0.ESC+(w?"b":"[1;5D"))):b.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(d.metaKey)break;m?(b.key=h.C0.ESC+"[1;"+(m+1)+"C",b.key===h.C0.ESC+"[1;3C"&&(b.key=h.C0.ESC+(w?"f":"[1;5C"))):b.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(d.metaKey)break;m?(b.key=h.C0.ESC+"[1;"+(m+1)+"A",w||b.key!==h.C0.ESC+"[1;3A"||(b.key=h.C0.ESC+"[1;5A")):b.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(d.metaKey)break;m?(b.key=h.C0.ESC+"[1;"+(m+1)+"B",w||b.key!==h.C0.ESC+"[1;3B"||(b.key=h.C0.ESC+"[1;5B")):b.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(b.key=h.C0.ESC+"[2~");break;case 46:b.key=m?h.C0.ESC+"[3;"+(m+1)+"~":h.C0.ESC+"[3~";break;case 36:b.key=m?h.C0.ESC+"[1;"+(m+1)+"H":C?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:b.key=m?h.C0.ESC+"[1;"+(m+1)+"F":C?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:d.shiftKey?b.type=2:d.ctrlKey?b.key=h.C0.ESC+"[5;"+(m+1)+"~":b.key=h.C0.ESC+"[5~";break;case 34:d.shiftKey?b.type=3:d.ctrlKey?b.key=h.C0.ESC+"[6;"+(m+1)+"~":b.key=h.C0.ESC+"[6~";break;case 112:b.key=m?h.C0.ESC+"[1;"+(m+1)+"P":h.C0.ESC+"OP";break;case 113:b.key=m?h.C0.ESC+"[1;"+(m+1)+"Q":h.C0.ESC+"OQ";break;case 114:b.key=m?h.C0.ESC+"[1;"+(m+1)+"R":h.C0.ESC+"OR";break;case 115:b.key=m?h.C0.ESC+"[1;"+(m+1)+"S":h.C0.ESC+"OS";break;case 116:b.key=m?h.C0.ESC+"[15;"+(m+1)+"~":h.C0.ESC+"[15~";break;case 117:b.key=m?h.C0.ESC+"[17;"+(m+1)+"~":h.C0.ESC+"[17~";break;case 118:b.key=m?h.C0.ESC+"[18;"+(m+1)+"~":h.C0.ESC+"[18~";break;case 119:b.key=m?h.C0.ESC+"[19;"+(m+1)+"~":h.C0.ESC+"[19~";break;case 120:b.key=m?h.C0.ESC+"[20;"+(m+1)+"~":h.C0.ESC+"[20~";break;case 121:b.key=m?h.C0.ESC+"[21;"+(m+1)+"~":h.C0.ESC+"[21~";break;case 122:b.key=m?h.C0.ESC+"[23;"+(m+1)+"~":h.C0.ESC+"[23~";break;case 123:b.key=m?h.C0.ESC+"[24;"+(m+1)+"~":h.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(w&&!k||!d.altKey||d.metaKey)!w||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?b.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(b.key=h.C0.US),d.key==="@"&&(b.key=h.C0.NUL)):d.keyCode===65&&(b.type=1);else{const v=y[d.keyCode],f=v==null?void 0:v[d.shiftKey?1:0];if(f)b.key=h.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()),b.key=h.C0.ESC+S}else if(d.keyCode===32)b.key=h.C0.ESC+(d.ctrlKey?h.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let p=d.code.slice(3,4);d.shiftKey||(p=p.toLowerCase()),b.key=h.C0.ESC+p,b.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?b.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?b.key=h.C0.NUL:d.keyCode>=51&&d.keyCode<=55?b.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?b.key=h.C0.DEL:d.keyCode===219?b.key=h.C0.ESC:d.keyCode===220?b.key=h.C0.FS:d.keyCode===221&&(b.key=h.C0.GS)}return b}},482:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Utf8ToUtf32=c.StringToUtf32=c.utf32ToString=c.stringFromCodePoint=void 0,c.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},c.utf32ToString=function(u,h=0,y=u.length){let d="";for(let C=h;C<y;++C){let w=u[C];w>65535?(w-=65536,d+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):d+=String.fromCharCode(w)}return d},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const y=u.length;if(!y)return 0;let d=0,C=0;if(this._interim){const w=u.charCodeAt(C++);56320<=w&&w<=57343?h[d++]=1024*(this._interim-55296)+w-56320+65536:(h[d++]=this._interim,h[d++]=w),this._interim=0}for(let w=C;w<y;++w){const k=u.charCodeAt(w);if(55296<=k&&k<=56319){if(++w>=y)return this._interim=k,d;const b=u.charCodeAt(w);56320<=b&&b<=57343?h[d++]=1024*(k-55296)+b-56320+65536:(h[d++]=k,h[d++]=b)}else k!==65279&&(h[d++]=k)}return d}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const y=u.length;if(!y)return 0;let d,C,w,k,b=0,m=0,v=0;if(this.interim[0]){let S=!1,A=this.interim[0];A&=(224&A)==192?31:(240&A)==224?15:7;let R,M=0;for(;(R=63&this.interim[++M])&&M<4;)A<<=6,A|=R;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,B=E-M;for(;v<B;){if(v>=y)return 0;if(R=u[v++],(192&R)!=128){v--,S=!0;break}this.interim[M++]=R,A<<=6,A|=63&R}S||(E===2?A<128?v--:h[b++]=A:E===3?A<2048||A>=55296&&A<=57343||A===65279||(h[b++]=A):A<65536||A>1114111||(h[b++]=A)),this.interim.fill(0)}const f=y-4;let p=v;for(;p<y;){for(;!(!(p<f)||128&(d=u[p])||128&(C=u[p+1])||128&(w=u[p+2])||128&(k=u[p+3]));)h[b++]=d,h[b++]=C,h[b++]=w,h[b++]=k,p+=4;if(d=u[p++],d<128)h[b++]=d;else if((224&d)==192){if(p>=y)return this.interim[0]=d,b;if(C=u[p++],(192&C)!=128){p--;continue}if(m=(31&d)<<6|63&C,m<128){p--;continue}h[b++]=m}else if((240&d)==224){if(p>=y)return this.interim[0]=d,b;if(C=u[p++],(192&C)!=128){p--;continue}if(p>=y)return this.interim[0]=d,this.interim[1]=C,b;if(w=u[p++],(192&w)!=128){p--;continue}if(m=(15&d)<<12|(63&C)<<6|63&w,m<2048||m>=55296&&m<=57343||m===65279)continue;h[b++]=m}else if((248&d)==240){if(p>=y)return this.interim[0]=d,b;if(C=u[p++],(192&C)!=128){p--;continue}if(p>=y)return this.interim[0]=d,this.interim[1]=C,b;if(w=u[p++],(192&w)!=128){p--;continue}if(p>=y)return this.interim[0]=d,this.interim[1]=C,this.interim[2]=w,b;if(k=u[p++],(192&k)!=128){p--;continue}if(m=(7&d)<<18|(63&C)<<12|(63&w)<<6|63&k,m<65536||m>1114111)continue;h[b++]=m}}return b}}},225:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(1480),y=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let C;c.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let w=0;w<y.length;++w)C.fill(0,y[w][0],y[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?C[w]:(function(k,b){let m,v=0,f=b.length-1;if(k<b[0][0]||k>b[f][1])return!1;for(;f>=v;)if(m=v+f>>1,k>b[m][1])v=m+1;else{if(!(k<b[m][0]))return!0;f=m-1}return!1})(w,d)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,k){let b=this.wcwidth(w),m=b===0&&k!==0;if(m){const v=h.UnicodeService.extractWidth(k);v===0?m=!1:v>b&&(b=v)}return h.UnicodeService.createPropertyValue(0,b,m)}}},5981:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const h=u(8460),y=u(844);class d extends y.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let b;for(this._isSyncWriting=!0;b=this._writeBuffer.shift();){this._action(b);const m=this._callbacks.shift();m&&m()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,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+=w.length,this._writeBuffer.push(w),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(k)}_innerWrite(w=0,k=!0){const b=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const m=this._writeBuffer[this._bufferOffset],v=this._action(m,k);if(v){const p=S=>Date.now()-b>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(b,S);return void v.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(p)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=m.length,Date.now()-b>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}c.WriteBuffer=d},5941:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.toRgbString=c.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function y(d,C){const w=d.toString(16),k=w.length<2?"0"+w:w;switch(C){case 4:return w[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}c.parseColor=function(d){if(!d)return;let C=d.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const w=u.exec(C);if(w){const k=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/k*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/k*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/k*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),h.exec(C)&&[3,6,9,12].includes(C.length))){const w=C.length/3,k=[0,0,0];for(let b=0;b<3;++b){const m=parseInt(C.slice(w*b,w*b+w),16);k[b]=w===1?m<<4:w===2?m:w===3?m>>4:m>>8}return k}},c.toRgbString=function(d,C=16){const[w,k,b]=d;return`rgb:${y(w,C)}/${y(k,C)}/${y(b,C)}`}},5770:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const h=u(482),y=u(8742),d=u(5770),C=[];c.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=C,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=C}registerHandler(k,b){this._handlers[k]===void 0&&(this._handlers[k]=[]);const m=this._handlers[k];return m.push(b),{dispose:()=>{const v=m.indexOf(b);v!==-1&&m.splice(v,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=C,this._ident=0}hook(k,b){if(this.reset(),this._ident=k,this._active=this._handlers[k]||C,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].hook(b);else this._handlerFb(this._ident,"HOOK",b)}put(k,b,m){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(k,b,m);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(k,b,m))}unhook(k,b=!0){if(this._active.length){let m=!1,v=this._active.length-1,f=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,m=b,f=this._stack.fallThrough,this._stack.paused=!1),!f&&m===!1){for(;v>=0&&(m=this._active[v].unhook(k),m!==!0);v--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,m;v--}for(;v>=0;v--)if(m=this._active[v].unhook(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,m}else this._handlerFb(this._ident,"UNHOOK",k);this._active=C,this._ident=0}};const w=new y.Params;w.addParam(0),c.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=w,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():w,this._data="",this._hitLimit=!1}put(k,b,m){this._hitLimit||(this._data+=(0,h.utf32ToString)(k,b,m),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let b=!1;if(this._hitLimit)b=!1;else if(k&&(b=this._handler(this._data,this._params),b instanceof Promise))return b.then((m=>(this._params=w,this._data="",this._hitLimit=!1,m)));return this._params=w,this._data="",this._hitLimit=!1,b}}},2015:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const h=u(844),y=u(8742),d=u(6242),C=u(6351);class w{constructor(v){this.table=new Uint8Array(v)}setDefault(v,f){this.table.fill(v<<4|f)}add(v,f,p,S){this.table[f<<8|v]=p<<4|S}addMany(v,f,p,S){for(let A=0;A<v.length;A++)this.table[f<<8|v[A]]=p<<4|S}}c.TransitionTable=w;const k=160;c.VT500_TRANSITION_TABLE=(function(){const m=new w(4095),v=Array.apply(null,Array(256)).map(((M,E)=>E)),f=(M,E)=>v.slice(M,E),p=f(32,127),S=f(0,24);S.push(25),S.push.apply(S,f(28,32));const A=f(0,14);let R;for(R in m.setDefault(1,0),m.addMany(p,0,2,0),A)m.addMany([24,26,153,154],R,3,0),m.addMany(f(128,144),R,3,0),m.addMany(f(144,152),R,3,0),m.add(156,R,0,0),m.add(27,R,11,1),m.add(157,R,4,8),m.addMany([152,158,159],R,0,7),m.add(155,R,11,3),m.add(144,R,11,9);return m.addMany(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 b extends h.Disposable{constructor(v=c.VT500_TRANSITION_TABLE){super(),this._transitions=v,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new y.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(f,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,h.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 C.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,f=[64,126]){let p=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(p=v.prefix.charCodeAt(0),p&&60>p||p>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let A=0;A<v.intermediates.length;++A){const R=v.intermediates.charCodeAt(A);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");p<<=8,p|=R}}if(v.final.length!==1)throw new Error("final must be a single byte");const S=v.final.charCodeAt(0);if(f[0]>S||S>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return p<<=8,p|=S,p}identToString(v){const f=[];for(;v;)f.push(String.fromCharCode(255&v)),v>>=8;return f.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,f){const p=this._identifier(v,[48,126]);this._escHandlers[p]===void 0&&(this._escHandlers[p]=[]);const S=this._escHandlers[p];return S.push(f),{dispose:()=>{const A=S.indexOf(f);A!==-1&&S.splice(A,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,f){this._executeHandlers[v.charCodeAt(0)]=f}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,f){const p=this._identifier(v);this._csiHandlers[p]===void 0&&(this._csiHandlers[p]=[]);const S=this._csiHandlers[p];return S.push(f),{dispose:()=>{const A=S.indexOf(f);A!==-1&&S.splice(A,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,f){return this._dcsParser.registerHandler(this._identifier(v),f)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,f){return this._oscParser.registerHandler(v,f)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(v,f,p,S,A){this._parseStack.state=v,this._parseStack.handlers=f,this._parseStack.handlerPos=p,this._parseStack.transition=S,this._parseStack.chunkPos=A}parse(v,f,p){let S,A=0,R=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 E=this._parseStack.handlers;let B=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(p===!1&&B>-1){for(;B>=0&&(S=E[B](this._params),S!==!0);B--)if(S instanceof Promise)return this._parseStack.handlerPos=B,S}this._parseStack.handlers=[];break;case 4:if(p===!1&&B>-1){for(;B>=0&&(S=E[B](),S!==!0);B--)if(S instanceof Promise)return this._parseStack.handlerPos=B,S}this._parseStack.handlers=[];break;case 6:if(A=v[this._parseStack.chunkPos],S=this._dcsParser.unhook(A!==24&&A!==26,p),S)return S;A===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(A=v[this._parseStack.chunkPos],S=this._oscParser.end(A!==24&&A!==26,p),S)return S;A===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 E=M;E<f;++E){switch(A=v[E],R=this._transitions.table[this.currentState<<8|(A<160?A:k)],R>>4){case 2:for(let P=E+1;;++P){if(P>=f||(A=v[P])<32||A>126&&A<k){this._printHandler(v,E,P),E=P-1;break}if(++P>=f||(A=v[P])<32||A>126&&A<k){this._printHandler(v,E,P),E=P-1;break}if(++P>=f||(A=v[P])<32||A>126&&A<k){this._printHandler(v,E,P),E=P-1;break}if(++P>=f||(A=v[P])<32||A>126&&A<k){this._printHandler(v,E,P),E=P-1;break}}break;case 3:this._executeHandlers[A]?this._executeHandlers[A]():this._executeHandlerFb(A),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:E,code:A,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const B=this._csiHandlers[this._collect<<8|A];let $=B?B.length-1:-1;for(;$>=0&&(S=B[$](this._params),S!==!0);$--)if(S instanceof Promise)return this._preserveStack(3,B,$,R,E),S;$<0&&this._csiHandlerFb(this._collect<<8|A,this._params),this.precedingJoinState=0;break;case 8:do switch(A){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(A-48)}while(++E<f&&(A=v[E])>47&&A<60);E--;break;case 9:this._collect<<=8,this._collect|=A;break;case 10:const I=this._escHandlers[this._collect<<8|A];let q=I?I.length-1:-1;for(;q>=0&&(S=I[q](),S!==!0);q--)if(S instanceof Promise)return this._preserveStack(4,I,q,R,E),S;q<0&&this._escHandlerFb(this._collect<<8|A),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|A,this._params);break;case 13:for(let P=E+1;;++P)if(P>=f||(A=v[P])===24||A===26||A===27||A>127&&A<k){this._dcsParser.put(v,E,P),E=P-1;break}break;case 14:if(S=this._dcsParser.unhook(A!==24&&A!==26),S)return this._preserveStack(6,[],0,R,E),S;A===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let P=E+1;;P++)if(P>=f||(A=v[P])<32||A>127&&A<k){this._oscParser.put(v,E,P),E=P-1;break}break;case 6:if(S=this._oscParser.end(A!==24&&A!==26),S)return this._preserveStack(5,[],0,R,E),S;A===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}c.EscapeSequenceParser=b},6242:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const h=u(5770),y=u(482),d=[];c.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(C,w){this._handlers[C]===void 0&&(this._handlers[C]=[]);const k=this._handlers[C];return k.push(w),{dispose:()=>{const b=k.indexOf(w);b!==-1&&k.splice(b,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].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 C=this._active.length-1;C>=0;C--)this._active[C].start();else this._handlerFb(this._id,"START")}_put(C,w,k){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(C,w,k);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(C,w,k))}start(){this.reset(),this._state=1}put(C,w,k){if(this._state!==3){if(this._state===1)for(;w<k;){const b=C[w++];if(b===59){this._state=2,this._start();break}if(b<48||57<b)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+b-48}this._state===2&&k-w>0&&this._put(C,w,k)}}end(C,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,b=this._active.length-1,m=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,k=w,m=this._stack.fallThrough,this._stack.paused=!1),!m&&k===!1){for(;b>=0&&(k=this._active[b].end(C),k!==!0);b--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,k;b--}for(;b>=0;b--)if(k=this._active[b].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",C);this._active=d,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(C){this._handler=C,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(C,w,k){this._hitLimit||(this._data+=(0,y.utf32ToString)(C,w,k),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let w=!1;if(this._hitLimit)w=!1;else if(C&&(w=this._handler(this._data),w instanceof Promise))return w.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,w}}},8742:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const u=2147483647;class h{static fromArray(d){const C=new h;if(!d.length)return C;for(let w=Array.isArray(d[0])?1:0;w<d.length;++w){const k=d[w];if(Array.isArray(k))for(let b=0;b<k.length;++b)C.addSubParam(k[b]);else C.addParam(k)}return C}constructor(d=32,C=32){if(this.maxLength=d,this.maxSubParamsLength=C,C>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(C),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new h(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 C=0;C<this.length;++C){d.push(this.params[C]);const w=this._subParamsIdx[C]>>8,k=255&this._subParamsIdx[C];k-w>0&&d.push(Array.prototype.slice.call(this._subParams,w,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>u?u:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>u?u:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const C=this._subParamsIdx[d]>>8,w=255&this._subParamsIdx[d];return w-C>0?this._subParams.subarray(C,w):null}getSubParamsAll(){const d={};for(let C=0;C<this.length;++C){const w=this._subParamsIdx[C]>>8,k=255&this._subParamsIdx[C];k-w>0&&(d[C]=this._subParams.slice(w,k))}return d}addDigit(d){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,k=w[C-1];w[C-1]=~k?Math.min(10*k+d,u):d}}c.Params=h},5741:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0,c.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,h){const y={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(y),h.dispose=()=>this._wrappedAddonDispose(y),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===u){h=y;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(h,1)}}},8771:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const h=u(3785),y=u(511);c.BufferApiView=class{constructor(d,C){this._buffer=d,this.type=C}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 C=this._buffer.lines.get(d);if(C)return new h.BufferLineApiView(C)}getNullCell(){return new y.CellData}}},3785:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const h=u(511);c.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 h.CellData)}translateToString(y,d,C){return this._line.translateToString(y,d,C)}}},8285:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const h=u(8771),y=u(8460),d=u(844);class C extends d.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.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)}}c.BufferNamespaceApi=C},7975:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ParserApi=void 0,c.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,h){return this._core.registerCsiHandler(u,(y=>h(y.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((y,d)=>h(y,d.toArray())))}addDcsHandler(u,h){return this.registerDcsHandler(u,h)}registerEscHandler(u,h){return this._core.registerEscHandler(u,h)}addEscHandler(u,h){return this.registerEscHandler(u,h)}registerOscHandler(u,h){return this._core.registerOscHandler(u,h)}addOscHandler(u,h){return this.registerOscHandler(u,h)}}},7090:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeApi=void 0,c.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(T,c,u){var h=this&&this.__decorate||function(m,v,f,p){var S,A=arguments.length,R=A<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(m,v,f,p);else for(var M=m.length-1;M>=0;M--)(S=m[M])&&(R=(A<3?S(R):A>3?S(v,f,R):S(v,f))||R);return A>3&&R&&Object.defineProperty(v,f,R),R},y=this&&this.__param||function(m,v){return function(f,p){v(f,p,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const d=u(8460),C=u(844),w=u(5295),k=u(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let b=c.BufferService=class extends C.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,c.MINIMUM_COLS),this.rows=Math.max(m.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(m,this))}resize(m,v){this.cols=m,this.rows=v,this.buffers.resize(m,v),this._onResize.fire({cols:m,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(m,v=!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,v),this._cachedBlankLine=p),p.isWrapped=v;const S=f.ybase+f.scrollTop,A=f.ybase+f.scrollBottom;if(f.scrollTop===0){const R=f.lines.isFull;A===f.lines.length-1?R?f.lines.recycle().copyFrom(p):f.lines.push(p.clone()):f.lines.splice(A+1,0,p.clone()),R?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const R=A-S+1;f.lines.shiftElements(S+1,R-1,-1),f.lines.set(A,p.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(m,v,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&&(v||this._onScroll.fire(p.ydisp))}};c.BufferService=b=h([y(0,k.IOptionsService)],b)},7994:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CharsetService=void 0,c.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,h){this._charsets[u]=h,this.glevel===u&&(this.charset=h)}}},1753:function(T,c,u){var h=this&&this.__decorate||function(p,S,A,R){var M,E=arguments.length,B=E<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,A):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(p,S,A,R);else for(var $=p.length-1;$>=0;$--)(M=p[$])&&(B=(E<3?M(B):E>3?M(S,A,B):M(S,A))||B);return E>3&&B&&Object.defineProperty(S,A,B),B},y=this&&this.__param||function(p,S){return function(A,R){S(A,R,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const d=u(2585),C=u(8460),w=u(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 b(p,S){let A=(p.ctrl?16:0)|(p.shift?4:0)|(p.alt?8:0);return p.button===4?(A|=64,A|=p.action):(A|=3&p.button,4&p.button&&(A|=64),8&p.button&&(A|=128),p.action===32?A|=32:p.action!==0||S||(A|=3)),A}const m=String.fromCharCode,v={DEFAULT:p=>{const S=[b(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[<${b(p,!0)};${p.col};${p.row}${S}`},SGR_PIXELS:p=>{const S=p.action===0&&p.button!==4?"m":"M";return`\x1B[<${b(p,!0)};${p.x};${p.y}${S}`}};let f=c.CoreMouseService=class extends w.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 C.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const A of Object.keys(k))this.addProtocol(A,k[A]);for(const A of Object.keys(v))this.addEncoding(A,v[A]);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,A){if(A){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}};c.CoreMouseService=f=h([y(0,d.IBufferService),y(1,d.ICoreService)],f)},6975:function(T,c,u){var h=this&&this.__decorate||function(f,p,S,A){var R,M=arguments.length,E=M<3?p:A===null?A=Object.getOwnPropertyDescriptor(p,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,p,S,A);else for(var B=f.length-1;B>=0;B--)(R=f[B])&&(E=(M<3?R(E):M>3?R(p,S,E):R(p,S))||E);return M>3&&E&&Object.defineProperty(p,S,E),E},y=this&&this.__param||function(f,p){return function(S,A){p(S,A,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const d=u(1439),C=u(8460),w=u(844),k=u(2585),b=Object.freeze({insertMode:!1}),m=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=c.CoreService=class extends w.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 C.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new C.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new C.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new C.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(b),this.decPrivateModes=(0,d.clone)(m)}reset(){this.modes=(0,d.clone)(b),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((A=>A.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))}};c.CoreService=v=h([y(0,k.IBufferService),y(1,k.ILogService),y(2,k.IOptionsService)],v)},9074:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const h=u(8055),y=u(8460),d=u(844),C=u(6106);let w=0,k=0;class b extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.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 A=0,R=0;for(const M of this._decorations.getKeyIterator(p))A=M.options.x??0,R=A+(M.options.width??1),f>=A&&f<R&&(!S||(M.options.layer??"bottom")===S)&&(yield M)}forEachDecorationAtCell(f,p,S,A){this._decorations.forEachByKey(p,(R=>{w=R.options.x??0,k=w+(R.options.width??1),f>=w&&f<k&&(!S||(R.options.layer??"bottom")===S)&&A(R)}))}}c.DecorationService=b;class m extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.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:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const h=u(2585),y=u(8343);class d{constructor(...w){this._entries=new Map;for(const[k,b]of w)this.set(k,b)}set(w,k){const b=this._entries.get(w);return this._entries.set(w,k),b}forEach(w){for(const[k,b]of this._entries.entries())w(k,b)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}c.ServiceCollection=d,c.InstantiationService=class{constructor(){this._services=new d,this._services.set(h.IInstantiationService,this)}setService(C,w){this._services.set(C,w)}getService(C){return this._services.get(C)}createInstance(C,...w){const k=(0,y.getServiceDependencies)(C).sort(((v,f)=>v.index-f.index)),b=[];for(const v of k){const f=this._services.get(v.id);if(!f)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${v.id}.`);b.push(f)}const m=k.length>0?k[0].index:w.length;if(w.length!==m)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${m+1} conflicts with ${w.length} static arguments`);return new C(...w,...b)}}},7866:function(T,c,u){var h=this&&this.__decorate||function(m,v,f,p){var S,A=arguments.length,R=A<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(m,v,f,p);else for(var M=m.length-1;M>=0;M--)(S=m[M])&&(R=(A<3?S(R):A>3?S(v,f,R):S(v,f))||R);return A>3&&R&&Object.defineProperty(v,f,R),R},y=this&&this.__param||function(m,v){return function(f,p){v(f,p,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const d=u(844),C=u(2585),w={trace:C.LogLevelEnum.TRACE,debug:C.LogLevelEnum.DEBUG,info:C.LogLevelEnum.INFO,warn:C.LogLevelEnum.WARN,error:C.LogLevelEnum.ERROR,off:C.LogLevelEnum.OFF};let k,b=c.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(m){super(),this._optionsService=m,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(m){for(let v=0;v<m.length;v++)typeof m[v]=="function"&&(m[v]=m[v]())}_log(m,v,f){this._evalLazyOptionalParams(f),m.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,...f)}trace(m,...v){var f;this._logLevel<=C.LogLevelEnum.TRACE&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.trace.bind(this._optionsService.options.logger))??console.log,m,v)}debug(m,...v){var f;this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.debug.bind(this._optionsService.options.logger))??console.log,m,v)}info(m,...v){var f;this._logLevel<=C.LogLevelEnum.INFO&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.info.bind(this._optionsService.options.logger))??console.info,m,v)}warn(m,...v){var f;this._logLevel<=C.LogLevelEnum.WARN&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.warn.bind(this._optionsService.options.logger))??console.warn,m,v)}error(m,...v){var f;this._logLevel<=C.LogLevelEnum.ERROR&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.error.bind(this._optionsService.options.logger))??console.error,m,v)}};c.LogService=b=h([y(0,C.IOptionsService)],b),c.setTraceLogger=function(m){k=m},c.traceCall=function(m,v,f){if(typeof f.value!="function")throw new Error("not supported");const p=f.value;f.value=function(...S){if(k.logLevel!==C.LogLevelEnum.TRACE)return p.apply(this,S);k.trace(`GlyphRenderer#${p.name}(${S.map((R=>JSON.stringify(R))).join(", ")})`);const A=p.apply(this,S);return k.trace(`GlyphRenderer#${p.name} return`,A),A}}},7302:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const h=u(8460),y=u(844),d=u(6114);c.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 C=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends y.Disposable{constructor(b){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const m={...c.DEFAULT_OPTIONS};for(const v in b)if(v in m)try{const f=b[v];m[v]=this._sanitizeAndValidateOption(v,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(b,m){return this.onOptionChange((v=>{v===b&&m(this.rawOptions[b])}))}onMultipleOptionChange(b,m){return this.onOptionChange((v=>{b.indexOf(v)!==-1&&m()}))}_setupOptions(){const b=v=>{if(!(v in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},m=(v,f)=>{if(!(v in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);f=this._sanitizeAndValidateOption(v,f),this.rawOptions[v]!==f&&(this.rawOptions[v]=f,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const f={get:b.bind(this,v),set:m.bind(this,v)};Object.defineProperty(this.options,v,f)}}_sanitizeAndValidateOption(b,m){switch(b){case"cursorStyle":if(m||(m=c.DEFAULT_OPTIONS[b]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(m))throw new Error(`"${m}" is not a valid value for ${b}`);break;case"wordSeparator":m||(m=c.DEFAULT_OPTIONS[b]);break;case"fontWeight":case"fontWeightBold":if(typeof m=="number"&&1<=m&&m<=1e3)break;m=C.includes(m)?m:c.DEFAULT_OPTIONS[b];break;case"cursorWidth":m=Math.floor(m);case"lineHeight":case"tabStopWidth":if(m<1)throw new Error(`${b} 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(`${b} cannot be less than 0, value: ${m}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(m<=0)throw new Error(`${b} cannot be less than or equal to 0, value: ${m}`);break;case"rows":case"cols":if(!m&&m!==0)throw new Error(`${b} must be numeric, value: ${m}`);break;case"windowsPty":m=m??{}}return m}}c.OptionsService=w},2660:function(T,c,u){var h=this&&this.__decorate||function(w,k,b,m){var v,f=arguments.length,p=f<3?k:m===null?m=Object.getOwnPropertyDescriptor(k,b):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(w,k,b,m);else for(var S=w.length-1;S>=0;S--)(v=w[S])&&(p=(f<3?v(p):f>3?v(k,b,p):v(k,b))||p);return f>3&&p&&Object.defineProperty(k,b,p),p},y=this&&this.__param||function(w,k){return function(b,m){k(b,m,w)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const d=u(2585);let C=c.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const k=this._bufferService.buffer;if(w.id===void 0){const S=k.addMarker(k.ybase+k.y),A={data:w,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(A,S))),this._dataByLinkId.set(A.id,A),A.id}const b=w,m=this._getEntryIdKey(b),v=this._entriesWithId.get(m);if(v)return this.addLineToLink(v.id,k.ybase+k.y),v.id;const f=k.addMarker(k.ybase+k.y),p={id:this._nextId++,key:this._getEntryIdKey(b),data:b,lines:[f]};return f.onDispose((()=>this._removeMarkerFromLink(p,f))),this._entriesWithId.set(p.key,p),this._dataByLinkId.set(p.id,p),p.id}addLineToLink(w,k){const b=this._dataByLinkId.get(w);if(b&&b.lines.every((m=>m.line!==k))){const m=this._bufferService.buffer.addMarker(k);b.lines.push(m),m.onDispose((()=>this._removeMarkerFromLink(b,m)))}}getLinkData(w){var k;return(k=this._dataByLinkId.get(w))==null?void 0:k.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,k){const b=w.lines.indexOf(k);b!==-1&&(w.lines.splice(b,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};c.OscLinkService=C=h([y(0,d.IBufferService)],C)},8343:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;const u="di$target",h="di$dependencies";c.serviceRegistry=new Map,c.getServiceDependencies=function(y){return y[h]||[]},c.createDecorator=function(y){if(c.serviceRegistry.has(y))return c.serviceRegistry.get(y);const d=function(C,w,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(b,m,v){m[u]===m?m[h].push({id:b,index:v}):(m[h]=[{id:b,index:v}],m[u]=m)})(d,C,k)};return d.toString=()=>y,c.serviceRegistry.set(y,d),d}},2585:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.IDecorationService=c.IUnicodeService=c.IOscLinkService=c.IOptionsService=c.ILogService=c.LogLevelEnum=c.IInstantiationService=c.ICharsetService=c.ICoreService=c.ICoreMouseService=c.IBufferService=void 0;const h=u(8343);var y;c.IBufferService=(0,h.createDecorator)("BufferService"),c.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),c.ICoreService=(0,h.createDecorator)("CoreService"),c.ICharsetService=(0,h.createDecorator)("CharsetService"),c.IInstantiationService=(0,h.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||(c.LogLevelEnum=y={})),c.ILogService=(0,h.createDecorator)("LogService"),c.IOptionsService=(0,h.createDecorator)("OptionsService"),c.IOscLinkService=(0,h.createDecorator)("OscLinkService"),c.IUnicodeService=(0,h.createDecorator)("UnicodeService"),c.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(8460),y=u(225);class d{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,k,b=!1){return(16777215&w)<<3|(3&k)<<1|(b?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const w=new y.UnicodeV6;this.register(w),this._active=w.version,this._activeProvider=w}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(w){if(!this._providers[w])throw new Error(`unknown Unicode version "${w}"`);this._active=w,this._activeProvider=this._providers[w],this._onChange.fire(w)}register(w){this._providers[w.version]=w}wcwidth(w){return this._activeProvider.wcwidth(w)}getStringCellWidth(w){let k=0,b=0;const m=w.length;for(let v=0;v<m;++v){let f=w.charCodeAt(v);if(55296<=f&&f<=56319){if(++v>=m)return k+this.wcwidth(f);const A=w.charCodeAt(v);56320<=A&&A<=57343?f=1024*(f-55296)+A-56320+65536:k+=this.wcwidth(A)}const p=this.charProperties(f,b);let S=d.extractWidth(p);d.extractShouldJoin(p)&&(S-=d.extractWidth(b)),k+=S,b=p}return k}charProperties(w,k){return this._activeProvider.charProperties(w,k)}}c.UnicodeService=d}},o={};function g(T){var c=o[T];if(c!==void 0)return c.exports;var u=o[T]={exports:{}};return a[T].call(u.exports,u,u.exports,g),u.exports}var x={};return(()=>{var T=x;Object.defineProperty(T,"__esModule",{value:!0}),T.Terminal=void 0;const c=g(9042),u=g(3236),h=g(844),y=g(5741),d=g(8285),C=g(7975),w=g(7090),k=["cols","rows"];class b extends h.Disposable{constructor(v){super(),this._core=this.register(new u.Terminal(v)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const f=S=>this._core.options[S],p=(S,A)=>{this._checkReadonlyOptions(S),this._core.options[S]=A};for(const S in this._core.options){const A={get:f.bind(this,S),set:p.bind(this,S)};Object.defineProperty(this._publicOptions,S,A)}}_checkReadonlyOptions(v){if(k.includes(v))throw new Error(`Option "${v}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new C.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const f in v)this._publicOptions[f]=v[f]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,f=!0){this._core.input(v,f)}resize(v,f){this._verifyIntegers(v,f),this._core.resize(v,f)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,f,p){this._verifyIntegers(v,f,p),this._core.select(v,f,p)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,f){this._verifyIntegers(v,f),this._core.selectLines(v,f)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,f){this._core.write(v,f)}writeln(v,f){this._core.write(v),this._core.write(`\r
262
+ `,f)}paste(v){this._core.paste(v)}refresh(v,f){this._verifyIntegers(v,f),this._core.refresh(v,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return c}_verifyIntegers(...v){for(const f of v)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const f of v)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}T.Terminal=b})(),x})()))})(Gu)),Gu.exports}var LE=ME(),Wu={exports:{}},op;function NE(){return op||(op=1,(function(i,r){(function(a,o){i.exports=o()})(self,(()=>(()=>{var a={};return(()=>{var o=a;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.FitAddon=class{activate(g){this._terminal=g}dispose(){}fit(){const g=this.proposeDimensions();if(!g||!this._terminal||isNaN(g.cols)||isNaN(g.rows))return;const x=this._terminal._core;this._terminal.rows===g.rows&&this._terminal.cols===g.cols||(x._renderService.clear(),this._terminal.resize(g.cols,g.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const g=this._terminal._core,x=g._renderService.dimensions;if(x.css.cell.width===0||x.css.cell.height===0)return;const T=this._terminal.options.scrollback===0?0:g.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(c.getPropertyValue("height")),h=Math.max(0,parseInt(c.getPropertyValue("width"))),y=window.getComputedStyle(this._terminal.element),d=u-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),C=h-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-T;return{cols:Math.max(2,Math.floor(C/x.css.cell.width)),rows:Math.max(1,Math.floor(d/x.css.cell.height))}}}})(),a})()))})(Wu)),Wu.exports}var BE=NE();const zE=3e4,jE=300*1e3;class HE{constructor(r,a,o){At(this,"ws",null);At(this,"consecutiveFailures",0);At(this,"failStartTime",null);At(this,"destroyed",!1);At(this,"reconnectTimer",null);At(this,"url");At(this,"authToken");At(this,"callbacks");this.url=r,this.authToken=o,this.callbacks=a,this.connect()}connect(){if(!this.destroyed){try{this.ws=new WebSocket(this.url)}catch{this.scheduleReconnect();return}this.ws.onopen=()=>{var r,a,o;this.destroyed||(this.consecutiveFailures=0,this.failStartTime=null,this.authToken&&((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"auth",token:this.authToken})),(o=(a=this.callbacks).onOpen)==null||o.call(a))},this.ws.onmessage=r=>{if(!this.destroyed)try{this.callbacks.onMessage(JSON.parse(r.data))}catch{}},this.ws.onclose=()=>{this.destroyed||(this.ws=null,this.scheduleReconnect())},this.ws.onerror=()=>{this.destroyed}}}scheduleReconnect(){var a,o,g,x,T,c,u,h;if(this.destroyed)return;if(this.failStartTime===null&&(this.failStartTime=Date.now()),Date.now()-this.failStartTime>=jE){(o=(a=this.callbacks).onGiveUp)==null||o.call(a),(x=(g=this.callbacks).onClose)==null||x.call(g);return}this.consecutiveFailures++;const r=Math.min(zE,1e3*Math.pow(2,this.consecutiveFailures-1));(c=(T=this.callbacks).onReconnecting)==null||c.call(T,this.consecutiveFailures,r),(h=(u=this.callbacks).onClose)==null||h.call(u),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 UE({sessionId:i,status:r}){const a=Mt(b=>b.token),o=F.useRef(null),g=F.useRef(null),x=F.useRef(null),T=F.useRef(null),c=F.useRef(r);F.useEffect(()=>{c.current=r},[r]);const[u,h]=F.useState("connecting"),[y,d]=F.useState(null),C=F.useCallback(()=>{const b=window.location.origin,m=`/v1/sessions/${encodeURIComponent(i)}/terminal`;return`${b.replace(/^http/,"ws")}${m}`},[i]);F.useEffect(()=>{if(!o.current)return;const b=new LE.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}),m=new BE.FitAddon;b.loadAddon(m),b.open(o.current),m.fit(),g.current=b,x.current=m;const v=new ResizeObserver(()=>{var S;m.fit();const{cols:f,rows:p}=b;(S=T.current)==null||S.send({type:"resize",cols:f,rows:p})});return v.observe(o.current),()=>{v.disconnect(),b.dispose(),g.current=null,x.current=null}},[]),F.useEffect(()=>{const b=C(),m=new HE(b,{onMessage:v=>{const f=v,p=g.current;if(p)switch(f.type){case"pane":p.reset(),p.write(f.content),d(null);break;case"status":break;case"error":d(f.message);break}},onOpen:()=>{var v;if(h("connected"),d(null),x.current){const{cols:f,rows:p}=g.current;(v=T.current)==null||v.send({type:"resize",cols:f,rows:p})}},onReconnecting:()=>{h("reconnecting")},onGiveUp:()=>{h("disconnected")},onClose:()=>{h("disconnected")}},a??void 0);return T.current=m,()=>{T.current=null,m.close()}},[C]),F.useEffect(()=>{const b=g.current;if(!b)return;const m=b.onData(v=>{var f;(f=T.current)==null||f.send({type:"input",text:v})});return()=>{m.dispose()}},[]);const w=r==="working",k=u==="connected";return O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[O.jsxs("div",{className:"flex items-center justify-between px-4 py-2 text-xs border-b border-[#1a1a2e]",children:[O.jsx("div",{className:"flex items-center gap-2",children:O.jsx("span",{className:"font-mono text-[#888]",children:"Terminal"})}),O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsxs("div",{className:"flex items-center gap-1.5",children:[O.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:k?"#00e5ff":u==="reconnecting"?"#ffaa00":"#666",boxShadow:k?"0 0 4px #00e5ff40":"none",animation:u==="reconnecting"?"pulse 1s ease-in-out infinite":"none"}}),O.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:u==="connecting"?"connecting…":u==="reconnecting"?"reconnecting…":u==="connected"?"ws live":"disconnected"})]}),O.jsxs("div",{className:"flex items-center gap-1.5",children:[O.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:w?"#00ff88":"#888",boxShadow:w?"0 0 4px #00ff88":"none"}}),O.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:w?"active":"idle"})]})]})]}),y&&O.jsx("div",{className:"px-4 py-2 text-xs text-[#ff3366] bg-[#ff336610] border-b border-[#ff336620]",children:y}),O.jsx("div",{ref:o,className:"h-[calc(100vh-420px)] sm:h-[calc(100vh-460px)] min-h-[250px] sm:min-h-[300px]"})]})}function IE({metrics:i,loading:r}){if(r||!i)return O.jsx("div",{className:"flex items-center justify-center h-48 text-[#555] text-sm animate-pulse",children:"Loading metrics…"});const a=[{label:"Duration",value:F2(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 O.jsxs("div",{className:"space-y-4",children:[O.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:a.map(o=>O.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors duration-150 hover:border-[#00e5ff]/30",children:[O.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[O.jsx("span",{className:"text-base",children:o.icon}),O.jsx("span",{className:"text-[10px] text-[#888] uppercase tracking-wider",children:o.label})]}),O.jsx("div",{className:"text-2xl font-semibold font-mono tabular-nums",style:{color:o.color},children:o.value})]},o.label))}),i.statusChanges.length>0&&O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-4",children:[O.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider mb-3",children:"Status Changes"}),O.jsx("div",{className:"flex flex-wrap gap-2",children:i.statusChanges.map((o,g)=>O.jsx("div",{className:"text-xs font-mono text-[#555] bg-[#0a0a0f] px-2 py-1 rounded border border-[#1a1a2e]",children:o},g))})]})]})}const PE=new Set(["bypassPermissions","dontAsk","acceptEdits","plan","auto"]);function $E({prompt:i,permissionMode:r,onApprove:a,onReject:o}){const[g,x]=F.useState(!1);return r&&r!=="default"&&PE.has(r)?O.jsx("div",{className:"flex items-center gap-2 px-4 py-2 bg-[#003322]/50 border border-[#00ff88]/30 rounded-lg text-sm",children:O.jsxs("span",{className:"text-[#00ff88] font-semibold text-xs uppercase tracking-wider",children:["AUTO-APPROVED (",r,")"]})}):O.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:[O.jsxs("div",{className:"flex items-center gap-3 sm:gap-2 min-w-0",children:[O.jsx("span",{className:"text-[#ffaa00] text-lg shrink-0",children:"⚠"}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("div",{className:"text-xs text-[#ffaa00] font-semibold uppercase tracking-wider mb-0.5",children:"Permission Required"}),O.jsxs("div",{className:`text-sm text-[#e0e0e0] font-mono cursor-pointer ${g?"":"truncate"}`,onClick:()=>x(!g),title:g?void 0:"Click to expand",children:[i,!g&&i.length>60&&O.jsx("span",{className:"text-[#888] ml-1",children:"..."})]})]})]}),O.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[O.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"}),O.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 FE=[{id:"transcript",label:"Transcript"},{id:"terminal",label:"Terminal"},{id:"metrics",label:"Metrics"}];function ZE(){const{id:i}=Sp(),r=ll(),[a,o]=F.useState("transcript"),{session:g,health:x,notFound:T,loading:c,metrics:u,metricsLoading:h}=J2(i??""),[y,d]=F.useState(""),[C,w]=F.useState(!1),k=F.useRef(null),b=F.useRef(!1),m=Xs(I=>I.addToast);if(c)return O.jsx("div",{className:"min-h-screen bg-[#0a0a0f] flex items-center justify-center text-[#555] text-sm",children:O.jsx("div",{className:"animate-pulse",children:"Loading session…"})});if(T||!g||!x)return O.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-[#555]",children:[O.jsx("div",{className:"text-6xl mb-4",children:"404"}),O.jsx("div",{className:"text-lg mb-6 text-[#e0e0e0]",children:"Session not found"}),O.jsx(Wi,{to:"/",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Overview"})]});const v=g,f=x,p=f.status==="permission_prompt"||f.status==="bash_approval";function S(){fv(v.id).catch(I=>m("error","Approve failed",I instanceof Error?I.message:void 0))}function A(){A2(v.id).catch(I=>m("error","Reject failed",I instanceof Error?I.message:void 0))}function R(){dv(v.id).catch(I=>m("error","Interrupt failed",I instanceof Error?I.message:void 0))}function M(){R2(v.id).catch(I=>m("error","Escape failed",I instanceof Error?I.message:void 0))}async function E(){try{await hv(v.id),r("/")}catch(I){m("error","Failed to kill session",I instanceof Error?I.message:void 0)}}async function B(){var q;const I=y.trim();if(I&&!b.current){b.current=!0,w(!0);try{await T2(v.id,I),d("")}catch(P){m("error","Failed to send message",P instanceof Error?P.message:void 0)}finally{w(!1),b.current=!1,(q=k.current)==null||q.focus()}}}function $(I){I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),B())}return O.jsx("div",{className:"min-h-screen bg-[#0a0a0f]",children:O.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:[O.jsxs("nav",{className:"text-xs text-[#555] flex items-center gap-1",children:[O.jsx(Wi,{to:"/",className:"hover:text-[#00e5ff] transition-colors",children:"Overview"}),O.jsx("span",{className:"text-[#333]",children:"/"}),O.jsx("span",{className:"text-[#e0e0e0] truncate max-w-[160px] sm:max-w-xs",children:v.windowName||v.id})]}),O.jsx(eE,{session:v,health:f,onApprove:S,onReject:A,onInterrupt:R,onKill:E}),O.jsx("div",{className:"flex border-b border-[#1a1a2e]",role:"tablist",children:FE.map(I=>O.jsxs("button",{id:`tab-${I.id}`,onClick:()=>o(I.id),role:"tab","aria-selected":a===I.id,"aria-controls":`panel-${I.id}`,tabIndex:a===I.id?0:-1,className:`flex-1 min-h-[44px] text-sm font-medium transition-colors relative ${a===I.id?"text-[#00e5ff]":"text-[#555] hover:text-[#888]"}`,children:[I.label,a===I.id&&O.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-[#00e5ff]"})]},I.id))}),O.jsxs("div",{className:"bg-[#0a0a0f] rounded-lg min-h-[300px] sm:min-h-[400px]",children:[p&&O.jsx("div",{className:"p-3 sm:p-4 pb-0",children:O.jsx($E,{sessionId:v.id,prompt:f.details,permissionMode:v.permissionMode,onApprove:S,onReject:A})}),a==="transcript"&&O.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:O.jsx(OE,{sessionId:v.id})}),a==="terminal"&&O.jsx("div",{id:"panel-terminal",role:"tabpanel","aria-labelledby":"tab-terminal",tabIndex:0,children:O.jsx(UE,{sessionId:v.id,status:f.status})}),a==="metrics"&&O.jsx("div",{id:"panel-metrics",role:"tabpanel","aria-labelledby":"tab-metrics",tabIndex:0,className:"p-3 sm:p-4",children:O.jsx(IE,{metrics:u,loading:h})})]}),O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx("input",{ref:k,type:"text",value:y,onChange:I=>d(I.target.value),onKeyDown:$,placeholder:"Send a message to Claude…",disabled:C||!f.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"}),O.jsx("button",{onClick:B,disabled:C||!y.trim()||!f.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:O.jsx(XS,{className:"h-4 w-4"})})]}),O.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#1a1a2e]/50",children:[O.jsxs("button",{onClick:R,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:[O.jsx(FS,{className:"h-3.5 w-3.5"}),"Interrupt"]}),O.jsxs("button",{onClick:M,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:[O.jsx(NS,{className:"h-3.5 w-3.5"}),"Escape"]})]})]})]})})}const qE={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"},GE=new Set(["running"]);function bv({status:i}){const r=qE[i]??"bg-gray-500/10 text-gray-500 border-gray-500/30",a=GE.has(i);return O.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&&O.jsxs("span",{className:"relative flex h-2 w-2",children:[O.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75 bg-current"}),O.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]}),i]})}let WE=0;function ma(){return{workDir:"",name:"",prompt:"",_key:WE++}}function YE({open:i,onClose:r}){const a=ll(),o=F.useRef(null),g=F.useRef(null),[x,T]=F.useState(""),[c,u]=F.useState([ma(),ma()]),[h,y]=F.useState(!1),[d,C]=F.useState(null),w=F.useCallback(()=>{k(),r()},[r]);function k(){T(""),u([ma(),ma()]),y(!1),C(null)}F.useEffect(()=>{if(!i)return;const S=A=>{A.key==="Escape"&&w()};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[i,w]),F.useEffect(()=>{if(!i)return;const S=o.current;if(!S)return;const A='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',R=M=>{if(M.key!=="Tab")return;const E=Array.from(S.querySelectorAll(A));if(E.length===0)return;const B=E[0],$=E[E.length-1];M.shiftKey?document.activeElement===B&&(M.preventDefault(),$.focus()):document.activeElement===$&&(M.preventDefault(),B.focus())};return S.addEventListener("keydown",R),()=>S.removeEventListener("keydown",R)},[i]),F.useEffect(()=>{if(i){const S=setTimeout(()=>{var A;return(A=g.current)==null?void 0:A.focus()},50);return()=>clearTimeout(S)}},[i]);function b(){c.length>=10||u([...c,ma()])}function m(S){c.length<=1||u(c.filter((A,R)=>R!==S))}function v(S,A,R){u(c.map((M,E)=>E===S?{...M,[A]:R}:M))}async function f(S){S.preventDefault(),C(null);const A=c.filter(R=>R.workDir.trim());if(!x.trim()){C("Pipeline name is required");return}if(A.length===0){C("At least one step with a working directory is required");return}y(!0);try{const R=await M2({name:x.trim(),sessions:A.map(M=>({workDir:M.workDir.trim(),name:M.name.trim()||void 0,prompt:M.prompt.trim()||void 0}))});k(),r(),a(`/pipelines/${R.id}`)}catch(R){C(R instanceof Error?R.message:"Failed to create pipeline")}finally{y(!1)}}if(!i)return null;const p=x.trim()&&c.some(S=>S.workDir.trim());return O.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[O.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:w}),O.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:[O.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[O.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Pipeline"}),O.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:O.jsx(hl,{className:"h-4 w-4"})})]}),O.jsxs("form",{onSubmit:f,className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{children:[O.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Pipeline Name ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("input",{type:"text",ref:g,value:x,onChange:S=>T(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]"})]}),O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[O.jsxs("span",{children:["Working Directory ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("span",{children:"Name"}),O.jsx("span",{children:"Prompt"}),O.jsx("span",{})]}),O.jsx("div",{className:"space-y-2",children:c.map((S,A)=>O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[O.jsx("input",{type:"text",value:S.workDir,onChange:R=>v(A,"workDir",R.target.value),placeholder:"/home/user/project",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] font-mono"}),O.jsx("input",{type:"text",value:S.name,onChange:R=>v(A,"name",R.target.value),placeholder:"name",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff]"}),O.jsx("input",{type:"text",value:S.prompt,onChange:R=>v(A,"prompt",R.target.value),placeholder:"Initial prompt...",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff]"}),O.jsx("button",{type:"button",onClick:()=>m(A),disabled:c.length<=1,"aria-label":`Remove step ${A+1}`,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ff3366] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:O.jsx(Op,{className:"h-3.5 w-3.5"})})]},S._key))}),c.length<10&&O.jsxs("button",{type:"button",onClick:b,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[O.jsx(ul,{className:"h-3.5 w-3.5"}),"Add Step"]}),d&&O.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:d}),O.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[O.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"}),O.jsxs("button",{type:"submit",disabled:h||!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:[h&&O.jsx(Ku,{className:"h-3 w-3 animate-spin"}),"Create Pipeline"]})]})]})]})]})}function VE(){const[i,r]=F.useState([]),[a,o]=F.useState(!0),[g,x]=F.useState(!1),T=Xs(h=>h.addToast),c=F.useCallback(async()=>{try{const h=await L2();r(h)}catch(h){T("error","Failed to fetch pipelines",h instanceof Error?h.message:void 0)}finally{o(!1)}},[T]);F.useEffect(()=>{c();const h=setInterval(c,5e3);return()=>clearInterval(h)},[c]);const u={total:i.length,running:i.filter(h=>h.status==="running").length,completed:i.filter(h=>h.status==="completed").length,failed:i.filter(h=>h.status==="failed").length};return a?O.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:O.jsx("div",{className:"animate-pulse",children:"Loading pipelines…"})}):O.jsxs("div",{className:"flex flex-col gap-6",children:[O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{children:[O.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Pipelines"}),O.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Manage and monitor session pipelines"})]}),O.jsxs("button",{onClick:()=>x(!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:[O.jsx(ul,{className:"h-3.5 w-3.5"}),"New Pipeline"]})]}),O.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[O.jsx(qs,{label:"Total",value:u.total}),O.jsx(qs,{label:"Running",value:u.running}),O.jsx(qs,{label:"Completed",value:u.completed}),O.jsx(qs,{label:"Failed",value:u.failed})]}),i.length===0?O.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:[O.jsx("p",{className:"text-gray-500",children:"No pipelines yet"}),O.jsx("p",{className:"mt-1 text-xs text-gray-600",children:"Create a pipeline to run sessions in sequence"})]}):O.jsx("div",{className:"space-y-3",children:i.map(h=>O.jsx(Wi,{to:`/pipelines/${h.id}`,className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 hover:border-[#00e5ff]/30 transition-colors",children:O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[O.jsx("span",{className:"font-medium text-gray-200 truncate",children:h.name}),O.jsx(bv,{status:h.status})]}),O.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 shrink-0 ml-4",children:[O.jsxs("span",{children:[h.sessions.length," step",h.sessions.length!==1?"s":""]}),O.jsx("span",{children:pr(new Date(h.createdAt).getTime())})]})]})},h.id))}),O.jsx(YE,{open:g,onClose:()=>x(!1)})]})}function KE(){const{id:i}=Sp(),[r,a]=F.useState(null),[o,g]=F.useState(!0),[x,T]=F.useState(!1),c=Xs(h=>h.addToast),u=F.useCallback(async()=>{if(i)try{const h=await N2(i);a(h),T(!1)}catch(h){const y=h;y.statusCode===404?T(!0):c("error","Failed to fetch pipeline",y.message)}finally{g(!1)}},[i,c]);return F.useEffect(()=>{u();const h=setInterval(u,3e3);return()=>clearInterval(h)},[u]),o?O.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:O.jsx("div",{className:"animate-pulse",children:"Loading pipeline…"})}):x||!r?O.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[50vh] text-gray-500",children:[O.jsx("div",{className:"text-6xl mb-4",children:"404"}),O.jsx("div",{className:"text-lg mb-6 text-gray-200",children:"Pipeline not found"}),O.jsx(Wi,{to:"/pipelines",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Pipelines"})]}):O.jsxs("div",{className:"flex flex-col gap-6",children:[O.jsxs("nav",{className:"text-xs text-gray-500 flex items-center gap-1",children:[O.jsx(Wi,{to:"/pipelines",className:"hover:text-[#00e5ff] transition-colors",children:"Pipelines"}),O.jsx("span",{className:"text-gray-700",children:"/"}),O.jsx("span",{className:"text-gray-200 truncate max-w-xs",children:r.name})]}),O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:r.name}),O.jsx(bv,{status:r.status})]}),O.jsxs("div",{className:"text-xs text-gray-500",children:["Created ",pr(new Date(r.createdAt).getTime())]})]}),O.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118]",children:[O.jsx("div",{className:"px-4 py-3 border-b border-void-lighter",children:O.jsxs("h3",{className:"text-sm font-semibold text-gray-200",children:["Steps (",r.sessions.length,")"]})}),r.sessions.length===0?O.jsx("div",{className:"p-8 text-center text-gray-500 text-sm",children:"No steps yet"}):O.jsxs("table",{className:"w-full text-left text-sm",children:[O.jsx("thead",{children:O.jsxs("tr",{className:"border-b border-void-lighter text-gray-600",children:[O.jsx("th",{className:"px-4 py-3 font-medium w-16",children:"#"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"WorkDir"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Last Activity"})]})}),O.jsx("tbody",{children:r.sessions.map((h,y)=>O.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[O.jsxs("td",{className:"px-4 py-3 text-gray-500 font-mono text-xs",children:["#",y+1]}),O.jsx("td",{className:"px-4 py-3",children:O.jsx(al,{status:h.status})}),O.jsx("td",{className:"px-4 py-3",children:O.jsx(Wi,{to:`/sessions/${encodeURIComponent(h.id)}`,className:"font-medium text-gray-200 hover:text-cyan transition-colors",children:h.windowName||h.id})}),O.jsx("td",{className:"px-4 py-3 max-w-[200px] truncate font-mono text-xs text-gray-400",title:h.workDir,children:h.workDir}),O.jsx("td",{className:"px-4 py-3 whitespace-nowrap text-gray-400",children:pr(h.lastActivity)})]},h.id))})]})]})]})}function XE(){return O.jsx(bS,{children:O.jsx($y,{children:O.jsxs(en,{element:O.jsx(P2,{}),children:[O.jsx(en,{path:"/",element:O.jsx(X2,{})}),O.jsx(en,{path:"/sessions/:id",element:O.jsx(ZE,{})}),O.jsx(en,{path:"/pipelines",element:O.jsx(VE,{})}),O.jsx(en,{path:"/pipelines/:id",element:O.jsx(KE,{})})]})})})}$0.createRoot(document.getElementById("root")).render(O.jsx(pa.StrictMode,{children:O.jsx(fS,{basename:"/dashboard",children:O.jsx(XE,{})})}));