vibe-coding-master 0.4.41 → 0.4.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
var T0=Object.defineProperty;var R0=(n,r,s)=>r in n?T0(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var Am=(n,r,s)=>R0(n,typeof r!="symbol"?r+"":r,s);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))l(d);new MutationObserver(d=>{for(const p of d)if(p.type==="childList")for(const f of p.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function s(d){const p={};return d.integrity&&(p.integrity=d.integrity),d.referrerPolicy&&(p.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?p.credentials="include":d.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function l(d){if(d.ep)return;d.ep=!0;const p=s(d);fetch(d.href,p)}})();function Qg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var zu={exports:{}},Ha={};/**
|
|
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 Tm;function D0(){if(Tm)return Ha;Tm=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(l,d,p){var f=null;if(p!==void 0&&(f=""+p),d.key!==void 0&&(f=""+d.key),"key"in d){p={};for(var o in d)o!=="key"&&(p[o]=d[o])}else p=d;return d=p.ref,{$$typeof:n,type:l,key:f,ref:d!==void 0?d:null,props:p}}return Ha.Fragment=r,Ha.jsx=s,Ha.jsxs=s,Ha}var Rm;function M0(){return Rm||(Rm=1,zu.exports=D0()),zu.exports}var x=M0(),Iu={exports:{}},Ne={};/**
|
|
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 Dm;function L0(){if(Dm)return Ne;Dm=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),f=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),u=Symbol.for("react.activity"),b=Symbol.iterator;function C(N){return N===null||typeof N!="object"?null:(N=b&&N[b]||N["@@iterator"],typeof N=="function"?N:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,S={};function v(N,$,I){this.props=N,this.context=$,this.refs=S,this.updater=I||T}v.prototype.isReactComponent={},v.prototype.setState=function(N,$){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,$,"setState")},v.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function _(){}_.prototype=v.prototype;function y(N,$,I){this.props=N,this.context=$,this.refs=S,this.updater=I||T}var A=y.prototype=new _;A.constructor=y,E(A,v.prototype),A.isPureReactComponent=!0;var L=Array.isArray;function D(){}var R={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function M(N,$,I){var re=I.ref;return{$$typeof:n,type:N,key:$,ref:re!==void 0?re:null,props:I}}function j(N,$){return M(N.type,$,N.props)}function H(N){return typeof N=="object"&&N!==null&&N.$$typeof===n}function U(N){var $={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(I){return $[I]})}var F=/\/+/g;function K(N,$){return typeof N=="object"&&N!==null&&N.key!=null?U(""+N.key):$.toString(36)}function Y(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(D,D):(N.status="pending",N.then(function($){N.status==="pending"&&(N.status="fulfilled",N.value=$)},function($){N.status==="pending"&&(N.status="rejected",N.reason=$)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function G(N,$,I,re,ve){var ge=typeof N;(ge==="undefined"||ge==="boolean")&&(N=null);var Q=!1;if(N===null)Q=!0;else switch(ge){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(N.$$typeof){case n:case r:Q=!0;break;case m:return Q=N._init,G(Q(N._payload),$,I,re,ve)}}if(Q)return ve=ve(N),Q=re===""?"."+K(N,0):re,L(ve)?(I="",Q!=null&&(I=Q.replace(F,"$&/")+"/"),G(ve,$,I,"",function(se){return se})):ve!=null&&(H(ve)&&(ve=j(ve,I+(ve.key==null||N&&N.key===ve.key?"":(""+ve.key).replace(F,"$&/")+"/")+Q)),$.push(ve)),1;Q=0;var q=re===""?".":re+":";if(L(N))for(var ee=0;ee<N.length;ee++)re=N[ee],ge=q+K(re,ee),Q+=G(re,$,I,ge,ve);else if(ee=C(N),typeof ee=="function")for(N=ee.call(N),ee=0;!(re=N.next()).done;)re=re.value,ge=q+K(re,ee++),Q+=G(re,$,I,ge,ve);else if(ge==="object"){if(typeof N.then=="function")return G(Y(N),$,I,re,ve);throw $=String(N),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Q}function W(N,$,I){if(N==null)return N;var re=[],ve=0;return G(N,re,"","",function(ge){return $.call(I,ge,ve++)}),re}function Z(N){if(N._status===-1){var $=N._result;$=$(),$.then(function(I){(N._status===0||N._status===-1)&&(N._status=1,N._result=I)},function(I){(N._status===0||N._status===-1)&&(N._status=2,N._result=I)}),N._status===-1&&(N._status=0,N._result=$)}if(N._status===1)return N._result.default;throw N._result}var z=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},O={map:W,forEach:function(N,$,I){W(N,function(){$.apply(this,arguments)},I)},count:function(N){var $=0;return W(N,function(){$++}),$},toArray:function(N){return W(N,function($){return $})||[]},only:function(N){if(!H(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Ne.Activity=u,Ne.Children=O,Ne.Component=v,Ne.Fragment=s,Ne.Profiler=d,Ne.PureComponent=y,Ne.StrictMode=l,Ne.Suspense=c,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(N){return R.H.useMemoCache(N)}},Ne.cache=function(N){return function(){return N.apply(null,arguments)}},Ne.cacheSignal=function(){return null},Ne.cloneElement=function(N,$,I){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var re=E({},N.props),ve=N.key;if($!=null)for(ge in $.key!==void 0&&(ve=""+$.key),$)!k.call($,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&$.ref===void 0||(re[ge]=$[ge]);var ge=arguments.length-2;if(ge===1)re.children=I;else if(1<ge){for(var Q=Array(ge),q=0;q<ge;q++)Q[q]=arguments[q+2];re.children=Q}return M(N.type,ve,re)},Ne.createContext=function(N){return N={$$typeof:f,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:p,_context:N},N},Ne.createElement=function(N,$,I){var re,ve={},ge=null;if($!=null)for(re in $.key!==void 0&&(ge=""+$.key),$)k.call($,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ve[re]=$[re]);var Q=arguments.length-2;if(Q===1)ve.children=I;else if(1<Q){for(var q=Array(Q),ee=0;ee<Q;ee++)q[ee]=arguments[ee+2];ve.children=q}if(N&&N.defaultProps)for(re in Q=N.defaultProps,Q)ve[re]===void 0&&(ve[re]=Q[re]);return M(N,ge,ve)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(N){return{$$typeof:o,render:N}},Ne.isValidElement=H,Ne.lazy=function(N){return{$$typeof:m,_payload:{_status:-1,_result:N},_init:Z}},Ne.memo=function(N,$){return{$$typeof:h,type:N,compare:$===void 0?null:$}},Ne.startTransition=function(N){var $=R.T,I={};R.T=I;try{var re=N(),ve=R.S;ve!==null&&ve(I,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(D,z)}catch(ge){z(ge)}finally{$!==null&&I.types!==null&&($.types=I.types),R.T=$}},Ne.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},Ne.use=function(N){return R.H.use(N)},Ne.useActionState=function(N,$,I){return R.H.useActionState(N,$,I)},Ne.useCallback=function(N,$){return R.H.useCallback(N,$)},Ne.useContext=function(N){return R.H.useContext(N)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(N,$){return R.H.useDeferredValue(N,$)},Ne.useEffect=function(N,$){return R.H.useEffect(N,$)},Ne.useEffectEvent=function(N){return R.H.useEffectEvent(N)},Ne.useId=function(){return R.H.useId()},Ne.useImperativeHandle=function(N,$,I){return R.H.useImperativeHandle(N,$,I)},Ne.useInsertionEffect=function(N,$){return R.H.useInsertionEffect(N,$)},Ne.useLayoutEffect=function(N,$){return R.H.useLayoutEffect(N,$)},Ne.useMemo=function(N,$){return R.H.useMemo(N,$)},Ne.useOptimistic=function(N,$){return R.H.useOptimistic(N,$)},Ne.useReducer=function(N,$,I){return R.H.useReducer(N,$,I)},Ne.useRef=function(N){return R.H.useRef(N)},Ne.useState=function(N){return R.H.useState(N)},Ne.useSyncExternalStore=function(N,$,I){return R.H.useSyncExternalStore(N,$,I)},Ne.useTransition=function(){return R.H.useTransition()},Ne.version="19.2.6",Ne}var Mm;function Dh(){return Mm||(Mm=1,Iu.exports=L0()),Iu.exports}var te=Dh(),Uu={exports:{}},za={},Pu={exports:{}},Fu={};/**
|
|
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 Lm;function O0(){return Lm||(Lm=1,(function(n){function r(G,W){var Z=G.length;G.push(W);e:for(;0<Z;){var z=Z-1>>>1,O=G[z];if(0<d(O,W))G[z]=W,G[Z]=O,Z=z;else break e}}function s(G){return G.length===0?null:G[0]}function l(G){if(G.length===0)return null;var W=G[0],Z=G.pop();if(Z!==W){G[0]=Z;e:for(var z=0,O=G.length,N=O>>>1;z<N;){var $=2*(z+1)-1,I=G[$],re=$+1,ve=G[re];if(0>d(I,Z))re<O&&0>d(ve,I)?(G[z]=ve,G[re]=Z,z=re):(G[z]=I,G[$]=Z,z=$);else if(re<O&&0>d(ve,Z))G[z]=ve,G[re]=Z,z=re;else break e}}return W}function d(G,W){var Z=G.sortIndex-W.sortIndex;return Z!==0?Z:G.id-W.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;n.unstable_now=function(){return p.now()}}else{var f=Date,o=f.now();n.unstable_now=function(){return f.now()-o}}var c=[],h=[],m=1,u=null,b=3,C=!1,T=!1,E=!1,S=!1,v=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function A(G){for(var W=s(h);W!==null;){if(W.callback===null)l(h);else if(W.startTime<=G)l(h),W.sortIndex=W.expirationTime,r(c,W);else break;W=s(h)}}function L(G){if(E=!1,A(G),!T)if(s(c)!==null)T=!0,D||(D=!0,U());else{var W=s(h);W!==null&&Y(L,W.startTime-G)}}var D=!1,R=-1,k=5,M=-1;function j(){return S?!0:!(n.unstable_now()-M<k)}function H(){if(S=!1,D){var G=n.unstable_now();M=G;var W=!0;try{e:{T=!1,E&&(E=!1,_(R),R=-1),C=!0;var Z=b;try{t:{for(A(G),u=s(c);u!==null&&!(u.expirationTime>G&&j());){var z=u.callback;if(typeof z=="function"){u.callback=null,b=u.priorityLevel;var O=z(u.expirationTime<=G);if(G=n.unstable_now(),typeof O=="function"){u.callback=O,A(G),W=!0;break t}u===s(c)&&l(c),A(G)}else l(c);u=s(c)}if(u!==null)W=!0;else{var N=s(h);N!==null&&Y(L,N.startTime-G),W=!1}}break e}finally{u=null,b=Z,C=!1}W=void 0}}finally{W?U():D=!1}}}var U;if(typeof y=="function")U=function(){y(H)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,K=F.port2;F.port1.onmessage=H,U=function(){K.postMessage(null)}}else U=function(){v(H,0)};function Y(G,W){R=v(function(){G(n.unstable_now())},W)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(G){G.callback=null},n.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"):k=0<G?Math.floor(1e3/G):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(G){switch(b){case 1:case 2:case 3:var W=3;break;default:W=b}var Z=b;b=W;try{return G()}finally{b=Z}},n.unstable_requestPaint=function(){S=!0},n.unstable_runWithPriority=function(G,W){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var Z=b;b=G;try{return W()}finally{b=Z}},n.unstable_scheduleCallback=function(G,W,Z){var z=n.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?z+Z:z):Z=z,G){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=Z+O,G={id:m++,callback:W,priorityLevel:G,startTime:Z,expirationTime:O,sortIndex:-1},Z>z?(G.sortIndex=Z,r(h,G),s(c)===null&&G===s(h)&&(E?(_(R),R=-1):E=!0,Y(L,Z-z))):(G.sortIndex=O,r(c,G),T||C||(T=!0,D||(D=!0,U()))),G},n.unstable_shouldYield=j,n.unstable_wrapCallback=function(G){var W=b;return function(){var Z=b;b=W;try{return G.apply(this,arguments)}finally{b=Z}}}})(Fu)),Fu}var Om;function B0(){return Om||(Om=1,Pu.exports=O0()),Pu.exports}var qu={exports:{}},Zt={};/**
|
|
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 Bm;function j0(){if(Bm)return Zt;Bm=1;var n=Dh();function r(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+c+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var l={d:{f:s,r:function(){throw Error(r(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},d=Symbol.for("react.portal");function p(c,h,m){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:u==null?null:""+u,children:c,containerInfo:h,implementation:m}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Zt.createPortal=function(c,h){var m=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 p(c,h,null,m)},Zt.flushSync=function(c){var h=f.T,m=l.p;try{if(f.T=null,l.p=2,c)return c()}finally{f.T=h,l.p=m,l.d.f()}},Zt.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,l.d.C(c,h))},Zt.prefetchDNS=function(c){typeof c=="string"&&l.d.D(c)},Zt.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var m=h.as,u=o(m,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,C=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?l.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:u,integrity:b,fetchPriority:C}):m==="script"&&l.d.X(c,{crossOrigin:u,integrity:b,fetchPriority:C,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Zt.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=o(h.as,h.crossOrigin);l.d.M(c,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&l.d.M(c)},Zt.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,u=o(m,h.crossOrigin);l.d.L(c,m,{crossOrigin:u,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})}},Zt.preloadModule=function(c,h){if(typeof c=="string")if(h){var m=o(h.as,h.crossOrigin);l.d.m(c,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else l.d.m(c)},Zt.requestFormReset=function(c){l.d.r(c)},Zt.unstable_batchedUpdates=function(c,h){return c(h)},Zt.useFormState=function(c,h,m){return f.H.useFormState(c,h,m)},Zt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Zt.version="19.2.6",Zt}var jm;function N0(){if(jm)return qu.exports;jm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),qu.exports=j0(),qu.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 Nm;function H0(){if(Nm)return za;Nm=1;var n=B0(),r=Dh(),s=N0();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function p(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function f(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 o(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 c(e){if(p(e)!==e)throw Error(l(188))}function h(e){var t=e.alternate;if(!t){if(t=p(e),t===null)throw Error(l(188));return t!==e?null:e}for(var i=e,a=t;;){var g=i.return;if(g===null)break;var w=g.alternate;if(w===null){if(a=g.return,a!==null){i=a;continue}break}if(g.child===w.child){for(w=g.child;w;){if(w===i)return c(g),e;if(w===a)return c(g),t;w=w.sibling}throw Error(l(188))}if(i.return!==a.return)i=g,a=w;else{for(var B=!1,P=g.child;P;){if(P===i){B=!0,i=g,a=w;break}if(P===a){B=!0,a=g,i=w;break}P=P.sibling}if(!B){for(P=w.child;P;){if(P===i){B=!0,i=w,a=g;break}if(P===a){B=!0,a=w,i=g;break}P=P.sibling}if(!B)throw Error(l(189))}}if(i.alternate!==a)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var u=Object.assign,b=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),y=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),j=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function U(e){return e===null||typeof e!="object"?null:(e=H&&e[H]||e["@@iterator"],typeof e=="function"?e:null)}var F=Symbol.for("react.client.reference");function K(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===F?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case v:return"Profiler";case S:return"StrictMode";case L:return"Suspense";case D:return"SuspenseList";case M:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case y:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case A:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case R:return t=e.displayName||null,t!==null?t:K(e.type)||"Memo";case k:t=e._payload,e=e._init;try{return K(e(t))}catch{}}return null}var Y=Array.isArray,G=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},z=[],O=-1;function N(e){return{current:e}}function $(e){0>O||(e.current=z[O],z[O]=null,O--)}function I(e,t){O++,z[O]=e.current,e.current=t}var re=N(null),ve=N(null),ge=N(null),Q=N(null);function q(e,t){switch(I(ge,t),I(ve,e),I(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Xp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Xp(t),e=Qp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(re),I(re,e)}function ee(){$(re),$(ve),$(ge)}function se(e){e.memoizedState!==null&&I(Q,e);var t=re.current,i=Qp(t,e.type);t!==i&&(I(ve,e),I(re,i))}function we(e){ve.current===e&&($(re),$(ve)),Q.current===e&&($(Q),Oa._currentValue=Z)}var he,pe;function ke(e){if(he===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||"",pe=-1<i.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+he+e+pe}var Be=!1;function Ke(e,t){if(!e||Be)return"";Be=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(ce){var oe=ce}Reflect.construct(e,[],_e)}else{try{_e.call()}catch(ce){oe=ce}e.call(_e.prototype)}}else{try{throw Error()}catch(ce){oe=ce}(_e=e())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(ce){if(ce&&oe&&typeof ce.stack=="string")return[ce.stack,oe.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=a.DetermineComponentFrameRoot(),B=w[0],P=w[1];if(B&&P){var X=B.split(`
|
|
44
|
+
`),le=P.split(`
|
|
45
|
+
`);for(g=a=0;a<X.length&&!X[a].includes("DetermineComponentFrameRoot");)a++;for(;g<le.length&&!le[g].includes("DetermineComponentFrameRoot");)g++;if(a===X.length||g===le.length)for(a=X.length-1,g=le.length-1;1<=a&&0<=g&&X[a]!==le[g];)g--;for(;1<=a&&0<=g;a--,g--)if(X[a]!==le[g]){if(a!==1||g!==1)do if(a--,g--,0>g||X[a]!==le[g]){var fe=`
|
|
46
|
+
`+X[a].replace(" at new "," at ");return e.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",e.displayName)),fe}while(1<=a&&0<=g);break}}}finally{Be=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?ke(i):""}function xe(e,t){switch(e.tag){case 26:case 27:case 5:return ke(e.type);case 16:return ke("Lazy");case 13:return e.child!==t&&t!==null?ke("Suspense Fallback"):ke("Suspense");case 19:return ke("SuspenseList");case 0:case 15:return Ke(e.type,!1);case 11:return Ke(e.type.render,!1);case 1:return Ke(e.type,!0);case 31:return ke("Activity");default:return""}}function rt(e){try{var t="",i=null;do t+=xe(e,i),i=e,e=e.return;while(e);return t}catch(a){return`
|
|
47
|
+
Error generating stack: `+a.message+`
|
|
48
|
+
`+a.stack}}var wt=Object.prototype.hasOwnProperty,yt=n.unstable_scheduleCallback,It=n.unstable_cancelCallback,yn=n.unstable_shouldYield,xt=n.unstable_requestPaint,tt=n.unstable_now,jt=n.unstable_getCurrentPriorityLevel,ue=n.unstable_ImmediatePriority,Se=n.unstable_UserBlockingPriority,Ae=n.unstable_NormalPriority,Le=n.unstable_LowPriority,je=n.unstable_IdlePriority,mt=n.log,Fe=n.unstable_setDisableYieldValue,St=null,vt=null;function Nt(e){if(typeof mt=="function"&&Fe(e),vt&&typeof vt.setStrictMode=="function")try{vt.setStrictMode(St,e)}catch{}}var Qe=Math.clz32?Math.clz32:ln,rn=Math.log,Ht=Math.LN2;function ln(e){return e>>>=0,e===0?32:31-(rn(e)/Ht|0)|0}var Vn=256,Wn=262144,Pt=4194304;function on(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 Kn(e,t,i){var a=e.pendingLanes;if(a===0)return 0;var g=0,w=e.suspendedLanes,B=e.pingedLanes;e=e.warmLanes;var P=a&134217727;return P!==0?(a=P&~w,a!==0?g=on(a):(B&=P,B!==0?g=on(B):i||(i=P&~e,i!==0&&(g=on(i))))):(P=a&~w,P!==0?g=on(P):B!==0?g=on(B):i||(i=a&~e,i!==0&&(g=on(i)))),g===0?0:t!==0&&t!==g&&(t&w)===0&&(w=g&-g,i=t&-t,w>=i||w===32&&(i&4194048)!==0)?t:g}function Xt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $s(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 Qt(){var e=Pt;return Pt<<=1,(Pt&62914560)===0&&(Pt=4194304),e}function Sn(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Ft(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Hi(e,t,i,a,g,w){var B=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var P=e.entanglements,X=e.expirationTimes,le=e.hiddenUpdates;for(i=B&~i;0<i;){var fe=31-Qe(i),_e=1<<fe;P[fe]=0,X[fe]=-1;var oe=le[fe];if(oe!==null)for(le[fe]=null,fe=0;fe<oe.length;fe++){var ce=oe[fe];ce!==null&&(ce.lane&=-536870913)}i&=~_e}a!==0&&ze(e,a,0),w!==0&&g===0&&e.tag!==0&&(e.suspendedLanes|=w&~(B&~t))}function ze(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Qe(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|i&261930}function mi(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var a=31-Qe(i),g=1<<a;g&t|e[a]&t&&(e[a]|=t),i&=~g}}function Fr(e,t){var i=t&-t;return i=(i&42)!==0?1:zi(i),(i&(e.suspendedLanes|t))!==0?0:i}function zi(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 Gs(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Yn(){var e=W.p;return e!==0?e:(e=window.event,e===void 0?32:Sm(e.type))}function nl(e,t){var i=W.p;try{return W.p=e,t()}finally{W.p=i}}var ri=Math.random().toString(36).slice(2),Tt="__reactFiber$"+ri,qt="__reactProps$"+ri,Xn="__reactContainer$"+ri,Vs="__reactEvents$"+ri,Io="__reactListeners$"+ri,il="__reactHandles$"+ri,rl="__reactResources$"+ri,On="__reactMarker$"+ri;function qr(e){delete e[Tt],delete e[qt],delete e[Vs],delete e[Io],delete e[il]}function cn(e){var t=e[Tt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Xn]||i[Tt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=rm(e);e!==null;){if(i=e[Tt])return i;e=rm(e)}return t}e=i,i=e.parentNode}return null}function gi(e){if(e=e[Tt]||e[Xn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function si(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function _i(e){var t=e[rl];return t||(t=e[rl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ot(e){e[On]=!0}var $r=new Set,ie={};function Rt(e,t){ai(e,t),ai(e+"Capture",t)}function ai(e,t){for(ie[e]=t,e=0;e<t.length;e++)$r.add(t[e])}var sl=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]*$"),al={},ll={};function Gr(e){return wt.call(ll,e)?!0:wt.call(al,e)?!1:sl.test(e)?ll[e]=!0:(al[e]=!0,!1)}function gr(e,t,i){if(Gr(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Vr(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function Qn(e,t,i,a){if(a===null)e.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+a)}}function ht(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $t(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ol(e,t,i){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var g=a.get,w=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return g.call(this)},set:function(B){i=""+B,w.call(this,B)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return i},setValue:function(B){i=""+B},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wr(e){if(!e._valueTracker){var t=$t(e)?"checked":"value";e._valueTracker=ol(e,t,""+e[t])}}function Ws(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),a="";return e&&(a=$t(e)?e.checked?"true":"false":e.value),e=a,e!==i?(t.setValue(e),!0):!1}function Kr(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 Uo=/[\n"\\]/g;function un(e){return e.replace(Uo,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ks(e,t,i,a,g,w,B,P){e.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?e.type=B:e.removeAttribute("type"),t!=null?B==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ht(t)):e.value!==""+ht(t)&&(e.value=""+ht(t)):B!=="submit"&&B!=="reset"||e.removeAttribute("value"),t!=null?Ys(e,B,ht(t)):i!=null?Ys(e,B,ht(i)):a!=null&&e.removeAttribute("value"),g==null&&w!=null&&(e.defaultChecked=!!w),g!=null&&(e.checked=g&&typeof g!="function"&&typeof g!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?e.name=""+ht(P):e.removeAttribute("name")}function cl(e,t,i,a,g,w,B,P){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(e.type=w),t!=null||i!=null){if(!(w!=="submit"&&w!=="reset"||t!=null)){Wr(e);return}i=i!=null?""+ht(i):"",t=t!=null?""+ht(t):i,P||t===e.value||(e.value=t),e.defaultValue=t}a=a??g,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=P?e.checked:!!a,e.defaultChecked=!!a,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(e.name=B),Wr(e)}function Ys(e,t,i){t==="number"&&Kr(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function bn(e,t,i,a){if(e=e.options,t){t={};for(var g=0;g<i.length;g++)t["$"+i[g]]=!0;for(i=0;i<e.length;i++)g=t.hasOwnProperty("$"+e[i].value),e[i].selected!==g&&(e[i].selected=g),g&&a&&(e[i].defaultSelected=!0)}else{for(i=""+ht(i),t=null,g=0;g<e.length;g++){if(e[g].value===i){e[g].selected=!0,a&&(e[g].defaultSelected=!0);return}t!==null||e[g].disabled||(t=e[g])}t!==null&&(t.selected=!0)}}function Yr(e,t,i){if(t!=null&&(t=""+ht(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+ht(i):""}function Xr(e,t,i,a){if(t==null){if(a!=null){if(i!=null)throw Error(l(92));if(Y(a)){if(1<a.length)throw Error(l(93));a=a[0]}i=a}i==null&&(i=""),t=i}i=ht(t),e.defaultValue=i,a=e.textContent,a===i&&a!==""&&a!==null&&(e.value=a),Wr(e)}function Cn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Po=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 Xs(e,t,i){var a=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,i):typeof i!="number"||i===0||Po.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Qr(e,t,i){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,i!=null){for(var a in i)!i.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var g in t)a=t[g],t.hasOwnProperty(g)&&i[g]!==a&&Xs(e,g,a)}else for(var w in t)t.hasOwnProperty(w)&&Xs(e,w,t[w])}function Jr(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 ul=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"]]),Ii=/^[\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 _r(e){return Ii.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Jt(){}var Bn=null;function Qs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ui=null,Pi=null;function hn(e){var t=gi(e);if(t&&(e=t.stateNode)){var i=e[qt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ks(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+un(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var a=i[t];if(a!==e&&a.form===e.form){var g=a[qt]||null;if(!g)throw Error(l(90));Ks(a,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(t=0;t<i.length;t++)a=i[t],a.form===e.form&&Ws(a)}break e;case"textarea":Yr(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&bn(e,!!i.multiple,t,!1)}}}var vr=!1;function Zr(e,t,i){if(vr)return e(t,i);vr=!0;try{var a=e(t);return a}finally{if(vr=!1,(Ui!==null||Pi!==null)&&(Wl(),Ui&&(t=Ui,e=Pi,Pi=Ui=null,hn(t),e)))for(t=0;t<e.length;t++)hn(e[t])}}function vi(e,t){var i=e.stateNode;if(i===null)return null;var a=i[qt]||null;if(a===null)return null;i=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(l(231,t,typeof i));return i}var Jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Re=!1;if(Jn)try{var yr={};Object.defineProperty(yr,"passive",{get:function(){Re=!0}}),window.addEventListener("test",yr,yr),window.removeEventListener("test",yr,yr)}catch{Re=!1}var li=null,Js=null,es=null;function wn(){if(es)return es;var e,t=Js,i=t.length,a,g="value"in li?li.value:li.textContent,w=g.length;for(e=0;e<i&&t[e]===g[e];e++);var B=i-e;for(a=1;a<=B&&t[i-a]===g[w-a];a++);return es=g.slice(e,1<a?1-a:void 0)}function Fi(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 Sr(){return!0}function ts(){return!1}function Gt(e){function t(i,a,g,w,B){this._reactName=i,this._targetInst=g,this.type=a,this.nativeEvent=w,this.target=B,this.currentTarget=null;for(var P in e)e.hasOwnProperty(P)&&(i=e[P],this[P]=i?i(w):w[P]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Sr:ts,this.isPropagationStopped=ts,this}return u(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Sr)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Sr)},persist:function(){},isPersistent:Sr}),t}var V={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},de=Gt(V),Pe=u({},V,{view:0,detail:0}),Et=Gt(Pe),Zn,jn,Nn,ns=u({},Pe,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qo,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!==Nn&&(Nn&&e.type==="mousemove"?(Zn=e.screenX-Nn.screenX,jn=e.screenY-Nn.screenY):jn=Zn=0,Nn=e),Zn)},movementY:function(e){return"movementY"in e?e.movementY:jn}}),Zs=Gt(ns),hl=u({},ns,{dataTransfer:0}),Tv=Gt(hl),Rv=u({},Pe,{relatedTarget:0}),Fo=Gt(Rv),Dv=u({},V,{animationName:0,elapsedTime:0,pseudoElement:0}),Mv=Gt(Dv),Lv=u({},V,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ov=Gt(Lv),Bv=u({},V,{data:0}),Zh=Gt(Bv),jv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nv={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Hv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Hv[e])?!!t[e]:!1}function qo(){return zv}var Iv=u({},Pe,{key:function(e){if(e.key){var t=jv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Nv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qo,charCode:function(e){return e.type==="keypress"?Fi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Uv=Gt(Iv),Pv=u({},ns,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ef=Gt(Pv),Fv=u({},Pe,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qo}),qv=Gt(Fv),$v=u({},V,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gv=Gt($v),Vv=u({},ns,{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}),Wv=Gt(Vv),Kv=u({},V,{newState:0,oldState:0}),Yv=Gt(Kv),Xv=[9,13,27,32],$o=Jn&&"CompositionEvent"in window,ea=null;Jn&&"documentMode"in document&&(ea=document.documentMode);var Qv=Jn&&"TextEvent"in window&&!ea,tf=Jn&&(!$o||ea&&8<ea&&11>=ea),nf=" ",rf=!1;function sf(e,t){switch(e){case"keyup":return Xv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function af(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var is=!1;function Jv(e,t){switch(e){case"compositionend":return af(t);case"keypress":return t.which!==32?null:(rf=!0,nf);case"textInput":return e=t.data,e===nf&&rf?null:e;default:return null}}function Zv(e,t){if(is)return e==="compositionend"||!$o&&sf(e,t)?(e=wn(),es=Js=li=null,is=!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 tf&&t.locale!=="ko"?null:t.data;default:return null}}var ey={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 lf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ey[e.type]:t==="textarea"}function of(e,t,i,a){Ui?Pi?Pi.push(a):Pi=[a]:Ui=a,t=eo(t,"onChange"),0<t.length&&(i=new de("onChange","change",null,i,a),e.push({event:i,listeners:t}))}var ta=null,na=null;function ty(e){$p(e,0)}function fl(e){var t=si(e);if(Ws(t))return e}function cf(e,t){if(e==="change")return t}var uf=!1;if(Jn){var Go;if(Jn){var Vo="oninput"in document;if(!Vo){var hf=document.createElement("div");hf.setAttribute("oninput","return;"),Vo=typeof hf.oninput=="function"}Go=Vo}else Go=!1;uf=Go&&(!document.documentMode||9<document.documentMode)}function ff(){ta&&(ta.detachEvent("onpropertychange",df),na=ta=null)}function df(e){if(e.propertyName==="value"&&fl(na)){var t=[];of(t,na,e,Qs(e)),Zr(ty,t)}}function ny(e,t,i){e==="focusin"?(ff(),ta=t,na=i,ta.attachEvent("onpropertychange",df)):e==="focusout"&&ff()}function iy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fl(na)}function ry(e,t){if(e==="click")return fl(t)}function sy(e,t){if(e==="input"||e==="change")return fl(t)}function ay(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xn=typeof Object.is=="function"?Object.is:ay;function ia(e,t){if(xn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(a=0;a<i.length;a++){var g=i[a];if(!wt.call(t,g)||!xn(e[g],t[g]))return!1}return!0}function pf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mf(e,t){var i=pf(e);e=0;for(var a;i;){if(i.nodeType===3){if(a=e+i.textContent.length,e<=t&&a>=t)return{node:i,offset:t-e};e=a}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=pf(i)}}function gf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _f(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kr(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Kr(e.document)}return t}function Wo(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 ly=Jn&&"documentMode"in document&&11>=document.documentMode,rs=null,Ko=null,ra=null,Yo=!1;function vf(e,t,i){var a=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Yo||rs==null||rs!==Kr(a)||(a=rs,"selectionStart"in a&&Wo(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),ra&&ia(ra,a)||(ra=a,a=eo(Ko,"onSelect"),0<a.length&&(t=new de("onSelect","select",null,t,i),e.push({event:t,listeners:a}),t.target=rs)))}function br(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var ss={animationend:br("Animation","AnimationEnd"),animationiteration:br("Animation","AnimationIteration"),animationstart:br("Animation","AnimationStart"),transitionrun:br("Transition","TransitionRun"),transitionstart:br("Transition","TransitionStart"),transitioncancel:br("Transition","TransitionCancel"),transitionend:br("Transition","TransitionEnd")},Xo={},yf={};Jn&&(yf=document.createElement("div").style,"AnimationEvent"in window||(delete ss.animationend.animation,delete ss.animationiteration.animation,delete ss.animationstart.animation),"TransitionEvent"in window||delete ss.transitionend.transition);function Cr(e){if(Xo[e])return Xo[e];if(!ss[e])return e;var t=ss[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in yf)return Xo[e]=t[i];return e}var Sf=Cr("animationend"),bf=Cr("animationiteration"),Cf=Cr("animationstart"),oy=Cr("transitionrun"),cy=Cr("transitionstart"),uy=Cr("transitioncancel"),wf=Cr("transitionend"),xf=new Map,Qo="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(" ");Qo.push("scrollEnd");function ei(e,t){xf.set(e,t),Rt(t,[e])}var dl=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)},Hn=[],as=0,Jo=0;function pl(){for(var e=as,t=Jo=as=0;t<e;){var i=Hn[t];Hn[t++]=null;var a=Hn[t];Hn[t++]=null;var g=Hn[t];Hn[t++]=null;var w=Hn[t];if(Hn[t++]=null,a!==null&&g!==null){var B=a.pending;B===null?g.next=g:(g.next=B.next,B.next=g),a.pending=g}w!==0&&Ef(i,g,w)}}function ml(e,t,i,a){Hn[as++]=e,Hn[as++]=t,Hn[as++]=i,Hn[as++]=a,Jo|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Zo(e,t,i,a){return ml(e,t,i,a),gl(e)}function wr(e,t){return ml(e,null,null,t),gl(e)}function Ef(e,t,i){e.lanes|=i;var a=e.alternate;a!==null&&(a.lanes|=i);for(var g=!1,w=e.return;w!==null;)w.childLanes|=i,a=w.alternate,a!==null&&(a.childLanes|=i),w.tag===22&&(e=w.stateNode,e===null||e._visibility&1||(g=!0)),e=w,w=w.return;return e.tag===3?(w=e.stateNode,g&&t!==null&&(g=31-Qe(i),e=w.hiddenUpdates,a=e[g],a===null?e[g]=[t]:a.push(t),t.lane=i|536870912),w):null}function gl(e){if(50<ka)throw ka=0,ou=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ls={};function hy(e,t,i,a){this.tag=e,this.key=i,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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(e,t,i,a){return new hy(e,t,i,a)}function ec(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yi(e,t){var i=e.alternate;return i===null?(i=En(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function kf(e,t){e.flags&=65011714;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function _l(e,t,i,a,g,w){var B=0;if(a=e,typeof e=="function")ec(e)&&(B=1);else if(typeof e=="string")B=g0(e,i,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case M:return e=En(31,i,t,g),e.elementType=M,e.lanes=w,e;case E:return xr(i.children,g,w,t);case S:B=8,g|=24;break;case v:return e=En(12,i,t,g|2),e.elementType=v,e.lanes=w,e;case L:return e=En(13,i,t,g),e.elementType=L,e.lanes=w,e;case D:return e=En(19,i,t,g),e.elementType=D,e.lanes=w,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case y:B=10;break e;case _:B=9;break e;case A:B=11;break e;case R:B=14;break e;case k:B=16,a=null;break e}B=29,i=Error(l(130,e===null?"null":typeof e,"")),a=null}return t=En(B,i,t,g),t.elementType=e,t.type=a,t.lanes=w,t}function xr(e,t,i,a){return e=En(7,e,a,t),e.lanes=i,e}function tc(e,t,i){return e=En(6,e,null,t),e.lanes=i,e}function Af(e){var t=En(18,null,null,0);return t.stateNode=e,t}function nc(e,t,i){return t=En(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Tf=new WeakMap;function zn(e,t){if(typeof e=="object"&&e!==null){var i=Tf.get(e);return i!==void 0?i:(t={value:e,source:t,stack:rt(t)},Tf.set(e,t),t)}return{value:e,source:t,stack:rt(t)}}var os=[],cs=0,vl=null,sa=0,In=[],Un=0,qi=null,oi=1,ci="";function Si(e,t){os[cs++]=sa,os[cs++]=vl,vl=e,sa=t}function Rf(e,t,i){In[Un++]=oi,In[Un++]=ci,In[Un++]=qi,qi=e;var a=oi;e=ci;var g=32-Qe(a)-1;a&=~(1<<g),i+=1;var w=32-Qe(t)+g;if(30<w){var B=g-g%5;w=(a&(1<<B)-1).toString(32),a>>=B,g-=B,oi=1<<32-Qe(t)+g|i<<g|a,ci=w+e}else oi=1<<w|i<<g|a,ci=e}function ic(e){e.return!==null&&(Si(e,1),Rf(e,1,0))}function rc(e){for(;e===vl;)vl=os[--cs],os[cs]=null,sa=os[--cs],os[cs]=null;for(;e===qi;)qi=In[--Un],In[Un]=null,ci=In[--Un],In[Un]=null,oi=In[--Un],In[Un]=null}function Df(e,t){In[Un++]=oi,In[Un++]=ci,In[Un++]=qi,oi=t.id,ci=t.overflow,qi=e}var Vt=null,dt=null,Ye=!1,$i=null,Pn=!1,sc=Error(l(519));function Gi(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw aa(zn(t,e)),sc}function Mf(e){var t=e.stateNode,i=e.type,a=e.memoizedProps;switch(t[Tt]=e,t[qt]=a,i){case"dialog":$e("cancel",t),$e("close",t);break;case"iframe":case"object":case"embed":$e("load",t);break;case"video":case"audio":for(i=0;i<Ta.length;i++)$e(Ta[i],t);break;case"source":$e("error",t);break;case"img":case"image":case"link":$e("error",t),$e("load",t);break;case"details":$e("toggle",t);break;case"input":$e("invalid",t),cl(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":$e("invalid",t);break;case"textarea":$e("invalid",t),Xr(t,a.value,a.defaultValue,a.children)}i=a.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||a.suppressHydrationWarning===!0||Kp(t.textContent,i)?(a.popover!=null&&($e("beforetoggle",t),$e("toggle",t)),a.onScroll!=null&&$e("scroll",t),a.onScrollEnd!=null&&$e("scrollend",t),a.onClick!=null&&(t.onclick=Jt),t=!0):t=!1,t||Gi(e,!0)}function Lf(e){for(Vt=e.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:Pn=!1;return;case 27:case 3:Pn=!0;return;default:Vt=Vt.return}}function us(e){if(e!==Vt)return!1;if(!Ye)return Lf(e),Ye=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||wu(e.type,e.memoizedProps)),i=!i),i&&dt&&Gi(e),Lf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));dt=im(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));dt=im(e)}else t===27?(t=dt,sr(e.type)?(e=Tu,Tu=null,dt=e):dt=t):dt=Vt?qn(e.stateNode.nextSibling):null;return!0}function Er(){dt=Vt=null,Ye=!1}function ac(){var e=$i;return e!==null&&(mn===null?mn=e:mn.push.apply(mn,e),$i=null),e}function aa(e){$i===null?$i=[e]:$i.push(e)}var lc=N(null),kr=null,bi=null;function Vi(e,t,i){I(lc,t._currentValue),t._currentValue=i}function Ci(e){e._currentValue=lc.current,$(lc)}function oc(e,t,i){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===i)break;e=e.return}}function cc(e,t,i,a){var g=e.child;for(g!==null&&(g.return=e);g!==null;){var w=g.dependencies;if(w!==null){var B=g.child;w=w.firstContext;e:for(;w!==null;){var P=w;w=g;for(var X=0;X<t.length;X++)if(P.context===t[X]){w.lanes|=i,P=w.alternate,P!==null&&(P.lanes|=i),oc(w.return,i,e),a||(B=null);break e}w=P.next}}else if(g.tag===18){if(B=g.return,B===null)throw Error(l(341));B.lanes|=i,w=B.alternate,w!==null&&(w.lanes|=i),oc(B,i,e),B=null}else B=g.child;if(B!==null)B.return=g;else for(B=g;B!==null;){if(B===e){B=null;break}if(g=B.sibling,g!==null){g.return=B.return,B=g;break}B=B.return}g=B}}function hs(e,t,i,a){e=null;for(var g=t,w=!1;g!==null;){if(!w){if((g.flags&524288)!==0)w=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var B=g.alternate;if(B===null)throw Error(l(387));if(B=B.memoizedProps,B!==null){var P=g.type;xn(g.pendingProps.value,B.value)||(e!==null?e.push(P):e=[P])}}else if(g===Q.current){if(B=g.alternate,B===null)throw Error(l(387));B.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(e!==null?e.push(Oa):e=[Oa])}g=g.return}e!==null&&cc(t,e,i,a),t.flags|=262144}function yl(e){for(e=e.firstContext;e!==null;){if(!xn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ar(e){kr=e,bi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Wt(e){return Of(kr,e)}function Sl(e,t){return kr===null&&Ar(e),Of(e,t)}function Of(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},bi===null){if(e===null)throw Error(l(308));bi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else bi=bi.next=t;return i}var fy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},dy=n.unstable_scheduleCallback,py=n.unstable_NormalPriority,Dt={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function uc(){return{controller:new fy,data:new Map,refCount:0}}function la(e){e.refCount--,e.refCount===0&&dy(py,function(){e.controller.abort()})}var oa=null,hc=0,fs=0,ds=null;function my(e,t){if(oa===null){var i=oa=[];hc=0,fs=pu(),ds={status:"pending",value:void 0,then:function(a){i.push(a)}}}return hc++,t.then(Bf,Bf),t}function Bf(){if(--hc===0&&oa!==null){ds!==null&&(ds.status="fulfilled");var e=oa;oa=null,fs=0,ds=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function gy(e,t){var i=[],a={status:"pending",value:null,reason:null,then:function(g){i.push(g)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var g=0;g<i.length;g++)(0,i[g])(t)},function(g){for(a.status="rejected",a.reason=g,g=0;g<i.length;g++)(0,i[g])(void 0)}),a}var jf=G.S;G.S=function(e,t){vp=tt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&my(e,t),jf!==null&&jf(e,t)};var Tr=N(null);function fc(){var e=Tr.current;return e!==null?e:ct.pooledCache}function bl(e,t){t===null?I(Tr,Tr.current):I(Tr,t.pool)}function Nf(){var e=fc();return e===null?null:{parent:Dt._currentValue,pool:e}}var ps=Error(l(460)),dc=Error(l(474)),Cl=Error(l(542)),wl={then:function(){}};function Hf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function zf(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Jt,Jt),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Uf(e),e;default:if(typeof t.status=="string")t.then(Jt,Jt);else{if(e=ct,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var g=t;g.status="fulfilled",g.value=a}},function(a){if(t.status==="pending"){var g=t;g.status="rejected",g.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Uf(e),e}throw Dr=t,ps}}function Rr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Dr=i,ps):i}}var Dr=null;function If(){if(Dr===null)throw Error(l(459));var e=Dr;return Dr=null,e}function Uf(e){if(e===ps||e===Cl)throw Error(l(483))}var ms=null,ca=0;function xl(e){var t=ca;return ca+=1,ms===null&&(ms=[]),zf(ms,e,t)}function ua(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function El(e,t){throw t.$$typeof===b?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Pf(e){function t(ne,J){if(e){var ae=ne.deletions;ae===null?(ne.deletions=[J],ne.flags|=16):ae.push(J)}}function i(ne,J){if(!e)return null;for(;J!==null;)t(ne,J),J=J.sibling;return null}function a(ne){for(var J=new Map;ne!==null;)ne.key!==null?J.set(ne.key,ne):J.set(ne.index,ne),ne=ne.sibling;return J}function g(ne,J){return ne=yi(ne,J),ne.index=0,ne.sibling=null,ne}function w(ne,J,ae){return ne.index=ae,e?(ae=ne.alternate,ae!==null?(ae=ae.index,ae<J?(ne.flags|=67108866,J):ae):(ne.flags|=67108866,J)):(ne.flags|=1048576,J)}function B(ne){return e&&ne.alternate===null&&(ne.flags|=67108866),ne}function P(ne,J,ae,me){return J===null||J.tag!==6?(J=tc(ae,ne.mode,me),J.return=ne,J):(J=g(J,ae),J.return=ne,J)}function X(ne,J,ae,me){var De=ae.type;return De===E?fe(ne,J,ae.props.children,me,ae.key):J!==null&&(J.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===k&&Rr(De)===J.type)?(J=g(J,ae.props),ua(J,ae),J.return=ne,J):(J=_l(ae.type,ae.key,ae.props,null,ne.mode,me),ua(J,ae),J.return=ne,J)}function le(ne,J,ae,me){return J===null||J.tag!==4||J.stateNode.containerInfo!==ae.containerInfo||J.stateNode.implementation!==ae.implementation?(J=nc(ae,ne.mode,me),J.return=ne,J):(J=g(J,ae.children||[]),J.return=ne,J)}function fe(ne,J,ae,me,De){return J===null||J.tag!==7?(J=xr(ae,ne.mode,me,De),J.return=ne,J):(J=g(J,ae),J.return=ne,J)}function _e(ne,J,ae){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=tc(""+J,ne.mode,ae),J.return=ne,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case C:return ae=_l(J.type,J.key,J.props,null,ne.mode,ae),ua(ae,J),ae.return=ne,ae;case T:return J=nc(J,ne.mode,ae),J.return=ne,J;case k:return J=Rr(J),_e(ne,J,ae)}if(Y(J)||U(J))return J=xr(J,ne.mode,ae,null),J.return=ne,J;if(typeof J.then=="function")return _e(ne,xl(J),ae);if(J.$$typeof===y)return _e(ne,Sl(ne,J),ae);El(ne,J)}return null}function oe(ne,J,ae,me){var De=J!==null?J.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return De!==null?null:P(ne,J,""+ae,me);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case C:return ae.key===De?X(ne,J,ae,me):null;case T:return ae.key===De?le(ne,J,ae,me):null;case k:return ae=Rr(ae),oe(ne,J,ae,me)}if(Y(ae)||U(ae))return De!==null?null:fe(ne,J,ae,me,null);if(typeof ae.then=="function")return oe(ne,J,xl(ae),me);if(ae.$$typeof===y)return oe(ne,J,Sl(ne,ae),me);El(ne,ae)}return null}function ce(ne,J,ae,me,De){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return ne=ne.get(ae)||null,P(J,ne,""+me,De);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case C:return ne=ne.get(me.key===null?ae:me.key)||null,X(J,ne,me,De);case T:return ne=ne.get(me.key===null?ae:me.key)||null,le(J,ne,me,De);case k:return me=Rr(me),ce(ne,J,ae,me,De)}if(Y(me)||U(me))return ne=ne.get(ae)||null,fe(J,ne,me,De,null);if(typeof me.then=="function")return ce(ne,J,ae,xl(me),De);if(me.$$typeof===y)return ce(ne,J,ae,Sl(J,me),De);El(J,me)}return null}function Ee(ne,J,ae,me){for(var De=null,Je=null,Te=J,Ie=J=0,We=null;Te!==null&&Ie<ae.length;Ie++){Te.index>Ie?(We=Te,Te=null):We=Te.sibling;var Ze=oe(ne,Te,ae[Ie],me);if(Ze===null){Te===null&&(Te=We);break}e&&Te&&Ze.alternate===null&&t(ne,Te),J=w(Ze,J,Ie),Je===null?De=Ze:Je.sibling=Ze,Je=Ze,Te=We}if(Ie===ae.length)return i(ne,Te),Ye&&Si(ne,Ie),De;if(Te===null){for(;Ie<ae.length;Ie++)Te=_e(ne,ae[Ie],me),Te!==null&&(J=w(Te,J,Ie),Je===null?De=Te:Je.sibling=Te,Je=Te);return Ye&&Si(ne,Ie),De}for(Te=a(Te);Ie<ae.length;Ie++)We=ce(Te,ne,Ie,ae[Ie],me),We!==null&&(e&&We.alternate!==null&&Te.delete(We.key===null?Ie:We.key),J=w(We,J,Ie),Je===null?De=We:Je.sibling=We,Je=We);return e&&Te.forEach(function(ur){return t(ne,ur)}),Ye&&Si(ne,Ie),De}function Oe(ne,J,ae,me){if(ae==null)throw Error(l(151));for(var De=null,Je=null,Te=J,Ie=J=0,We=null,Ze=ae.next();Te!==null&&!Ze.done;Ie++,Ze=ae.next()){Te.index>Ie?(We=Te,Te=null):We=Te.sibling;var ur=oe(ne,Te,Ze.value,me);if(ur===null){Te===null&&(Te=We);break}e&&Te&&ur.alternate===null&&t(ne,Te),J=w(ur,J,Ie),Je===null?De=ur:Je.sibling=ur,Je=ur,Te=We}if(Ze.done)return i(ne,Te),Ye&&Si(ne,Ie),De;if(Te===null){for(;!Ze.done;Ie++,Ze=ae.next())Ze=_e(ne,Ze.value,me),Ze!==null&&(J=w(Ze,J,Ie),Je===null?De=Ze:Je.sibling=Ze,Je=Ze);return Ye&&Si(ne,Ie),De}for(Te=a(Te);!Ze.done;Ie++,Ze=ae.next())Ze=ce(Te,ne,Ie,Ze.value,me),Ze!==null&&(e&&Ze.alternate!==null&&Te.delete(Ze.key===null?Ie:Ze.key),J=w(Ze,J,Ie),Je===null?De=Ze:Je.sibling=Ze,Je=Ze);return e&&Te.forEach(function(A0){return t(ne,A0)}),Ye&&Si(ne,Ie),De}function lt(ne,J,ae,me){if(typeof ae=="object"&&ae!==null&&ae.type===E&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case C:e:{for(var De=ae.key;J!==null;){if(J.key===De){if(De=ae.type,De===E){if(J.tag===7){i(ne,J.sibling),me=g(J,ae.props.children),me.return=ne,ne=me;break e}}else if(J.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===k&&Rr(De)===J.type){i(ne,J.sibling),me=g(J,ae.props),ua(me,ae),me.return=ne,ne=me;break e}i(ne,J);break}else t(ne,J);J=J.sibling}ae.type===E?(me=xr(ae.props.children,ne.mode,me,ae.key),me.return=ne,ne=me):(me=_l(ae.type,ae.key,ae.props,null,ne.mode,me),ua(me,ae),me.return=ne,ne=me)}return B(ne);case T:e:{for(De=ae.key;J!==null;){if(J.key===De)if(J.tag===4&&J.stateNode.containerInfo===ae.containerInfo&&J.stateNode.implementation===ae.implementation){i(ne,J.sibling),me=g(J,ae.children||[]),me.return=ne,ne=me;break e}else{i(ne,J);break}else t(ne,J);J=J.sibling}me=nc(ae,ne.mode,me),me.return=ne,ne=me}return B(ne);case k:return ae=Rr(ae),lt(ne,J,ae,me)}if(Y(ae))return Ee(ne,J,ae,me);if(U(ae)){if(De=U(ae),typeof De!="function")throw Error(l(150));return ae=De.call(ae),Oe(ne,J,ae,me)}if(typeof ae.then=="function")return lt(ne,J,xl(ae),me);if(ae.$$typeof===y)return lt(ne,J,Sl(ne,ae),me);El(ne,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,J!==null&&J.tag===6?(i(ne,J.sibling),me=g(J,ae),me.return=ne,ne=me):(i(ne,J),me=tc(ae,ne.mode,me),me.return=ne,ne=me),B(ne)):i(ne,J)}return function(ne,J,ae,me){try{ca=0;var De=lt(ne,J,ae,me);return ms=null,De}catch(Te){if(Te===ps||Te===Cl)throw Te;var Je=En(29,Te,null,ne.mode);return Je.lanes=me,Je.return=ne,Je}finally{}}}var Mr=Pf(!0),Ff=Pf(!1),Wi=!1;function pc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mc(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 Ki(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Yi(e,t,i){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(et&2)!==0){var g=a.pending;return g===null?t.next=t:(t.next=g.next,g.next=t),a.pending=t,t=gl(e),Ef(e,null,i),t}return ml(e,a,t,i),gl(e)}function ha(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,i|=a,t.lanes=i,mi(e,i)}}function gc(e,t){var i=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,i===a)){var g=null,w=null;if(i=i.firstBaseUpdate,i!==null){do{var B={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};w===null?g=w=B:w=w.next=B,i=i.next}while(i!==null);w===null?g=w=t:w=w.next=t}else g=w=t;i={baseState:a.baseState,firstBaseUpdate:g,lastBaseUpdate:w,shared:a.shared,callbacks:a.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var _c=!1;function fa(){if(_c){var e=ds;if(e!==null)throw e}}function da(e,t,i,a){_c=!1;var g=e.updateQueue;Wi=!1;var w=g.firstBaseUpdate,B=g.lastBaseUpdate,P=g.shared.pending;if(P!==null){g.shared.pending=null;var X=P,le=X.next;X.next=null,B===null?w=le:B.next=le,B=X;var fe=e.alternate;fe!==null&&(fe=fe.updateQueue,P=fe.lastBaseUpdate,P!==B&&(P===null?fe.firstBaseUpdate=le:P.next=le,fe.lastBaseUpdate=X))}if(w!==null){var _e=g.baseState;B=0,fe=le=X=null,P=w;do{var oe=P.lane&-536870913,ce=oe!==P.lane;if(ce?(Ve&oe)===oe:(a&oe)===oe){oe!==0&&oe===fs&&(_c=!0),fe!==null&&(fe=fe.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Ee=e,Oe=P;oe=t;var lt=i;switch(Oe.tag){case 1:if(Ee=Oe.payload,typeof Ee=="function"){_e=Ee.call(lt,_e,oe);break e}_e=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Oe.payload,oe=typeof Ee=="function"?Ee.call(lt,_e,oe):Ee,oe==null)break e;_e=u({},_e,oe);break e;case 2:Wi=!0}}oe=P.callback,oe!==null&&(e.flags|=64,ce&&(e.flags|=8192),ce=g.callbacks,ce===null?g.callbacks=[oe]:ce.push(oe))}else ce={lane:oe,tag:P.tag,payload:P.payload,callback:P.callback,next:null},fe===null?(le=fe=ce,X=_e):fe=fe.next=ce,B|=oe;if(P=P.next,P===null){if(P=g.shared.pending,P===null)break;ce=P,P=ce.next,ce.next=null,g.lastBaseUpdate=ce,g.shared.pending=null}}while(!0);fe===null&&(X=_e),g.baseState=X,g.firstBaseUpdate=le,g.lastBaseUpdate=fe,w===null&&(g.shared.lanes=0),er|=B,e.lanes=B,e.memoizedState=_e}}function qf(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function $f(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)qf(i[e],t)}var gs=N(null),kl=N(0);function Gf(e,t){e=Mi,I(kl,e),I(gs,t),Mi=e|t.baseLanes}function vc(){I(kl,Mi),I(gs,gs.current)}function yc(){Mi=kl.current,$(gs),$(kl)}var kn=N(null),Fn=null;function Xi(e){var t=e.alternate;I(kt,kt.current&1),I(kn,e),Fn===null&&(t===null||gs.current!==null||t.memoizedState!==null)&&(Fn=e)}function Sc(e){I(kt,kt.current),I(kn,e),Fn===null&&(Fn=e)}function Vf(e){e.tag===22?(I(kt,kt.current),I(kn,e),Fn===null&&(Fn=e)):Qi()}function Qi(){I(kt,kt.current),I(kn,kn.current)}function An(e){$(kn),Fn===e&&(Fn=null),$(kt)}var kt=N(0);function Al(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||ku(i)||Au(i)))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 wi=0,He=null,st=null,Mt=null,Tl=!1,_s=!1,Lr=!1,Rl=0,pa=0,vs=null,_y=0;function bt(){throw Error(l(321))}function bc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!xn(e[i],t[i]))return!1;return!0}function Cc(e,t,i,a,g,w){return wi=w,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?Rd:Hc,Lr=!1,w=i(a,g),Lr=!1,_s&&(w=Kf(t,i,a,g)),Wf(e),w}function Wf(e){G.H=_a;var t=st!==null&&st.next!==null;if(wi=0,Mt=st=He=null,Tl=!1,pa=0,vs=null,t)throw Error(l(300));e===null||Lt||(e=e.dependencies,e!==null&&yl(e)&&(Lt=!0))}function Kf(e,t,i,a){He=e;var g=0;do{if(_s&&(vs=null),pa=0,_s=!1,25<=g)throw Error(l(301));if(g+=1,Mt=st=null,e.updateQueue!=null){var w=e.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}G.H=Dd,w=t(i,a)}while(_s);return w}function vy(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?ma(t):t,e=e.useState()[0],(st!==null?st.memoizedState:null)!==e&&(He.flags|=1024),t}function wc(){var e=Rl!==0;return Rl=0,e}function xc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Ec(e){if(Tl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Tl=!1}wi=0,Mt=st=He=null,_s=!1,pa=Rl=0,vs=null}function sn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?He.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function At(){if(st===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=st.next;var t=Mt===null?He.memoizedState:Mt.next;if(t!==null)Mt=t,st=e;else{if(e===null)throw He.alternate===null?Error(l(467)):Error(l(310));st=e,e={memoizedState:st.memoizedState,baseState:st.baseState,baseQueue:st.baseQueue,queue:st.queue,next:null},Mt===null?He.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function Dl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ma(e){var t=pa;return pa+=1,vs===null&&(vs=[]),e=zf(vs,e,t),t=He,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?Rd:Hc),e}function Ml(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ma(e);if(e.$$typeof===y)return Wt(e)}throw Error(l(438,String(e)))}function kc(e){var t=null,i=He.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var a=He.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(g){return g.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Dl(),He.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),a=0;a<e;a++)i[a]=j;return t.index++,i}function xi(e,t){return typeof t=="function"?t(e):t}function Ll(e){var t=At();return Ac(t,st,e)}function Ac(e,t,i){var a=e.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=i;var g=e.baseQueue,w=a.pending;if(w!==null){if(g!==null){var B=g.next;g.next=w.next,w.next=B}t.baseQueue=g=w,a.pending=null}if(w=e.baseState,g===null)e.memoizedState=w;else{t=g.next;var P=B=null,X=null,le=t,fe=!1;do{var _e=le.lane&-536870913;if(_e!==le.lane?(Ve&_e)===_e:(wi&_e)===_e){var oe=le.revertLane;if(oe===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),_e===fs&&(fe=!0);else if((wi&oe)===oe){le=le.next,oe===fs&&(fe=!0);continue}else _e={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},X===null?(P=X=_e,B=w):X=X.next=_e,He.lanes|=oe,er|=oe;_e=le.action,Lr&&i(w,_e),w=le.hasEagerState?le.eagerState:i(w,_e)}else oe={lane:_e,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},X===null?(P=X=oe,B=w):X=X.next=oe,He.lanes|=_e,er|=_e;le=le.next}while(le!==null&&le!==t);if(X===null?B=w:X.next=P,!xn(w,e.memoizedState)&&(Lt=!0,fe&&(i=ds,i!==null)))throw i;e.memoizedState=w,e.baseState=B,e.baseQueue=X,a.lastRenderedState=w}return g===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Tc(e){var t=At(),i=t.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=e;var a=i.dispatch,g=i.pending,w=t.memoizedState;if(g!==null){i.pending=null;var B=g=g.next;do w=e(w,B.action),B=B.next;while(B!==g);xn(w,t.memoizedState)||(Lt=!0),t.memoizedState=w,t.baseQueue===null&&(t.baseState=w),i.lastRenderedState=w}return[w,a]}function Yf(e,t,i){var a=He,g=At(),w=Ye;if(w){if(i===void 0)throw Error(l(407));i=i()}else i=t();var B=!xn((st||g).memoizedState,i);if(B&&(g.memoizedState=i,Lt=!0),g=g.queue,Mc(Jf.bind(null,a,g,e),[e]),g.getSnapshot!==t||B||Mt!==null&&Mt.memoizedState.tag&1){if(a.flags|=2048,ys(9,{destroy:void 0},Qf.bind(null,a,g,i,t),null),ct===null)throw Error(l(349));w||(wi&127)!==0||Xf(a,t,i)}return i}function Xf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=He.updateQueue,t===null?(t=Dl(),He.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Qf(e,t,i,a){t.value=i,t.getSnapshot=a,Zf(t)&&ed(e)}function Jf(e,t,i){return i(function(){Zf(t)&&ed(e)})}function Zf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!xn(e,i)}catch{return!0}}function ed(e){var t=wr(e,2);t!==null&&gn(t,e,2)}function Rc(e){var t=sn();if(typeof e=="function"){var i=e;if(e=i(),Lr){Nt(!0);try{i()}finally{Nt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:e},t}function td(e,t,i,a){return e.baseState=i,Ac(e,st,typeof a=="function"?a:xi)}function yy(e,t,i,a,g){if(jl(e))throw Error(l(485));if(e=t.action,e!==null){var w={payload:g,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(B){w.listeners.push(B)}};G.T!==null?i(!0):w.isTransition=!1,a(w),i=t.pending,i===null?(w.next=t.pending=w,nd(t,w)):(w.next=i.next,t.pending=i.next=w)}}function nd(e,t){var i=t.action,a=t.payload,g=e.state;if(t.isTransition){var w=G.T,B={};G.T=B;try{var P=i(g,a),X=G.S;X!==null&&X(B,P),id(e,t,P)}catch(le){Dc(e,t,le)}finally{w!==null&&B.types!==null&&(w.types=B.types),G.T=w}}else try{w=i(g,a),id(e,t,w)}catch(le){Dc(e,t,le)}}function id(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(a){rd(e,t,a)},function(a){return Dc(e,t,a)}):rd(e,t,i)}function rd(e,t,i){t.status="fulfilled",t.value=i,sd(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,nd(e,i)))}function Dc(e,t,i){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=i,sd(t),t=t.next;while(t!==a)}e.action=null}function sd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ad(e,t){return t}function ld(e,t){if(Ye){var i=ct.formState;if(i!==null){e:{var a=He;if(Ye){if(dt){t:{for(var g=dt,w=Pn;g.nodeType!==8;){if(!w){g=null;break t}if(g=qn(g.nextSibling),g===null){g=null;break t}}w=g.data,g=w==="F!"||w==="F"?g:null}if(g){dt=qn(g.nextSibling),a=g.data==="F!";break e}}Gi(a)}a=!1}a&&(t=i[0])}}return i=sn(),i.memoizedState=i.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ad,lastRenderedState:t},i.queue=a,i=kd.bind(null,He,a),a.dispatch=i,a=Rc(!1),w=Nc.bind(null,He,!1,a.queue),a=sn(),g={state:t,dispatch:null,action:e,pending:null},a.queue=g,i=yy.bind(null,He,g,w,i),g.dispatch=i,a.memoizedState=e,[t,i,!1]}function od(e){var t=At();return cd(t,st,e)}function cd(e,t,i){if(t=Ac(e,t,ad)[0],e=Ll(xi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=ma(t)}catch(B){throw B===ps?Cl:B}else a=t;t=At();var g=t.queue,w=g.dispatch;return i!==t.memoizedState&&(He.flags|=2048,ys(9,{destroy:void 0},Sy.bind(null,g,i),null)),[a,w,e]}function Sy(e,t){e.action=t}function ud(e){var t=At(),i=st;if(i!==null)return cd(t,i,e);At(),t=t.memoizedState,i=At();var a=i.queue.dispatch;return i.memoizedState=e,[t,a,!1]}function ys(e,t,i,a){return e={tag:e,create:i,deps:a,inst:t,next:null},t=He.updateQueue,t===null&&(t=Dl(),He.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(a=i.next,i.next=e,e.next=a,t.lastEffect=e),e}function hd(){return At().memoizedState}function Ol(e,t,i,a){var g=sn();He.flags|=e,g.memoizedState=ys(1|t,{destroy:void 0},i,a===void 0?null:a)}function Bl(e,t,i,a){var g=At();a=a===void 0?null:a;var w=g.memoizedState.inst;st!==null&&a!==null&&bc(a,st.memoizedState.deps)?g.memoizedState=ys(t,w,i,a):(He.flags|=e,g.memoizedState=ys(1|t,w,i,a))}function fd(e,t){Ol(8390656,8,e,t)}function Mc(e,t){Bl(2048,8,e,t)}function by(e){He.flags|=4;var t=He.updateQueue;if(t===null)t=Dl(),He.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function dd(e){var t=At().memoizedState;return by({ref:t,nextImpl:e}),function(){if((et&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function pd(e,t){return Bl(4,2,e,t)}function md(e,t){return Bl(4,4,e,t)}function gd(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function _d(e,t,i){i=i!=null?i.concat([e]):null,Bl(4,4,gd.bind(null,t,e),i)}function Lc(){}function vd(e,t){var i=At();t=t===void 0?null:t;var a=i.memoizedState;return t!==null&&bc(t,a[1])?a[0]:(i.memoizedState=[e,t],e)}function yd(e,t){var i=At();t=t===void 0?null:t;var a=i.memoizedState;if(t!==null&&bc(t,a[1]))return a[0];if(a=e(),Lr){Nt(!0);try{e()}finally{Nt(!1)}}return i.memoizedState=[a,t],a}function Oc(e,t,i){return i===void 0||(wi&1073741824)!==0&&(Ve&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Sp(),He.lanes|=e,er|=e,i)}function Sd(e,t,i,a){return xn(i,t)?i:gs.current!==null?(e=Oc(e,i,a),xn(e,t)||(Lt=!0),e):(wi&42)===0||(wi&1073741824)!==0&&(Ve&261930)===0?(Lt=!0,e.memoizedState=i):(e=Sp(),He.lanes|=e,er|=e,t)}function bd(e,t,i,a,g){var w=W.p;W.p=w!==0&&8>w?w:8;var B=G.T,P={};G.T=P,Nc(e,!1,t,i);try{var X=g(),le=G.S;if(le!==null&&le(P,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var fe=gy(X,a);ga(e,t,fe,Dn(e))}else ga(e,t,a,Dn(e))}catch(_e){ga(e,t,{then:function(){},status:"rejected",reason:_e},Dn())}finally{W.p=w,B!==null&&P.types!==null&&(B.types=P.types),G.T=B}}function Cy(){}function Bc(e,t,i,a){if(e.tag!==5)throw Error(l(476));var g=Cd(e).queue;bd(e,g,t,Z,i===null?Cy:function(){return wd(e),i(a)})}function Cd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:Z},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function wd(e){var t=Cd(e);t.next===null&&(t=e.alternate.memoizedState),ga(e,t.next.queue,{},Dn())}function jc(){return Wt(Oa)}function xd(){return At().memoizedState}function Ed(){return At().memoizedState}function wy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Dn();e=Ki(i);var a=Yi(t,e,i);a!==null&&(gn(a,t,i),ha(a,t,i)),t={cache:uc()},e.payload=t;return}t=t.return}}function xy(e,t,i){var a=Dn();i={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},jl(e)?Ad(t,i):(i=Zo(e,t,i,a),i!==null&&(gn(i,e,a),Td(i,t,a)))}function kd(e,t,i){var a=Dn();ga(e,t,i,a)}function ga(e,t,i,a){var g={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(jl(e))Ad(t,g);else{var w=e.alternate;if(e.lanes===0&&(w===null||w.lanes===0)&&(w=t.lastRenderedReducer,w!==null))try{var B=t.lastRenderedState,P=w(B,i);if(g.hasEagerState=!0,g.eagerState=P,xn(P,B))return ml(e,t,g,0),ct===null&&pl(),!1}catch{}finally{}if(i=Zo(e,t,g,a),i!==null)return gn(i,e,a),Td(i,t,a),!0}return!1}function Nc(e,t,i,a){if(a={lane:2,revertLane:pu(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},jl(e)){if(t)throw Error(l(479))}else t=Zo(e,i,a,2),t!==null&&gn(t,e,2)}function jl(e){var t=e.alternate;return e===He||t!==null&&t===He}function Ad(e,t){_s=Tl=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Td(e,t,i){if((i&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,i|=a,t.lanes=i,mi(e,i)}}var _a={readContext:Wt,use:Ml,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useLayoutEffect:bt,useInsertionEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useSyncExternalStore:bt,useId:bt,useHostTransitionStatus:bt,useFormState:bt,useActionState:bt,useOptimistic:bt,useMemoCache:bt,useCacheRefresh:bt};_a.useEffectEvent=bt;var Rd={readContext:Wt,use:Ml,useCallback:function(e,t){return sn().memoizedState=[e,t===void 0?null:t],e},useContext:Wt,useEffect:fd,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Ol(4194308,4,gd.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Ol(4194308,4,e,t)},useInsertionEffect:function(e,t){Ol(4,2,e,t)},useMemo:function(e,t){var i=sn();t=t===void 0?null:t;var a=e();if(Lr){Nt(!0);try{e()}finally{Nt(!1)}}return i.memoizedState=[a,t],a},useReducer:function(e,t,i){var a=sn();if(i!==void 0){var g=i(t);if(Lr){Nt(!0);try{i(t)}finally{Nt(!1)}}}else g=t;return a.memoizedState=a.baseState=g,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:g},a.queue=e,e=e.dispatch=xy.bind(null,He,e),[a.memoizedState,e]},useRef:function(e){var t=sn();return e={current:e},t.memoizedState=e},useState:function(e){e=Rc(e);var t=e.queue,i=kd.bind(null,He,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Lc,useDeferredValue:function(e,t){var i=sn();return Oc(i,e,t)},useTransition:function(){var e=Rc(!1);return e=bd.bind(null,He,e.queue,!0,!1),sn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var a=He,g=sn();if(Ye){if(i===void 0)throw Error(l(407));i=i()}else{if(i=t(),ct===null)throw Error(l(349));(Ve&127)!==0||Xf(a,t,i)}g.memoizedState=i;var w={value:i,getSnapshot:t};return g.queue=w,fd(Jf.bind(null,a,w,e),[e]),a.flags|=2048,ys(9,{destroy:void 0},Qf.bind(null,a,w,i,t),null),i},useId:function(){var e=sn(),t=ct.identifierPrefix;if(Ye){var i=ci,a=oi;i=(a&~(1<<32-Qe(a)-1)).toString(32)+i,t="_"+t+"R_"+i,i=Rl++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=_y++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:jc,useFormState:ld,useActionState:ld,useOptimistic:function(e){var t=sn();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Nc.bind(null,He,!0,i),i.dispatch=t,[e,t]},useMemoCache:kc,useCacheRefresh:function(){return sn().memoizedState=wy.bind(null,He)},useEffectEvent:function(e){var t=sn(),i={impl:e};return t.memoizedState=i,function(){if((et&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Hc={readContext:Wt,use:Ml,useCallback:vd,useContext:Wt,useEffect:Mc,useImperativeHandle:_d,useInsertionEffect:pd,useLayoutEffect:md,useMemo:yd,useReducer:Ll,useRef:hd,useState:function(){return Ll(xi)},useDebugValue:Lc,useDeferredValue:function(e,t){var i=At();return Sd(i,st.memoizedState,e,t)},useTransition:function(){var e=Ll(xi)[0],t=At().memoizedState;return[typeof e=="boolean"?e:ma(e),t]},useSyncExternalStore:Yf,useId:xd,useHostTransitionStatus:jc,useFormState:od,useActionState:od,useOptimistic:function(e,t){var i=At();return td(i,st,e,t)},useMemoCache:kc,useCacheRefresh:Ed};Hc.useEffectEvent=dd;var Dd={readContext:Wt,use:Ml,useCallback:vd,useContext:Wt,useEffect:Mc,useImperativeHandle:_d,useInsertionEffect:pd,useLayoutEffect:md,useMemo:yd,useReducer:Tc,useRef:hd,useState:function(){return Tc(xi)},useDebugValue:Lc,useDeferredValue:function(e,t){var i=At();return st===null?Oc(i,e,t):Sd(i,st.memoizedState,e,t)},useTransition:function(){var e=Tc(xi)[0],t=At().memoizedState;return[typeof e=="boolean"?e:ma(e),t]},useSyncExternalStore:Yf,useId:xd,useHostTransitionStatus:jc,useFormState:ud,useActionState:ud,useOptimistic:function(e,t){var i=At();return st!==null?td(i,st,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:kc,useCacheRefresh:Ed};Dd.useEffectEvent=dd;function zc(e,t,i,a){t=e.memoizedState,i=i(a,t),i=i==null?t:u({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Ic={enqueueSetState:function(e,t,i){e=e._reactInternals;var a=Dn(),g=Ki(a);g.payload=t,i!=null&&(g.callback=i),t=Yi(e,g,a),t!==null&&(gn(t,e,a),ha(t,e,a))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var a=Dn(),g=Ki(a);g.tag=1,g.payload=t,i!=null&&(g.callback=i),t=Yi(e,g,a),t!==null&&(gn(t,e,a),ha(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Dn(),a=Ki(i);a.tag=2,t!=null&&(a.callback=t),t=Yi(e,a,i),t!==null&&(gn(t,e,i),ha(t,e,i))}};function Md(e,t,i,a,g,w,B){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,w,B):t.prototype&&t.prototype.isPureReactComponent?!ia(i,a)||!ia(g,w):!0}function Ld(e,t,i,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,a),t.state!==e&&Ic.enqueueReplaceState(t,t.state,null)}function Or(e,t){var i=t;if("ref"in t){i={};for(var a in t)a!=="ref"&&(i[a]=t[a])}if(e=e.defaultProps){i===t&&(i=u({},i));for(var g in e)i[g]===void 0&&(i[g]=e[g])}return i}function Od(e){dl(e)}function Bd(e){console.error(e)}function jd(e){dl(e)}function Nl(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Nd(e,t,i){try{var a=e.onCaughtError;a(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Uc(e,t,i){return i=Ki(i),i.tag=3,i.payload={element:null},i.callback=function(){Nl(e,t)},i}function Hd(e){return e=Ki(e),e.tag=3,e}function zd(e,t,i,a){var g=i.type.getDerivedStateFromError;if(typeof g=="function"){var w=a.value;e.payload=function(){return g(w)},e.callback=function(){Nd(t,i,a)}}var B=i.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(e.callback=function(){Nd(t,i,a),typeof g!="function"&&(tr===null?tr=new Set([this]):tr.add(this));var P=a.stack;this.componentDidCatch(a.value,{componentStack:P!==null?P:""})})}function Ey(e,t,i,a,g){if(i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=i.alternate,t!==null&&hs(t,i,g,!0),i=kn.current,i!==null){switch(i.tag){case 31:case 13:return Fn===null?Kl():i.alternate===null&&Ct===0&&(Ct=3),i.flags&=-257,i.flags|=65536,i.lanes=g,a===wl?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([a]):t.add(a),hu(e,a,g)),!1;case 22:return i.flags|=65536,a===wl?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([a]):i.add(a)),hu(e,a,g)),!1}throw Error(l(435,i.tag))}return hu(e,a,g),Kl(),!1}if(Ye)return t=kn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=g,a!==sc&&(e=Error(l(422),{cause:a}),aa(zn(e,i)))):(a!==sc&&(t=Error(l(423),{cause:a}),aa(zn(t,i))),e=e.current.alternate,e.flags|=65536,g&=-g,e.lanes|=g,a=zn(a,i),g=Uc(e.stateNode,a,g),gc(e,g),Ct!==4&&(Ct=2)),!1;var w=Error(l(520),{cause:a});if(w=zn(w,i),Ea===null?Ea=[w]:Ea.push(w),Ct!==4&&(Ct=2),t===null)return!0;a=zn(a,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=g&-g,i.lanes|=e,e=Uc(i.stateNode,a,e),gc(i,e),!1;case 1:if(t=i.type,w=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(tr===null||!tr.has(w))))return i.flags|=65536,g&=-g,i.lanes|=g,g=Hd(g),zd(g,e,i,a),gc(i,g),!1}i=i.return}while(i!==null);return!1}var Pc=Error(l(461)),Lt=!1;function Kt(e,t,i,a){t.child=e===null?Ff(t,null,i,a):Mr(t,e.child,i,a)}function Id(e,t,i,a,g){i=i.render;var w=t.ref;if("ref"in a){var B={};for(var P in a)P!=="ref"&&(B[P]=a[P])}else B=a;return Ar(t),a=Cc(e,t,i,B,w,g),P=wc(),e!==null&&!Lt?(xc(e,t,g),Ei(e,t,g)):(Ye&&P&&ic(t),t.flags|=1,Kt(e,t,a,g),t.child)}function Ud(e,t,i,a,g){if(e===null){var w=i.type;return typeof w=="function"&&!ec(w)&&w.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=w,Pd(e,t,w,a,g)):(e=_l(i.type,null,a,t,t.mode,g),e.ref=t.ref,e.return=t,t.child=e)}if(w=e.child,!Yc(e,g)){var B=w.memoizedProps;if(i=i.compare,i=i!==null?i:ia,i(B,a)&&e.ref===t.ref)return Ei(e,t,g)}return t.flags|=1,e=yi(w,a),e.ref=t.ref,e.return=t,t.child=e}function Pd(e,t,i,a,g){if(e!==null){var w=e.memoizedProps;if(ia(w,a)&&e.ref===t.ref)if(Lt=!1,t.pendingProps=a=w,Yc(e,g))(e.flags&131072)!==0&&(Lt=!0);else return t.lanes=e.lanes,Ei(e,t,g)}return Fc(e,t,i,a,g)}function Fd(e,t,i,a){var g=a.children,w=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(w=w!==null?w.baseLanes|i:i,e!==null){for(a=t.child=e.child,g=0;a!==null;)g=g|a.lanes|a.childLanes,a=a.sibling;a=g&~w}else a=0,t.child=null;return qd(e,t,w,i,a)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&bl(t,w!==null?w.cachePool:null),w!==null?Gf(t,w):vc(),Vf(t);else return a=t.lanes=536870912,qd(e,t,w!==null?w.baseLanes|i:i,i,a)}else w!==null?(bl(t,w.cachePool),Gf(t,w),Qi(),t.memoizedState=null):(e!==null&&bl(t,null),vc(),Qi());return Kt(e,t,g,i),t.child}function va(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function qd(e,t,i,a,g){var w=fc();return w=w===null?null:{parent:Dt._currentValue,pool:w},t.memoizedState={baseLanes:i,cachePool:w},e!==null&&bl(t,null),vc(),Vf(t),e!==null&&hs(e,t,a,!0),t.childLanes=g,null}function Hl(e,t){return t=Il({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function $d(e,t,i){return Mr(t,e.child,null,i),e=Hl(t,t.pendingProps),e.flags|=2,An(t),t.memoizedState=null,e}function ky(e,t,i){var a=t.pendingProps,g=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ye){if(a.mode==="hidden")return e=Hl(t,a),t.lanes=536870912,va(null,e);if(Sc(t),(e=dt)?(e=nm(e,Pn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi!==null?{id:oi,overflow:ci}:null,retryLane:536870912,hydrationErrors:null},i=Af(e),i.return=t,t.child=i,Vt=t,dt=null)):e=null,e===null)throw Gi(t);return t.lanes=536870912,null}return Hl(t,a)}var w=e.memoizedState;if(w!==null){var B=w.dehydrated;if(Sc(t),g)if(t.flags&256)t.flags&=-257,t=$d(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(Lt||hs(e,t,i,!1),g=(i&e.childLanes)!==0,Lt||g){if(a=ct,a!==null&&(B=Fr(a,i),B!==0&&B!==w.retryLane))throw w.retryLane=B,wr(e,B),gn(a,e,B),Pc;Kl(),t=$d(e,t,i)}else e=w.treeContext,dt=qn(B.nextSibling),Vt=t,Ye=!0,$i=null,Pn=!1,e!==null&&Df(t,e),t=Hl(t,a),t.flags|=4096;return t}return e=yi(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function zl(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Fc(e,t,i,a,g){return Ar(t),i=Cc(e,t,i,a,void 0,g),a=wc(),e!==null&&!Lt?(xc(e,t,g),Ei(e,t,g)):(Ye&&a&&ic(t),t.flags|=1,Kt(e,t,i,g),t.child)}function Gd(e,t,i,a,g,w){return Ar(t),t.updateQueue=null,i=Kf(t,a,i,g),Wf(e),a=wc(),e!==null&&!Lt?(xc(e,t,w),Ei(e,t,w)):(Ye&&a&&ic(t),t.flags|=1,Kt(e,t,i,w),t.child)}function Vd(e,t,i,a,g){if(Ar(t),t.stateNode===null){var w=ls,B=i.contextType;typeof B=="object"&&B!==null&&(w=Wt(B)),w=new i(a,w),t.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Ic,t.stateNode=w,w._reactInternals=t,w=t.stateNode,w.props=a,w.state=t.memoizedState,w.refs={},pc(t),B=i.contextType,w.context=typeof B=="object"&&B!==null?Wt(B):ls,w.state=t.memoizedState,B=i.getDerivedStateFromProps,typeof B=="function"&&(zc(t,i,B,a),w.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(B=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),B!==w.state&&Ic.enqueueReplaceState(w,w.state,null),da(t,a,w,g),fa(),w.state=t.memoizedState),typeof w.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){w=t.stateNode;var P=t.memoizedProps,X=Or(i,P);w.props=X;var le=w.context,fe=i.contextType;B=ls,typeof fe=="object"&&fe!==null&&(B=Wt(fe));var _e=i.getDerivedStateFromProps;fe=typeof _e=="function"||typeof w.getSnapshotBeforeUpdate=="function",P=t.pendingProps!==P,fe||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(P||le!==B)&&Ld(t,w,a,B),Wi=!1;var oe=t.memoizedState;w.state=oe,da(t,a,w,g),fa(),le=t.memoizedState,P||oe!==le||Wi?(typeof _e=="function"&&(zc(t,i,_e,a),le=t.memoizedState),(X=Wi||Md(t,i,X,a,oe,le,B))?(fe||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(t.flags|=4194308)):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=le),w.props=a,w.state=le,w.context=B,a=X):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{w=t.stateNode,mc(e,t),B=t.memoizedProps,fe=Or(i,B),w.props=fe,_e=t.pendingProps,oe=w.context,le=i.contextType,X=ls,typeof le=="object"&&le!==null&&(X=Wt(le)),P=i.getDerivedStateFromProps,(le=typeof P=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(B!==_e||oe!==X)&&Ld(t,w,a,X),Wi=!1,oe=t.memoizedState,w.state=oe,da(t,a,w,g),fa();var ce=t.memoizedState;B!==_e||oe!==ce||Wi||e!==null&&e.dependencies!==null&&yl(e.dependencies)?(typeof P=="function"&&(zc(t,i,P,a),ce=t.memoizedState),(fe=Wi||Md(t,i,fe,a,oe,ce,X)||e!==null&&e.dependencies!==null&&yl(e.dependencies))?(le||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(a,ce,X),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(a,ce,X)),typeof w.componentDidUpdate=="function"&&(t.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof w.componentDidUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=ce),w.props=a,w.state=ce,w.context=X,a=fe):(typeof w.componentDidUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(t.flags|=1024),a=!1)}return w=a,zl(e,t),a=(t.flags&128)!==0,w||a?(w=t.stateNode,i=a&&typeof i.getDerivedStateFromError!="function"?null:w.render(),t.flags|=1,e!==null&&a?(t.child=Mr(t,e.child,null,g),t.child=Mr(t,null,i,g)):Kt(e,t,i,g),t.memoizedState=w.state,e=t.child):e=Ei(e,t,g),e}function Wd(e,t,i,a){return Er(),t.flags|=256,Kt(e,t,i,a),t.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $c(e){return{baseLanes:e,cachePool:Nf()}}function Gc(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Rn),e}function Kd(e,t,i){var a=t.pendingProps,g=!1,w=(t.flags&128)!==0,B;if((B=w)||(B=e!==null&&e.memoizedState===null?!1:(kt.current&2)!==0),B&&(g=!0,t.flags&=-129),B=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ye){if(g?Xi(t):Qi(),(e=dt)?(e=nm(e,Pn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi!==null?{id:oi,overflow:ci}:null,retryLane:536870912,hydrationErrors:null},i=Af(e),i.return=t,t.child=i,Vt=t,dt=null)):e=null,e===null)throw Gi(t);return Au(e)?t.lanes=32:t.lanes=536870912,null}var P=a.children;return a=a.fallback,g?(Qi(),g=t.mode,P=Il({mode:"hidden",children:P},g),a=xr(a,g,i,null),P.return=t,a.return=t,P.sibling=a,t.child=P,a=t.child,a.memoizedState=$c(i),a.childLanes=Gc(e,B,i),t.memoizedState=qc,va(null,a)):(Xi(t),Vc(t,P))}var X=e.memoizedState;if(X!==null&&(P=X.dehydrated,P!==null)){if(w)t.flags&256?(Xi(t),t.flags&=-257,t=Wc(e,t,i)):t.memoizedState!==null?(Qi(),t.child=e.child,t.flags|=128,t=null):(Qi(),P=a.fallback,g=t.mode,a=Il({mode:"visible",children:a.children},g),P=xr(P,g,i,null),P.flags|=2,a.return=t,P.return=t,a.sibling=P,t.child=a,Mr(t,e.child,null,i),a=t.child,a.memoizedState=$c(i),a.childLanes=Gc(e,B,i),t.memoizedState=qc,t=va(null,a));else if(Xi(t),Au(P)){if(B=P.nextSibling&&P.nextSibling.dataset,B)var le=B.dgst;B=le,a=Error(l(419)),a.stack="",a.digest=B,aa({value:a,source:null,stack:null}),t=Wc(e,t,i)}else if(Lt||hs(e,t,i,!1),B=(i&e.childLanes)!==0,Lt||B){if(B=ct,B!==null&&(a=Fr(B,i),a!==0&&a!==X.retryLane))throw X.retryLane=a,wr(e,a),gn(B,e,a),Pc;ku(P)||Kl(),t=Wc(e,t,i)}else ku(P)?(t.flags|=192,t.child=e.child,t=null):(e=X.treeContext,dt=qn(P.nextSibling),Vt=t,Ye=!0,$i=null,Pn=!1,e!==null&&Df(t,e),t=Vc(t,a.children),t.flags|=4096);return t}return g?(Qi(),P=a.fallback,g=t.mode,X=e.child,le=X.sibling,a=yi(X,{mode:"hidden",children:a.children}),a.subtreeFlags=X.subtreeFlags&65011712,le!==null?P=yi(le,P):(P=xr(P,g,i,null),P.flags|=2),P.return=t,a.return=t,a.sibling=P,t.child=a,va(null,a),a=t.child,P=e.child.memoizedState,P===null?P=$c(i):(g=P.cachePool,g!==null?(X=Dt._currentValue,g=g.parent!==X?{parent:X,pool:X}:g):g=Nf(),P={baseLanes:P.baseLanes|i,cachePool:g}),a.memoizedState=P,a.childLanes=Gc(e,B,i),t.memoizedState=qc,va(e.child,a)):(Xi(t),i=e.child,e=i.sibling,i=yi(i,{mode:"visible",children:a.children}),i.return=t,i.sibling=null,e!==null&&(B=t.deletions,B===null?(t.deletions=[e],t.flags|=16):B.push(e)),t.child=i,t.memoizedState=null,i)}function Vc(e,t){return t=Il({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Il(e,t){return e=En(22,e,null,t),e.lanes=0,e}function Wc(e,t,i){return Mr(t,e.child,null,i),e=Vc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Yd(e,t,i){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),oc(e.return,t,i)}function Kc(e,t,i,a,g,w){var B=e.memoizedState;B===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:i,tailMode:g,treeForkCount:w}:(B.isBackwards=t,B.rendering=null,B.renderingStartTime=0,B.last=a,B.tail=i,B.tailMode=g,B.treeForkCount=w)}function Xd(e,t,i){var a=t.pendingProps,g=a.revealOrder,w=a.tail;a=a.children;var B=kt.current,P=(B&2)!==0;if(P?(B=B&1|2,t.flags|=128):B&=1,I(kt,B),Kt(e,t,a,i),a=Ye?sa:0,!P&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Yd(e,i,t);else if(e.tag===19)Yd(e,i,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(g){case"forwards":for(i=t.child,g=null;i!==null;)e=i.alternate,e!==null&&Al(e)===null&&(g=i),i=i.sibling;i=g,i===null?(g=t.child,t.child=null):(g=i.sibling,i.sibling=null),Kc(t,!1,g,i,w,a);break;case"backwards":case"unstable_legacy-backwards":for(i=null,g=t.child,t.child=null;g!==null;){if(e=g.alternate,e!==null&&Al(e)===null){t.child=g;break}e=g.sibling,g.sibling=i,i=g,g=e}Kc(t,!0,i,null,w,a);break;case"together":Kc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Ei(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),er|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(hs(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,i=yi(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=yi(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Yc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&yl(e)))}function Ay(e,t,i){switch(t.tag){case 3:q(t,t.stateNode.containerInfo),Vi(t,Dt,e.memoizedState.cache),Er();break;case 27:case 5:se(t);break;case 4:q(t,t.stateNode.containerInfo);break;case 10:Vi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Sc(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Xi(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Kd(e,t,i):(Xi(t),e=Ei(e,t,i),e!==null?e.sibling:null);Xi(t);break;case 19:var g=(e.flags&128)!==0;if(a=(i&t.childLanes)!==0,a||(hs(e,t,i,!1),a=(i&t.childLanes)!==0),g){if(a)return Xd(e,t,i);t.flags|=128}if(g=t.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),I(kt,kt.current),a)break;return null;case 22:return t.lanes=0,Fd(e,t,i,t.pendingProps);case 24:Vi(t,Dt,e.memoizedState.cache)}return Ei(e,t,i)}function Qd(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Lt=!0;else{if(!Yc(e,i)&&(t.flags&128)===0)return Lt=!1,Ay(e,t,i);Lt=(e.flags&131072)!==0}else Lt=!1,Ye&&(t.flags&1048576)!==0&&Rf(t,sa,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Rr(t.elementType),t.type=e,typeof e=="function")ec(e)?(a=Or(e,a),t.tag=1,t=Vd(null,t,e,a,i)):(t.tag=0,t=Fc(null,t,e,a,i));else{if(e!=null){var g=e.$$typeof;if(g===A){t.tag=11,t=Id(null,t,e,a,i);break e}else if(g===R){t.tag=14,t=Ud(null,t,e,a,i);break e}}throw t=K(e)||e,Error(l(306,t,""))}}return t;case 0:return Fc(e,t,t.type,t.pendingProps,i);case 1:return a=t.type,g=Or(a,t.pendingProps),Vd(e,t,a,g,i);case 3:e:{if(q(t,t.stateNode.containerInfo),e===null)throw Error(l(387));a=t.pendingProps;var w=t.memoizedState;g=w.element,mc(e,t),da(t,a,null,i);var B=t.memoizedState;if(a=B.cache,Vi(t,Dt,a),a!==w.cache&&cc(t,[Dt],i,!0),fa(),a=B.element,w.isDehydrated)if(w={element:a,isDehydrated:!1,cache:B.cache},t.updateQueue.baseState=w,t.memoizedState=w,t.flags&256){t=Wd(e,t,a,i);break e}else if(a!==g){g=zn(Error(l(424)),t),aa(g),t=Wd(e,t,a,i);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(dt=qn(e.firstChild),Vt=t,Ye=!0,$i=null,Pn=!0,i=Ff(t,null,a,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Er(),a===g){t=Ei(e,t,i);break e}Kt(e,t,a,i)}t=t.child}return t;case 26:return zl(e,t),e===null?(i=om(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ye||(i=t.type,e=t.pendingProps,a=to(ge.current).createElement(i),a[Tt]=t,a[qt]=e,Yt(a,i,e),ot(a),t.stateNode=a):t.memoizedState=om(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return se(t),e===null&&Ye&&(a=t.stateNode=sm(t.type,t.pendingProps,ge.current),Vt=t,Pn=!0,g=dt,sr(t.type)?(Tu=g,dt=qn(a.firstChild)):dt=g),Kt(e,t,t.pendingProps.children,i),zl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ye&&((g=a=dt)&&(a=i0(a,t.type,t.pendingProps,Pn),a!==null?(t.stateNode=a,Vt=t,dt=qn(a.firstChild),Pn=!1,g=!0):g=!1),g||Gi(t)),se(t),g=t.type,w=t.pendingProps,B=e!==null?e.memoizedProps:null,a=w.children,wu(g,w)?a=null:B!==null&&wu(g,B)&&(t.flags|=32),t.memoizedState!==null&&(g=Cc(e,t,vy,null,null,i),Oa._currentValue=g),zl(e,t),Kt(e,t,a,i),t.child;case 6:return e===null&&Ye&&((e=i=dt)&&(i=r0(i,t.pendingProps,Pn),i!==null?(t.stateNode=i,Vt=t,dt=null,e=!0):e=!1),e||Gi(t)),null;case 13:return Kd(e,t,i);case 4:return q(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Mr(t,null,a,i):Kt(e,t,a,i),t.child;case 11:return Id(e,t,t.type,t.pendingProps,i);case 7:return Kt(e,t,t.pendingProps,i),t.child;case 8:return Kt(e,t,t.pendingProps.children,i),t.child;case 12:return Kt(e,t,t.pendingProps.children,i),t.child;case 10:return a=t.pendingProps,Vi(t,t.type,a.value),Kt(e,t,a.children,i),t.child;case 9:return g=t.type._context,a=t.pendingProps.children,Ar(t),g=Wt(g),a=a(g),t.flags|=1,Kt(e,t,a,i),t.child;case 14:return Ud(e,t,t.type,t.pendingProps,i);case 15:return Pd(e,t,t.type,t.pendingProps,i);case 19:return Xd(e,t,i);case 31:return ky(e,t,i);case 22:return Fd(e,t,i,t.pendingProps);case 24:return Ar(t),a=Wt(Dt),e===null?(g=fc(),g===null&&(g=ct,w=uc(),g.pooledCache=w,w.refCount++,w!==null&&(g.pooledCacheLanes|=i),g=w),t.memoizedState={parent:a,cache:g},pc(t),Vi(t,Dt,g)):((e.lanes&i)!==0&&(mc(e,t),da(t,null,null,i),fa()),g=e.memoizedState,w=t.memoizedState,g.parent!==a?(g={parent:a,cache:a},t.memoizedState=g,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=g),Vi(t,Dt,a)):(a=w.cache,Vi(t,Dt,a),a!==g.cache&&cc(t,[Dt],i,!0))),Kt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function ki(e){e.flags|=4}function Xc(e,t,i,a,g){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(g&335544128)===g)if(e.stateNode.complete)e.flags|=8192;else if(xp())e.flags|=8192;else throw Dr=wl,dc}else e.flags&=-16777217}function Jd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!dm(t))if(xp())e.flags|=8192;else throw Dr=wl,dc}function Ul(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Qt():536870912,e.lanes|=t,ws|=t)}function ya(e,t){if(!Ye)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function pt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,a=0;if(t)for(var g=e.child;g!==null;)i|=g.lanes|g.childLanes,a|=g.subtreeFlags&65011712,a|=g.flags&65011712,g.return=e,g=g.sibling;else for(g=e.child;g!==null;)i|=g.lanes|g.childLanes,a|=g.subtreeFlags,a|=g.flags,g.return=e,g=g.sibling;return e.subtreeFlags|=a,e.childLanes=i,t}function Ty(e,t,i){var a=t.pendingProps;switch(rc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pt(t),null;case 1:return pt(t),null;case 3:return i=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ci(Dt),ee(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(us(t)?ki(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ac())),pt(t),null;case 26:var g=t.type,w=t.memoizedState;return e===null?(ki(t),w!==null?(pt(t),Jd(t,w)):(pt(t),Xc(t,g,null,a,i))):w?w!==e.memoizedState?(ki(t),pt(t),Jd(t,w)):(pt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&ki(t),pt(t),Xc(t,g,e,a,i)),null;case 27:if(we(t),i=ge.current,g=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ki(t);else{if(!a){if(t.stateNode===null)throw Error(l(166));return pt(t),null}e=re.current,us(t)?Mf(t):(e=sm(g,a,i),t.stateNode=e,ki(t))}return pt(t),null;case 5:if(we(t),g=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ki(t);else{if(!a){if(t.stateNode===null)throw Error(l(166));return pt(t),null}if(w=re.current,us(t))Mf(t);else{var B=to(ge.current);switch(w){case 1:w=B.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:w=B.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":w=B.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":w=B.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":w=B.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof a.is=="string"?B.createElement("select",{is:a.is}):B.createElement("select"),a.multiple?w.multiple=!0:a.size&&(w.size=a.size);break;default:w=typeof a.is=="string"?B.createElement(g,{is:a.is}):B.createElement(g)}}w[Tt]=t,w[qt]=a;e:for(B=t.child;B!==null;){if(B.tag===5||B.tag===6)w.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===t)break e;for(;B.sibling===null;){if(B.return===null||B.return===t)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}t.stateNode=w;e:switch(Yt(w,g,a),g){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ki(t)}}return pt(t),Xc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&ki(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(l(166));if(e=ge.current,us(t)){if(e=t.stateNode,i=t.memoizedProps,a=null,g=Vt,g!==null)switch(g.tag){case 27:case 5:a=g.memoizedProps}e[Tt]=t,e=!!(e.nodeValue===i||a!==null&&a.suppressHydrationWarning===!0||Kp(e.nodeValue,i)),e||Gi(t,!0)}else e=to(e).createTextNode(a),e[Tt]=t,t.stateNode=e}return pt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(a=us(t),i!==null){if(e===null){if(!a)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[Tt]=t}else Er(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pt(t),e=!1}else i=ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(An(t),t):(An(t),null);if((t.flags&128)!==0)throw Error(l(558))}return pt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(g=us(t),a!==null&&a.dehydrated!==null){if(e===null){if(!g)throw Error(l(318));if(g=t.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(l(317));g[Tt]=t}else Er(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pt(t),g=!1}else g=ac(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=g),g=!0;if(!g)return t.flags&256?(An(t),t):(An(t),null)}return An(t),(t.flags&128)!==0?(t.lanes=i,t):(i=a!==null,e=e!==null&&e.memoizedState!==null,i&&(a=t.child,g=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(g=a.alternate.memoizedState.cachePool.pool),w=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(w=a.memoizedState.cachePool.pool),w!==g&&(a.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Ul(t,t.updateQueue),pt(t),null);case 4:return ee(),e===null&&vu(t.stateNode.containerInfo),pt(t),null;case 10:return Ci(t.type),pt(t),null;case 19:if($(kt),a=t.memoizedState,a===null)return pt(t),null;if(g=(t.flags&128)!==0,w=a.rendering,w===null)if(g)ya(a,!1);else{if(Ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(w=Al(e),w!==null){for(t.flags|=128,ya(a,!1),e=w.updateQueue,t.updateQueue=e,Ul(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)kf(i,e),i=i.sibling;return I(kt,kt.current&1|2),Ye&&Si(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&tt()>Gl&&(t.flags|=128,g=!0,ya(a,!1),t.lanes=4194304)}else{if(!g)if(e=Al(w),e!==null){if(t.flags|=128,g=!0,e=e.updateQueue,t.updateQueue=e,Ul(t,e),ya(a,!0),a.tail===null&&a.tailMode==="hidden"&&!w.alternate&&!Ye)return pt(t),null}else 2*tt()-a.renderingStartTime>Gl&&i!==536870912&&(t.flags|=128,g=!0,ya(a,!1),t.lanes=4194304);a.isBackwards?(w.sibling=t.child,t.child=w):(e=a.last,e!==null?e.sibling=w:t.child=w,a.last=w)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=tt(),e.sibling=null,i=kt.current,I(kt,g?i&1|2:i&1),Ye&&Si(t,a.treeForkCount),e):(pt(t),null);case 22:case 23:return An(t),yc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(i&536870912)!==0&&(t.flags&128)===0&&(pt(t),t.subtreeFlags&6&&(t.flags|=8192)):pt(t),i=t.updateQueue,i!==null&&Ul(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==i&&(t.flags|=2048),e!==null&&$(Tr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Ci(Dt),pt(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function Ry(e,t){switch(rc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ci(Dt),ee(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return we(t),null;case 31:if(t.memoizedState!==null){if(An(t),t.alternate===null)throw Error(l(340));Er()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(An(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));Er()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(kt),null;case 4:return ee(),null;case 10:return Ci(t.type),null;case 22:case 23:return An(t),yc(),e!==null&&$(Tr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ci(Dt),null;case 25:return null;default:return null}}function Zd(e,t){switch(rc(t),t.tag){case 3:Ci(Dt),ee();break;case 26:case 27:case 5:we(t);break;case 4:ee();break;case 31:t.memoizedState!==null&&An(t);break;case 13:An(t);break;case 19:$(kt);break;case 10:Ci(t.type);break;case 22:case 23:An(t),yc(),e!==null&&$(Tr);break;case 24:Ci(Dt)}}function Sa(e,t){try{var i=t.updateQueue,a=i!==null?i.lastEffect:null;if(a!==null){var g=a.next;i=g;do{if((i.tag&e)===e){a=void 0;var w=i.create,B=i.inst;a=w(),B.destroy=a}i=i.next}while(i!==g)}}catch(P){it(t,t.return,P)}}function Ji(e,t,i){try{var a=t.updateQueue,g=a!==null?a.lastEffect:null;if(g!==null){var w=g.next;a=w;do{if((a.tag&e)===e){var B=a.inst,P=B.destroy;if(P!==void 0){B.destroy=void 0,g=t;var X=i,le=P;try{le()}catch(fe){it(g,X,fe)}}}a=a.next}while(a!==w)}}catch(fe){it(t,t.return,fe)}}function ep(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{$f(t,i)}catch(a){it(e,e.return,a)}}}function tp(e,t,i){i.props=Or(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(a){it(e,t,a)}}function ba(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof i=="function"?e.refCleanup=i(a):i.current=a}}catch(g){it(e,t,g)}}function ui(e,t){var i=e.ref,a=e.refCleanup;if(i!==null)if(typeof a=="function")try{a()}catch(g){it(e,t,g)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(g){it(e,t,g)}else i.current=null}function np(e){var t=e.type,i=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&a.focus();break e;case"img":i.src?a.src=i.src:i.srcSet&&(a.srcset=i.srcSet)}}catch(g){it(e,e.return,g)}}function Qc(e,t,i){try{var a=e.stateNode;Qy(a,e.type,i,t),a[qt]=t}catch(g){it(e,e.return,g)}}function ip(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&sr(e.type)||e.tag===4}function Jc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ip(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&&sr(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 Zc(e,t,i){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Jt));else if(a!==4&&(a===27&&sr(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Zc(e,t,i),e=e.sibling;e!==null;)Zc(e,t,i),e=e.sibling}function Pl(e,t,i){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(a!==4&&(a===27&&sr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Pl(e,t,i),e=e.sibling;e!==null;)Pl(e,t,i),e=e.sibling}function rp(e){var t=e.stateNode,i=e.memoizedProps;try{for(var a=e.type,g=t.attributes;g.length;)t.removeAttributeNode(g[0]);Yt(t,a,i),t[Tt]=e,t[qt]=i}catch(w){it(e,e.return,w)}}var Ai=!1,Ot=!1,eu=!1,sp=typeof WeakSet=="function"?WeakSet:Set,Ut=null;function Dy(e,t){if(e=e.containerInfo,bu=oo,e=_f(e),Wo(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var a=i.getSelection&&i.getSelection();if(a&&a.rangeCount!==0){i=a.anchorNode;var g=a.anchorOffset,w=a.focusNode;a=a.focusOffset;try{i.nodeType,w.nodeType}catch{i=null;break e}var B=0,P=-1,X=-1,le=0,fe=0,_e=e,oe=null;t:for(;;){for(var ce;_e!==i||g!==0&&_e.nodeType!==3||(P=B+g),_e!==w||a!==0&&_e.nodeType!==3||(X=B+a),_e.nodeType===3&&(B+=_e.nodeValue.length),(ce=_e.firstChild)!==null;)oe=_e,_e=ce;for(;;){if(_e===e)break t;if(oe===i&&++le===g&&(P=B),oe===w&&++fe===a&&(X=B),(ce=_e.nextSibling)!==null)break;_e=oe,oe=_e.parentNode}_e=ce}i=P===-1||X===-1?null:{start:P,end:X}}else i=null}i=i||{start:0,end:0}}else i=null;for(Cu={focusedElem:e,selectionRange:i},oo=!1,Ut=t;Ut!==null;)if(t=Ut,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ut=e;else for(;Ut!==null;){switch(t=Ut,w=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(i=0;i<e.length;i++)g=e[i],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&w!==null){e=void 0,i=t,g=w.memoizedProps,w=w.memoizedState,a=i.stateNode;try{var Ee=Or(i.type,g);e=a.getSnapshotBeforeUpdate(Ee,w),a.__reactInternalSnapshotBeforeUpdate=e}catch(Oe){it(i,i.return,Oe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)Eu(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Eu(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(l(163))}if(e=t.sibling,e!==null){e.return=t.return,Ut=e;break}Ut=t.return}}function ap(e,t,i){var a=i.flags;switch(i.tag){case 0:case 11:case 15:Ri(e,i),a&4&&Sa(5,i);break;case 1:if(Ri(e,i),a&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(B){it(i,i.return,B)}else{var g=Or(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(g,t,e.__reactInternalSnapshotBeforeUpdate)}catch(B){it(i,i.return,B)}}a&64&&ep(i),a&512&&ba(i,i.return);break;case 3:if(Ri(e,i),a&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{$f(e,t)}catch(B){it(i,i.return,B)}}break;case 27:t===null&&a&4&&rp(i);case 26:case 5:Ri(e,i),t===null&&a&4&&np(i),a&512&&ba(i,i.return);break;case 12:Ri(e,i);break;case 31:Ri(e,i),a&4&&cp(e,i);break;case 13:Ri(e,i),a&4&&up(e,i),a&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Iy.bind(null,i),s0(e,i))));break;case 22:if(a=i.memoizedState!==null||Ai,!a){t=t!==null&&t.memoizedState!==null||Ot,g=Ai;var w=Ot;Ai=a,(Ot=t)&&!w?Di(e,i,(i.subtreeFlags&8772)!==0):Ri(e,i),Ai=g,Ot=w}break;case 30:break;default:Ri(e,i)}}function lp(e){var t=e.alternate;t!==null&&(e.alternate=null,lp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&qr(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 gt=null,fn=!1;function Ti(e,t,i){for(i=i.child;i!==null;)op(e,t,i),i=i.sibling}function op(e,t,i){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(St,i)}catch{}switch(i.tag){case 26:Ot||ui(i,t),Ti(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Ot||ui(i,t);var a=gt,g=fn;sr(i.type)&&(gt=i.stateNode,fn=!1),Ti(e,t,i),Da(i.stateNode),gt=a,fn=g;break;case 5:Ot||ui(i,t);case 6:if(a=gt,g=fn,gt=null,Ti(e,t,i),gt=a,fn=g,gt!==null)if(fn)try{(gt.nodeType===9?gt.body:gt.nodeName==="HTML"?gt.ownerDocument.body:gt).removeChild(i.stateNode)}catch(w){it(i,t,w)}else try{gt.removeChild(i.stateNode)}catch(w){it(i,t,w)}break;case 18:gt!==null&&(fn?(e=gt,em(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Ms(e)):em(gt,i.stateNode));break;case 4:a=gt,g=fn,gt=i.stateNode.containerInfo,fn=!0,Ti(e,t,i),gt=a,fn=g;break;case 0:case 11:case 14:case 15:Ji(2,i,t),Ot||Ji(4,i,t),Ti(e,t,i);break;case 1:Ot||(ui(i,t),a=i.stateNode,typeof a.componentWillUnmount=="function"&&tp(i,t,a)),Ti(e,t,i);break;case 21:Ti(e,t,i);break;case 22:Ot=(a=Ot)||i.memoizedState!==null,Ti(e,t,i),Ot=a;break;default:Ti(e,t,i)}}function cp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ms(e)}catch(i){it(t,t.return,i)}}}function up(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ms(e)}catch(i){it(t,t.return,i)}}function My(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new sp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new sp),t;default:throw Error(l(435,e.tag))}}function Fl(e,t){var i=My(e);t.forEach(function(a){if(!i.has(a)){i.add(a);var g=Uy.bind(null,e,a);a.then(g,g)}})}function dn(e,t){var i=t.deletions;if(i!==null)for(var a=0;a<i.length;a++){var g=i[a],w=e,B=t,P=B;e:for(;P!==null;){switch(P.tag){case 27:if(sr(P.type)){gt=P.stateNode,fn=!1;break e}break;case 5:gt=P.stateNode,fn=!1;break e;case 3:case 4:gt=P.stateNode.containerInfo,fn=!0;break e}P=P.return}if(gt===null)throw Error(l(160));op(w,B,g),gt=null,fn=!1,w=g.alternate,w!==null&&(w.return=null),g.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hp(t,e),t=t.sibling}var ti=null;function hp(e,t){var i=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dn(t,e),pn(e),a&4&&(Ji(3,e,e.return),Sa(3,e),Ji(5,e,e.return));break;case 1:dn(t,e),pn(e),a&512&&(Ot||i===null||ui(i,i.return)),a&64&&Ai&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?a:i.concat(a))));break;case 26:var g=ti;if(dn(t,e),pn(e),a&512&&(Ot||i===null||ui(i,i.return)),a&4){var w=i!==null?i.memoizedState:null;if(a=e.memoizedState,i===null)if(a===null)if(e.stateNode===null){e:{a=e.type,i=e.memoizedProps,g=g.ownerDocument||g;t:switch(a){case"title":w=g.getElementsByTagName("title")[0],(!w||w[On]||w[Tt]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=g.createElement(a),g.head.insertBefore(w,g.querySelector("head > title"))),Yt(w,a,i),w[Tt]=e,ot(w),a=w;break e;case"link":var B=hm("link","href",g).get(a+(i.href||""));if(B){for(var P=0;P<B.length;P++)if(w=B[P],w.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&w.getAttribute("rel")===(i.rel==null?null:i.rel)&&w.getAttribute("title")===(i.title==null?null:i.title)&&w.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){B.splice(P,1);break t}}w=g.createElement(a),Yt(w,a,i),g.head.appendChild(w);break;case"meta":if(B=hm("meta","content",g).get(a+(i.content||""))){for(P=0;P<B.length;P++)if(w=B[P],w.getAttribute("content")===(i.content==null?null:""+i.content)&&w.getAttribute("name")===(i.name==null?null:i.name)&&w.getAttribute("property")===(i.property==null?null:i.property)&&w.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&w.getAttribute("charset")===(i.charSet==null?null:i.charSet)){B.splice(P,1);break t}}w=g.createElement(a),Yt(w,a,i),g.head.appendChild(w);break;default:throw Error(l(468,a))}w[Tt]=e,ot(w),a=w}e.stateNode=a}else fm(g,e.type,e.stateNode);else e.stateNode=um(g,a,e.memoizedProps);else w!==a?(w===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):w.count--,a===null?fm(g,e.type,e.stateNode):um(g,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Qc(e,e.memoizedProps,i.memoizedProps)}break;case 27:dn(t,e),pn(e),a&512&&(Ot||i===null||ui(i,i.return)),i!==null&&a&4&&Qc(e,e.memoizedProps,i.memoizedProps);break;case 5:if(dn(t,e),pn(e),a&512&&(Ot||i===null||ui(i,i.return)),e.flags&32){g=e.stateNode;try{Cn(g,"")}catch(Ee){it(e,e.return,Ee)}}a&4&&e.stateNode!=null&&(g=e.memoizedProps,Qc(e,g,i!==null?i.memoizedProps:g)),a&1024&&(eu=!0);break;case 6:if(dn(t,e),pn(e),a&4){if(e.stateNode===null)throw Error(l(162));a=e.memoizedProps,i=e.stateNode;try{i.nodeValue=a}catch(Ee){it(e,e.return,Ee)}}break;case 3:if(ro=null,g=ti,ti=no(t.containerInfo),dn(t,e),ti=g,pn(e),a&4&&i!==null&&i.memoizedState.isDehydrated)try{Ms(t.containerInfo)}catch(Ee){it(e,e.return,Ee)}eu&&(eu=!1,fp(e));break;case 4:a=ti,ti=no(e.stateNode.containerInfo),dn(t,e),pn(e),ti=a;break;case 12:dn(t,e),pn(e);break;case 31:dn(t,e),pn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Fl(e,a)));break;case 13:dn(t,e),pn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&($l=tt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Fl(e,a)));break;case 22:g=e.memoizedState!==null;var X=i!==null&&i.memoizedState!==null,le=Ai,fe=Ot;if(Ai=le||g,Ot=fe||X,dn(t,e),Ot=fe,Ai=le,pn(e),a&8192)e:for(t=e.stateNode,t._visibility=g?t._visibility&-2:t._visibility|1,g&&(i===null||X||Ai||Ot||Br(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){X=i=t;try{if(w=X.stateNode,g)B=w.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none";else{P=X.stateNode;var _e=X.memoizedProps.style,oe=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;P.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Ee){it(X,X.return,Ee)}}}else if(t.tag===6){if(i===null){X=t;try{X.stateNode.nodeValue=g?"":X.memoizedProps}catch(Ee){it(X,X.return,Ee)}}}else if(t.tag===18){if(i===null){X=t;try{var ce=X.stateNode;g?tm(ce,!0):tm(X.stateNode,!1)}catch(Ee){it(X,X.return,Ee)}}}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;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(i=a.retryQueue,i!==null&&(a.retryQueue=null,Fl(e,i))));break;case 19:dn(t,e),pn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Fl(e,a)));break;case 30:break;case 21:break;default:dn(t,e),pn(e)}}function pn(e){var t=e.flags;if(t&2){try{for(var i,a=e.return;a!==null;){if(ip(a)){i=a;break}a=a.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var g=i.stateNode,w=Jc(e);Pl(e,w,g);break;case 5:var B=i.stateNode;i.flags&32&&(Cn(B,""),i.flags&=-33);var P=Jc(e);Pl(e,P,B);break;case 3:case 4:var X=i.stateNode.containerInfo,le=Jc(e);Zc(e,le,X);break;default:throw Error(l(161))}}catch(fe){it(e,e.return,fe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function fp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;fp(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ri(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ap(e,t.alternate,t),t=t.sibling}function Br(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ji(4,t,t.return),Br(t);break;case 1:ui(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&tp(t,t.return,i),Br(t);break;case 27:Da(t.stateNode);case 26:case 5:ui(t,t.return),Br(t);break;case 22:t.memoizedState===null&&Br(t);break;case 30:Br(t);break;default:Br(t)}e=e.sibling}}function Di(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,g=e,w=t,B=w.flags;switch(w.tag){case 0:case 11:case 15:Di(g,w,i),Sa(4,w);break;case 1:if(Di(g,w,i),a=w,g=a.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(le){it(a,a.return,le)}if(a=w,g=a.updateQueue,g!==null){var P=a.stateNode;try{var X=g.shared.hiddenCallbacks;if(X!==null)for(g.shared.hiddenCallbacks=null,g=0;g<X.length;g++)qf(X[g],P)}catch(le){it(a,a.return,le)}}i&&B&64&&ep(w),ba(w,w.return);break;case 27:rp(w);case 26:case 5:Di(g,w,i),i&&a===null&&B&4&&np(w),ba(w,w.return);break;case 12:Di(g,w,i);break;case 31:Di(g,w,i),i&&B&4&&cp(g,w);break;case 13:Di(g,w,i),i&&B&4&&up(g,w);break;case 22:w.memoizedState===null&&Di(g,w,i),ba(w,w.return);break;case 30:break;default:Di(g,w,i)}t=t.sibling}}function tu(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&la(i))}function nu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e))}function ni(e,t,i,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)dp(e,t,i,a),t=t.sibling}function dp(e,t,i,a){var g=t.flags;switch(t.tag){case 0:case 11:case 15:ni(e,t,i,a),g&2048&&Sa(9,t);break;case 1:ni(e,t,i,a);break;case 3:ni(e,t,i,a),g&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e)));break;case 12:if(g&2048){ni(e,t,i,a),e=t.stateNode;try{var w=t.memoizedProps,B=w.id,P=w.onPostCommit;typeof P=="function"&&P(B,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(X){it(t,t.return,X)}}else ni(e,t,i,a);break;case 31:ni(e,t,i,a);break;case 13:ni(e,t,i,a);break;case 23:break;case 22:w=t.stateNode,B=t.alternate,t.memoizedState!==null?w._visibility&2?ni(e,t,i,a):Ca(e,t):w._visibility&2?ni(e,t,i,a):(w._visibility|=2,Ss(e,t,i,a,(t.subtreeFlags&10256)!==0||!1)),g&2048&&tu(B,t);break;case 24:ni(e,t,i,a),g&2048&&nu(t.alternate,t);break;default:ni(e,t,i,a)}}function Ss(e,t,i,a,g){for(g=g&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var w=e,B=t,P=i,X=a,le=B.flags;switch(B.tag){case 0:case 11:case 15:Ss(w,B,P,X,g),Sa(8,B);break;case 23:break;case 22:var fe=B.stateNode;B.memoizedState!==null?fe._visibility&2?Ss(w,B,P,X,g):Ca(w,B):(fe._visibility|=2,Ss(w,B,P,X,g)),g&&le&2048&&tu(B.alternate,B);break;case 24:Ss(w,B,P,X,g),g&&le&2048&&nu(B.alternate,B);break;default:Ss(w,B,P,X,g)}t=t.sibling}}function Ca(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,a=t,g=a.flags;switch(a.tag){case 22:Ca(i,a),g&2048&&tu(a.alternate,a);break;case 24:Ca(i,a),g&2048&&nu(a.alternate,a);break;default:Ca(i,a)}t=t.sibling}}var wa=8192;function bs(e,t,i){if(e.subtreeFlags&wa)for(e=e.child;e!==null;)pp(e,t,i),e=e.sibling}function pp(e,t,i){switch(e.tag){case 26:bs(e,t,i),e.flags&wa&&e.memoizedState!==null&&_0(i,ti,e.memoizedState,e.memoizedProps);break;case 5:bs(e,t,i);break;case 3:case 4:var a=ti;ti=no(e.stateNode.containerInfo),bs(e,t,i),ti=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=wa,wa=16777216,bs(e,t,i),wa=a):bs(e,t,i));break;default:bs(e,t,i)}}function mp(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 xa(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var a=t[i];Ut=a,_p(a,e)}mp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)gp(e),e=e.sibling}function gp(e){switch(e.tag){case 0:case 11:case 15:xa(e),e.flags&2048&&Ji(9,e,e.return);break;case 3:xa(e);break;case 12:xa(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ql(e)):xa(e);break;default:xa(e)}}function ql(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var a=t[i];Ut=a,_p(a,e)}mp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ji(8,t,t.return),ql(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,ql(t));break;default:ql(t)}e=e.sibling}}function _p(e,t){for(;Ut!==null;){var i=Ut;switch(i.tag){case 0:case 11:case 15:Ji(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var a=i.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:la(i.memoizedState.cache)}if(a=i.child,a!==null)a.return=i,Ut=a;else e:for(i=e;Ut!==null;){a=Ut;var g=a.sibling,w=a.return;if(lp(a),a===i){Ut=null;break e}if(g!==null){g.return=w,Ut=g;break e}Ut=w}}}var Ly={getCacheForType:function(e){var t=Wt(Dt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Wt(Dt).controller.signal}},Oy=typeof WeakMap=="function"?WeakMap:Map,et=0,ct=null,qe=null,Ve=0,nt=0,Tn=null,Zi=!1,Cs=!1,iu=!1,Mi=0,Ct=0,er=0,jr=0,ru=0,Rn=0,ws=0,Ea=null,mn=null,su=!1,$l=0,vp=0,Gl=1/0,Vl=null,tr=null,zt=0,nr=null,xs=null,Li=0,au=0,lu=null,yp=null,ka=0,ou=null;function Dn(){return(et&2)!==0&&Ve!==0?Ve&-Ve:G.T!==null?pu():Yn()}function Sp(){if(Rn===0)if((Ve&536870912)===0||Ye){var e=Wn;Wn<<=1,(Wn&3932160)===0&&(Wn=262144),Rn=e}else Rn=536870912;return e=kn.current,e!==null&&(e.flags|=32),Rn}function gn(e,t,i){(e===ct&&(nt===2||nt===9)||e.cancelPendingCommit!==null)&&(Es(e,0),ir(e,Ve,Rn,!1)),Ft(e,i),((et&2)===0||e!==ct)&&(e===ct&&((et&2)===0&&(jr|=i),Ct===4&&ir(e,Ve,Rn,!1)),hi(e))}function bp(e,t,i){if((et&6)!==0)throw Error(l(327));var a=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Xt(e,t),g=a?Ny(e,t):uu(e,t,!0),w=a;do{if(g===0){Cs&&!a&&ir(e,t,0,!1);break}else{if(i=e.current.alternate,w&&!By(i)){g=uu(e,t,!1),w=!1;continue}if(g===2){if(w=t,e.errorRecoveryDisabledLanes&w)var B=0;else B=e.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){t=B;e:{var P=e;g=Ea;var X=P.current.memoizedState.isDehydrated;if(X&&(Es(P,B).flags|=256),B=uu(P,B,!1),B!==2){if(iu&&!X){P.errorRecoveryDisabledLanes|=w,jr|=w,g=4;break e}w=mn,mn=g,w!==null&&(mn===null?mn=w:mn.push.apply(mn,w))}g=B}if(w=!1,g!==2)continue}}if(g===1){Es(e,0),ir(e,t,0,!0);break}e:{switch(a=e,w=g,w){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:ir(a,t,Rn,!Zi);break e;case 2:mn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(g=$l+300-tt(),10<g)){if(ir(a,t,Rn,!Zi),Kn(a,0,!0)!==0)break e;Li=t,a.timeoutHandle=Jp(Cp.bind(null,a,i,mn,Vl,su,t,Rn,jr,ws,Zi,w,"Throttled",-0,0),g);break e}Cp(a,i,mn,Vl,su,t,Rn,jr,ws,Zi,w,null,-0,0)}}break}while(!0);hi(e)}function Cp(e,t,i,a,g,w,B,P,X,le,fe,_e,oe,ce){if(e.timeoutHandle=-1,_e=t.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jt},pp(t,w,_e);var Ee=(w&62914560)===w?$l-tt():(w&4194048)===w?vp-tt():0;if(Ee=v0(_e,Ee),Ee!==null){Li=w,e.cancelPendingCommit=Ee(Dp.bind(null,e,t,w,i,a,g,B,P,X,fe,_e,null,oe,ce)),ir(e,w,B,!le);return}}Dp(e,t,w,i,a,g,B,P,X)}function By(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var a=0;a<i.length;a++){var g=i[a],w=g.getSnapshot;g=g.value;try{if(!xn(w(),g))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 ir(e,t,i,a){t&=~ru,t&=~jr,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var g=t;0<g;){var w=31-Qe(g),B=1<<w;a[w]=-1,g&=~B}i!==0&&ze(e,i,t)}function Wl(){return(et&6)===0?(Aa(0),!1):!0}function cu(){if(qe!==null){if(nt===0)var e=qe.return;else e=qe,bi=kr=null,Ec(e),ms=null,ca=0,e=qe;for(;e!==null;)Zd(e.alternate,e),e=e.return;qe=null}}function Es(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,e0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Li=0,cu(),ct=e,qe=i=yi(e.current,null),Ve=t,nt=0,Tn=null,Zi=!1,Cs=Xt(e,t),iu=!1,ws=Rn=ru=jr=er=Ct=0,mn=Ea=null,su=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var g=31-Qe(a),w=1<<g;t|=e[g],a&=~w}return Mi=t,pl(),i}function wp(e,t){He=null,G.H=_a,t===ps||t===Cl?(t=If(),nt=3):t===dc?(t=If(),nt=4):nt=t===Pc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Tn=t,qe===null&&(Ct=1,Nl(e,zn(t,e.current)))}function xp(){var e=kn.current;return e===null?!0:(Ve&4194048)===Ve?Fn===null:(Ve&62914560)===Ve||(Ve&536870912)!==0?e===Fn:!1}function Ep(){var e=G.H;return G.H=_a,e===null?_a:e}function kp(){var e=G.A;return G.A=Ly,e}function Kl(){Ct=4,Zi||(Ve&4194048)!==Ve&&kn.current!==null||(Cs=!0),(er&134217727)===0&&(jr&134217727)===0||ct===null||ir(ct,Ve,Rn,!1)}function uu(e,t,i){var a=et;et|=2;var g=Ep(),w=kp();(ct!==e||Ve!==t)&&(Vl=null,Es(e,t)),t=!1;var B=Ct;e:do try{if(nt!==0&&qe!==null){var P=qe,X=Tn;switch(nt){case 8:cu(),B=6;break e;case 3:case 2:case 9:case 6:kn.current===null&&(t=!0);var le=nt;if(nt=0,Tn=null,ks(e,P,X,le),i&&Cs){B=0;break e}break;default:le=nt,nt=0,Tn=null,ks(e,P,X,le)}}jy(),B=Ct;break}catch(fe){wp(e,fe)}while(!0);return t&&e.shellSuspendCounter++,bi=kr=null,et=a,G.H=g,G.A=w,qe===null&&(ct=null,Ve=0,pl()),B}function jy(){for(;qe!==null;)Ap(qe)}function Ny(e,t){var i=et;et|=2;var a=Ep(),g=kp();ct!==e||Ve!==t?(Vl=null,Gl=tt()+500,Es(e,t)):Cs=Xt(e,t);e:do try{if(nt!==0&&qe!==null){t=qe;var w=Tn;t:switch(nt){case 1:nt=0,Tn=null,ks(e,t,w,1);break;case 2:case 9:if(Hf(w)){nt=0,Tn=null,Tp(t);break}t=function(){nt!==2&&nt!==9||ct!==e||(nt=7),hi(e)},w.then(t,t);break e;case 3:nt=7;break e;case 4:nt=5;break e;case 7:Hf(w)?(nt=0,Tn=null,Tp(t)):(nt=0,Tn=null,ks(e,t,w,7));break;case 5:var B=null;switch(qe.tag){case 26:B=qe.memoizedState;case 5:case 27:var P=qe;if(B?dm(B):P.stateNode.complete){nt=0,Tn=null;var X=P.sibling;if(X!==null)qe=X;else{var le=P.return;le!==null?(qe=le,Yl(le)):qe=null}break t}}nt=0,Tn=null,ks(e,t,w,5);break;case 6:nt=0,Tn=null,ks(e,t,w,6);break;case 8:cu(),Ct=6;break e;default:throw Error(l(462))}}Hy();break}catch(fe){wp(e,fe)}while(!0);return bi=kr=null,G.H=a,G.A=g,et=i,qe!==null?0:(ct=null,Ve=0,pl(),Ct)}function Hy(){for(;qe!==null&&!yn();)Ap(qe)}function Ap(e){var t=Qd(e.alternate,e,Mi);e.memoizedProps=e.pendingProps,t===null?Yl(e):qe=t}function Tp(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Gd(i,t,t.pendingProps,t.type,void 0,Ve);break;case 11:t=Gd(i,t,t.pendingProps,t.type.render,t.ref,Ve);break;case 5:Ec(t);default:Zd(i,t),t=qe=kf(t,Mi),t=Qd(i,t,Mi)}e.memoizedProps=e.pendingProps,t===null?Yl(e):qe=t}function ks(e,t,i,a){bi=kr=null,Ec(t),ms=null,ca=0;var g=t.return;try{if(Ey(e,g,t,i,Ve)){Ct=1,Nl(e,zn(i,e.current)),qe=null;return}}catch(w){if(g!==null)throw qe=g,w;Ct=1,Nl(e,zn(i,e.current)),qe=null;return}t.flags&32768?(Ye||a===1?e=!0:Cs||(Ve&536870912)!==0?e=!1:(Zi=e=!0,(a===2||a===9||a===3||a===6)&&(a=kn.current,a!==null&&a.tag===13&&(a.flags|=16384))),Rp(t,e)):Yl(t)}function Yl(e){var t=e;do{if((t.flags&32768)!==0){Rp(t,Zi);return}e=t.return;var i=Ty(t.alternate,t,Mi);if(i!==null){qe=i;return}if(t=t.sibling,t!==null){qe=t;return}qe=t=e}while(t!==null);Ct===0&&(Ct=5)}function Rp(e,t){do{var i=Ry(e.alternate,e);if(i!==null){i.flags&=32767,qe=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){qe=e;return}qe=e=i}while(e!==null);Ct=6,qe=null}function Dp(e,t,i,a,g,w,B,P,X){e.cancelPendingCommit=null;do Xl();while(zt!==0);if((et&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(w=t.lanes|t.childLanes,w|=Jo,Hi(e,i,w,B,P,X),e===ct&&(qe=ct=null,Ve=0),xs=t,nr=e,Li=i,au=w,lu=g,yp=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Py(Ae,function(){return jp(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=G.T,G.T=null,g=W.p,W.p=2,B=et,et|=4;try{Dy(e,t,i)}finally{et=B,W.p=g,G.T=a}}zt=1,Mp(),Lp(),Op()}}function Mp(){if(zt===1){zt=0;var e=nr,t=xs,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=G.T,G.T=null;var a=W.p;W.p=2;var g=et;et|=4;try{hp(t,e);var w=Cu,B=_f(e.containerInfo),P=w.focusedElem,X=w.selectionRange;if(B!==P&&P&&P.ownerDocument&&gf(P.ownerDocument.documentElement,P)){if(X!==null&&Wo(P)){var le=X.start,fe=X.end;if(fe===void 0&&(fe=le),"selectionStart"in P)P.selectionStart=le,P.selectionEnd=Math.min(fe,P.value.length);else{var _e=P.ownerDocument||document,oe=_e&&_e.defaultView||window;if(oe.getSelection){var ce=oe.getSelection(),Ee=P.textContent.length,Oe=Math.min(X.start,Ee),lt=X.end===void 0?Oe:Math.min(X.end,Ee);!ce.extend&&Oe>lt&&(B=lt,lt=Oe,Oe=B);var ne=mf(P,Oe),J=mf(P,lt);if(ne&&J&&(ce.rangeCount!==1||ce.anchorNode!==ne.node||ce.anchorOffset!==ne.offset||ce.focusNode!==J.node||ce.focusOffset!==J.offset)){var ae=_e.createRange();ae.setStart(ne.node,ne.offset),ce.removeAllRanges(),Oe>lt?(ce.addRange(ae),ce.extend(J.node,J.offset)):(ae.setEnd(J.node,J.offset),ce.addRange(ae))}}}}for(_e=[],ce=P;ce=ce.parentNode;)ce.nodeType===1&&_e.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<_e.length;P++){var me=_e[P];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}oo=!!bu,Cu=bu=null}finally{et=g,W.p=a,G.T=i}}e.current=t,zt=2}}function Lp(){if(zt===2){zt=0;var e=nr,t=xs,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=G.T,G.T=null;var a=W.p;W.p=2;var g=et;et|=4;try{ap(e,t.alternate,t)}finally{et=g,W.p=a,G.T=i}}zt=3}}function Op(){if(zt===4||zt===3){zt=0,xt();var e=nr,t=xs,i=Li,a=yp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?zt=5:(zt=0,xs=nr=null,Bp(e,e.pendingLanes));var g=e.pendingLanes;if(g===0&&(tr=null),Gs(i),t=t.stateNode,vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(St,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=G.T,g=W.p,W.p=2,G.T=null;try{for(var w=e.onRecoverableError,B=0;B<a.length;B++){var P=a[B];w(P.value,{componentStack:P.stack})}}finally{G.T=t,W.p=g}}(Li&3)!==0&&Xl(),hi(e),g=e.pendingLanes,(i&261930)!==0&&(g&42)!==0?e===ou?ka++:(ka=0,ou=e):ka=0,Aa(0)}}function Bp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,la(t)))}function Xl(){return Mp(),Lp(),Op(),jp()}function jp(){if(zt!==5)return!1;var e=nr,t=au;au=0;var i=Gs(Li),a=G.T,g=W.p;try{W.p=32>i?32:i,G.T=null,i=lu,lu=null;var w=nr,B=Li;if(zt=0,xs=nr=null,Li=0,(et&6)!==0)throw Error(l(331));var P=et;if(et|=4,gp(w.current),dp(w,w.current,B,i),et=P,Aa(0,!1),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(St,w)}catch{}return!0}finally{W.p=g,G.T=a,Bp(e,t)}}function Np(e,t,i){t=zn(i,t),t=Uc(e.stateNode,t,2),e=Yi(e,t,2),e!==null&&(Ft(e,2),hi(e))}function it(e,t,i){if(e.tag===3)Np(e,e,i);else for(;t!==null;){if(t.tag===3){Np(t,e,i);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(tr===null||!tr.has(a))){e=zn(i,e),i=Hd(2),a=Yi(t,i,2),a!==null&&(zd(i,a,t,e),Ft(a,2),hi(a));break}}t=t.return}}function hu(e,t,i){var a=e.pingCache;if(a===null){a=e.pingCache=new Oy;var g=new Set;a.set(t,g)}else g=a.get(t),g===void 0&&(g=new Set,a.set(t,g));g.has(i)||(iu=!0,g.add(i),e=zy.bind(null,e,t,i),t.then(e,e))}function zy(e,t,i){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,ct===e&&(Ve&i)===i&&(Ct===4||Ct===3&&(Ve&62914560)===Ve&&300>tt()-$l?(et&2)===0&&Es(e,0):ru|=i,ws===Ve&&(ws=0)),hi(e)}function Hp(e,t){t===0&&(t=Qt()),e=wr(e,t),e!==null&&(Ft(e,t),hi(e))}function Iy(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Hp(e,i)}function Uy(e,t){var i=0;switch(e.tag){case 31:case 13:var a=e.stateNode,g=e.memoizedState;g!==null&&(i=g.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(l(314))}a!==null&&a.delete(t),Hp(e,i)}function Py(e,t){return yt(e,t)}var Ql=null,As=null,fu=!1,Jl=!1,du=!1,rr=0;function hi(e){e!==As&&e.next===null&&(As===null?Ql=As=e:As=As.next=e),Jl=!0,fu||(fu=!0,qy())}function Aa(e,t){if(!du&&Jl){du=!0;do for(var i=!1,a=Ql;a!==null;){if(e!==0){var g=a.pendingLanes;if(g===0)var w=0;else{var B=a.suspendedLanes,P=a.pingedLanes;w=(1<<31-Qe(42|e)+1)-1,w&=g&~(B&~P),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(i=!0,Pp(a,w))}else w=Ve,w=Kn(a,a===ct?w:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(w&3)===0||Xt(a,w)||(i=!0,Pp(a,w));a=a.next}while(i);du=!1}}function Fy(){zp()}function zp(){Jl=fu=!1;var e=0;rr!==0&&Zy()&&(e=rr);for(var t=tt(),i=null,a=Ql;a!==null;){var g=a.next,w=Ip(a,t);w===0?(a.next=null,i===null?Ql=g:i.next=g,g===null&&(As=i)):(i=a,(e!==0||(w&3)!==0)&&(Jl=!0)),a=g}zt!==0&&zt!==5||Aa(e),rr!==0&&(rr=0)}function Ip(e,t){for(var i=e.suspendedLanes,a=e.pingedLanes,g=e.expirationTimes,w=e.pendingLanes&-62914561;0<w;){var B=31-Qe(w),P=1<<B,X=g[B];X===-1?((P&i)===0||(P&a)!==0)&&(g[B]=$s(P,t)):X<=t&&(e.expiredLanes|=P),w&=~P}if(t=ct,i=Ve,i=Kn(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,i===0||e===t&&(nt===2||nt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&It(a),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Xt(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(a!==null&&It(a),Gs(i)){case 2:case 8:i=Se;break;case 32:i=Ae;break;case 268435456:i=je;break;default:i=Ae}return a=Up.bind(null,e),i=yt(i,a),e.callbackPriority=t,e.callbackNode=i,t}return a!==null&&a!==null&&It(a),e.callbackPriority=2,e.callbackNode=null,2}function Up(e,t){if(zt!==0&&zt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Xl()&&e.callbackNode!==i)return null;var a=Ve;return a=Kn(e,e===ct?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(bp(e,a,t),Ip(e,tt()),e.callbackNode!=null&&e.callbackNode===i?Up.bind(null,e):null)}function Pp(e,t){if(Xl())return null;bp(e,t,!0)}function qy(){t0(function(){(et&6)!==0?yt(ue,Fy):zp()})}function pu(){if(rr===0){var e=fs;e===0&&(e=Vn,Vn<<=1,(Vn&261888)===0&&(Vn=256)),rr=e}return rr}function Fp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_r(""+e)}function qp(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function $y(e,t,i,a,g){if(t==="submit"&&i&&i.stateNode===g){var w=Fp((g[qt]||null).action),B=a.submitter;B&&(t=(t=B[qt]||null)?Fp(t.formAction):B.getAttribute("formAction"),t!==null&&(w=t,B=null));var P=new de("action","action",null,a,g);e.push({event:P,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(rr!==0){var X=B?qp(g,B):new FormData(g);Bc(i,{pending:!0,data:X,method:g.method,action:w},null,X)}}else typeof w=="function"&&(P.preventDefault(),X=B?qp(g,B):new FormData(g),Bc(i,{pending:!0,data:X,method:g.method,action:w},w,X))},currentTarget:g}]})}}for(var mu=0;mu<Qo.length;mu++){var gu=Qo[mu],Gy=gu.toLowerCase(),Vy=gu[0].toUpperCase()+gu.slice(1);ei(Gy,"on"+Vy)}ei(Sf,"onAnimationEnd"),ei(bf,"onAnimationIteration"),ei(Cf,"onAnimationStart"),ei("dblclick","onDoubleClick"),ei("focusin","onFocus"),ei("focusout","onBlur"),ei(oy,"onTransitionRun"),ei(cy,"onTransitionStart"),ei(uy,"onTransitionCancel"),ei(wf,"onTransitionEnd"),ai("onMouseEnter",["mouseout","mouseover"]),ai("onMouseLeave",["mouseout","mouseover"]),ai("onPointerEnter",["pointerout","pointerover"]),ai("onPointerLeave",["pointerout","pointerover"]),Rt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Rt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Rt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Rt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Rt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Rt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ta="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(" "),Wy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ta));function $p(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var a=e[i],g=a.event;a=a.listeners;e:{var w=void 0;if(t)for(var B=a.length-1;0<=B;B--){var P=a[B],X=P.instance,le=P.currentTarget;if(P=P.listener,X!==w&&g.isPropagationStopped())break e;w=P,g.currentTarget=le;try{w(g)}catch(fe){dl(fe)}g.currentTarget=null,w=X}else for(B=0;B<a.length;B++){if(P=a[B],X=P.instance,le=P.currentTarget,P=P.listener,X!==w&&g.isPropagationStopped())break e;w=P,g.currentTarget=le;try{w(g)}catch(fe){dl(fe)}g.currentTarget=null,w=X}}}}function $e(e,t){var i=t[Vs];i===void 0&&(i=t[Vs]=new Set);var a=e+"__bubble";i.has(a)||(Gp(t,e,2,!1),i.add(a))}function _u(e,t,i){var a=0;t&&(a|=4),Gp(i,e,a,t)}var Zl="_reactListening"+Math.random().toString(36).slice(2);function vu(e){if(!e[Zl]){e[Zl]=!0,$r.forEach(function(i){i!=="selectionchange"&&(Wy.has(i)||_u(i,!1,e),_u(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zl]||(t[Zl]=!0,_u("selectionchange",!1,t))}}function Gp(e,t,i,a){switch(Sm(t)){case 2:var g=b0;break;case 8:g=C0;break;default:g=Ou}i=g.bind(null,t,i,e),g=void 0,!Re||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(g=!0),a?g!==void 0?e.addEventListener(t,i,{capture:!0,passive:g}):e.addEventListener(t,i,!0):g!==void 0?e.addEventListener(t,i,{passive:g}):e.addEventListener(t,i,!1)}function yu(e,t,i,a,g){var w=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var B=a.tag;if(B===3||B===4){var P=a.stateNode.containerInfo;if(P===g)break;if(B===4)for(B=a.return;B!==null;){var X=B.tag;if((X===3||X===4)&&B.stateNode.containerInfo===g)return;B=B.return}for(;P!==null;){if(B=cn(P),B===null)return;if(X=B.tag,X===5||X===6||X===26||X===27){a=w=B;continue e}P=P.parentNode}}a=a.return}Zr(function(){var le=w,fe=Qs(i),_e=[];e:{var oe=xf.get(e);if(oe!==void 0){var ce=de,Ee=e;switch(e){case"keypress":if(Fi(i)===0)break e;case"keydown":case"keyup":ce=Uv;break;case"focusin":Ee="focus",ce=Fo;break;case"focusout":Ee="blur",ce=Fo;break;case"beforeblur":case"afterblur":ce=Fo;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=Zs;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=Tv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=qv;break;case Sf:case bf:case Cf:ce=Mv;break;case wf:ce=Gv;break;case"scroll":case"scrollend":ce=Et;break;case"wheel":ce=Wv;break;case"copy":case"cut":case"paste":ce=Ov;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=ef;break;case"toggle":case"beforetoggle":ce=Yv}var Oe=(t&4)!==0,lt=!Oe&&(e==="scroll"||e==="scrollend"),ne=Oe?oe!==null?oe+"Capture":null:oe;Oe=[];for(var J=le,ae;J!==null;){var me=J;if(ae=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ae===null||ne===null||(me=vi(J,ne),me!=null&&Oe.push(Ra(J,me,ae))),lt)break;J=J.return}0<Oe.length&&(oe=new ce(oe,Ee,null,i,fe),_e.push({event:oe,listeners:Oe}))}}if((t&7)===0){e:{if(oe=e==="mouseover"||e==="pointerover",ce=e==="mouseout"||e==="pointerout",oe&&i!==Bn&&(Ee=i.relatedTarget||i.fromElement)&&(cn(Ee)||Ee[Xn]))break e;if((ce||oe)&&(oe=fe.window===fe?fe:(oe=fe.ownerDocument)?oe.defaultView||oe.parentWindow:window,ce?(Ee=i.relatedTarget||i.toElement,ce=le,Ee=Ee?cn(Ee):null,Ee!==null&&(lt=p(Ee),Oe=Ee.tag,Ee!==lt||Oe!==5&&Oe!==27&&Oe!==6)&&(Ee=null)):(ce=null,Ee=le),ce!==Ee)){if(Oe=Zs,me="onMouseLeave",ne="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(Oe=ef,me="onPointerLeave",ne="onPointerEnter",J="pointer"),lt=ce==null?oe:si(ce),ae=Ee==null?oe:si(Ee),oe=new Oe(me,J+"leave",ce,i,fe),oe.target=lt,oe.relatedTarget=ae,me=null,cn(fe)===le&&(Oe=new Oe(ne,J+"enter",Ee,i,fe),Oe.target=ae,Oe.relatedTarget=lt,me=Oe),lt=me,ce&&Ee)t:{for(Oe=Ky,ne=ce,J=Ee,ae=0,me=ne;me;me=Oe(me))ae++;me=0;for(var De=J;De;De=Oe(De))me++;for(;0<ae-me;)ne=Oe(ne),ae--;for(;0<me-ae;)J=Oe(J),me--;for(;ae--;){if(ne===J||J!==null&&ne===J.alternate){Oe=ne;break t}ne=Oe(ne),J=Oe(J)}Oe=null}else Oe=null;ce!==null&&Vp(_e,oe,ce,Oe,!1),Ee!==null&<!==null&&Vp(_e,lt,Ee,Oe,!0)}}e:{if(oe=le?si(le):window,ce=oe.nodeName&&oe.nodeName.toLowerCase(),ce==="select"||ce==="input"&&oe.type==="file")var Je=cf;else if(lf(oe))if(uf)Je=sy;else{Je=iy;var Te=ny}else ce=oe.nodeName,!ce||ce.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?le&&Jr(le.elementType)&&(Je=cf):Je=ry;if(Je&&(Je=Je(e,le))){of(_e,Je,i,fe);break e}Te&&Te(e,oe,le),e==="focusout"&&le&&oe.type==="number"&&le.memoizedProps.value!=null&&Ys(oe,"number",oe.value)}switch(Te=le?si(le):window,e){case"focusin":(lf(Te)||Te.contentEditable==="true")&&(rs=Te,Ko=le,ra=null);break;case"focusout":ra=Ko=rs=null;break;case"mousedown":Yo=!0;break;case"contextmenu":case"mouseup":case"dragend":Yo=!1,vf(_e,i,fe);break;case"selectionchange":if(ly)break;case"keydown":case"keyup":vf(_e,i,fe)}var Ie;if($o)e:{switch(e){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else is?sf(e,i)&&(We="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(We="onCompositionStart");We&&(tf&&i.locale!=="ko"&&(is||We!=="onCompositionStart"?We==="onCompositionEnd"&&is&&(Ie=wn()):(li=fe,Js="value"in li?li.value:li.textContent,is=!0)),Te=eo(le,We),0<Te.length&&(We=new Zh(We,e,null,i,fe),_e.push({event:We,listeners:Te}),Ie?We.data=Ie:(Ie=af(i),Ie!==null&&(We.data=Ie)))),(Ie=Qv?Jv(e,i):Zv(e,i))&&(We=eo(le,"onBeforeInput"),0<We.length&&(Te=new Zh("onBeforeInput","beforeinput",null,i,fe),_e.push({event:Te,listeners:We}),Te.data=Ie)),$y(_e,e,le,i,fe)}$p(_e,t)})}function Ra(e,t,i){return{instance:e,listener:t,currentTarget:i}}function eo(e,t){for(var i=t+"Capture",a=[];e!==null;){var g=e,w=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||w===null||(g=vi(e,i),g!=null&&a.unshift(Ra(e,g,w)),g=vi(e,t),g!=null&&a.push(Ra(e,g,w))),e.tag===3)return a;e=e.return}return[]}function Ky(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Vp(e,t,i,a,g){for(var w=t._reactName,B=[];i!==null&&i!==a;){var P=i,X=P.alternate,le=P.stateNode;if(P=P.tag,X!==null&&X===a)break;P!==5&&P!==26&&P!==27||le===null||(X=le,g?(le=vi(i,w),le!=null&&B.unshift(Ra(i,le,X))):g||(le=vi(i,w),le!=null&&B.push(Ra(i,le,X)))),i=i.return}B.length!==0&&e.push({event:t,listeners:B})}var Yy=/\r\n?/g,Xy=/\u0000|\uFFFD/g;function Wp(e){return(typeof e=="string"?e:""+e).replace(Yy,`
|
|
49
|
+
`).replace(Xy,"")}function Kp(e,t){return t=Wp(t),Wp(e)===t}function at(e,t,i,a,g,w){switch(i){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Cn(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Cn(e,""+a);break;case"className":Vr(e,"class",a);break;case"tabIndex":Vr(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Vr(e,i,a);break;case"style":Qr(e,a,w);break;case"data":if(t!=="object"){Vr(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=_r(""+a),e.setAttribute(i,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(i,"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 w=="function"&&(i==="formAction"?(t!=="input"&&at(e,t,"name",g.name,g,null),at(e,t,"formEncType",g.formEncType,g,null),at(e,t,"formMethod",g.formMethod,g,null),at(e,t,"formTarget",g.formTarget,g,null)):(at(e,t,"encType",g.encType,g,null),at(e,t,"method",g.method,g,null),at(e,t,"target",g.target,g,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=_r(""+a),e.setAttribute(i,a);break;case"onClick":a!=null&&(e.onclick=Jt);break;case"onScroll":a!=null&&$e("scroll",e);break;case"onScrollEnd":a!=null&&$e("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(i=a.__html,i!=null){if(g.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}i=_r(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,""+a):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":a===!0?e.setAttribute(i,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,a):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(i,a):e.removeAttribute(i);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(i):e.setAttribute(i,a);break;case"popover":$e("beforetoggle",e),$e("toggle",e),gr(e,"popover",a);break;case"xlinkActuate":Qn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Qn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Qn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Qn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Qn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Qn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Qn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Qn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Qn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":gr(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=ul.get(i)||i,gr(e,i,a))}}function Su(e,t,i,a,g,w){switch(i){case"style":Qr(e,a,w);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(i=a.__html,i!=null){if(g.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"children":typeof a=="string"?Cn(e,a):(typeof a=="number"||typeof a=="bigint")&&Cn(e,""+a);break;case"onScroll":a!=null&&$e("scroll",e);break;case"onScrollEnd":a!=null&&$e("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Jt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ie.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(g=i.endsWith("Capture"),t=i.slice(2,g?i.length-7:void 0),w=e[qt]||null,w=w!=null?w[i]:null,typeof w=="function"&&e.removeEventListener(t,w,g),typeof a=="function")){typeof w!="function"&&w!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,a,g);break e}i in e?e[i]=a:a===!0?e.setAttribute(i,""):gr(e,i,a)}}}function Yt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":$e("error",e),$e("load",e);var a=!1,g=!1,w;for(w in i)if(i.hasOwnProperty(w)){var B=i[w];if(B!=null)switch(w){case"src":a=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:at(e,t,w,B,i,null)}}g&&at(e,t,"srcSet",i.srcSet,i,null),a&&at(e,t,"src",i.src,i,null);return;case"input":$e("invalid",e);var P=w=B=g=null,X=null,le=null;for(a in i)if(i.hasOwnProperty(a)){var fe=i[a];if(fe!=null)switch(a){case"name":g=fe;break;case"type":B=fe;break;case"checked":X=fe;break;case"defaultChecked":le=fe;break;case"value":w=fe;break;case"defaultValue":P=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(l(137,t));break;default:at(e,t,a,fe,i,null)}}cl(e,w,P,X,le,B,g,!1);return;case"select":$e("invalid",e),a=B=w=null;for(g in i)if(i.hasOwnProperty(g)&&(P=i[g],P!=null))switch(g){case"value":w=P;break;case"defaultValue":B=P;break;case"multiple":a=P;default:at(e,t,g,P,i,null)}t=w,i=B,e.multiple=!!a,t!=null?bn(e,!!a,t,!1):i!=null&&bn(e,!!a,i,!0);return;case"textarea":$e("invalid",e),w=g=a=null;for(B in i)if(i.hasOwnProperty(B)&&(P=i[B],P!=null))switch(B){case"value":a=P;break;case"defaultValue":g=P;break;case"children":w=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(l(91));break;default:at(e,t,B,P,i,null)}Xr(e,a,g,w);return;case"option":for(X in i)if(i.hasOwnProperty(X)&&(a=i[X],a!=null))switch(X){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:at(e,t,X,a,i,null)}return;case"dialog":$e("beforetoggle",e),$e("toggle",e),$e("cancel",e),$e("close",e);break;case"iframe":case"object":$e("load",e);break;case"video":case"audio":for(a=0;a<Ta.length;a++)$e(Ta[a],e);break;case"image":$e("error",e),$e("load",e);break;case"details":$e("toggle",e);break;case"embed":case"source":case"link":$e("error",e),$e("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(le in i)if(i.hasOwnProperty(le)&&(a=i[le],a!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:at(e,t,le,a,i,null)}return;default:if(Jr(t)){for(fe in i)i.hasOwnProperty(fe)&&(a=i[fe],a!==void 0&&Su(e,t,fe,a,i,void 0));return}}for(P in i)i.hasOwnProperty(P)&&(a=i[P],a!=null&&at(e,t,P,a,i,null))}function Qy(e,t,i,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,w=null,B=null,P=null,X=null,le=null,fe=null;for(ce in i){var _e=i[ce];if(i.hasOwnProperty(ce)&&_e!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":X=_e;default:a.hasOwnProperty(ce)||at(e,t,ce,null,a,_e)}}for(var oe in a){var ce=a[oe];if(_e=i[oe],a.hasOwnProperty(oe)&&(ce!=null||_e!=null))switch(oe){case"type":w=ce;break;case"name":g=ce;break;case"checked":le=ce;break;case"defaultChecked":fe=ce;break;case"value":B=ce;break;case"defaultValue":P=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(l(137,t));break;default:ce!==_e&&at(e,t,oe,ce,a,_e)}}Ks(e,B,P,X,le,fe,w,g);return;case"select":ce=B=P=oe=null;for(w in i)if(X=i[w],i.hasOwnProperty(w)&&X!=null)switch(w){case"value":break;case"multiple":ce=X;default:a.hasOwnProperty(w)||at(e,t,w,null,a,X)}for(g in a)if(w=a[g],X=i[g],a.hasOwnProperty(g)&&(w!=null||X!=null))switch(g){case"value":oe=w;break;case"defaultValue":P=w;break;case"multiple":B=w;default:w!==X&&at(e,t,g,w,a,X)}t=P,i=B,a=ce,oe!=null?bn(e,!!i,oe,!1):!!a!=!!i&&(t!=null?bn(e,!!i,t,!0):bn(e,!!i,i?[]:"",!1));return;case"textarea":ce=oe=null;for(P in i)if(g=i[P],i.hasOwnProperty(P)&&g!=null&&!a.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:at(e,t,P,null,a,g)}for(B in a)if(g=a[B],w=i[B],a.hasOwnProperty(B)&&(g!=null||w!=null))switch(B){case"value":oe=g;break;case"defaultValue":ce=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(l(91));break;default:g!==w&&at(e,t,B,g,a,w)}Yr(e,oe,ce);return;case"option":for(var Ee in i)if(oe=i[Ee],i.hasOwnProperty(Ee)&&oe!=null&&!a.hasOwnProperty(Ee))switch(Ee){case"selected":e.selected=!1;break;default:at(e,t,Ee,null,a,oe)}for(X in a)if(oe=a[X],ce=i[X],a.hasOwnProperty(X)&&oe!==ce&&(oe!=null||ce!=null))switch(X){case"selected":e.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:at(e,t,X,oe,a,ce)}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 Oe in i)oe=i[Oe],i.hasOwnProperty(Oe)&&oe!=null&&!a.hasOwnProperty(Oe)&&at(e,t,Oe,null,a,oe);for(le in a)if(oe=a[le],ce=i[le],a.hasOwnProperty(le)&&oe!==ce&&(oe!=null||ce!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(l(137,t));break;default:at(e,t,le,oe,a,ce)}return;default:if(Jr(t)){for(var lt in i)oe=i[lt],i.hasOwnProperty(lt)&&oe!==void 0&&!a.hasOwnProperty(lt)&&Su(e,t,lt,void 0,a,oe);for(fe in a)oe=a[fe],ce=i[fe],!a.hasOwnProperty(fe)||oe===ce||oe===void 0&&ce===void 0||Su(e,t,fe,oe,a,ce);return}}for(var ne in i)oe=i[ne],i.hasOwnProperty(ne)&&oe!=null&&!a.hasOwnProperty(ne)&&at(e,t,ne,null,a,oe);for(_e in a)oe=a[_e],ce=i[_e],!a.hasOwnProperty(_e)||oe===ce||oe==null&&ce==null||at(e,t,_e,oe,a,ce)}function Yp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Jy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),a=0;a<i.length;a++){var g=i[a],w=g.transferSize,B=g.initiatorType,P=g.duration;if(w&&P&&Yp(B)){for(B=0,P=g.responseEnd,a+=1;a<i.length;a++){var X=i[a],le=X.startTime;if(le>P)break;var fe=X.transferSize,_e=X.initiatorType;fe&&Yp(_e)&&(X=X.responseEnd,B+=fe*(X<P?1:(P-le)/(X-le)))}if(--a,t+=8*(w+B)/(g.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 bu=null,Cu=null;function to(e){return e.nodeType===9?e:e.ownerDocument}function Xp(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 Qp(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 wu(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 xu=null;function Zy(){var e=window.event;return e&&e.type==="popstate"?e===xu?!1:(xu=e,!0):(xu=null,!1)}var Jp=typeof setTimeout=="function"?setTimeout:void 0,e0=typeof clearTimeout=="function"?clearTimeout:void 0,Zp=typeof Promise=="function"?Promise:void 0,t0=typeof queueMicrotask=="function"?queueMicrotask:typeof Zp<"u"?function(e){return Zp.resolve(null).then(e).catch(n0)}:Jp;function n0(e){setTimeout(function(){throw e})}function sr(e){return e==="head"}function em(e,t){var i=t,a=0;do{var g=i.nextSibling;if(e.removeChild(i),g&&g.nodeType===8)if(i=g.data,i==="/$"||i==="/&"){if(a===0){e.removeChild(g),Ms(t);return}a--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")a++;else if(i==="html")Da(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Da(i);for(var w=i.firstChild;w;){var B=w.nextSibling,P=w.nodeName;w[On]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&w.rel.toLowerCase()==="stylesheet"||i.removeChild(w),w=B}}else i==="body"&&Da(e.ownerDocument.body);i=g}while(i);Ms(t)}function tm(e,t){var i=e;e=0;do{var a=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),a&&a.nodeType===8)if(i=a.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=a}while(i)}function Eu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Eu(i),qr(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function i0(e,t,i,a){for(;e.nodeType===1;){var g=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[On])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(w=e.getAttribute("rel"),w==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(w!==g.rel||e.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||e.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||e.getAttribute("title")!==(g.title==null?null:g.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(w=e.getAttribute("src"),(w!==(g.src==null?null:g.src)||e.getAttribute("type")!==(g.type==null?null:g.type)||e.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&w&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var w=g.name==null?null:""+g.name;if(g.type==="hidden"&&e.getAttribute("name")===w)return e}else return e;if(e=qn(e.nextSibling),e===null)break}return null}function r0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=qn(e.nextSibling),e===null))return null;return e}function nm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=qn(e.nextSibling),e===null))return null;return e}function ku(e){return e.data==="$?"||e.data==="$~"}function Au(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function s0(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var a=function(){t(),i.removeEventListener("DOMContentLoaded",a)};i.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function qn(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 Tu=null;function im(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return qn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function rm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function sm(e,t,i){switch(t=to(i),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Da(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);qr(e)}var $n=new Map,am=new Set;function no(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Oi=W.d;W.d={f:a0,r:l0,D:o0,C:c0,L:u0,m:h0,X:d0,S:f0,M:p0};function a0(){var e=Oi.f(),t=Wl();return e||t}function l0(e){var t=gi(e);t!==null&&t.tag===5&&t.type==="form"?wd(t):Oi.r(e)}var Ts=typeof document>"u"?null:document;function lm(e,t,i){var a=Ts;if(a&&typeof t=="string"&&t){var g=un(t);g='link[rel="'+e+'"][href="'+g+'"]',typeof i=="string"&&(g+='[crossorigin="'+i+'"]'),am.has(g)||(am.add(g),e={rel:e,crossOrigin:i,href:t},a.querySelector(g)===null&&(t=a.createElement("link"),Yt(t,"link",e),ot(t),a.head.appendChild(t)))}}function o0(e){Oi.D(e),lm("dns-prefetch",e,null)}function c0(e,t){Oi.C(e,t),lm("preconnect",e,t)}function u0(e,t,i){Oi.L(e,t,i);var a=Ts;if(a&&e&&t){var g='link[rel="preload"][as="'+un(t)+'"]';t==="image"&&i&&i.imageSrcSet?(g+='[imagesrcset="'+un(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(g+='[imagesizes="'+un(i.imageSizes)+'"]')):g+='[href="'+un(e)+'"]';var w=g;switch(t){case"style":w=Rs(e);break;case"script":w=Ds(e)}$n.has(w)||(e=u({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),$n.set(w,e),a.querySelector(g)!==null||t==="style"&&a.querySelector(Ma(w))||t==="script"&&a.querySelector(La(w))||(t=a.createElement("link"),Yt(t,"link",e),ot(t),a.head.appendChild(t)))}}function h0(e,t){Oi.m(e,t);var i=Ts;if(i&&e){var a=t&&typeof t.as=="string"?t.as:"script",g='link[rel="modulepreload"][as="'+un(a)+'"][href="'+un(e)+'"]',w=g;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Ds(e)}if(!$n.has(w)&&(e=u({rel:"modulepreload",href:e},t),$n.set(w,e),i.querySelector(g)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(La(w)))return}a=i.createElement("link"),Yt(a,"link",e),ot(a),i.head.appendChild(a)}}}function f0(e,t,i){Oi.S(e,t,i);var a=Ts;if(a&&e){var g=_i(a).hoistableStyles,w=Rs(e);t=t||"default";var B=g.get(w);if(!B){var P={loading:0,preload:null};if(B=a.querySelector(Ma(w)))P.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},i),(i=$n.get(w))&&Ru(e,i);var X=B=a.createElement("link");ot(X),Yt(X,"link",e),X._p=new Promise(function(le,fe){X.onload=le,X.onerror=fe}),X.addEventListener("load",function(){P.loading|=1}),X.addEventListener("error",function(){P.loading|=2}),P.loading|=4,io(B,t,a)}B={type:"stylesheet",instance:B,count:1,state:P},g.set(w,B)}}}function d0(e,t){Oi.X(e,t);var i=Ts;if(i&&e){var a=_i(i).hoistableScripts,g=Ds(e),w=a.get(g);w||(w=i.querySelector(La(g)),w||(e=u({src:e,async:!0},t),(t=$n.get(g))&&Du(e,t),w=i.createElement("script"),ot(w),Yt(w,"link",e),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},a.set(g,w))}}function p0(e,t){Oi.M(e,t);var i=Ts;if(i&&e){var a=_i(i).hoistableScripts,g=Ds(e),w=a.get(g);w||(w=i.querySelector(La(g)),w||(e=u({src:e,async:!0,type:"module"},t),(t=$n.get(g))&&Du(e,t),w=i.createElement("script"),ot(w),Yt(w,"link",e),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},a.set(g,w))}}function om(e,t,i,a){var g=(g=ge.current)?no(g):null;if(!g)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Rs(i.href),i=_i(g).hoistableStyles,a=i.get(t),a||(a={type:"style",instance:null,count:0,state:null},i.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Rs(i.href);var w=_i(g).hoistableStyles,B=w.get(e);if(B||(g=g.ownerDocument||g,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(e,B),(w=g.querySelector(Ma(e)))&&!w._p&&(B.instance=w,B.state.loading=5),$n.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},$n.set(e,i),w||m0(g,e,i,B.state))),t&&a===null)throw Error(l(528,""));return B}if(t&&a!==null)throw Error(l(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ds(i),i=_i(g).hoistableScripts,a=i.get(t),a||(a={type:"script",instance:null,count:0,state:null},i.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function Rs(e){return'href="'+un(e)+'"'}function Ma(e){return'link[rel="stylesheet"]['+e+"]"}function cm(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function m0(e,t,i,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Yt(t,"link",i),ot(t),e.head.appendChild(t))}function Ds(e){return'[src="'+un(e)+'"]'}function La(e){return"script[async]"+e}function um(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+un(i.href)+'"]');if(a)return t.instance=a,ot(a),a;var g=u({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),ot(a),Yt(a,"style",g),io(a,i.precedence,e),t.instance=a;case"stylesheet":g=Rs(i.href);var w=e.querySelector(Ma(g));if(w)return t.state.loading|=4,t.instance=w,ot(w),w;a=cm(i),(g=$n.get(g))&&Ru(a,g),w=(e.ownerDocument||e).createElement("link"),ot(w);var B=w;return B._p=new Promise(function(P,X){B.onload=P,B.onerror=X}),Yt(w,"link",a),t.state.loading|=4,io(w,i.precedence,e),t.instance=w;case"script":return w=Ds(i.src),(g=e.querySelector(La(w)))?(t.instance=g,ot(g),g):(a=i,(g=$n.get(w))&&(a=u({},i),Du(a,g)),e=e.ownerDocument||e,g=e.createElement("script"),ot(g),Yt(g,"link",a),e.head.appendChild(g),t.instance=g);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,io(a,i.precedence,e));return t.instance}function io(e,t,i){for(var a=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=a.length?a[a.length-1]:null,w=g,B=0;B<a.length;B++){var P=a[B];if(P.dataset.precedence===t)w=P;else if(w!==g)break}w?w.parentNode.insertBefore(e,w.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Ru(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Du(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ro=null;function hm(e,t,i){if(ro===null){var a=new Map,g=ro=new Map;g.set(i,a)}else g=ro,a=g.get(i),a||(a=new Map,g.set(i,a));if(a.has(e))return a;for(a.set(e,null),i=i.getElementsByTagName(e),g=0;g<i.length;g++){var w=i[g];if(!(w[On]||w[Tt]||e==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var B=w.getAttribute(t)||"";B=e+B;var P=a.get(B);P?P.push(w):a.set(B,[w])}}return a}function fm(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function g0(e,t,i){if(i===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 dm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function _0(e,t,i,a){if(i.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var g=Rs(a.href),w=t.querySelector(Ma(g));if(w){t=w._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=so.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=w,ot(w);return}w=t.ownerDocument||t,a=cm(a),(g=$n.get(g))&&Ru(a,g),w=w.createElement("link"),ot(w);var B=w;B._p=new Promise(function(P,X){B.onload=P,B.onerror=X}),Yt(w,"link",a),i.instance=w}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=so.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Mu=0;function v0(e,t){return e.stylesheets&&e.count===0&&lo(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var a=setTimeout(function(){if(e.stylesheets&&lo(e,e.stylesheets),e.unsuspend){var w=e.unsuspend;e.unsuspend=null,w()}},6e4+t);0<e.imgBytes&&Mu===0&&(Mu=62500*Jy());var g=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&lo(e,e.stylesheets),e.unsuspend)){var w=e.unsuspend;e.unsuspend=null,w()}},(e.imgBytes>Mu?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(g)}}:null}function so(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ao=null;function lo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ao=new Map,t.forEach(y0,e),ao=null,so.call(e))}function y0(e,t){if(!(t.state.loading&4)){var i=ao.get(e);if(i)var a=i.get(null);else{i=new Map,ao.set(e,i);for(var g=e.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<g.length;w++){var B=g[w];(B.nodeName==="LINK"||B.getAttribute("media")!=="not all")&&(i.set(B.dataset.precedence,B),a=B)}a&&i.set(null,a)}g=t.instance,B=g.getAttribute("data-precedence"),w=i.get(B)||a,w===a&&i.set(null,g),i.set(B,g),this.count++,a=so.bind(this),g.addEventListener("load",a),g.addEventListener("error",a),w?w.parentNode.insertBefore(g,w.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(g,e.firstChild)),t.state.loading|=4}}var Oa={$$typeof:y,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function S0(e,t,i,a,g,w,B,P,X){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=Sn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sn(0),this.hiddenUpdates=Sn(null),this.identifierPrefix=a,this.onUncaughtError=g,this.onCaughtError=w,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function pm(e,t,i,a,g,w,B,P,X,le,fe,_e){return e=new S0(e,t,i,B,X,le,fe,_e,P),t=1,w===!0&&(t|=24),w=En(3,null,null,t),e.current=w,w.stateNode=e,t=uc(),t.refCount++,e.pooledCache=t,t.refCount++,w.memoizedState={element:a,isDehydrated:i,cache:t},pc(w),e}function mm(e){return e?(e=ls,e):ls}function gm(e,t,i,a,g,w){g=mm(g),a.context===null?a.context=g:a.pendingContext=g,a=Ki(t),a.payload={element:i},w=w===void 0?null:w,w!==null&&(a.callback=w),i=Yi(e,a,t),i!==null&&(gn(i,e,t),ha(i,e,t))}function _m(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Lu(e,t){_m(e,t),(e=e.alternate)&&_m(e,t)}function vm(e){if(e.tag===13||e.tag===31){var t=wr(e,67108864);t!==null&&gn(t,e,67108864),Lu(e,67108864)}}function ym(e){if(e.tag===13||e.tag===31){var t=Dn();t=zi(t);var i=wr(e,t);i!==null&&gn(i,e,t),Lu(e,t)}}var oo=!0;function b0(e,t,i,a){var g=G.T;G.T=null;var w=W.p;try{W.p=2,Ou(e,t,i,a)}finally{W.p=w,G.T=g}}function C0(e,t,i,a){var g=G.T;G.T=null;var w=W.p;try{W.p=8,Ou(e,t,i,a)}finally{W.p=w,G.T=g}}function Ou(e,t,i,a){if(oo){var g=Bu(a);if(g===null)yu(e,t,a,co,i),bm(e,a);else if(x0(g,e,t,i,a))a.stopPropagation();else if(bm(e,a),t&4&&-1<w0.indexOf(e)){for(;g!==null;){var w=gi(g);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var B=on(w.pendingLanes);if(B!==0){var P=w;for(P.pendingLanes|=2,P.entangledLanes|=2;B;){var X=1<<31-Qe(B);P.entanglements[1]|=X,B&=~X}hi(w),(et&6)===0&&(Gl=tt()+500,Aa(0))}}break;case 31:case 13:P=wr(w,2),P!==null&&gn(P,w,2),Wl(),Lu(w,2)}if(w=Bu(a),w===null&&yu(e,t,a,co,i),w===g)break;g=w}g!==null&&a.stopPropagation()}else yu(e,t,a,null,i)}}function Bu(e){return e=Qs(e),ju(e)}var co=null;function ju(e){if(co=null,e=cn(e),e!==null){var t=p(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=f(t),e!==null)return e;e=null}else if(i===31){if(e=o(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return co=e,null}function Sm(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(jt()){case ue:return 2;case Se:return 8;case Ae:case Le:return 32;case je:return 268435456;default:return 32}default:return 32}}var Nu=!1,ar=null,lr=null,or=null,Ba=new Map,ja=new Map,cr=[],w0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function bm(e,t){switch(e){case"focusin":case"focusout":ar=null;break;case"dragenter":case"dragleave":lr=null;break;case"mouseover":case"mouseout":or=null;break;case"pointerover":case"pointerout":Ba.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ja.delete(t.pointerId)}}function Na(e,t,i,a,g,w){return e===null||e.nativeEvent!==w?(e={blockedOn:t,domEventName:i,eventSystemFlags:a,nativeEvent:w,targetContainers:[g]},t!==null&&(t=gi(t),t!==null&&vm(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,g!==null&&t.indexOf(g)===-1&&t.push(g),e)}function x0(e,t,i,a,g){switch(t){case"focusin":return ar=Na(ar,e,t,i,a,g),!0;case"dragenter":return lr=Na(lr,e,t,i,a,g),!0;case"mouseover":return or=Na(or,e,t,i,a,g),!0;case"pointerover":var w=g.pointerId;return Ba.set(w,Na(Ba.get(w)||null,e,t,i,a,g)),!0;case"gotpointercapture":return w=g.pointerId,ja.set(w,Na(ja.get(w)||null,e,t,i,a,g)),!0}return!1}function Cm(e){var t=cn(e.target);if(t!==null){var i=p(t);if(i!==null){if(t=i.tag,t===13){if(t=f(i),t!==null){e.blockedOn=t,nl(e.priority,function(){ym(i)});return}}else if(t===31){if(t=o(i),t!==null){e.blockedOn=t,nl(e.priority,function(){ym(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function uo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Bu(e.nativeEvent);if(i===null){i=e.nativeEvent;var a=new i.constructor(i.type,i);Bn=a,i.target.dispatchEvent(a),Bn=null}else return t=gi(i),t!==null&&vm(t),e.blockedOn=i,!1;t.shift()}return!0}function wm(e,t,i){uo(e)&&i.delete(t)}function E0(){Nu=!1,ar!==null&&uo(ar)&&(ar=null),lr!==null&&uo(lr)&&(lr=null),or!==null&&uo(or)&&(or=null),Ba.forEach(wm),ja.forEach(wm)}function ho(e,t){e.blockedOn===t&&(e.blockedOn=null,Nu||(Nu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,E0)))}var fo=null;function xm(e){fo!==e&&(fo=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){fo===e&&(fo=null);for(var t=0;t<e.length;t+=3){var i=e[t],a=e[t+1],g=e[t+2];if(typeof a!="function"){if(ju(a||i)===null)continue;break}var w=gi(i);w!==null&&(e.splice(t,3),t-=3,Bc(w,{pending:!0,data:g,method:i.method,action:a},a,g))}}))}function Ms(e){function t(X){return ho(X,e)}ar!==null&&ho(ar,e),lr!==null&&ho(lr,e),or!==null&&ho(or,e),Ba.forEach(t),ja.forEach(t);for(var i=0;i<cr.length;i++){var a=cr[i];a.blockedOn===e&&(a.blockedOn=null)}for(;0<cr.length&&(i=cr[0],i.blockedOn===null);)Cm(i),i.blockedOn===null&&cr.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(a=0;a<i.length;a+=3){var g=i[a],w=i[a+1],B=g[qt]||null;if(typeof w=="function")B||xm(i);else if(B){var P=null;if(w&&w.hasAttribute("formAction")){if(g=w,B=w[qt]||null)P=B.formAction;else if(ju(g)!==null)continue}else P=B.action;typeof P=="function"?i[a+1]=P:(i.splice(a,3),a-=3),xm(i)}}}function Em(){function e(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(B){return g=B})},focusReset:"manual",scroll:"manual"})}function t(){g!==null&&(g(),g=null),a||setTimeout(i,20)}function i(){if(!a&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,g=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),g!==null&&(g(),g=null)}}}function Hu(e){this._internalRoot=e}po.prototype.render=Hu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var i=t.current,a=Dn();gm(i,a,e,t,null,null)},po.prototype.unmount=Hu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gm(e.current,2,null,e,null,null),Wl(),t[Xn]=null}};function po(e){this._internalRoot=e}po.prototype.unstable_scheduleHydration=function(e){if(e){var t=Yn();e={blockedOn:null,target:e,priority:t};for(var i=0;i<cr.length&&t!==0&&t<cr[i].priority;i++);cr.splice(i,0,e),i===0&&Cm(e)}};var km=r.version;if(km!=="19.2.6")throw Error(l(527,km,"19.2.6"));W.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=h(t),e=e!==null?m(e):null,e=e===null?null:e.stateNode,e};var k0={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mo.isDisabled&&mo.supportsFiber)try{St=mo.inject(k0),vt=mo}catch{}}return za.createRoot=function(e,t){if(!d(e))throw Error(l(299));var i=!1,a="",g=Od,w=Bd,B=jd;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(g=t.onUncaughtError),t.onCaughtError!==void 0&&(w=t.onCaughtError),t.onRecoverableError!==void 0&&(B=t.onRecoverableError)),t=pm(e,1,!1,null,null,i,a,null,g,w,B,Em),e[Xn]=t.current,vu(e),new Hu(t)},za.hydrateRoot=function(e,t,i){if(!d(e))throw Error(l(299));var a=!1,g="",w=Od,B=Bd,P=jd,X=null;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(g=i.identifierPrefix),i.onUncaughtError!==void 0&&(w=i.onUncaughtError),i.onCaughtError!==void 0&&(B=i.onCaughtError),i.onRecoverableError!==void 0&&(P=i.onRecoverableError),i.formState!==void 0&&(X=i.formState)),t=pm(e,1,!0,t,i??null,a,g,X,w,B,P,Em),t.context=mm(null),i=t.current,a=Dn(),a=zi(a),g=Ki(a),g.callback=null,Yi(i,g,a),i=a,t.current.lanes=i,Ft(t,i),hi(t),e[Xn]=t.current,vu(e),new po(t)},za.version="19.2.6",za}var Hm;function z0(){if(Hm)return Uu.exports;Hm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Uu.exports=H0(),Uu.exports}var I0=z0();const Ur=function(n,r){let d=n;const p=$a[r];let f=null,o=0,c=null;const h=[],m={},u=function(R,k){o=d*4+17,f=(function(M){const j=new Array(M);for(let H=0;H<M;H+=1){j[H]=new Array(M);for(let U=0;U<M;U+=1)j[H][U]=null}return j})(o),b(0,0),b(o-7,0),b(0,o-7),E(),T(),v(R,k),d>=7&&S(R),c==null&&(c=A(d,p,h)),_(c,k)},b=function(R,k){for(let M=-1;M<=7;M+=1)if(!(R+M<=-1||o<=R+M))for(let j=-1;j<=7;j+=1)k+j<=-1||o<=k+j||(0<=M&&M<=6&&(j==0||j==6)||0<=j&&j<=6&&(M==0||M==6)||2<=M&&M<=4&&2<=j&&j<=4?f[R+M][k+j]=!0:f[R+M][k+j]=!1)},C=function(){let R=0,k=0;for(let M=0;M<8;M+=1){u(!0,M);const j=fr.getLostPoint(m);(M==0||R>j)&&(R=j,k=M)}return k},T=function(){for(let R=8;R<o-8;R+=1)f[R][6]==null&&(f[R][6]=R%2==0);for(let R=8;R<o-8;R+=1)f[6][R]==null&&(f[6][R]=R%2==0)},E=function(){const R=fr.getPatternPosition(d);for(let k=0;k<R.length;k+=1)for(let M=0;M<R.length;M+=1){const j=R[k],H=R[M];if(f[j][H]==null)for(let U=-2;U<=2;U+=1)for(let F=-2;F<=2;F+=1)U==-2||U==2||F==-2||F==2||U==0&&F==0?f[j+U][H+F]=!0:f[j+U][H+F]=!1}},S=function(R){const k=fr.getBCHTypeNumber(d);for(let M=0;M<18;M+=1){const j=!R&&(k>>M&1)==1;f[Math.floor(M/3)][M%3+o-8-3]=j}for(let M=0;M<18;M+=1){const j=!R&&(k>>M&1)==1;f[M%3+o-8-3][Math.floor(M/3)]=j}},v=function(R,k){const M=p<<3|k,j=fr.getBCHTypeInfo(M);for(let H=0;H<15;H+=1){const U=!R&&(j>>H&1)==1;H<6?f[H][8]=U:H<8?f[H+1][8]=U:f[o-15+H][8]=U}for(let H=0;H<15;H+=1){const U=!R&&(j>>H&1)==1;H<8?f[8][o-H-1]=U:H<9?f[8][15-H-1+1]=U:f[8][15-H-1]=U}f[o-8][8]=!R},_=function(R,k){let M=-1,j=o-1,H=7,U=0;const F=fr.getMaskFunction(k);for(let K=o-1;K>0;K-=2)for(K==6&&(K-=1);;){for(let Y=0;Y<2;Y+=1)if(f[j][K-Y]==null){let G=!1;U<R.length&&(G=(R[U]>>>H&1)==1),F(j,K-Y)&&(G=!G),f[j][K-Y]=G,H-=1,H==-1&&(U+=1,H=7)}if(j+=M,j<0||o<=j){j-=M,M=-M;break}}},y=function(R,k){let M=0,j=0,H=0;const U=new Array(k.length),F=new Array(k.length);for(let W=0;W<k.length;W+=1){const Z=k[W].dataCount,z=k[W].totalCount-Z;j=Math.max(j,Z),H=Math.max(H,z),U[W]=new Array(Z);for(let I=0;I<U[W].length;I+=1)U[W][I]=255&R.getBuffer()[I+M];M+=Z;const O=fr.getErrorCorrectPolynomial(z),$=Ya(U[W],O.getLength()-1).mod(O);F[W]=new Array(O.getLength()-1);for(let I=0;I<F[W].length;I+=1){const re=I+$.getLength()-F[W].length;F[W][I]=re>=0?$.getAt(re):0}}let K=0;for(let W=0;W<k.length;W+=1)K+=k[W].totalCount;const Y=new Array(K);let G=0;for(let W=0;W<j;W+=1)for(let Z=0;Z<k.length;Z+=1)W<U[Z].length&&(Y[G]=U[Z][W],G+=1);for(let W=0;W<H;W+=1)for(let Z=0;Z<k.length;Z+=1)W<F[Z].length&&(Y[G]=F[Z][W],G+=1);return Y},A=function(R,k,M){const j=zm.getRSBlocks(R,k),H=Im();for(let F=0;F<M.length;F+=1){const K=M[F];H.put(K.getMode(),4),H.put(K.getLength(),fr.getLengthInBits(K.getMode(),R)),K.write(H)}let U=0;for(let F=0;F<j.length;F+=1)U+=j[F].dataCount;if(H.getLengthInBits()>U*8)throw"code length overflow. ("+H.getLengthInBits()+">"+U*8+")";for(H.getLengthInBits()+4<=U*8&&H.put(0,4);H.getLengthInBits()%8!=0;)H.putBit(!1);for(;!(H.getLengthInBits()>=U*8||(H.put(236,8),H.getLengthInBits()>=U*8));)H.put(17,8);return y(H,j)};m.addData=function(R,k){k=k||"Byte";let M=null;switch(k){case"Numeric":M=U0(R);break;case"Alphanumeric":M=P0(R);break;case"Byte":M=F0(R);break;case"Kanji":M=q0(R);break;default:throw"mode:"+k}h.push(M),c=null},m.isDark=function(R,k){if(R<0||o<=R||k<0||o<=k)throw R+","+k;return f[R][k]},m.getModuleCount=function(){return o},m.make=function(){if(d<1){let R=1;for(;R<40;R++){const k=zm.getRSBlocks(R,p),M=Im();for(let H=0;H<h.length;H++){const U=h[H];M.put(U.getMode(),4),M.put(U.getLength(),fr.getLengthInBits(U.getMode(),R)),U.write(M)}let j=0;for(let H=0;H<k.length;H++)j+=k[H].dataCount;if(M.getLengthInBits()<=j*8)break}d=R}u(!1,C())},m.createTableTag=function(R,k){R=R||2,k=typeof k>"u"?R*4:k;let M="";M+='<table style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: "+k+"px;",M+='">',M+="<tbody>";for(let j=0;j<m.getModuleCount();j+=1){M+="<tr>";for(let H=0;H<m.getModuleCount();H+=1)M+='<td style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: 0px;",M+=" width: "+R+"px;",M+=" height: "+R+"px;",M+=" background-color: ",M+=m.isDark(j,H)?"#000000":"#ffffff",M+=";",M+='"/>';M+="</tr>"}return M+="</tbody>",M+="</table>",M},m.createSvgTag=function(R,k,M,j){let H={};typeof arguments[0]=="object"&&(H=arguments[0],R=H.cellSize,k=H.margin,M=H.alt,j=H.title),R=R||2,k=typeof k>"u"?R*4:k,M=typeof M=="string"?{text:M}:M||{},M.text=M.text||null,M.id=M.text?M.id||"qrcode-description":null,j=typeof j=="string"?{text:j}:j||{},j.text=j.text||null,j.id=j.text?j.id||"qrcode-title":null;const U=m.getModuleCount()*R+k*2;let F,K,Y,G,W="",Z;for(Z="l"+R+",0 0,"+R+" -"+R+",0 0,-"+R+"z ",W+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',W+=H.scalable?"":' width="'+U+'px" height="'+U+'px"',W+=' viewBox="0 0 '+U+" "+U+'" ',W+=' preserveAspectRatio="xMinYMin meet"',W+=j.text||M.text?' role="img" aria-labelledby="'+L([j.id,M.id].join(" ").trim())+'"':"",W+=">",W+=j.text?'<title id="'+L(j.id)+'">'+L(j.text)+"</title>":"",W+=M.text?'<description id="'+L(M.id)+'">'+L(M.text)+"</description>":"",W+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',W+='<path d="',Y=0;Y<m.getModuleCount();Y+=1)for(G=Y*R+k,F=0;F<m.getModuleCount();F+=1)m.isDark(Y,F)&&(K=F*R+k,W+="M"+K+","+G+Z);return W+='" stroke="transparent" fill="black"/>',W+="</svg>",W},m.createDataURL=function(R,k){R=R||2,k=typeof k>"u"?R*4:k;const M=m.getModuleCount()*R+k*2,j=k,H=M-k;return W0(M,M,function(U,F){if(j<=U&&U<H&&j<=F&&F<H){const K=Math.floor((U-j)/R),Y=Math.floor((F-j)/R);return m.isDark(Y,K)?0:1}else return 1})},m.createImgTag=function(R,k,M){R=R||2,k=typeof k>"u"?R*4:k;const j=m.getModuleCount()*R+k*2;let H="";return H+="<img",H+=' src="',H+=m.createDataURL(R,k),H+='"',H+=' width="',H+=j,H+='"',H+=' height="',H+=j,H+='"',M&&(H+=' alt="',H+=L(M),H+='"'),H+="/>",H};const L=function(R){let k="";for(let M=0;M<R.length;M+=1){const j=R.charAt(M);switch(j){case"<":k+="<";break;case">":k+=">";break;case"&":k+="&";break;case'"':k+=""";break;default:k+=j;break}}return k},D=function(R){R=typeof R>"u"?2:R;const M=m.getModuleCount()*1+R*2,j=R,H=M-R;let U,F,K,Y,G;const W={"██":"█","█ ":"▀"," █":"▄"," ":" "},Z={"██":"▀","█ ":"▀"," █":" "," ":" "};let z="";for(U=0;U<M;U+=2){for(K=Math.floor((U-j)/1),Y=Math.floor((U+1-j)/1),F=0;F<M;F+=1)G="█",j<=F&&F<H&&j<=U&&U<H&&m.isDark(K,Math.floor((F-j)/1))&&(G=" "),j<=F&&F<H&&j<=U+1&&U+1<H&&m.isDark(Y,Math.floor((F-j)/1))?G+=" ":G+="█",z+=R<1&&U+1>=H?Z[G]:W[G];z+=`
|
|
50
|
+
`}return M%2&&R>0?z.substring(0,z.length-M-1)+Array(M+1).join("▀"):z.substring(0,z.length-1)};return m.createASCII=function(R,k){if(R=R||1,R<2)return D(k);R-=1,k=typeof k>"u"?R*2:k;const M=m.getModuleCount()*R+k*2,j=k,H=M-k;let U,F,K,Y;const G=Array(R+1).join("██"),W=Array(R+1).join(" ");let Z="",z="";for(U=0;U<M;U+=1){for(K=Math.floor((U-j)/R),z="",F=0;F<M;F+=1)Y=1,j<=F&&F<H&&j<=U&&U<H&&m.isDark(K,Math.floor((F-j)/R))&&(Y=0),z+=Y?G:W;for(K=0;K<R;K+=1)Z+=z+`
|
|
51
|
+
`}return Z.substring(0,Z.length-1)},m.renderTo2dContext=function(R,k){k=k||2;const M=m.getModuleCount();for(let j=0;j<M;j++)for(let H=0;H<M;H++)R.fillStyle=m.isDark(j,H)?"black":"white",R.fillRect(H*k,j*k,k,k)},m};Ur.stringToBytes=function(n){const r=[];for(let s=0;s<n.length;s+=1){const l=n.charCodeAt(s);r.push(l&255)}return r};Ur.createStringToBytes=function(n,r){const s=(function(){const d=G0(n),p=function(){const c=d.read();if(c==-1)throw"eof";return c};let f=0;const o={};for(;;){const c=d.read();if(c==-1)break;const h=p(),m=p(),u=p(),b=String.fromCharCode(c<<8|h),C=m<<8|u;o[b]=C,f+=1}if(f!=r)throw f+" != "+r;return o})(),l=63;return function(d){const p=[];for(let f=0;f<d.length;f+=1){const o=d.charCodeAt(f);if(o<128)p.push(o);else{const c=s[d.charAt(f)];typeof c=="number"?(c&255)==c?p.push(c):(p.push(c>>>8),p.push(c&255)):p.push(l)}}return p}};const en={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},$a={L:1,M:0,Q:3,H:2},hr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},fr=(function(){const n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r=1335,s=7973,l=21522,d={},p=function(f){let o=0;for(;f!=0;)o+=1,f>>>=1;return o};return d.getBCHTypeInfo=function(f){let o=f<<10;for(;p(o)-p(r)>=0;)o^=r<<p(o)-p(r);return(f<<10|o)^l},d.getBCHTypeNumber=function(f){let o=f<<12;for(;p(o)-p(s)>=0;)o^=s<<p(o)-p(s);return f<<12|o},d.getPatternPosition=function(f){return n[f-1]},d.getMaskFunction=function(f){switch(f){case hr.PATTERN000:return function(o,c){return(o+c)%2==0};case hr.PATTERN001:return function(o,c){return o%2==0};case hr.PATTERN010:return function(o,c){return c%3==0};case hr.PATTERN011:return function(o,c){return(o+c)%3==0};case hr.PATTERN100:return function(o,c){return(Math.floor(o/2)+Math.floor(c/3))%2==0};case hr.PATTERN101:return function(o,c){return o*c%2+o*c%3==0};case hr.PATTERN110:return function(o,c){return(o*c%2+o*c%3)%2==0};case hr.PATTERN111:return function(o,c){return(o*c%3+(o+c)%2)%2==0};default:throw"bad maskPattern:"+f}},d.getErrorCorrectPolynomial=function(f){let o=Ya([1],0);for(let c=0;c<f;c+=1)o=o.multiply(Ya([1,pr.gexp(c)],0));return o},d.getLengthInBits=function(f,o){if(1<=o&&o<10)switch(f){case en.MODE_NUMBER:return 10;case en.MODE_ALPHA_NUM:return 9;case en.MODE_8BIT_BYTE:return 8;case en.MODE_KANJI:return 8;default:throw"mode:"+f}else if(o<27)switch(f){case en.MODE_NUMBER:return 12;case en.MODE_ALPHA_NUM:return 11;case en.MODE_8BIT_BYTE:return 16;case en.MODE_KANJI:return 10;default:throw"mode:"+f}else if(o<41)switch(f){case en.MODE_NUMBER:return 14;case en.MODE_ALPHA_NUM:return 13;case en.MODE_8BIT_BYTE:return 16;case en.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+o},d.getLostPoint=function(f){const o=f.getModuleCount();let c=0;for(let u=0;u<o;u+=1)for(let b=0;b<o;b+=1){let C=0;const T=f.isDark(u,b);for(let E=-1;E<=1;E+=1)if(!(u+E<0||o<=u+E))for(let S=-1;S<=1;S+=1)b+S<0||o<=b+S||E==0&&S==0||T==f.isDark(u+E,b+S)&&(C+=1);C>5&&(c+=3+C-5)}for(let u=0;u<o-1;u+=1)for(let b=0;b<o-1;b+=1){let C=0;f.isDark(u,b)&&(C+=1),f.isDark(u+1,b)&&(C+=1),f.isDark(u,b+1)&&(C+=1),f.isDark(u+1,b+1)&&(C+=1),(C==0||C==4)&&(c+=3)}for(let u=0;u<o;u+=1)for(let b=0;b<o-6;b+=1)f.isDark(u,b)&&!f.isDark(u,b+1)&&f.isDark(u,b+2)&&f.isDark(u,b+3)&&f.isDark(u,b+4)&&!f.isDark(u,b+5)&&f.isDark(u,b+6)&&(c+=40);for(let u=0;u<o;u+=1)for(let b=0;b<o-6;b+=1)f.isDark(b,u)&&!f.isDark(b+1,u)&&f.isDark(b+2,u)&&f.isDark(b+3,u)&&f.isDark(b+4,u)&&!f.isDark(b+5,u)&&f.isDark(b+6,u)&&(c+=40);let h=0;for(let u=0;u<o;u+=1)for(let b=0;b<o;b+=1)f.isDark(b,u)&&(h+=1);const m=Math.abs(100*h/o/o-50)/5;return c+=m*10,c},d})(),pr=(function(){const n=new Array(256),r=new Array(256);for(let l=0;l<8;l+=1)n[l]=1<<l;for(let l=8;l<256;l+=1)n[l]=n[l-4]^n[l-5]^n[l-6]^n[l-8];for(let l=0;l<255;l+=1)r[n[l]]=l;const s={};return s.glog=function(l){if(l<1)throw"glog("+l+")";return r[l]},s.gexp=function(l){for(;l<0;)l+=255;for(;l>=256;)l-=255;return n[l]},s})(),Ya=function(n,r){if(typeof n.length>"u")throw n.length+"/"+r;const s=(function(){let d=0;for(;d<n.length&&n[d]==0;)d+=1;const p=new Array(n.length-d+r);for(let f=0;f<n.length-d;f+=1)p[f]=n[f+d];return p})(),l={};return l.getAt=function(d){return s[d]},l.getLength=function(){return s.length},l.multiply=function(d){const p=new Array(l.getLength()+d.getLength()-1);for(let f=0;f<l.getLength();f+=1)for(let o=0;o<d.getLength();o+=1)p[f+o]^=pr.gexp(pr.glog(l.getAt(f))+pr.glog(d.getAt(o)));return Ya(p,0)},l.mod=function(d){if(l.getLength()-d.getLength()<0)return l;const p=pr.glog(l.getAt(0))-pr.glog(d.getAt(0)),f=new Array(l.getLength());for(let o=0;o<l.getLength();o+=1)f[o]=l.getAt(o);for(let o=0;o<d.getLength();o+=1)f[o]^=pr.gexp(pr.glog(d.getAt(o))+p);return Ya(f,0).mod(d)},l},zm=(function(){const n=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r=function(d,p){const f={};return f.totalCount=d,f.dataCount=p,f},s={},l=function(d,p){switch(p){case $a.L:return n[(d-1)*4+0];case $a.M:return n[(d-1)*4+1];case $a.Q:return n[(d-1)*4+2];case $a.H:return n[(d-1)*4+3];default:return}};return s.getRSBlocks=function(d,p){const f=l(d,p);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+p;const o=f.length/3,c=[];for(let h=0;h<o;h+=1){const m=f[h*3+0],u=f[h*3+1],b=f[h*3+2];for(let C=0;C<m;C+=1)c.push(r(u,b))}return c},s})(),Im=function(){const n=[];let r=0;const s={};return s.getBuffer=function(){return n},s.getAt=function(l){const d=Math.floor(l/8);return(n[d]>>>7-l%8&1)==1},s.put=function(l,d){for(let p=0;p<d;p+=1)s.putBit((l>>>d-p-1&1)==1)},s.getLengthInBits=function(){return r},s.putBit=function(l){const d=Math.floor(r/8);n.length<=d&&n.push(0),l&&(n[d]|=128>>>r%8),r+=1},s},U0=function(n){const r=en.MODE_NUMBER,s=n,l={};l.getMode=function(){return r},l.getLength=function(f){return s.length},l.write=function(f){const o=s;let c=0;for(;c+2<o.length;)f.put(d(o.substring(c,c+3)),10),c+=3;c<o.length&&(o.length-c==1?f.put(d(o.substring(c,c+1)),4):o.length-c==2&&f.put(d(o.substring(c,c+2)),7))};const d=function(f){let o=0;for(let c=0;c<f.length;c+=1)o=o*10+p(f.charAt(c));return o},p=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return l},P0=function(n){const r=en.MODE_ALPHA_NUM,s=n,l={};l.getMode=function(){return r},l.getLength=function(p){return s.length},l.write=function(p){const f=s;let o=0;for(;o+1<f.length;)p.put(d(f.charAt(o))*45+d(f.charAt(o+1)),11),o+=2;o<f.length&&p.put(d(f.charAt(o)),6)};const d=function(p){if("0"<=p&&p<="9")return p.charCodeAt(0)-48;if("A"<=p&&p<="Z")return p.charCodeAt(0)-65+10;switch(p){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+p}};return l},F0=function(n){const r=en.MODE_8BIT_BYTE,s=Ur.stringToBytes(n),l={};return l.getMode=function(){return r},l.getLength=function(d){return s.length},l.write=function(d){for(let p=0;p<s.length;p+=1)d.put(s[p],8)},l},q0=function(n){const r=en.MODE_KANJI,s=Ur.stringToBytes;(function(p,f){const o=s(p);if(o.length!=2||(o[0]<<8|o[1])!=f)throw"sjis not supported."})("友",38726);const l=s(n),d={};return d.getMode=function(){return r},d.getLength=function(p){return~~(l.length/2)},d.write=function(p){const f=l;let o=0;for(;o+1<f.length;){let c=(255&f[o])<<8|255&f[o+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(o+1)+"/"+c;c=(c>>>8&255)*192+(c&255),p.put(c,13),o+=2}if(o<f.length)throw"illegal char at "+(o+1)},d},Jg=function(){const n=[],r={};return r.writeByte=function(s){n.push(s&255)},r.writeShort=function(s){r.writeByte(s),r.writeByte(s>>>8)},r.writeBytes=function(s,l,d){l=l||0,d=d||s.length;for(let p=0;p<d;p+=1)r.writeByte(s[p+l])},r.writeString=function(s){for(let l=0;l<s.length;l+=1)r.writeByte(s.charCodeAt(l))},r.toByteArray=function(){return n},r.toString=function(){let s="";s+="[";for(let l=0;l<n.length;l+=1)l>0&&(s+=","),s+=n[l];return s+="]",s},r},$0=function(){let n=0,r=0,s=0,l="";const d={},p=function(o){l+=String.fromCharCode(f(o&63))},f=function(o){if(o<0)throw"n:"+o;if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47;throw"n:"+o};return d.writeByte=function(o){for(n=n<<8|o&255,r+=8,s+=1;r>=6;)p(n>>>r-6),r-=6},d.flush=function(){if(r>0&&(p(n<<6-r),n=0,r=0),s%3!=0){const o=3-s%3;for(let c=0;c<o;c+=1)l+="="}},d.toString=function(){return l},d},G0=function(n){const r=n;let s=0,l=0,d=0;const p={};p.read=function(){for(;d<8;){if(s>=r.length){if(d==0)return-1;throw"unexpected end of file./"+d}const c=r.charAt(s);if(s+=1,c=="=")return d=0,-1;if(c.match(/^\s$/))continue;l=l<<6|f(c.charCodeAt(0)),d+=6}const o=l>>>d-8&255;return d-=8,o};const f=function(o){if(65<=o&&o<=90)return o-65;if(97<=o&&o<=122)return o-97+26;if(48<=o&&o<=57)return o-48+52;if(o==43)return 62;if(o==47)return 63;throw"c:"+o};return p},V0=function(n,r){const s=n,l=r,d=new Array(n*r),p={};p.setPixel=function(h,m,u){d[m*s+h]=u},p.write=function(h){h.writeString("GIF87a"),h.writeShort(s),h.writeShort(l),h.writeByte(128),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(255),h.writeByte(255),h.writeByte(255),h.writeString(","),h.writeShort(0),h.writeShort(0),h.writeShort(s),h.writeShort(l),h.writeByte(0);const m=2,u=o(m);h.writeByte(m);let b=0;for(;u.length-b>255;)h.writeByte(255),h.writeBytes(u,b,255),b+=255;h.writeByte(u.length-b),h.writeBytes(u,b,u.length-b),h.writeByte(0),h.writeString(";")};const f=function(h){const m=h;let u=0,b=0;const C={};return C.write=function(T,E){if(T>>>E)throw"length over";for(;u+E>=8;)m.writeByte(255&(T<<u|b)),E-=8-u,T>>>=8-u,b=0,u=0;b=T<<u|b,u=u+E},C.flush=function(){u>0&&m.writeByte(b)},C},o=function(h){const m=1<<h,u=(1<<h)+1;let b=h+1;const C=c();for(let _=0;_<m;_+=1)C.add(String.fromCharCode(_));C.add(String.fromCharCode(m)),C.add(String.fromCharCode(u));const T=Jg(),E=f(T);E.write(m,b);let S=0,v=String.fromCharCode(d[S]);for(S+=1;S<d.length;){const _=String.fromCharCode(d[S]);S+=1,C.contains(v+_)?v=v+_:(E.write(C.indexOf(v),b),C.size()<4095&&(C.size()==1<<b&&(b+=1),C.add(v+_)),v=_)}return E.write(C.indexOf(v),b),E.write(u,b),E.flush(),T.toByteArray()},c=function(){const h={};let m=0;const u={};return u.add=function(b){if(u.contains(b))throw"dup key:"+b;h[b]=m,m+=1},u.size=function(){return m},u.indexOf=function(b){return h[b]},u.contains=function(b){return typeof h[b]<"u"},u};return p},W0=function(n,r,s){const l=V0(n,r);for(let o=0;o<r;o+=1)for(let c=0;c<n;c+=1)l.setPixel(c,o,s(c,o));const d=Jg();l.write(d);const p=$0(),f=d.toByteArray();for(let o=0;o<f.length;o+=1)p.writeByte(f[o]);return p.flush(),"data:image/gif;base64,"+p};Ur.stringToBytes;const zs=[{name:"project-manager",label:"Project Manager",commandAgent:"project-manager",dispatchable:!1},{name:"architect",label:"Architect",commandAgent:"architect",dispatchable:!0},{name:"coder",label:"Coder",commandAgent:"coder",dispatchable:!0},{name:"reviewer",label:"Reviewer",commandAgent:"reviewer",dispatchable:!0}],Zg={name:"gate-reviewer",label:"Gate Reviewer",commandAgent:"gate-reviewer",dispatchable:!1},Ps=[...zs,Zg],K0={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},Y0={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},e_=[K0,Y0],Mh=[...Ps,...e_];zs.map(n=>n.name);const Lh=Ps.map(n=>n.name);e_.map(n=>n.name);Mh.map(n=>n.name);Mh.filter(n=>n.dispatchable).map(n=>n.name);function X0(n){return Lh.includes(n)}const Q0="zh-CN",J0="pm-final-only",t_=[{value:"zh-CN",label:"Chinese"},{value:"ja",label:"Japanese"},{value:"ko",label:"Korean"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"}],Z0=[{value:"pm-final-only",label:"PM final reply"},{value:"final-only",label:"Each role final reply"},{value:"all",label:"All replies"}];function e1(){const n={};for(const r of Lh)n[r]={permissionMode:"bypassPermissions",model:"default",effort:"default"};return{version:1,roles:n,autoOrchestration:!0}}function t1({sidebar:n,children:r}){const[s,l]=te.useState(!1);return x.jsxs("div",{className:s?"app-shell is-sidebar-collapsed":"app-shell",children:[x.jsxs("aside",{className:"app-sidebar",children:[x.jsx("button",{className:"sidebar-toggle",type:"button","aria-label":s?"Expand sidebar":"Collapse sidebar",title:s?"Expand sidebar":"Collapse sidebar",onClick:()=>l(d=>!d)}),x.jsx("div",{className:"sidebar-content",children:n})]}),x.jsx("main",{className:"app-main",children:r})]})}function n1({busy:n,state:r,onApprove:s,onCancel:l,onComment:d,onReject:p}){var _;const[f,o]=te.useState(!1),[c,h]=te.useState(""),[m,u]=te.useState(null);if(!r||r.status==="idle")return null;const b=r.active,C=i1(r);if(m===C)return null;const T=r.status==="awaiting_user_approval",E=(b==null?void 0:b.title)??((_=r.pending[0])==null?void 0:_.title)??"Harness feedback",S=(b==null?void 0:b.source)==="task-retrospective"?"Task Harness Review":"Harness Feedback",v=()=>{o(!1),u(C)};return x.jsxs(x.Fragment,{children:[x.jsxs("section",{className:T?"harness-feedback-float needs-review":"harness-feedback-float",children:[x.jsxs("div",{children:[x.jsx("strong",{children:T?`${S} needed`:S}),x.jsx("span",{children:r1(r)})]}),x.jsx("p",{title:E,children:E}),x.jsxs("div",{className:"harness-feedback-float-actions",children:[x.jsx("button",{type:"button",disabled:n,onClick:v,children:"Close"}),x.jsx("button",{type:"button",disabled:n||!b,onClick:()=>o(!0),children:T?"Review":"Open"})]})]}),f&&b?x.jsx("div",{className:"modal-backdrop harness-feedback-backdrop",children:x.jsxs("section",{className:"harness-feedback-modal",role:"dialog","aria-modal":"true","aria-label":"Harness feedback review",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:S}),x.jsxs("p",{className:"muted",children:[r.status.replaceAll("_"," ")," · queued ",r.queuedCount]})]}),x.jsx("button",{type:"button",onClick:()=>o(!1),children:"Close"})]}),x.jsxs("div",{className:"harness-feedback-modal-body",children:[x.jsxs("section",{children:[x.jsx("h3",{children:b.source==="task-retrospective"?"Task Retrospective Request":"Feedback"}),x.jsx("pre",{children:b.feedbackContent||"No feedback content found."})]}),x.jsxs("section",{children:[x.jsx("h3",{children:"Harness Engineer Analysis"}),x.jsx("pre",{children:b.analysisContent||"Analysis is not available yet."})]})]}),T?x.jsxs("footer",{className:"harness-feedback-review-actions",children:[x.jsx("textarea",{value:c,placeholder:"Optional note for Harness Engineer...",onChange:y=>h(y.target.value)}),x.jsxs("div",{children:[x.jsx("button",{type:"button",disabled:n,onClick:()=>d(c),children:"Send Feedback"}),x.jsx("button",{type:"button",disabled:n,onClick:()=>p(c),children:"Reject"}),x.jsx("button",{type:"button",disabled:n,onClick:()=>s(c),children:"Approve"})]})]}):b?x.jsxs("footer",{className:"harness-feedback-review-actions",children:[x.jsx("textarea",{value:c,placeholder:"Optional cancellation note...",onChange:y=>h(y.target.value)}),x.jsx("div",{children:x.jsx("button",{type:"button",disabled:n,onClick:()=>l(c),children:"Cancel"})})]}):null]})}):null]})}function i1(n){if(n.active)return["active",n.status,n.active.id,n.active.path,n.active.updatedAt??"",n.active.analysisPath??"",n.active.applyReportPath??""].join(":");const r=n.pending[0];return r?["pending",n.status,r.id,r.path,n.queuedCount].join(":"):[n.status,n.queuedCount].join(":")}function r1(n){return n.status==="queued"?`${n.queuedCount} queued`:n.status==="awaiting_user_approval"?"waiting for approval":n.status==="analyzing"?"Harness Engineer analyzing":n.status==="applying"?"Harness Engineer applying":n.status}function Lo(n,r="Unknown error."){if(n instanceof Error)return n.message||r;if(typeof n=="string"&&n.trim())return n;if(n===void 0)return r;try{return JSON.stringify(n)}catch{return String(n)}}function _t(n,r,s){return`${n} failed. Reason: ${Lo(r,s)}`}function xo(n,r){return r.some(s=>n.startsWith(`${s} failed.`))?"":n}const ye={getAppPreferences(){return Ce("/api/settings/preferences")},updateAppPreferences(n){return Ce("/api/settings/preferences",{method:"PUT",body:JSON.stringify(n)})},getRuntimeDiagnostics(){return Ce("/api/diagnostics/runtime")},getCurrentProject(){return Ce("/api/projects/current")},pullCurrentProject(){return Ce("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return Ce("/api/projects/recent")},connectProject(n){return Ce("/api/projects/connect",{method:"POST",body:JSON.stringify(n)})},listTasks(){return Ce("/api/tasks")},createTask(n){return Ce("/api/tasks",{method:"POST",body:JSON.stringify(n)})},cleanupTask(n,r={}){return Ce(`/api/tasks/${encodeURIComponent(n)}/cleanup`,{method:"POST",body:JSON.stringify(r)})},getHarnessStatus(n){const r=new URLSearchParams({taskSlug:n});return Ce(`/api/projects/harness?${r.toString()}`)},applyHarness(n){return Ce("/api/projects/harness/apply",{method:"POST",body:JSON.stringify(n)})},getHarnessFileContent(n,r){const s=new URLSearchParams({path:r,taskSlug:n});return Ce(`/api/projects/harness/file?${s.toString()}`)},updateHarnessFileContent(n,r,s){const l=new URLSearchParams({path:r,taskSlug:n});return Ce(`/api/projects/harness/file?${l.toString()}`,{method:"PUT",body:JSON.stringify(s)})},getRepositoryDiff(n,r){const s=new URLSearchParams({taskSlug:n});return r&&s.set("commit",r),Ce(`/api/projects/harness/repository-diff?${s.toString()}`)},getRepositoryFileDiff(n,r){const s=new URLSearchParams({taskSlug:n,path:r});return Ce(`/api/projects/harness/repository-diff/file?${s.toString()}`)},mergeRepositoryDiffToCurrentBranch(n){return Ce("/api/projects/harness/repository-diff/merge-to-current-branch",{method:"POST",body:JSON.stringify({taskSlug:n})})},getHarnessBootstrapStatus(n){const r=new URLSearchParams({taskSlug:n});return Ce(`/api/projects/harness/bootstrap?${r.toString()}`)},startHarnessBootstrap(n={}){return Ce("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(n)})},restartHarnessBootstrap(n={}){return Ce("/api/projects/harness/bootstrap/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessBootstrap(){return Ce("/api/projects/harness/bootstrap/stop",{method:"POST"})},runHarnessBootstrap(n){return Ce("/api/projects/harness/bootstrap/run",{method:"POST",body:JSON.stringify(n)})},getHarnessEngineerSession(){return Ce("/api/projects/harness/engineer/session")},ensureHarnessEngineerSession(n={}){return Ce("/api/projects/harness/engineer/session/ensure",{method:"POST",body:JSON.stringify(n)})},startHarnessEngineerSession(n={}){return Ce("/api/projects/harness/engineer/session/start",{method:"POST",body:JSON.stringify(n)})},resumeHarnessEngineerSession(n={}){return Ce("/api/projects/harness/engineer/session/resume",{method:"POST",body:JSON.stringify(n)})},restartHarnessEngineerSession(n={}){return Ce("/api/projects/harness/engineer/session/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessEngineerSession(){return Ce("/api/projects/harness/engineer/session/stop",{method:"POST"})},notifyHarnessEngineerHarnessUpdated(){return Ce("/api/projects/harness/engineer/session/notify-harness",{method:"POST"})},getHarnessFeedbackState(n){const r=new URLSearchParams;n&&r.set("taskSlug",n);const s=r.toString();return Ce(`/api/projects/harness/feedback${s?`?${s}`:""}`)},decideHarnessFeedback(n){return Ce("/api/projects/harness/feedback/decision",{method:"POST",body:JSON.stringify(n)})},startTaskHarnessRetrospective(n){return Ce("/api/projects/harness/task-retrospective",{method:"POST",body:JSON.stringify(n)})},getTaskStatus(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/status`)},getTaskWorkspaceState(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/workspace-state`)},getProjectRuntimeState(n){const r=new URLSearchParams;n&&r.set("taskSlug",n);const s=r.toString();return Ce(`/api/projects/runtime-state${s?`?${s}`:""}`)},listSessions(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions`)},startRoleSession(n,r,s={}){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(n,r,s={}){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(n,r,s={}){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},notifyRoleHarnessUpdated(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/notify-harness`,{method:"POST"})},dispatchRoleCommand(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/messages`)},markAllMessagesDone(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/messages/history`,{method:"DELETE"})},getOrchestrationState(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/orchestration`)},updateOrchestrationState(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/round`)},getGateReviewState(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/gate-review`)},updateGateReviewSettings(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/gate-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestGateReviewGate(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/request`,{method:"POST"})},retryGateReviewGate(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/retry`,{method:"POST"})},skipGateReviewGate(n,r,s){return Ce(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideGateReviewGate(n,r,s){return Ce(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getGateReviewReport(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/report`)},startTranslationSession(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/start`,{method:"POST"})},pollTranslationSession(n,r,s){const l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),Ce(`/api/translation/sessions/${encodeURIComponent(n)}/events?${l.toString()}`)},pollTranslationTaskFeed(n,r,s){const l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),Ce(`/api/tasks/${encodeURIComponent(n)}/translation/feed?${l.toString()}`)},translateUserInput(n,r,s){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},translateManualOutput(n,r,s){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/manual-output`,{method:"POST",body:JSON.stringify(s)})},sendTranslatedInput(n,r,s){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(n){return Ce(`/api/translation/sessions/${encodeURIComponent(n)}/clear`,{method:"POST"})},stopTranslationSession(n){return Ce(`/api/translation/sessions/${encodeURIComponent(n)}/stop`,{method:"POST"})},notifyTranslatorHarnessUpdated(){return Ce("/api/projects/translation/session/notify-harness",{method:"POST"})},retryTranslation(n,r){return Ce(`/api/translation/sessions/${encodeURIComponent(n)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(n){return Ce(`/api/translation/sessions/${encodeURIComponent(n)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(n){return Ce(`/api/translation/sessions/${encodeURIComponent(n)}/failures/retry`,{method:"POST"})},getTranslationState(){return Ce("/api/translation/state")},getTranslatorSession(){return Ce("/api/translation/session")},ensureTranslatorSession(n={}){return Ce("/api/translation/session/ensure",{method:"POST",body:JSON.stringify(n)})},startTranslatorSession(n={}){return Ce("/api/translation/session/start",{method:"POST",body:JSON.stringify(n)})},resumeTranslatorSession(n={}){return Ce("/api/translation/session/resume",{method:"POST",body:JSON.stringify(n)})},restartTranslatorSession(n={}){return Ce("/api/translation/session/restart",{method:"POST",body:JSON.stringify(n)})},stopTranslatorSession(){return Ce("/api/translation/session/stop",{method:"POST"})},browseTranslationSourceFiles(n={}){const r=new URLSearchParams;n.path&&r.set("path",n.path),n.query&&r.set("query",n.query),n.limit!==void 0&&r.set("limit",String(n.limit));const s=r.toString()?`?${r.toString()}`:"";return Ce(`/api/translation/source-files${s}`)},createFileTranslation(n){return Ce("/api/translation/files",{method:"POST",body:JSON.stringify(n)})},readFileTranslation(n){return Ce(`/api/translation/files/${encodeURIComponent(n)}`)},createTranslationBootstrap(n){return Ce("/api/translation/bootstrap",{method:"POST",body:JSON.stringify(n)})},createTranslationMemoryUpdate(n){return Ce("/api/translation/memory-update",{method:"POST",body:JSON.stringify(n)})},promoteTranslation(n,r){return Ce(`/api/translation/files/${encodeURIComponent(n)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return Ce("/api/gateway/status")},updateGatewaySettings(n){return Ce("/api/gateway/settings",{method:"PUT",body:JSON.stringify(n)})},startGatewayQrLogin(){return Ce("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(n={}){return Ce("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(n)})},startGatewayLarkRegistration(){return Ce("/api/gateway/lark-registration/start",{method:"POST"})},checkGatewayLarkRegistration(){return Ce("/api/gateway/lark-registration/check",{method:"POST"})},bindGatewayLarkApp(n){return Ce("/api/gateway/lark-registration/bind",{method:"POST",body:JSON.stringify(n)})},resetGatewayBinding(){return Ce("/api/gateway/binding/reset",{method:"POST"})}};async function Ce(n,r={}){var p,f,o;const s=new Headers(r.headers);r.body!==void 0&&r.body!==null&&!s.has("content-type")&&s.set("content-type","application/json");const l=(r.method??"GET").toUpperCase();let d;try{d=await fetch(n,{...r,headers:s})}catch(c){throw new Error(`${l} ${n} could not reach the VCM backend. Reason: ${Lo(c)}`)}if(!d.ok){const c=await d.text().catch(()=>""),h=s1(c),m=d.statusText?`${d.status} ${d.statusText}`:String(d.status),b=((p=h==null?void 0:h.error)!=null&&p.hint?`${h.error.message??"Backend error."} ${h.error.hint}`:(f=h==null?void 0:h.error)==null?void 0:f.message)??a1(c),C=(o=h==null?void 0:h.error)==null?void 0:o.runtime,T=C?` [backend ${C.version??"unknown"} pid=${C.pid??"unknown"} cwd=${C.cwd??"unknown"}]`:"";throw new Error(`${l} ${n} returned HTTP ${m}. ${b}${T}`)}return d.json()}function s1(n){if(!n.trim())return null;try{return JSON.parse(n)}catch{return null}}function a1(n){const r=n.trim();return r?`Non-JSON response body: ${r.slice(0,500)}`:"The response body was empty."}const hh="vcm:ui-error-report",fh="vcm:ui-error-clear-actions",dh="vcm:ui-error-clear-message";function l1(n){const r=n.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(hh,{detail:{message:r}}))}function o1(n){const r=n.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(dh,{detail:{message:r}}))}function c1(n){n.length===0||typeof window>"u"||window.dispatchEvent(new CustomEvent(fh,{detail:{actions:n}}))}function ji(n){const[r,s]=te.useState(n),l=te.useRef(n),d=te.useCallback(p=>{const f=l.current,o=typeof p=="function"?p(f):p;l.current=o,typeof o=="string"&&o.trim()?l1(o):typeof f=="string"&&f.trim()&&o1(f),s(o)},[]);return[r,d]}var $u={exports:{}},Um;function u1(){return Um||(Um=1,(function(n,r){(function(s,l){n.exports=l()})(self,(()=>(()=>{var s={};return(()=>{var l=s;Object.defineProperty(l,"__esModule",{value:!0}),l.FitAddon=void 0,l.FitAddon=class{activate(d){this._terminal=d}dispose(){}fit(){const d=this.proposeDimensions();if(!d||!this._terminal||isNaN(d.cols)||isNaN(d.rows))return;const p=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(p._renderService.clear(),this._terminal.resize(d.cols,d.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const d=this._terminal._core,p=d._renderService.dimensions;if(p.css.cell.width===0||p.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),h=Math.max(0,parseInt(o.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),u=c-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),b=h-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(b/p.css.cell.width)),rows:Math.max(1,Math.floor(u/p.css.cell.height))}}}})(),s})()))})($u)),$u.exports}var h1=u1(),Gu={exports:{}},Pm;function f1(){return Pm||(Pm=1,(function(n,r){(function(s,l){n.exports=l()})(self,(()=>(()=>{var s={6:(f,o)=>{function c(m){try{const u=new URL(m),b=u.password&&u.username?`${u.protocol}//${u.username}:${u.password}@${u.host}`:u.username?`${u.protocol}//${u.username}@${u.host}`:`${u.protocol}//${u.host}`;return m.toLocaleLowerCase().startsWith(b.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(m,u,b,C={}){this._terminal=m,this._regex=u,this._handler=b,this._options=C}provideLinks(m,u){const b=h.computeLink(m,this._regex,this._terminal,this._handler);u(this._addCallbacks(b))}_addCallbacks(m){return m.map((u=>(u.leave=this._options.leave,u.hover=(b,C)=>{if(this._options.hover){const{range:T}=u;this._options.hover(b,C,T)}},u)))}};class h{static computeLink(u,b,C,T){const E=new RegExp(b.source,(b.flags||"")+"g"),[S,v]=h._getWindowedLineStrings(u-1,C),_=S.join("");let y;const A=[];for(;y=E.exec(_);){const L=y[0];if(!c(L))continue;const[D,R]=h._mapStrIdx(C,v,0,y.index),[k,M]=h._mapStrIdx(C,D,R,L.length);if(D===-1||R===-1||k===-1||M===-1)continue;const j={start:{x:R+1,y:D+1},end:{x:M,y:k+1}};A.push({range:j,text:L,activate:T})}return A}static _getWindowedLineStrings(u,b){let C,T=u,E=u,S=0,v="";const _=[];if(C=b.buffer.active.getLine(u)){const y=C.translateToString(!0);if(C.isWrapped&&y[0]!==" "){for(S=0;(C=b.buffer.active.getLine(--T))&&S<2048&&(v=C.translateToString(!0),S+=v.length,_.push(v),C.isWrapped&&v.indexOf(" ")===-1););_.reverse()}for(_.push(y),S=0;(C=b.buffer.active.getLine(++E))&&C.isWrapped&&S<2048&&(v=C.translateToString(!0),S+=v.length,_.push(v),v.indexOf(" ")===-1););}return[_,T]}static _mapStrIdx(u,b,C,T){const E=u.buffer.active,S=E.getNullCell();let v=C;for(;T;){const _=E.getLine(b);if(!_)return[-1,-1];for(let y=v;y<_.length;++y){_.getCell(y,S);const A=S.getChars();if(S.getWidth()&&(T-=A.length||1,y===_.length-1&&A==="")){const L=E.getLine(b+1);L&&L.isWrapped&&(L.getCell(0,S),S.getWidth()===2&&(T+=1))}if(T<0)return[b,y]}b++,v=0}return[b,v]}}o.LinkComputer=h}},l={};function d(f){var o=l[f];if(o!==void 0)return o.exports;var c=l[f]={exports:{}};return s[f](c,c.exports,d),c.exports}var p={};return(()=>{var f=p;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const o=d(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(m,u){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}f.WebLinksAddon=class{constructor(m=h,u={}){this._handler=m,this._options=u}activate(m){this._terminal=m;const u=this._options,b=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,b,this._handler,u))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),p})()))})(Gu)),Gu.exports}var d1=f1(),Vu={exports:{}},Fm;function p1(){return Fm||(Fm=1,(function(n,r){(function(s,l){n.exports=l()})(globalThis,(()=>(()=>{var s={4567:function(f,o,c){var h=this&&this.__decorate||function(_,y,A,L){var D,R=arguments.length,k=R<3?y:L===null?L=Object.getOwnPropertyDescriptor(y,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,y,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(y,A,k):D(y,A))||k);return R>3&&k&&Object.defineProperty(y,A,k),k},m=this&&this.__param||function(_,y){return function(A,L){y(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const u=c(9042),b=c(9924),C=c(844),T=c(4725),E=c(2585),S=c(3656);let v=o.AccessibilityManager=class extends C.Disposable{constructor(_,y,A,L){super(),this._terminal=_,this._coreBrowserService=A,this._renderService=L,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let D=0;D<this._terminal.rows;D++)this._rowElements[D]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[D]);if(this._topBoundaryFocusListener=D=>this._handleBoundaryFocus(D,0),this._bottomBoundaryFocusListener=D=>this._handleBoundaryFocus(D,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new b.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((D=>this._handleResize(D.rows)))),this.register(this._terminal.onRender((D=>this._refreshRows(D.start,D.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((D=>this._handleChar(D)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
52
|
+
`)))),this.register(this._terminal.onA11yTab((D=>this._handleTab(D)))),this.register(this._terminal.onKey((D=>this._handleKey(D.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,S.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,C.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(_){for(let y=0;y<_;y++)this._handleChar(" ")}_handleChar(_){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==_&&(this._charsToAnnounce+=_):this._charsToAnnounce+=_,_===`
|
|
53
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(_){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(_)||this._charsToConsume.push(_)}_refreshRows(_,y){this._liveRegionDebouncer.refresh(_,y,this._terminal.rows)}_renderRows(_,y){const A=this._terminal.buffer,L=A.lines.length.toString();for(let D=_;D<=y;D++){const R=A.lines.get(A.ydisp+D),k=[],M=(R==null?void 0:R.translateToString(!0,void 0,void 0,k))||"",j=(A.ydisp+D+1).toString(),H=this._rowElements[D];H&&(M.length===0?(H.innerText=" ",this._rowColumns.set(H,[0,1])):(H.textContent=M,this._rowColumns.set(H,k)),H.setAttribute("aria-posinset",j),H.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(_,y){const A=_.target,L=this._rowElements[y===0?1:this._rowElements.length-2];if(A.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||_.relatedTarget!==L)return;let D,R;if(y===0?(D=A,R=this._rowElements.pop(),this._rowContainer.removeChild(R)):(D=this._rowElements.shift(),R=A,this._rowContainer.removeChild(D)),D.removeEventListener("focus",this._topBoundaryFocusListener),R.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),_.preventDefault(),_.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const _=document.getSelection();if(!_)return;if(_.isCollapsed)return void(this._rowContainer.contains(_.anchorNode)&&this._terminal.clearSelection());if(!_.anchorNode||!_.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:_.anchorNode,offset:_.anchorOffset},A={node:_.focusNode,offset:_.focusOffset};if((y.node.compareDocumentPosition(A.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===A.node&&y.offset>A.offset)&&([y,A]=[A,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const L=this._rowElements.slice(-1)[0];if(A.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(A={node:L,offset:((M=L.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(A.node))return;const D=({node:j,offset:H})=>{const U=j instanceof Text?j.parentNode:j;let F=parseInt(U==null?void 0:U.getAttribute("aria-posinset"),10)-1;if(isNaN(F))return console.warn("row is invalid. Race condition?"),null;const K=this._rowColumns.get(U);if(!K)return console.warn("columns is null. Race condition?"),null;let Y=H<K.length?K[H]:K.slice(-1)[0]+1;return Y>=this._terminal.cols&&(++F,Y=0),{row:F,column:Y}},R=D(y),k=D(A);if(R&&k){if(R.row>k.row||R.row===k.row&&R.column>=k.column)throw new Error("invalid range");this._terminal.select(R.column,R.row,(k.row-R.row)*this._terminal.cols-R.column+k.column)}}_handleResize(_){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>_;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const _=this._coreBrowserService.mainDocument.createElement("div");return _.setAttribute("role","listitem"),_.tabIndex=-1,this._refreshRowDimensions(_),_}_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 _=0;_<this._terminal.rows;_++)this._refreshRowDimensions(this._rowElements[_])}}_refreshRowDimensions(_){_.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=v=h([m(1,E.IInstantiationService),m(2,T.ICoreBrowserService),m(3,T.IRenderService)],v)},3614:(f,o)=>{function c(b){return b.replace(/\r?\n/g,"\r")}function h(b,C){return C?"\x1B[200~"+b+"\x1B[201~":b}function m(b,C,T,E){b=h(b=c(b),T.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),T.triggerDataEvent(b,!0),C.value=""}function u(b,C,T){const E=T.getBoundingClientRect(),S=b.clientX-E.left-10,v=b.clientY-E.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${S}px`,C.style.top=`${v}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=h,o.copyHandler=function(b,C){b.clipboardData&&b.clipboardData.setData("text/plain",C.selectionText),b.preventDefault()},o.handlePasteEvent=function(b,C,T,E){b.stopPropagation(),b.clipboardData&&m(b.clipboardData.getData("text/plain"),C,T,E)},o.paste=m,o.moveTextAreaUnderMouseCursor=u,o.rightClickHandler=function(b,C,T,E,S){u(b,C,T),S&&E.rightClickSelect(b),C.value=E.selectionText,C.select()}},7239:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const h=c(1505);o.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(m,u,b){this._css.set(m,u,b)}getCss(m,u){return this._css.get(m,u)}setColor(m,u,b){this._color.set(m,u,b)}getColor(m,u){return this._color.get(m,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,h,m,u){c.addEventListener(h,m,u);let b=!1;return{dispose:()=>{b||(b=!0,c.removeEventListener(h,m,u))}}}},3551:function(f,o,c){var h=this&&this.__decorate||function(v,_,y,A){var L,D=arguments.length,R=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,y):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,_,y,A);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(R=(D<3?L(R):D>3?L(_,y,R):L(_,y))||R);return D>3&&R&&Object.defineProperty(_,y,R),R},m=this&&this.__param||function(v,_){return function(y,A){_(y,A,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const u=c(3656),b=c(8460),C=c(844),T=c(2585),E=c(4725);let S=o.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(v,_,y,A,L){super(),this._element=v,this._mouseService=_,this._renderService=y,this._bufferService=A,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new b.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new b.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)((()=>{var D;this._lastMouseEvent=void 0,(D=this._activeProviderReplies)==null||D.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(v){this._lastMouseEvent=v;const _=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!_)return;this._isMouseOut=!1;const y=v.composedPath();for(let A=0;A<y.length;A++){const L=y[A];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&_.x===this._lastBufferCell.x&&_.y===this._lastBufferCell.y||(this._handleHover(_),this._lastBufferCell=_)}_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,_){var A,L;this._activeProviderReplies&&_||((A=this._activeProviderReplies)==null||A.forEach((D=>{D==null||D.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let y=!1;for(const[D,R]of this._linkProviderService.linkProviders.entries())_?(L=this._activeProviderReplies)!=null&&L.get(D)&&(y=this._checkLinkProviderResult(D,v,y)):R.provideLinks(v.y,(k=>{var j,H;if(this._isMouseOut)return;const M=k==null?void 0:k.map((U=>({link:U})));(j=this._activeProviderReplies)==null||j.set(D,M),y=this._checkLinkProviderResult(D,v,y),((H=this._activeProviderReplies)==null?void 0:H.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,_){const y=new Set;for(let A=0;A<_.size;A++){const L=_.get(A);if(L)for(let D=0;D<L.length;D++){const R=L[D],k=R.link.range.start.y<v?0:R.link.range.start.x,M=R.link.range.end.y>v?this._bufferService.cols:R.link.range.end.x;for(let j=k;j<=M;j++){if(y.has(j)){L.splice(D--,1);break}y.add(j)}}}}_checkLinkProviderResult(v,_,y){var D;if(!this._activeProviderReplies)return y;const A=this._activeProviderReplies.get(v);let L=!1;for(let R=0;R<v;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(L=!0);if(!L&&A){const R=A.find((k=>this._linkAtPosition(k.link,_)));R&&(y=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let R=0;R<this._activeProviderReplies.size;R++){const k=(D=this._activeProviderReplies.get(R))==null?void 0:D.find((M=>this._linkAtPosition(M.link,_)));if(k){y=!0,this._handleNewLink(k);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const _=this._positionFromMouseEvent(v,this._element,this._mouseService);_&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,_)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,_){this._currentLink&&this._lastMouseEvent&&(!v||!_||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=_)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._linkAtPosition(v.link,_)&&(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 y,A;return(A=(y=this._currentLink)==null?void 0:y.state)==null?void 0:A.decorations.pointerCursor},set:y=>{var A;(A=this._currentLink)!=null&&A.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,A;return(A=(y=this._currentLink)==null?void 0:y.state)==null?void 0:A.decorations.underline},set:y=>{var A,L,D;(A=this._currentLink)!=null&&A.state&&((D=(L=this._currentLink)==null?void 0:L.state)==null?void 0:D.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const A=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=A&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(A,L),this._lastMouseEvent)){const D=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);D&&this._askForLink(D,!1)}}))))}_linkHover(v,_,y){var A;(A=this._currentLink)!=null&&A.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),_.hover&&_.hover(y,_.text)}_fireUnderlineEvent(v,_){const y=v.range,A=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-A-1,y.end.x,y.end.y-A-1,void 0);(_?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(v,_,y){var A;(A=this._currentLink)!=null&&A.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),_.leave&&_.leave(y,_.text)}_linkAtPosition(v,_){const y=v.range.start.y*this._bufferService.cols+v.range.start.x,A=v.range.end.y*this._bufferService.cols+v.range.end.x,L=_.y*this._bufferService.cols+_.x;return y<=L&&L<=A}_positionFromMouseEvent(v,_,y){const A=y.getCoords(v,_,this._bufferService.cols,this._bufferService.rows);if(A)return{x:A[0],y:A[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,_,y,A,L){return{x1:v,y1:_,x2:y,y2:A,cols:this._bufferService.cols,fg:L}}};o.Linkifier=S=h([m(1,E.IMouseService),m(2,E.IRenderService),m(3,T.IBufferService),m(4,E.ILinkProviderService)],S)},9042:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,o,c){var h=this&&this.__decorate||function(E,S,v,_){var y,A=arguments.length,L=A<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,S,v,_);else for(var D=E.length-1;D>=0;D--)(y=E[D])&&(L=(A<3?y(L):A>3?y(S,v,L):y(S,v))||L);return A>3&&L&&Object.defineProperty(S,v,L),L},m=this&&this.__param||function(E,S){return function(v,_){S(v,_,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const u=c(511),b=c(2585);let C=o.OscLinkProvider=class{constructor(E,S,v){this._bufferService=E,this._optionsService=S,this._oscLinkService=v}provideLinks(E,S){var M;const v=this._bufferService.buffer.lines.get(E-1);if(!v)return void S(void 0);const _=[],y=this._optionsService.rawOptions.linkHandler,A=new u.CellData,L=v.getTrimmedLength();let D=-1,R=-1,k=!1;for(let j=0;j<L;j++)if(R!==-1||v.hasContent(j)){if(v.loadCell(j,A),A.hasExtendedAttrs()&&A.extended.urlId){if(R===-1){R=j,D=A.extended.urlId;continue}k=A.extended.urlId!==D}else R!==-1&&(k=!0);if(k||R!==-1&&j===L-1){const H=(M=this._oscLinkService.getLinkData(D))==null?void 0:M.uri;if(H){const U={start:{x:R+1,y:E},end:{x:j+(k||j!==L-1?0:1),y:E}};let F=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const K=new URL(H);["http:","https:"].includes(K.protocol)||(F=!0)}catch{F=!0}F||_.push({text:H,range:U,activate:(K,Y)=>y?y.activate(K,Y,U):T(0,Y),hover:(K,Y)=>{var G;return(G=y==null?void 0:y.hover)==null?void 0:G.call(y,K,Y,U)},leave:(K,Y)=>{var G;return(G=y==null?void 0:y.leave)==null?void 0:G.call(y,K,Y,U)}})}k=!1,A.hasExtendedAttrs()&&A.extended.urlId?(R=j,D=A.extended.urlId):(R=-1,D=-1)}}S(_)}};function T(E,S){if(confirm(`Do you want to navigate to ${S}?
|
|
54
|
+
|
|
55
|
+
WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=S}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=C=h([m(0,b.IBufferService),m(1,b.IOptionsService),m(2,b.IOscLinkService)],C)},6193:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,h,m){this._rowCount=m,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,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 c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const h=c(3614),m=c(3656),u=c(3551),b=c(9042),C=c(3730),T=c(1680),E=c(3107),S=c(5744),v=c(2950),_=c(1296),y=c(428),A=c(4269),L=c(5114),D=c(8934),R=c(3230),k=c(9312),M=c(4725),j=c(6731),H=c(8055),U=c(8969),F=c(8460),K=c(844),Y=c(6114),G=c(8437),W=c(2584),Z=c(7399),z=c(5941),O=c(9074),N=c(2585),$=c(5435),I=c(4567),re=c(779);class ve extends U.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(Q={}){super(Q),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new K.MutableDisposable),this._onCursorMove=this.register(new F.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new F.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new F.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new F.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new F.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new F.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new F.EventEmitter),this._onBlur=this.register(new F.EventEmitter),this._onA11yCharEmitter=this.register(new F.EventEmitter),this._onA11yTabEmitter=this.register(new F.EventEmitter),this._onWillOpen=this.register(new F.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(O.DecorationService),this._instantiationService.setService(N.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((q,ee)=>this.refresh(q,ee)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((q=>this._reportWindowsOptions(q)))),this.register(this._inputHandler.onColor((q=>this._handleColorEvent(q)))),this.register((0,F.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,F.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((q=>this._afterResize(q.cols,q.rows)))),this.register((0,K.toDisposable)((()=>{var q,ee;this._customKeyEventHandler=void 0,(ee=(q=this.element)==null?void 0:q.parentNode)==null||ee.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const q of Q){let ee,se="";switch(q.index){case 256:ee="foreground",se="10";break;case 257:ee="background",se="11";break;case 258:ee="cursor",se="12";break;default:ee="ansi",se="4;"+q.index}switch(q.type){case 0:const we=H.color.toColorRGB(ee==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[ee]);this.coreService.triggerDataEvent(`${W.C0.ESC}]${se};${(0,z.toRgbString)(we)}${W.C1_ESCAPED.ST}`);break;case 1:if(ee==="ansi")this._themeService.modifyColors((he=>he.ansi[q.index]=H.channels.toColor(...q.color)));else{const he=ee;this._themeService.modifyColors((pe=>pe[he]=H.channels.toColor(...q.color)))}break;case 2:this._themeService.restoreColor(q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Q){Q?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Q;return(Q=this.textarea)==null?void 0:Q.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.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 Q=this.buffer.ybase+this.buffer.y,q=this.buffer.lines.get(Q);if(!q)return;const ee=Math.min(this.buffer.x,this.cols-1),se=this._renderService.dimensions.css.cell.height,we=q.getWidth(ee),he=this._renderService.dimensions.css.cell.width*we,pe=this.buffer.y*this._renderService.dimensions.css.cell.height,ke=ee*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ke+"px",this.textarea.style.top=pe+"px",this.textarea.style.width=he+"px",this.textarea.style.height=se+"px",this.textarea.style.lineHeight=se+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(q=>{this.hasSelection()&&(0,h.copyHandler)(q,this._selectionService)})));const Q=q=>(0,h.handlePasteEvent)(q,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,m.addDisposableDomListener)(this.element,"paste",Q)),Y.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(q=>{q.button===2&&(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(q=>{(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(q=>{q.button===1&&(0,h.moveTextAreaUnderMouseCursor)(q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(Q=>this._inputEvent(Q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Q){var ee;if(!Q)throw new Error("Terminal requires a parent element.");if(Q.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ee=this.element)==null?void 0:ee.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Q.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"),Q.appendChild(this.element);const q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),q.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,m.addDisposableDomListener)(this.screenElement,"mousemove",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",b.promptLabel),Y.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(L.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(j.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(A.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(R.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.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(D.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(T.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.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(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(E.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),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(I.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(S.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(S.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(_.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,q=this.element;function ee(he){const pe=Q._mouseService.getMouseReportCoords(he,Q.screenElement);if(!pe)return!1;let ke,Be;switch(he.overrideType||he.type){case"mousemove":Be=32,he.buttons===void 0?(ke=3,he.button!==void 0&&(ke=he.button<3?he.button:3)):ke=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":Be=0,ke=he.button<3?he.button:3;break;case"mousedown":Be=1,ke=he.button<3?he.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(he)===!1||Q.viewport.getLinesScrolled(he)===0)return!1;Be=he.deltaY<0?0:1,ke=4;break;default:return!1}return!(Be===void 0||ke===void 0||ke>4)&&Q.coreMouseService.triggerMouseEvent({col:pe.col,row:pe.row,x:pe.x,y:pe.y,button:ke,action:Be,ctrl:he.ctrlKey,alt:he.altKey,shift:he.shiftKey})}const se={mouseup:null,wheel:null,mousedrag:null,mousemove:null},we={mouseup:he=>(ee(he),he.buttons||(this._document.removeEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.removeEventListener("mousemove",se.mousedrag)),this.cancel(he)),wheel:he=>(ee(he),this.cancel(he,!0)),mousedrag:he=>{he.buttons&&ee(he)},mousemove:he=>{he.buttons||ee(he)}};this.register(this.coreMouseService.onProtocolChange((he=>{he?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(he)),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&he?se.mousemove||(q.addEventListener("mousemove",we.mousemove),se.mousemove=we.mousemove):(q.removeEventListener("mousemove",se.mousemove),se.mousemove=null),16&he?se.wheel||(q.addEventListener("wheel",we.wheel,{passive:!1}),se.wheel=we.wheel):(q.removeEventListener("wheel",se.wheel),se.wheel=null),2&he?se.mouseup||(se.mouseup=we.mouseup):(this._document.removeEventListener("mouseup",se.mouseup),se.mouseup=null),4&he?se.mousedrag||(se.mousedrag=we.mousedrag):(this._document.removeEventListener("mousemove",se.mousedrag),se.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(q,"mousedown",(he=>{if(he.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(he))return ee(he),se.mouseup&&this._document.addEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.addEventListener("mousemove",se.mousedrag),this.cancel(he)}))),this.register((0,m.addDisposableDomListener)(q,"wheel",(he=>{if(!se.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(he)===!1)return!1;if(!this.buffer.hasScrollback){const pe=this.viewport.getLinesScrolled(he);if(pe===0)return;const ke=W.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let Be="";for(let Ke=0;Ke<Math.abs(pe);Ke++)Be+=ke;return this.coreService.triggerDataEvent(Be,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(q,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(q,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(Q,q){var ee;(ee=this._renderService)==null||ee.refreshRows(Q,q)}updateCursorStyle(Q){var q;(q=this._selectionService)!=null&&q.shouldColumnSelect(Q)?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(Q,q,ee=0){var se;ee===1?(super.scrollLines(Q,q,ee),this.refresh(0,this.rows-1)):(se=this.viewport)==null||se.scrollLines(Q)}paste(Q){(0,h.paste)(Q,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Q){this._customKeyEventHandler=Q}attachCustomWheelEventHandler(Q){this._customWheelEventHandler=Q}registerLinkProvider(Q){return this._linkProviderService.registerLinkProvider(Q)}registerCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const q=this._characterJoinerService.register(Q);return this.refresh(0,this.rows-1),q}deregisterCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Q)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Q){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Q)}registerDecoration(Q){return this._decorationService.registerDecoration(Q)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Q,q,ee){this._selectionService.setSelection(Q,q,ee)}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 Q;(Q=this._selectionService)==null||Q.clearSelection()}selectAll(){var Q;(Q=this._selectionService)==null||Q.selectAll()}selectLines(Q,q){var ee;(ee=this._selectionService)==null||ee.selectLines(Q,q)}_keyDown(Q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;const q=this.browser.isMac&&this.options.macOptionIsMeta&&Q.altKey;if(!q&&!this._compositionHelper.keydown(Q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;q||Q.key!=="Dead"&&Q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ee=(0,Z.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),ee.type===3||ee.type===2){const se=this.rows-1;return this.scrollLines(ee.type===2?-se:se),this.cancel(Q,!0)}return ee.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(ee.cancel&&this.cancel(Q,!0),!ee.key||!!(Q.key&&!Q.ctrlKey&&!Q.altKey&&!Q.metaKey&&Q.key.length===1&&Q.key.charCodeAt(0)>=65&&Q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ee.key!==W.C0.ETX&&ee.key!==W.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ee.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(ee.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,q){const ee=Q.isMac&&!this.options.macOptionIsMeta&&q.altKey&&!q.ctrlKey&&!q.metaKey||Q.isWindows&&q.altKey&&q.ctrlKey&&!q.metaKey||Q.isWindows&&q.getModifierState("AltGraph");return q.type==="keypress"?ee:ee&&(!q.keyCode||q.keyCode>47)}_keyUp(Q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1||((function(q){return q.keyCode===16||q.keyCode===17||q.keyCode===18})(Q)||this.focus(),this.updateCursorStyle(Q),this._keyPressHandled=!1)}_keyPress(Q){let q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;if(this.cancel(Q),Q.charCode)q=Q.charCode;else if(Q.which===null||Q.which===void 0)q=Q.keyCode;else{if(Q.which===0||Q.charCode===0)return!1;q=Q.which}return!(!q||(Q.altKey||Q.ctrlKey||Q.metaKey)&&!this._isThirdLevelShift(this.browser,Q)||(q=String.fromCharCode(q),this._onKey.fire({key:q,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Q){if(Q.data&&Q.inputType==="insertText"&&(!Q.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const q=Q.data;return this.coreService.triggerDataEvent(q,!0),this.cancel(Q),!0}return!1}resize(Q,q){Q!==this.cols||q!==this.rows?super.resize(Q,q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Q,q){var ee,se;(ee=this._charSizeService)==null||ee.measure(),(se=this.viewport)==null||se.syncScrollArea(!0)}clear(){var Q;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 q=1;q<this.rows;q++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Q=this.viewport)==null||Q.reset(),this.refresh(0,this.rows-1)}}reset(){var q,ee;this.options.rows=this.rows,this.options.cols=this.cols;const Q=this._customKeyEventHandler;this._setup(),super.reset(),(q=this._selectionService)==null||q.reset(),this._decorationService.reset(),(ee=this.viewport)==null||ee.reset(),this._customKeyEventHandler=Q,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Q;(Q=this._renderService)==null||Q.clearTextureAtlas()}_reportFocus(){var Q;(Q=this.element)!=null&&Q.classList.contains("focus")?this.coreService.triggerDataEvent(W.C0.ESC+"[I"):this.coreService.triggerDataEvent(W.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),ee=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[4;${ee};${q}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const se=this._renderService.dimensions.css.cell.width.toFixed(0),we=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[6;${we};${se}t`)}}cancel(Q,q){if(this.options.cancelEvents||q)return Q.preventDefault(),Q.stopPropagation(),!1}}o.Terminal=ve},9924:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,m){this._rowCount=m,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const b=u-this._lastRefreshMs,C=this._debounceThresholdMS-b;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(f,o,c){var h=this&&this.__decorate||function(v,_,y,A){var L,D=arguments.length,R=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,y):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,_,y,A);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(R=(D<3?L(R):D>3?L(_,y,R):L(_,y))||R);return D>3&&R&&Object.defineProperty(_,y,R),R},m=this&&this.__param||function(v,_){return function(y,A){_(y,A,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const u=c(3656),b=c(4725),C=c(8460),T=c(844),E=c(2585);let S=o.Viewport=class extends T.Disposable{constructor(v,_,y,A,L,D,R,k){super(),this._viewportElement=v,this._scrollArea=_,this._bufferService=y,this._optionsService=A,this._charSizeService=L,this._renderService=D,this._coreBrowserService=R,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((M=>this._handleThemeChange(M)))),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 _=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==_&&(this._lastRecordedBufferHeight=_,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 _=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:_,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,_){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(_<0&&this._viewportElement.scrollTop!==0||_>0&&y<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const _=this._getPixelsScrolled(v);return _!==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+_:this._smoothScrollState.target+=_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=_,this._bubbleScroll(v,_))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const _=v*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+_,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 _=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?_*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._currentRowHeight*this._bufferService.rows),_}getBufferElements(v,_){var k;let y,A="";const L=[],D=_??this._bufferService.buffer.lines.length,R=this._bufferService.buffer.lines;for(let M=v;M<D;M++){const j=R.get(M);if(!j)continue;const H=(k=R.get(M+1))==null?void 0:k.isWrapped;if(A+=j.translateToString(!H),!H||M===R.length-1){const U=document.createElement("div");U.textContent=A,L.push(U),A.length>0&&(y=U),A=""}}return{bufferElements:L,cursorElement:y}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let _=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(_/=this._currentRowHeight+0,this._wheelPartialScroll+=_,_=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._bufferService.rows),_}_applyScrollModifier(v,_){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&_.altKey||y==="ctrl"&&_.ctrlKey||y==="shift"&&_.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 _=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,_!==0&&(this._viewportElement.scrollTop+=_,this._bubbleScroll(v,_))}};o.Viewport=S=h([m(2,E.IBufferService),m(3,E.IOptionsService),m(4,b.ICharSizeService),m(5,b.IRenderService),m(6,b.ICoreBrowserService),m(7,b.IThemeService)],S)},3107:function(f,o,c){var h=this&&this.__decorate||function(E,S,v,_){var y,A=arguments.length,L=A<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,S,v,_);else for(var D=E.length-1;D>=0;D--)(y=E[D])&&(L=(A<3?y(L):A>3?y(S,v,L):y(S,v))||L);return A>3&&L&&Object.defineProperty(S,v,L),L},m=this&&this.__param||function(E,S){return function(v,_){S(v,_,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const u=c(4725),b=c(844),C=c(2585);let T=o.BufferDecorationRenderer=class extends b.Disposable{constructor(E,S,v,_,y){super(),this._screenElement=E,this._bufferService=S,this._coreBrowserService=v,this._decorationService=_,this._renderService=y,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((A=>this._removeDecoration(A)))),this.register((0,b.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const E of this._decorationService.decorations)this._renderDecoration(E);this._dimensionsChanged=!1}_renderDecoration(E){this._refreshStyle(E),this._dimensionsChanged&&this._refreshXPosition(E)}_createElement(E){var _;const S=this._coreBrowserService.mainDocument.createElement("div");S.classList.add("xterm-decoration"),S.classList.toggle("xterm-decoration-top-layer",((_=E==null?void 0:E.options)==null?void 0:_.layer)==="top"),S.style.width=`${Math.round((E.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,S.style.height=(E.options.height||1)*this._renderService.dimensions.css.cell.height+"px",S.style.top=(E.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",S.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=E.options.x??0;return v&&v>this._bufferService.cols&&(S.style.display="none"),this._refreshXPosition(E,S),S}_refreshStyle(E){const S=E.marker.line-this._bufferService.buffers.active.ydisp;if(S<0||S>=this._bufferService.rows)E.element&&(E.element.style.display="none",E.onRenderEmitter.fire(E.element));else{let v=this._decorationElements.get(E);v||(v=this._createElement(E),E.element=v,this._decorationElements.set(E,v),this._container.appendChild(v),E.onDispose((()=>{this._decorationElements.delete(E),v.remove()}))),v.style.top=S*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",E.onRenderEmitter.fire(v)}}_refreshXPosition(E,S=E.element){if(!S)return;const v=E.options.x??0;(E.options.anchor||"left")==="right"?S.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":S.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(E){var S;(S=this._decorationElements.get(E))==null||S.remove(),this._decorationElements.delete(E),E.dispose()}};o.BufferDecorationRenderer=T=h([m(1,C.IBufferService),m(2,u.ICoreBrowserService),m(3,C.IDecorationService),m(4,u.IRenderService)],T)},5871:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.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(c){if(c.options.overviewRulerOptions){for(const h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,m){return h>=c.startBufferLine-this._linePadding[m||"full"]&&h<=c.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(f,o,c){var h=this&&this.__decorate||function(y,A,L,D){var R,k=arguments.length,M=k<3?A:D===null?D=Object.getOwnPropertyDescriptor(A,L):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,A,L,D);else for(var j=y.length-1;j>=0;j--)(R=y[j])&&(M=(k<3?R(M):k>3?R(A,L,M):R(A,L))||M);return k>3&&M&&Object.defineProperty(A,L,M),M},m=this&&this.__param||function(y,A){return function(L,D){A(L,D,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const u=c(5871),b=c(4725),C=c(844),T=c(2585),E={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let _=o.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,A,L,D,R,k,M){var H;super(),this._viewportElement=y,this._screenElement=A,this._bufferService=L,this._decorationService=D,this._renderService=R,this._optionsService=k,this._coreBrowserService=M,this._colorZoneStore=new u.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(),(H=this._viewportElement.parentElement)==null||H.insertBefore(this._canvas,this._viewportElement);const j=this._canvas.getContext("2d");if(!j)throw new Error("Ctx cannot be null");this._ctx=j,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,C.toDisposable)((()=>{var U;(U=this._canvas)==null||U.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 y=Math.floor(this._canvas.width/3),A=Math.ceil(this._canvas.width/3);S.full=this._canvas.width,S.left=y,S.center=A,S.right=y,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=S.left,v.right=S.left+S.center}_refreshDrawHeightConstants(){E.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,A=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);E.left=A,E.center=A,E.right=A}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.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 A of this._decorationService.decorations)this._colorZoneStore.addDecoration(A);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const A of y)A.position!=="full"&&this._renderColorZone(A);for(const A of y)A.position==="full"&&this._renderColorZone(A);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(v[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-E[y.position||"full"]/2),S[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+E[y.position||"full"]))}_queueRefresh(y,A){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=A||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=_=h([m(2,T.IBufferService),m(3,T.IDecorationService),m(4,b.IRenderService),m(5,T.IOptionsService),m(6,b.ICoreBrowserService)],_)},2950:function(f,o,c){var h=this&&this.__decorate||function(E,S,v,_){var y,A=arguments.length,L=A<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,S,v,_);else for(var D=E.length-1;D>=0;D--)(y=E[D])&&(L=(A<3?y(L):A>3?y(S,v,L):y(S,v))||L);return A>3&&L&&Object.defineProperty(S,v,L),L},m=this&&this.__param||function(E,S){return function(v,_){S(v,_,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const u=c(4725),b=c(2585),C=c(2584);let T=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(E,S,v,_,y,A){this._textarea=E,this._compositionView=S,this._bufferService=v,this._optionsService=_,this._coreService=y,this._renderService=A,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(E){this._compositionView.textContent=E.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(E){if(this._isComposing||this._isSendingComposition){if(E.keyCode===229||E.keyCode===16||E.keyCode===17||E.keyCode===18)return!1;this._finalizeComposition(!1)}return E.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(E){if(this._compositionView.classList.remove("active"),this._isComposing=!1,E){const S={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,S.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(S.start,S.end):this._textarea.value.substring(S.start),v.length>0&&this._coreService.triggerDataEvent(v,!0)}}),0)}else{this._isSendingComposition=!1;const S=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(S,!0)}}_handleAnyTextareaChanges(){const E=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const S=this._textarea.value,v=S.replace(E,"");this._dataAlreadySent=v,S.length>E.length?this._coreService.triggerDataEvent(v,!0):S.length<E.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):S.length===E.length&&S!==E&&this._coreService.triggerDataEvent(S,!0)}}),0)}updateCompositionElements(E){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const S=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=this._renderService.dimensions.css.cell.height,_=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=S*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=_+"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 A=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=_+"px",this._textarea.style.width=Math.max(A.width,1)+"px",this._textarea.style.height=Math.max(A.height,1)+"px",this._textarea.style.lineHeight=A.height+"px"}E||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=T=h([m(2,b.IBufferService),m(3,b.IOptionsService),m(4,b.ICoreService),m(5,u.IRenderService)],T)},9806:(f,o)=>{function c(h,m,u){const b=u.getBoundingClientRect(),C=h.getComputedStyle(u),T=parseInt(C.getPropertyValue("padding-left")),E=parseInt(C.getPropertyValue("padding-top"));return[m.clientX-b.left-T,m.clientY-b.top-E]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(h,m,u,b,C,T,E,S,v){if(!T)return;const _=c(h,m,u);return _?(_[0]=Math.ceil((_[0]+(v?E/2:0))/E),_[1]=Math.ceil(_[1]/S),_[0]=Math.min(Math.max(_[0],1),b+(v?1:0)),_[1]=Math.min(Math.max(_[1],1),C),_):void 0}},9504:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const h=c(2584);function m(S,v,_,y){const A=S-u(S,_),L=v-u(v,_),D=Math.abs(A-L)-(function(R,k,M){let j=0;const H=R-u(R,M),U=k-u(k,M);for(let F=0;F<Math.abs(H-U);F++){const K=b(R,k)==="A"?-1:1,Y=M.buffer.lines.get(H+K*F);Y!=null&&Y.isWrapped&&j++}return j})(S,v,_);return E(D,T(b(S,v),y))}function u(S,v){let _=0,y=v.buffer.lines.get(S),A=y==null?void 0:y.isWrapped;for(;A&&S>=0&&S<v.rows;)_++,y=v.buffer.lines.get(--S),A=y==null?void 0:y.isWrapped;return _}function b(S,v){return S>v?"A":"B"}function C(S,v,_,y,A,L){let D=S,R=v,k="";for(;D!==_||R!==y;)D+=A?1:-1,A&&D>L.cols-1?(k+=L.buffer.translateBufferLineToString(R,!1,S,D),D=0,S=0,R++):!A&&D<0&&(k+=L.buffer.translateBufferLineToString(R,!1,0,S+1),D=L.cols-1,S=D,R--);return k+L.buffer.translateBufferLineToString(R,!1,S,D)}function T(S,v){const _=v?"O":"[";return h.C0.ESC+_+S}function E(S,v){S=Math.floor(S);let _="";for(let y=0;y<S;y++)_+=v;return _}o.moveToCellSequence=function(S,v,_,y){const A=_.buffer.x,L=_.buffer.y;if(!_.buffer.hasScrollback)return(function(k,M,j,H,U,F){return m(M,H,U,F).length===0?"":E(C(k,M,k,M-u(M,U),!1,U).length,T("D",F))})(A,L,0,v,_,y)+m(L,v,_,y)+(function(k,M,j,H,U,F){let K;K=m(M,H,U,F).length>0?H-u(H,U):M;const Y=H,G=(function(W,Z,z,O,N,$){let I;return I=m(z,O,N,$).length>0?O-u(O,N):Z,W<z&&I<=O||W>=z&&I<O?"C":"D"})(k,M,j,H,U,F);return E(C(k,K,j,Y,G==="C",U).length,T(G,F))})(A,L,S,v,_,y);let D;if(L===v)return D=A>S?"D":"C",E(Math.abs(A-S),T(D,y));D=L>v?"D":"C";const R=Math.abs(L-v);return E((function(k,M){return M.cols-k})(L>v?S:A,_)+(R-1)*_.cols+1+((L>v?A:S)-1),T(D,y))}},1296:function(f,o,c){var h=this&&this.__decorate||function(F,K,Y,G){var W,Z=arguments.length,z=Z<3?K:G===null?G=Object.getOwnPropertyDescriptor(K,Y):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(F,K,Y,G);else for(var O=F.length-1;O>=0;O--)(W=F[O])&&(z=(Z<3?W(z):Z>3?W(K,Y,z):W(K,Y))||z);return Z>3&&z&&Object.defineProperty(K,Y,z),z},m=this&&this.__param||function(F,K){return function(Y,G){K(Y,G,F)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const u=c(3787),b=c(2550),C=c(2223),T=c(6171),E=c(6052),S=c(4725),v=c(8055),_=c(8460),y=c(844),A=c(2585),L="xterm-dom-renderer-owner-",D="xterm-rows",R="xterm-fg-",k="xterm-bg-",M="xterm-focus",j="xterm-selection";let H=1,U=o.DomRenderer=class extends y.Disposable{constructor(F,K,Y,G,W,Z,z,O,N,$,I,re,ve){super(),this._terminal=F,this._document=K,this._element=Y,this._screenElement=G,this._viewportElement=W,this._helperContainer=Z,this._linkifier2=z,this._charSizeService=N,this._optionsService=$,this._bufferService=I,this._coreBrowserService=re,this._themeService=ve,this._terminalClass=H++,this._rowElements=[],this._selectionRenderModel=(0,E.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new _.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(D),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(j),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,T.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ge=>this._injectCss(ge)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(L+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ge=>this._handleLinkHover(ge)))),this.register(this._linkifier2.onHideLinkUnderline((ge=>this._handleLinkLeave(ge)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(L+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new b.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const F=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*F,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*F),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/F),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/F),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const K=`${this._terminalSelector} .${D} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=K,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(F){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let K=`${this._terminalSelector} .${D} { color: ${F.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;K+=`${this._terminalSelector} .${D} .xterm-dim { color: ${v.color.multiplyOpacity(F.foreground,.5).css};}`,K+=`${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 Y=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,W=`blink_block_${this._terminalClass}`;K+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,K+=`@keyframes ${G} { 50% { box-shadow: none; }}`,K+=`@keyframes ${W} { 0% { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css}; } 50% { background-color: inherit; color: ${F.cursor.css}; }}`,K+=`${this._terminalSelector} .${D}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${D}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${D}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css};}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${F.cursor.css} !important; color: ${F.cursorAccent.css} !important;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${F.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${F.cursor.css} inset;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${F.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,K+=`${this._terminalSelector} .${j} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${j} div { position: absolute; background-color: ${F.selectionBackgroundOpaque.css};}${this._terminalSelector} .${j} div { position: absolute; background-color: ${F.selectionInactiveBackgroundOpaque.css};}`;for(const[Z,z]of F.ansi.entries())K+=`${this._terminalSelector} .${R}${Z} { color: ${z.css}; }${this._terminalSelector} .${R}${Z}.xterm-dim { color: ${v.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${k}${Z} { background-color: ${z.css}; }`;K+=`${this._terminalSelector} .${R}${C.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(F.background).css}; }${this._terminalSelector} .${R}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(F.background),.5).css}; }${this._terminalSelector} .${k}${C.INVERTED_DEFAULT_COLOR} { background-color: ${F.foreground.css}; }`,this._themeStyleElement.textContent=K}_setDefaultSpacing(){const F=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${F}px`,this._rowFactory.defaultSpacing=F}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(F,K){for(let Y=this._rowElements.length;Y<=K;Y++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>K;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(F,K){this._refreshRowElements(F,K),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(F,K,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(F,K,Y),this.renderRows(0,this._bufferService.rows-1),!F||!K)return;this._selectionRenderModel.update(this._terminal,F,K,Y);const G=this._selectionRenderModel.viewportStartRow,W=this._selectionRenderModel.viewportEndRow,Z=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(Z>=this._bufferService.rows||z<0)return;const O=this._document.createDocumentFragment();if(Y){const N=F[0]>K[0];O.appendChild(this._createSelectionElement(Z,N?K[0]:F[0],N?F[0]:K[0],z-Z+1))}else{const N=G===Z?F[0]:0,$=Z===W?K[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(Z,N,$));const I=z-Z-1;if(O.appendChild(this._createSelectionElement(Z+1,0,this._bufferService.cols,I)),Z!==z){const re=W===z?K[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(z,0,re))}}this._selectionContainer.appendChild(O)}_createSelectionElement(F,K,Y,G=1){const W=this._document.createElement("div"),Z=K*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(Y-K);return Z+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-Z),W.style.height=G*this.dimensions.css.cell.height+"px",W.style.top=F*this.dimensions.css.cell.height+"px",W.style.left=`${Z}px`,W.style.width=`${z}px`,W}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const F of this._rowElements)F.replaceChildren()}renderRows(F,K){const Y=this._bufferService.buffer,G=Y.ybase+Y.y,W=Math.min(Y.x,this._bufferService.cols-1),Z=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=F;N<=K;N++){const $=N+Y.ydisp,I=this._rowElements[N],re=Y.lines.get($);if(!I||!re)break;I.replaceChildren(...this._rowFactory.createRow(re,$,$===G,z,O,W,Z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${this._terminalClass}`}_handleLinkHover(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!0)}_handleLinkLeave(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!1)}_setCellUnderline(F,K,Y,G,W,Z){Y<0&&(F=0),G<0&&(K=0);const z=this._bufferService.rows-1;Y=Math.max(Math.min(Y,z),0),G=Math.max(Math.min(G,z),0),W=Math.min(W,this._bufferService.cols);const O=this._bufferService.buffer,N=O.ybase+O.y,$=Math.min(O.x,W-1),I=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,ve=this._optionsService.rawOptions.cursorInactiveStyle;for(let ge=Y;ge<=G;++ge){const Q=ge+O.ydisp,q=this._rowElements[ge],ee=O.lines.get(Q);if(!q||!ee)break;q.replaceChildren(...this._rowFactory.createRow(ee,Q,Q===N,re,ve,$,I,this.dimensions.css.cell.width,this._widthCache,Z?ge===Y?F:0:-1,Z?(ge===G?K:W)-1:-1))}}};o.DomRenderer=U=h([m(7,A.IInstantiationService),m(8,S.ICharSizeService),m(9,A.IOptionsService),m(10,A.IBufferService),m(11,S.ICoreBrowserService),m(12,S.IThemeService)],U)},3787:function(f,o,c){var h=this&&this.__decorate||function(D,R,k,M){var j,H=arguments.length,U=H<3?R:M===null?M=Object.getOwnPropertyDescriptor(R,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(D,R,k,M);else for(var F=D.length-1;F>=0;F--)(j=D[F])&&(U=(H<3?j(U):H>3?j(R,k,U):j(R,k))||U);return H>3&&U&&Object.defineProperty(R,k,U),U},m=this&&this.__param||function(D,R){return function(k,M){R(k,M,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const u=c(2223),b=c(643),C=c(511),T=c(2585),E=c(8055),S=c(4725),v=c(4269),_=c(6171),y=c(3734);let A=o.DomRendererRowFactory=class{constructor(D,R,k,M,j,H,U){this._document=D,this._characterJoinerService=R,this._optionsService=k,this._coreBrowserService=M,this._coreService=j,this._decorationService=H,this._themeService=U,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(D,R,k){this._selectionStart=D,this._selectionEnd=R,this._columnSelectMode=k}createRow(D,R,k,M,j,H,U,F,K,Y,G){const W=[],Z=this._characterJoinerService.getJoinedCharacters(R),z=this._themeService.colors;let O,N=D.getNoBgTrimmedLength();k&&N<H+1&&(N=H+1);let $=0,I="",re=0,ve=0,ge=0,Q=!1,q=0,ee=!1,se=0;const we=[],he=Y!==-1&&G!==-1;for(let pe=0;pe<N;pe++){D.loadCell(pe,this._workCell);let ke=this._workCell.getWidth();if(ke===0)continue;let Be=!1,Ke=pe,xe=this._workCell;if(Z.length>0&&pe===Z[0][0]){Be=!0;const Fe=Z.shift();xe=new v.JoinedCellData(this._workCell,D.translateToString(!0,Fe[0],Fe[1]),Fe[1]-Fe[0]),Ke=Fe[1]-1,ke=xe.getWidth()}const rt=this._isCellInSelection(pe,R),wt=k&&pe===H,yt=he&&pe>=Y&&pe<=G;let It=!1;this._decorationService.forEachDecorationAtCell(pe,R,void 0,(Fe=>{It=!0}));let yn=xe.getChars()||b.WHITESPACE_CELL_CHAR;if(yn===" "&&(xe.isUnderline()||xe.isOverline())&&(yn=" "),se=ke*F-K.get(yn,xe.isBold(),xe.isItalic()),O){if($&&(rt&&ee||!rt&&!ee&&xe.bg===re)&&(rt&&ee&&z.selectionForeground||xe.fg===ve)&&xe.extended.ext===ge&&yt===Q&&se===q&&!wt&&!Be&&!It){xe.isInvisible()?I+=b.WHITESPACE_CELL_CHAR:I+=yn,$++;continue}$&&(O.textContent=I),O=this._document.createElement("span"),$=0,I=""}else O=this._document.createElement("span");if(re=xe.bg,ve=xe.fg,ge=xe.extended.ext,Q=yt,q=se,ee=rt,Be&&H>=pe&&H<=Ke&&(H=pe),!this._coreService.isCursorHidden&&wt&&this._coreService.isCursorInitialized){if(we.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&we.push("xterm-cursor-blink"),we.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(j)switch(j){case"outline":we.push("xterm-cursor-outline");break;case"block":we.push("xterm-cursor-block");break;case"bar":we.push("xterm-cursor-bar");break;case"underline":we.push("xterm-cursor-underline")}}if(xe.isBold()&&we.push("xterm-bold"),xe.isItalic()&&we.push("xterm-italic"),xe.isDim()&&we.push("xterm-dim"),I=xe.isInvisible()?b.WHITESPACE_CELL_CHAR:xe.getChars()||b.WHITESPACE_CELL_CHAR,xe.isUnderline()&&(we.push(`xterm-underline-${xe.extended.underlineStyle}`),I===" "&&(I=" "),!xe.isUnderlineColorDefault()))if(xe.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(xe.getUnderlineColor()).join(",")})`;else{let Fe=xe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&xe.isBold()&&Fe<8&&(Fe+=8),O.style.textDecorationColor=z.ansi[Fe].css}xe.isOverline()&&(we.push("xterm-overline"),I===" "&&(I=" ")),xe.isStrikethrough()&&we.push("xterm-strikethrough"),yt&&(O.style.textDecoration="underline");let xt=xe.getFgColor(),tt=xe.getFgColorMode(),jt=xe.getBgColor(),ue=xe.getBgColorMode();const Se=!!xe.isInverse();if(Se){const Fe=xt;xt=jt,jt=Fe;const St=tt;tt=ue,ue=St}let Ae,Le,je,mt=!1;switch(this._decorationService.forEachDecorationAtCell(pe,R,void 0,(Fe=>{Fe.options.layer!=="top"&&mt||(Fe.backgroundColorRGB&&(ue=50331648,jt=Fe.backgroundColorRGB.rgba>>8&16777215,Ae=Fe.backgroundColorRGB),Fe.foregroundColorRGB&&(tt=50331648,xt=Fe.foregroundColorRGB.rgba>>8&16777215,Le=Fe.foregroundColorRGB),mt=Fe.options.layer==="top")})),!mt&&rt&&(Ae=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,jt=Ae.rgba>>8&16777215,ue=50331648,mt=!0,z.selectionForeground&&(tt=50331648,xt=z.selectionForeground.rgba>>8&16777215,Le=z.selectionForeground)),mt&&we.push("xterm-decoration-top"),ue){case 16777216:case 33554432:je=z.ansi[jt],we.push(`xterm-bg-${jt}`);break;case 50331648:je=E.channels.toColor(jt>>16,jt>>8&255,255&jt),this._addStyle(O,`background-color:#${L((jt>>>0).toString(16),"0",6)}`);break;default:Se?(je=z.foreground,we.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):je=z.background}switch(Ae||xe.isDim()&&(Ae=E.color.multiplyOpacity(je,.5)),tt){case 16777216:case 33554432:xe.isBold()&&xt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(xt+=8),this._applyMinimumContrast(O,je,z.ansi[xt],xe,Ae,void 0)||we.push(`xterm-fg-${xt}`);break;case 50331648:const Fe=E.channels.toColor(xt>>16&255,xt>>8&255,255&xt);this._applyMinimumContrast(O,je,Fe,xe,Ae,Le)||this._addStyle(O,`color:#${L(xt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,je,z.foreground,xe,Ae,Le)||Se&&we.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}we.length&&(O.className=we.join(" "),we.length=0),wt||Be||It?O.textContent=I:$++,se!==this.defaultSpacing&&(O.style.letterSpacing=`${se}px`),W.push(O),pe=Ke}return O&&$&&(O.textContent=I),W}_applyMinimumContrast(D,R,k,M,j,H){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,_.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const U=this._getContrastCache(M);let F;if(j||H||(F=U.getColor(R.rgba,k.rgba)),F===void 0){const K=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);F=E.color.ensureContrastRatio(j||R,H||k,K),U.setColor((j||R).rgba,(H||k).rgba,F??null)}return!!F&&(this._addStyle(D,`color:${F.css}`),!0)}_getContrastCache(D){return D.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(D,R){D.setAttribute("style",`${D.getAttribute("style")||""}${R};`)}_isCellInSelection(D,R){const k=this._selectionStart,M=this._selectionEnd;return!(!k||!M)&&(this._columnSelectMode?k[0]<=M[0]?D>=k[0]&&R>=k[1]&&D<M[0]&&R<=M[1]:D<k[0]&&R>=k[1]&&D>=M[0]&&R<=M[1]:R>k[1]&&R<M[1]||k[1]===M[1]&&R===k[1]&&D>=k[0]&&D<M[0]||k[1]<M[1]&&R===M[1]&&D<M[0]||k[1]<M[1]&&R===k[1]&&D>=k[0])}};function L(D,R,k){for(;D.length<k;)D=R+D;return D}o.DomRendererRowFactory=A=h([m(1,S.ICharacterJoinerService),m(2,T.IOptionsService),m(3,S.ICoreBrowserService),m(4,T.ICoreService),m(5,T.IDecorationService),m(6,S.IThemeService)],A)},2550:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.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 m=c.createElement("span");m.classList.add("xterm-char-measure-element");const u=c.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const b=c.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontStyle="italic";const C=c.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontWeight="bold",C.style.fontStyle="italic",this._measureElements=[m,u,b,C],this._container.appendChild(m),this._container.appendChild(u),this._container.appendChild(b),this._container.appendChild(C),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(c,h,m,u){c===this._font&&h===this._fontSize&&m===this._weight&&u===this._weightBold||(this._font=c,this._fontSize=h,this._weight=m,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(c,h,m){let u=0;if(!h&&!m&&c.length===1&&(u=c.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const T=this._measure(c,0);return T>0&&(this._flat[u]=T),T}let b=c;h&&(b+="B"),m&&(b+="I");let C=this._holey.get(b);if(C===void 0){let T=0;h&&(T|=1),m&&(T|=2),C=this._measure(c,T),C>0&&this._holey.set(b,C)}return C}_measure(c,h){const m=this._measureElements[h];return m.textContent=c.repeat(32),m.offsetWidth/32}}},2223:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,o)=>{function c(m){return 57508<=m&&m<=57558}function h(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},o.isEmoji=h,o.allowRescaling=function(m,u,b,C){return u===1&&b>Math.ceil(1.5*C)&&m!==void 0&&m>255&&!h(m)&&!c(m)&&!(function(T){return 57344<=T&&T<=63743})(m)},o.treatGlyphAsBackgroundColor=function(m){return c(m)||(function(u){return 9472<=u&&u<=9631})(m)},o.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}}}},o.computeNextVariantOffset=function(m,u,b=0){return(m-(2*Math.round(u)-b))%(2*Math.round(u))}},6052:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{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(m,u,b,C=!1){if(this.selectionStart=u,this.selectionEnd=b,!u||!b||u[0]===b[0]&&u[1]===b[1])return void this.clear();const T=m.buffers.active.ydisp,E=u[1]-T,S=b[1]-T,v=Math.max(E,0),_=Math.min(S,m.rows-1);v>=m.rows||_<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=E,this.viewportEndRow=S,this.viewportCappedStartRow=v,this.viewportCappedEndRow=_,this.startCol=u[0],this.endCol=b[0])}isCellSelected(m,u,b){return!!this.hasSelection&&(b-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&b>=this.viewportCappedStartRow&&u<this.endCol&&b<=this.viewportCappedEndRow:u<this.startCol&&b>=this.viewportCappedStartRow&&u>=this.endCol&&b<=this.viewportCappedEndRow:b>this.viewportStartRow&&b<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&b===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportStartRow&&u>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,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 c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(f,o,c){var h=this&&this.__decorate||function(_,y,A,L){var D,R=arguments.length,k=R<3?y:L===null?L=Object.getOwnPropertyDescriptor(y,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,y,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(y,A,k):D(y,A))||k);return R>3&&k&&Object.defineProperty(y,A,k),k},m=this&&this.__param||function(_,y){return function(A,L){y(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const u=c(2585),b=c(8460),C=c(844);let T=o.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(_,y,A){super(),this._optionsService=A,this.width=0,this.height=0,this._onCharSizeChange=this.register(new b.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new S(_,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const _=this._measureStrategy.measure();_.width===this.width&&_.height===this.height||(this.width=_.width,this.height=_.height,this._onCharSizeChange.fire())}};o.CharSizeService=T=h([m(2,u.IOptionsService)],T);class E extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,A){y!==void 0&&y>0&&A!==void 0&&A>0&&(this._result.width=y,this._result.height=A)}}class S extends E{constructor(y,A,L){super(),this._document=y,this._parentElement=A,this._optionsService=L,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 E{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const A=this._ctx.measureText("W");if(!("width"in A&&"fontBoundingBoxAscent"in A&&"fontBoundingBoxDescent"in A))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(f,o,c){var h=this&&this.__decorate||function(v,_,y,A){var L,D=arguments.length,R=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,y):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,_,y,A);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(R=(D<3?L(R):D>3?L(_,y,R):L(_,y))||R);return D>3&&R&&Object.defineProperty(_,y,R),R},m=this&&this.__param||function(v,_){return function(y,A){_(y,A,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const u=c(3734),b=c(643),C=c(511),T=c(2585);class E extends u.AttributeData{constructor(_,y,A){super(),this.content=0,this.combinedData="",this.fg=_.fg,this.bg=_.bg,this.combinedData=y,this._width=A}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(_){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=E;let S=o.CharacterJoinerService=class n_{constructor(_){this._bufferService=_,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(_){const y={id:this._nextCharacterJoinerId++,handler:_};return this._characterJoiners.push(y),y.id}deregister(_){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===_)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(_){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(_);if(!y||y.length===0)return[];const A=[],L=y.translateToString(!0);let D=0,R=0,k=0,M=y.getFg(0),j=y.getBg(0);for(let H=0;H<y.getTrimmedLength();H++)if(y.loadCell(H,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==M||this._workCell.bg!==j){if(H-D>1){const U=this._getJoinedRanges(L,k,R,y,D);for(let F=0;F<U.length;F++)A.push(U[F])}D=H,k=R,M=this._workCell.fg,j=this._workCell.bg}R+=this._workCell.getChars().length||b.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-D>1){const H=this._getJoinedRanges(L,k,R,y,D);for(let U=0;U<H.length;U++)A.push(H[U])}return A}_getJoinedRanges(_,y,A,L,D){const R=_.substring(y,A);let k=[];try{k=this._characterJoiners[0].handler(R)}catch(M){console.error(M)}for(let M=1;M<this._characterJoiners.length;M++)try{const j=this._characterJoiners[M].handler(R);for(let H=0;H<j.length;H++)n_._mergeRanges(k,j[H])}catch(j){console.error(j)}return this._stringRangesToCellRanges(k,L,D),k}_stringRangesToCellRanges(_,y,A){let L=0,D=!1,R=0,k=_[L];if(k){for(let M=A;M<this._bufferService.cols;M++){const j=y.getWidth(M),H=y.getString(M).length||b.WHITESPACE_CELL_CHAR.length;if(j!==0){if(!D&&k[0]<=R&&(k[0]=M,D=!0),k[1]<=R){if(k[1]=M,k=_[++L],!k)break;k[0]<=R?(k[0]=M,D=!0):D=!1}R+=H}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(_,y){let A=!1;for(let L=0;L<_.length;L++){const D=_[L];if(A){if(y[1]<=D[0])return _[L-1][1]=y[1],_;if(y[1]<=D[1])return _[L-1][1]=Math.max(y[1],D[1]),_.splice(L,1),_;_.splice(L,1),L--}else{if(y[1]<=D[0])return _.splice(L,0,y),_;if(y[1]<=D[1])return D[0]=Math.min(y[0],D[0]),_;y[0]<D[1]&&(D[0]=Math.min(y[0],D[0]),A=!0)}}return A?_[_.length-1][1]=y[1]:_.push(y),_}};o.CharacterJoinerService=S=h([m(0,T.IBufferService)],S)},5114:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const h=c(844),m=c(8460),u=c(3656);class b extends h.Disposable{constructor(E,S,v){super(),this._textarea=E,this._window=S,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new C(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((_=>this._screenDprMonitor.setWindow(_)))),this.register((0,m.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(E){this._window!==E&&(this._window=E,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=b;class C extends h.Disposable{constructor(E){super(),this._parentWindow=E,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new m.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(E){this._parentWindow=E,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var E;this._outerListener&&((E=this._resolutionMediaMatchList)==null||E.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:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const h=c(844);class m extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(b){return this.linkProviders.push(b),{dispose:()=>{const C=this.linkProviders.indexOf(b);C!==-1&&this.linkProviders.splice(C,1)}}}}o.LinkProviderService=m},8934:function(f,o,c){var h=this&&this.__decorate||function(T,E,S,v){var _,y=arguments.length,A=y<3?E:v===null?v=Object.getOwnPropertyDescriptor(E,S):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(T,E,S,v);else for(var L=T.length-1;L>=0;L--)(_=T[L])&&(A=(y<3?_(A):y>3?_(E,S,A):_(E,S))||A);return y>3&&A&&Object.defineProperty(E,S,A),A},m=this&&this.__param||function(T,E){return function(S,v){E(S,v,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const u=c(4725),b=c(9806);let C=o.MouseService=class{constructor(T,E){this._renderService=T,this._charSizeService=E}getCoords(T,E,S,v,_){return(0,b.getCoords)(window,T,E,S,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,_)}getMouseReportCoords(T,E){const S=(0,b.getCoordsRelativeToElement)(window,T,E);if(this._charSizeService.hasValidSize)return S[0]=Math.min(Math.max(S[0],0),this._renderService.dimensions.css.canvas.width-1),S[1]=Math.min(Math.max(S[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(S[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(S[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(S[0]),y:Math.floor(S[1])}}};o.MouseService=C=h([m(0,u.IRenderService),m(1,u.ICharSizeService)],C)},3230:function(f,o,c){var h=this&&this.__decorate||function(_,y,A,L){var D,R=arguments.length,k=R<3?y:L===null?L=Object.getOwnPropertyDescriptor(y,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,y,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(y,A,k):D(y,A))||k);return R>3&&k&&Object.defineProperty(y,A,k),k},m=this&&this.__param||function(_,y){return function(A,L){y(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const u=c(6193),b=c(4725),C=c(8460),T=c(844),E=c(7226),S=c(2585);let v=o.RenderService=class extends T.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(_,y,A,L,D,R,k,M){super(),this._rowCount=_,this._charSizeService=L,this._renderer=this.register(new T.MutableDisposable),this._pausedResizeTask=new E.DebouncedIdleTask,this._observerDisposable=this.register(new T.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new C.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new C.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new C.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((j,H)=>this._renderRows(j,H)),k),this.register(this._renderDebouncer),this.register(k.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(R.onResize((()=>this._fullRefresh()))),this.register(R.buffers.onBufferActivate((()=>{var j;return(j=this._renderer.value)==null?void 0:j.clear()}))),this.register(A.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(D.onDecorationRegistered((()=>this._fullRefresh()))),this.register(D.onDecorationRemoved((()=>this._fullRefresh()))),this.register(A.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(R.cols,R.rows),this._fullRefresh()}))),this.register(A.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(R.buffer.y,R.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,y),this.register(k.onWindowChange((j=>this._registerIntersectionObserver(j,y))))}_registerIntersectionObserver(_,y){if("IntersectionObserver"in _){const A=new _.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});A.observe(y),this._observerDisposable.value=(0,T.toDisposable)((()=>A.disconnect()))}}_handleIntersectionChange(_){this._isPaused=_.isIntersecting===void 0?_.intersectionRatio===0:!_.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(_,y,A=!1){this._isPaused?this._needsFullRefresh=!0:(A||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(_,y,this._rowCount))}_renderRows(_,y){this._renderer.value&&(_=Math.min(_,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(_,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:_,end:y}),this._onRender.fire({start:_,end:y}),this._isNextRenderRedrawOnly=!0)}resize(_,y){this._rowCount=y,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(_){this._renderer.value=_,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(_){return this._renderDebouncer.addRefreshCallback(_)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var _,y;this._renderer.value&&((y=(_=this._renderer.value).clearTextureAtlas)==null||y.call(_),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(_,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var A;return(A=this._renderer.value)==null?void 0:A.handleResize(_,y)})):this._renderer.value.handleResize(_,y),this._fullRefresh())}handleCharSizeChanged(){var _;(_=this._renderer.value)==null||_.handleCharSizeChanged()}handleBlur(){var _;(_=this._renderer.value)==null||_.handleBlur()}handleFocus(){var _;(_=this._renderer.value)==null||_.handleFocus()}handleSelectionChanged(_,y,A){var L;this._selectionState.start=_,this._selectionState.end=y,this._selectionState.columnSelectMode=A,(L=this._renderer.value)==null||L.handleSelectionChanged(_,y,A)}handleCursorMove(){var _;(_=this._renderer.value)==null||_.handleCursorMove()}clear(){var _;(_=this._renderer.value)==null||_.clear()}};o.RenderService=v=h([m(2,S.IOptionsService),m(3,b.ICharSizeService),m(4,S.IDecorationService),m(5,S.IBufferService),m(6,b.ICoreBrowserService),m(7,b.IThemeService)],v)},9312:function(f,o,c){var h=this&&this.__decorate||function(k,M,j,H){var U,F=arguments.length,K=F<3?M:H===null?H=Object.getOwnPropertyDescriptor(M,j):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(k,M,j,H);else for(var Y=k.length-1;Y>=0;Y--)(U=k[Y])&&(K=(F<3?U(K):F>3?U(M,j,K):U(M,j))||K);return F>3&&K&&Object.defineProperty(M,j,K),K},m=this&&this.__param||function(k,M){return function(j,H){M(j,H,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const u=c(9806),b=c(9504),C=c(456),T=c(4725),E=c(8460),S=c(844),v=c(6114),_=c(4841),y=c(511),A=c(2585),L=" ",D=new RegExp(L,"g");let R=o.SelectionService=class extends S.Disposable{constructor(k,M,j,H,U,F,K,Y,G){super(),this._element=k,this._screenElement=M,this._linkifier=j,this._bufferService=H,this._coreService=U,this._mouseService=F,this._optionsService=K,this._renderService=Y,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new E.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new E.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new E.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=W=>this._handleMouseMove(W),this._mouseUpListener=W=>this._handleMouseUp(W),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((W=>this._handleTrim(W))),this.register(this._bufferService.buffers.onBufferActivate((W=>this._handleBufferActivate(W)))),this.enable(),this._model=new C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,S.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 k=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!k||!M||k[0]===M[0]&&k[1]===M[1])}get selectionText(){const k=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!k||!M)return"";const j=this._bufferService.buffer,H=[];if(this._activeSelectionMode===3){if(k[0]===M[0])return"";const U=k[0]<M[0]?k[0]:M[0],F=k[0]<M[0]?M[0]:k[0];for(let K=k[1];K<=M[1];K++){const Y=j.translateBufferLineToString(K,!0,U,F);H.push(Y)}}else{const U=k[1]===M[1]?M[0]:void 0;H.push(j.translateBufferLineToString(k[1],!0,k[0],U));for(let F=k[1]+1;F<=M[1]-1;F++){const K=j.lines.get(F),Y=j.translateBufferLineToString(F,!0);K!=null&&K.isWrapped?H[H.length-1]+=Y:H.push(Y)}if(k[1]!==M[1]){const F=j.lines.get(M[1]),K=j.translateBufferLineToString(M[1],!0,0,M[0]);F&&F.isWrapped?H[H.length-1]+=K:H.push(K)}}return H.map((U=>U.replace(D," "))).join(v.isWindows?`\r
|
|
56
|
+
`:`
|
|
57
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.isLinux&&k&&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(k){const M=this._getMouseBufferCoords(k),j=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!!(j&&H&&M)&&this._areCoordsInSelection(M,j,H)}isCellInSelection(k,M){const j=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!(!j||!H)&&this._areCoordsInSelection([k,M],j,H)}_areCoordsInSelection(k,M,j){return k[1]>M[1]&&k[1]<j[1]||M[1]===j[1]&&k[1]===M[1]&&k[0]>=M[0]&&k[0]<j[0]||M[1]<j[1]&&k[1]===j[1]&&k[0]<j[0]||M[1]<j[1]&&k[1]===M[1]&&k[0]>=M[0]}_selectWordAtCursor(k,M){var U,F;const j=(F=(U=this._linkifier.currentLink)==null?void 0:U.link)==null?void 0:F.range;if(j)return this._model.selectionStart=[j.start.x-1,j.start.y-1],this._model.selectionStartLength=(0,_.getRangeLength)(j,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const H=this._getMouseBufferCoords(k);return!!H&&(this._selectWordAt(H,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,M){this._model.clearSelection(),k=Math.max(k,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const M=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(k){let M=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const j=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=j?0:(M>j&&(M-=j),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(k){return v.isMac?k.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:k.shiftKey}handleMouseDown(k){if(this._mouseDownTimeStamp=k.timeStamp,(k.button!==2||!this.hasSelection)&&k.button===0){if(!this._enabled){if(!this.shouldForceSelection(k))return;k.stopPropagation()}k.preventDefault(),this._dragScrollAmount=0,this._enabled&&k.shiftKey?this._handleIncrementalClick(k):k.detail===1?this._handleSingleClick(k):k.detail===2?this._handleDoubleClick(k):k.detail===3&&this._handleTripleClick(k),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(k){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(k))}_handleSingleClick(k){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(k)?3:0,this._model.selectionStart=this._getMouseBufferCoords(k),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const M=this._getMouseBufferCoords(k);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(k){return k.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(k),!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(k),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const j=this._bufferService.buffer;if(this._model.selectionEnd[1]<j.lines.length){const H=j.lines.get(this._model.selectionEnd[1]);H&&H.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}M&&M[0]===this._model.selectionEnd[0]&&M[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const k=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(k.ydisp+this._bufferService.rows,k.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=k.ydisp),this.refresh()}}_handleMouseUp(k){const M=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const j=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(j&&j[0]!==void 0&&j[1]!==void 0){const H=(0,b.moveToCellSequence)(j[0]-1,j[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(H,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,j=!(!k||!M||k[0]===M[0]&&k[1]===M[1]);j?k&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,M,j)):this._oldHasSelection&&this._fireOnSelectionChange(k,M,j)}_fireOnSelectionChange(k,M,j){this._oldSelectionStart=k,this._oldSelectionEnd=M,this._oldHasSelection=j,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(k,M){let j=M;for(let H=0;M>=H;H++){const U=k.loadCell(H,this._workCell).getChars().length;this._workCell.getWidth()===0?j--:U>1&&M!==H&&(j+=U-1)}return j}setSelection(k,M,j){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,M],this._model.selectionStartLength=j,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,M,j=!0,H=!0){if(k[0]>=this._bufferService.cols)return;const U=this._bufferService.buffer,F=U.lines.get(k[1]);if(!F)return;const K=U.translateBufferLineToString(k[1],!1);let Y=this._convertViewportColToCharacterIndex(F,k[0]),G=Y;const W=k[0]-Y;let Z=0,z=0,O=0,N=0;if(K.charAt(Y)===" "){for(;Y>0&&K.charAt(Y-1)===" ";)Y--;for(;G<K.length&&K.charAt(G+1)===" ";)G++}else{let re=k[0],ve=k[0];F.getWidth(re)===0&&(Z++,re--),F.getWidth(ve)===2&&(z++,ve++);const ge=F.getString(ve).length;for(ge>1&&(N+=ge-1,G+=ge-1);re>0&&Y>0&&!this._isCharWordSeparator(F.loadCell(re-1,this._workCell));){F.loadCell(re-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(Z++,re--):Q>1&&(O+=Q-1,Y-=Q-1),Y--,re--}for(;ve<F.length&&G+1<K.length&&!this._isCharWordSeparator(F.loadCell(ve+1,this._workCell));){F.loadCell(ve+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,ve++):Q>1&&(N+=Q-1,G+=Q-1),G++,ve++}}G++;let $=Y+W-Z+O,I=Math.min(this._bufferService.cols,G-Y+Z+z-O-N);if(M||K.slice(Y,G).trim()!==""){if(j&&$===0&&F.getCodePoint(0)!==32){const re=U.lines.get(k[1]-1);if(re&&F.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const ve=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(ve){const ge=this._bufferService.cols-ve.start;$-=ge,I+=ge}}}if(H&&$+I===this._bufferService.cols&&F.getCodePoint(this._bufferService.cols-1)!==32){const re=U.lines.get(k[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const ve=this._getWordAt([0,k[1]+1],!1,!1,!0);ve&&(I+=ve.length)}}return{start:$,length:I}}}_selectWordAt(k,M){const j=this._getWordAt(k,M);if(j){for(;j.start<0;)j.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[j.start,k[1]],this._model.selectionStartLength=j.length}}_selectToWordAt(k){const M=this._getWordAt(k,!0);if(M){let j=k[1];for(;M.start<0;)M.start+=this._bufferService.cols,j--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,j++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,j]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const M=this._bufferService.buffer.getWrappedRangeForLine(k),j={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,_.getRangeLength)(j,this._bufferService.cols)}};o.SelectionService=R=h([m(3,A.IBufferService),m(4,A.ICoreService),m(5,T.IMouseService),m(6,A.IOptionsService),m(7,T.IRenderService),m(8,T.ICoreBrowserService)],R)},4725:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const h=c(8343);o.ICharSizeService=(0,h.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),o.IMouseService=(0,h.createDecorator)("MouseService"),o.IRenderService=(0,h.createDecorator)("RenderService"),o.ISelectionService=(0,h.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,h.createDecorator)("ThemeService"),o.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,o,c){var h=this&&this.__decorate||function(R,k,M,j){var H,U=arguments.length,F=U<3?k:j===null?j=Object.getOwnPropertyDescriptor(k,M):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(R,k,M,j);else for(var K=R.length-1;K>=0;K--)(H=R[K])&&(F=(U<3?H(F):U>3?H(k,M,F):H(k,M))||F);return U>3&&F&&Object.defineProperty(k,M,F),F},m=this&&this.__param||function(R,k){return function(M,j){k(M,j,R)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),b=c(8055),C=c(8460),T=c(844),E=c(2585),S=b.css.toColor("#ffffff"),v=b.css.toColor("#000000"),_=b.css.toColor("#ffffff"),y=b.css.toColor("#000000"),A={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const R=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],k=[0,95,135,175,215,255];for(let M=0;M<216;M++){const j=k[M/36%6|0],H=k[M/6%6|0],U=k[M%6];R.push({css:b.channels.toCss(j,H,U),rgba:b.channels.toRgba(j,H,U)})}for(let M=0;M<24;M++){const j=8+10*M;R.push({css:b.channels.toCss(j,j,j),rgba:b.channels.toRgba(j,j,j)})}return R})());let L=o.ThemeService=class extends T.Disposable{get colors(){return this._colors}constructor(R){super(),this._optionsService=R,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:S,background:v,cursor:_,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:A,selectionBackgroundOpaque:b.color.blend(v,A),selectionInactiveBackgroundTransparent:A,selectionInactiveBackgroundOpaque:b.color.blend(v,A),ansi:o.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(R={}){const k=this._colors;if(k.foreground=D(R.foreground,S),k.background=D(R.background,v),k.cursor=D(R.cursor,_),k.cursorAccent=D(R.cursorAccent,y),k.selectionBackgroundTransparent=D(R.selectionBackground,A),k.selectionBackgroundOpaque=b.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=D(R.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=b.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=R.selectionForeground?D(R.selectionForeground,b.NULL_COLOR):void 0,k.selectionForeground===b.NULL_COLOR&&(k.selectionForeground=void 0),b.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=b.color.opacity(k.selectionBackgroundTransparent,.3)),b.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=b.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=o.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=D(R.black,o.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=D(R.red,o.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=D(R.green,o.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=D(R.yellow,o.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=D(R.blue,o.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=D(R.magenta,o.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=D(R.cyan,o.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=D(R.white,o.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=D(R.brightBlack,o.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=D(R.brightRed,o.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=D(R.brightGreen,o.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=D(R.brightYellow,o.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=D(R.brightBlue,o.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=D(R.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=D(R.brightCyan,o.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=D(R.brightWhite,o.DEFAULT_ANSI_COLORS[15]),R.extendedAnsi){const M=Math.min(k.ansi.length-16,R.extendedAnsi.length);for(let j=0;j<M;j++)k.ansi[j+16]=D(R.extendedAnsi[j],o.DEFAULT_ANSI_COLORS[j+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(R){this._restoreColor(R),this._onChangeColors.fire(this.colors)}_restoreColor(R){if(R!==void 0)switch(R){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[R]=this._restoreColors.ansi[R]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(R){R(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function D(R,k){if(R!==void 0)try{return b.css.toColor(R)}catch{}return k}o.ThemeService=L=h([m(0,E.IOptionsService)],L)},6349:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const h=c(8460),m=c(844);class u extends m.Disposable{constructor(C){super(),this._maxLength=C,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(C){if(this._maxLength===C)return;const T=new Array(C);for(let E=0;E<Math.min(C,this.length);E++)T[E]=this._array[this._getCyclicIndex(E)];this._array=T,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let T=this._length;T<C;T++)this._array[T]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,T){this._array[this._getCyclicIndex(C)]=T}push(C){this._array[this._getCyclicIndex(this._length)]=C,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(C,T,...E){if(T){for(let S=C;S<this._length-T;S++)this._array[this._getCyclicIndex(S)]=this._array[this._getCyclicIndex(S+T)];this._length-=T,this.onDeleteEmitter.fire({index:C,amount:T})}for(let S=this._length-1;S>=C;S--)this._array[this._getCyclicIndex(S+E.length)]=this._array[this._getCyclicIndex(S)];for(let S=0;S<E.length;S++)this._array[this._getCyclicIndex(C+S)]=E[S];if(E.length&&this.onInsertEmitter.fire({index:C,amount:E.length}),this._length+E.length>this._maxLength){const S=this._length+E.length-this._maxLength;this._startIndex+=S,this._length=this._maxLength,this.onTrimEmitter.fire(S)}else this._length+=E.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,T,E){if(!(T<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+E<0)throw new Error("Cannot shift elements in list beyond index 0");if(E>0){for(let v=T-1;v>=0;v--)this.set(C+v+E,this.get(C+v));const S=C+T+E-this._length;if(S>0)for(this._length+=S;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let S=0;S<T;S++)this.set(C+S+E,this.get(C+S))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}o.CircularList=u},1439:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(h,m=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const b in h)u[b]=m<=1?h[b]:h[b]&&c(h[b],m-1);return u}},8055:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,h=0,m=0,u=0;var b,C,T,E,S;function v(y){const A=y.toString(16);return A.length<2?"0"+A:A}function _(y,A){return y<A?(A+.05)/(y+.05):(y+.05)/(A+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(A,L,D,R){return R!==void 0?`#${v(A)}${v(L)}${v(D)}${v(R)}`:`#${v(A)}${v(L)}${v(D)}`},y.toRgba=function(A,L,D,R=255){return(A<<24|L<<16|D<<8|R)>>>0},y.toColor=function(A,L,D,R){return{css:y.toCss(A,L,D,R),rgba:y.toRgba(A,L,D,R)}}})(b||(o.channels=b={})),(function(y){function A(L,D){return u=Math.round(255*D),[c,h,m]=S.toChannels(L.rgba),{css:b.toCss(c,h,m,u),rgba:b.toRgba(c,h,m,u)}}y.blend=function(L,D){if(u=(255&D.rgba)/255,u===1)return{css:D.css,rgba:D.rgba};const R=D.rgba>>24&255,k=D.rgba>>16&255,M=D.rgba>>8&255,j=L.rgba>>24&255,H=L.rgba>>16&255,U=L.rgba>>8&255;return c=j+Math.round((R-j)*u),h=H+Math.round((k-H)*u),m=U+Math.round((M-U)*u),{css:b.toCss(c,h,m),rgba:b.toRgba(c,h,m)}},y.isOpaque=function(L){return(255&L.rgba)==255},y.ensureContrastRatio=function(L,D,R){const k=S.ensureContrastRatio(L.rgba,D.rgba,R);if(k)return b.toColor(k>>24&255,k>>16&255,k>>8&255)},y.opaque=function(L){const D=(255|L.rgba)>>>0;return[c,h,m]=S.toChannels(D),{css:b.toCss(c,h,m),rgba:D}},y.opacity=A,y.multiplyOpacity=function(L,D){return u=255&L.rgba,A(L,u*D/255)},y.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(C||(o.color=C={})),(function(y){let A,L;try{const D=document.createElement("canvas");D.width=1,D.height=1;const R=D.getContext("2d",{willReadFrequently:!0});R&&(A=R,A.globalCompositeOperation="copy",L=A.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(D){if(D.match(/#[\da-f]{3,8}/i))switch(D.length){case 4:return c=parseInt(D.slice(1,2).repeat(2),16),h=parseInt(D.slice(2,3).repeat(2),16),m=parseInt(D.slice(3,4).repeat(2),16),b.toColor(c,h,m);case 5:return c=parseInt(D.slice(1,2).repeat(2),16),h=parseInt(D.slice(2,3).repeat(2),16),m=parseInt(D.slice(3,4).repeat(2),16),u=parseInt(D.slice(4,5).repeat(2),16),b.toColor(c,h,m,u);case 7:return{css:D,rgba:(parseInt(D.slice(1),16)<<8|255)>>>0};case 9:return{css:D,rgba:parseInt(D.slice(1),16)>>>0}}const R=D.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(R)return c=parseInt(R[1]),h=parseInt(R[2]),m=parseInt(R[3]),u=Math.round(255*(R[5]===void 0?1:parseFloat(R[5]))),b.toColor(c,h,m,u);if(!A||!L)throw new Error("css.toColor: Unsupported css format");if(A.fillStyle=L,A.fillStyle=D,typeof A.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(A.fillRect(0,0,1,1),[c,h,m,u]=A.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(c,h,m,u),css:D}}})(T||(o.css=T={})),(function(y){function A(L,D,R){const k=L/255,M=D/255,j=R/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))}y.relativeLuminance=function(L){return A(L>>16&255,L>>8&255,255&L)},y.relativeLuminance2=A})(E||(o.rgb=E={})),(function(y){function A(D,R,k){const M=D>>24&255,j=D>>16&255,H=D>>8&255;let U=R>>24&255,F=R>>16&255,K=R>>8&255,Y=_(E.relativeLuminance2(U,F,K),E.relativeLuminance2(M,j,H));for(;Y<k&&(U>0||F>0||K>0);)U-=Math.max(0,Math.ceil(.1*U)),F-=Math.max(0,Math.ceil(.1*F)),K-=Math.max(0,Math.ceil(.1*K)),Y=_(E.relativeLuminance2(U,F,K),E.relativeLuminance2(M,j,H));return(U<<24|F<<16|K<<8|255)>>>0}function L(D,R,k){const M=D>>24&255,j=D>>16&255,H=D>>8&255;let U=R>>24&255,F=R>>16&255,K=R>>8&255,Y=_(E.relativeLuminance2(U,F,K),E.relativeLuminance2(M,j,H));for(;Y<k&&(U<255||F<255||K<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),F=Math.min(255,F+Math.ceil(.1*(255-F))),K=Math.min(255,K+Math.ceil(.1*(255-K))),Y=_(E.relativeLuminance2(U,F,K),E.relativeLuminance2(M,j,H));return(U<<24|F<<16|K<<8|255)>>>0}y.blend=function(D,R){if(u=(255&R)/255,u===1)return R;const k=R>>24&255,M=R>>16&255,j=R>>8&255,H=D>>24&255,U=D>>16&255,F=D>>8&255;return c=H+Math.round((k-H)*u),h=U+Math.round((M-U)*u),m=F+Math.round((j-F)*u),b.toRgba(c,h,m)},y.ensureContrastRatio=function(D,R,k){const M=E.relativeLuminance(D>>8),j=E.relativeLuminance(R>>8);if(_(M,j)<k){if(j<M){const F=A(D,R,k),K=_(M,E.relativeLuminance(F>>8));if(K<k){const Y=L(D,R,k);return K>_(M,E.relativeLuminance(Y>>8))?F:Y}return F}const H=L(D,R,k),U=_(M,E.relativeLuminance(H>>8));if(U<k){const F=A(D,R,k);return U>_(M,E.relativeLuminance(F>>8))?H:F}return H}},y.reduceLuminance=A,y.increaseLuminance=L,y.toChannels=function(D){return[D>>24&255,D>>16&255,D>>8&255,255&D]}})(S||(o.rgba=S={})),o.toPaddedHex=v,o.contrastRatio=_},8969:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const h=c(844),m=c(2585),u=c(4348),b=c(7866),C=c(744),T=c(7302),E=c(6975),S=c(8460),v=c(1753),_=c(1480),y=c(7994),A=c(9282),L=c(5435),D=c(5981),R=c(2660);let k=!1;class M extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new S.EventEmitter),this._onScroll.event((H=>{var U;(U=this._onScrollApi)==null||U.fire(H.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(H){for(const U in H)this.optionsService.options[U]=H[U]}constructor(H){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new S.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new S.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new S.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new S.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new S.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new T.OptionsService(H)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(b.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(E.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(_.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(R.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new L.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,S.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,S.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,S.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,S.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((U=>{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((U=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new D.WriteBuffer(((U,F)=>this._inputHandler.parse(U,F)))),this.register((0,S.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(H,U){this._writeBuffer.write(H,U)}writeSync(H,U){this._logService.logLevel<=m.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(H,U)}input(H,U=!0){this.coreService.triggerDataEvent(H,U)}resize(H,U){isNaN(H)||isNaN(U)||(H=Math.max(H,C.MINIMUM_COLS),U=Math.max(U,C.MINIMUM_ROWS),this._bufferService.resize(H,U))}scroll(H,U=!1){this._bufferService.scroll(H,U)}scrollLines(H,U,F){this._bufferService.scrollLines(H,U,F)}scrollPages(H){this.scrollLines(H*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(H){const U=H-this._bufferService.buffer.ydisp;U!==0&&this.scrollLines(U)}registerEscHandler(H,U){return this._inputHandler.registerEscHandler(H,U)}registerDcsHandler(H,U){return this._inputHandler.registerDcsHandler(H,U)}registerCsiHandler(H,U){return this._inputHandler.registerCsiHandler(H,U)}registerOscHandler(H,U){return this._inputHandler.registerOscHandler(H,U)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let H=!1;const U=this.optionsService.rawOptions.windowsPty;U&&U.buildNumber!==void 0&&U.buildNumber!==void 0?H=U.backend==="conpty"&&U.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(H=!0),H?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const H=[];H.push(this.onLineFeed(A.updateWindowsModeWrappedState.bind(null,this._bufferService))),H.push(this.registerCsiHandler({final:"H"},(()=>((0,A.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const U of H)U.dispose()}))}}}o.CoreTerminal=M},8460:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const m=[];for(let u=0;u<this._listeners.length;u++)m.push(this._listeners[u]);for(let u=0;u<m.length;u++)m[u].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,h){return c((m=>h.fire(m)))},o.runAndSubscribe=function(c,h){return h(void 0),c((m=>h(m)))}},5435:function(f,o,c){var h=this&&this.__decorate||function(Z,z,O,N){var $,I=arguments.length,re=I<3?z:N===null?N=Object.getOwnPropertyDescriptor(z,O):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(Z,z,O,N);else for(var ve=Z.length-1;ve>=0;ve--)($=Z[ve])&&(re=(I<3?$(re):I>3?$(z,O,re):$(z,O))||re);return I>3&&re&&Object.defineProperty(z,O,re),re},m=this&&this.__param||function(Z,z){return function(O,N){z(O,N,Z)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const u=c(2584),b=c(7116),C=c(2015),T=c(844),E=c(482),S=c(8437),v=c(8460),_=c(643),y=c(511),A=c(3734),L=c(2585),D=c(1480),R=c(6242),k=c(6351),M=c(5941),j={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function U(Z,z){if(Z>24)return z.setWinLines||!1;switch(Z){case 1:return!!z.restoreWin;case 2:return!!z.minimizeWin;case 3:return!!z.setWinPosition;case 4:return!!z.setWinSizePixels;case 5:return!!z.raiseWin;case 6:return!!z.lowerWin;case 7:return!!z.refreshWin;case 8:return!!z.setWinSizeChars;case 9:return!!z.maximizeWin;case 10:return!!z.fullscreenWin;case 11:return!!z.getWinState;case 13:return!!z.getWinPosition;case 14:return!!z.getWinSizePixels;case 15:return!!z.getScreenSizePixels;case 16:return!!z.getCellSizePixels;case 18:return!!z.getWinSizeChars;case 19:return!!z.getScreenSizeChars;case 20:return!!z.getIconTitle;case 21:return!!z.getWinTitle;case 22:return!!z.pushTitle;case 23:return!!z.popTitle;case 24:return!!z.setWinLines}return!1}var F;(function(Z){Z[Z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Z[Z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(F||(o.WindowsOptionsReportType=F={}));let K=0;class Y extends T.Disposable{getAttrData(){return this._curAttrData}constructor(z,O,N,$,I,re,ve,ge,Q=new C.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=O,this._coreService=N,this._logService=$,this._optionsService=I,this._oscLinkService=re,this._coreMouseService=ve,this._unicodeService=ge,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new E.StringToUtf32,this._utf8Decoder=new E.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=S.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=S.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((q=>this._activeBuffer=q.activeBuffer))),this._parser.setCsiHandlerFallback(((q,ee)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:ee.toArray()})})),this._parser.setEscHandlerFallback((q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(q)})})),this._parser.setExecuteHandlerFallback((q=>{this._logService.debug("Unknown EXECUTE code: ",{code:q})})),this._parser.setOscHandlerFallback(((q,ee,se)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:ee,data:se})})),this._parser.setDcsHandlerFallback(((q,ee,se)=>{ee==="HOOK"&&(se=se.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:ee,payload:se})})),this._parser.setPrintHandler(((q,ee,se)=>this.print(q,ee,se))),this._parser.registerCsiHandler({final:"@"},(q=>this.insertChars(q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(q=>this.scrollLeft(q))),this._parser.registerCsiHandler({final:"A"},(q=>this.cursorUp(q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(q=>this.scrollRight(q))),this._parser.registerCsiHandler({final:"B"},(q=>this.cursorDown(q))),this._parser.registerCsiHandler({final:"C"},(q=>this.cursorForward(q))),this._parser.registerCsiHandler({final:"D"},(q=>this.cursorBackward(q))),this._parser.registerCsiHandler({final:"E"},(q=>this.cursorNextLine(q))),this._parser.registerCsiHandler({final:"F"},(q=>this.cursorPrecedingLine(q))),this._parser.registerCsiHandler({final:"G"},(q=>this.cursorCharAbsolute(q))),this._parser.registerCsiHandler({final:"H"},(q=>this.cursorPosition(q))),this._parser.registerCsiHandler({final:"I"},(q=>this.cursorForwardTab(q))),this._parser.registerCsiHandler({final:"J"},(q=>this.eraseInDisplay(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(q=>this.eraseInDisplay(q,!0))),this._parser.registerCsiHandler({final:"K"},(q=>this.eraseInLine(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(q=>this.eraseInLine(q,!0))),this._parser.registerCsiHandler({final:"L"},(q=>this.insertLines(q))),this._parser.registerCsiHandler({final:"M"},(q=>this.deleteLines(q))),this._parser.registerCsiHandler({final:"P"},(q=>this.deleteChars(q))),this._parser.registerCsiHandler({final:"S"},(q=>this.scrollUp(q))),this._parser.registerCsiHandler({final:"T"},(q=>this.scrollDown(q))),this._parser.registerCsiHandler({final:"X"},(q=>this.eraseChars(q))),this._parser.registerCsiHandler({final:"Z"},(q=>this.cursorBackwardTab(q))),this._parser.registerCsiHandler({final:"`"},(q=>this.charPosAbsolute(q))),this._parser.registerCsiHandler({final:"a"},(q=>this.hPositionRelative(q))),this._parser.registerCsiHandler({final:"b"},(q=>this.repeatPrecedingCharacter(q))),this._parser.registerCsiHandler({final:"c"},(q=>this.sendDeviceAttributesPrimary(q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(q=>this.sendDeviceAttributesSecondary(q))),this._parser.registerCsiHandler({final:"d"},(q=>this.linePosAbsolute(q))),this._parser.registerCsiHandler({final:"e"},(q=>this.vPositionRelative(q))),this._parser.registerCsiHandler({final:"f"},(q=>this.hVPosition(q))),this._parser.registerCsiHandler({final:"g"},(q=>this.tabClear(q))),this._parser.registerCsiHandler({final:"h"},(q=>this.setMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(q=>this.setModePrivate(q))),this._parser.registerCsiHandler({final:"l"},(q=>this.resetMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(q=>this.resetModePrivate(q))),this._parser.registerCsiHandler({final:"m"},(q=>this.charAttributes(q))),this._parser.registerCsiHandler({final:"n"},(q=>this.deviceStatus(q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(q=>this.deviceStatusPrivate(q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(q=>this.softReset(q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(q=>this.setCursorStyle(q))),this._parser.registerCsiHandler({final:"r"},(q=>this.setScrollRegion(q))),this._parser.registerCsiHandler({final:"s"},(q=>this.saveCursor(q))),this._parser.registerCsiHandler({final:"t"},(q=>this.windowOptions(q))),this._parser.registerCsiHandler({final:"u"},(q=>this.restoreCursor(q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(q=>this.insertColumns(q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(q=>this.deleteColumns(q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(q=>this.selectProtected(q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(q=>this.requestMode(q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(q=>this.requestMode(q,!1))),this._parser.setExecuteHandler(u.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(u.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(u.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(u.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(u.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(u.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(u.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(u.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(u.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new R.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new R.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new R.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new R.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new R.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new R.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new R.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new R.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new R.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new R.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new R.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new R.OscHandler((q=>this.restoreCursorColor(q)))),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 q in b.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:q},(()=>this.selectCharset("("+q))),this._parser.registerEscHandler({intermediates:")",final:q},(()=>this.selectCharset(")"+q))),this._parser.registerEscHandler({intermediates:"*",final:q},(()=>this.selectCharset("*"+q))),this._parser.registerEscHandler({intermediates:"+",final:q},(()=>this.selectCharset("+"+q))),this._parser.registerEscHandler({intermediates:"-",final:q},(()=>this.selectCharset("-"+q))),this._parser.registerEscHandler({intermediates:".",final:q},(()=>this.selectCharset("."+q))),this._parser.registerEscHandler({intermediates:"/",final:q},(()=>this.selectCharset("/"+q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((q=>(this._logService.error("Parsing error: ",q),q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler(((q,ee)=>this.requestStatusString(q,ee))))}_preserveStack(z,O,N,$){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=N,this._parseStack.position=$}_logSlowResolvingAsync(z){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([z,new Promise(((O,N)=>setTimeout((()=>N("#SLOW_TIMEOUT")),5e3)))]).catch((O=>{if(O!=="#SLOW_TIMEOUT")throw O;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(z,O){let N,$=this._activeBuffer.x,I=this._activeBuffer.y,re=0;const ve=this._parseStack.paused;if(ve){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(N),N;$=this._parseStack.cursorStartX,I=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>H&&(re=this._parseStack.position+H)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof z=="string"?` "${z}"`:` "${Array.prototype.map.call(z,(q=>String.fromCharCode(q))).join("")}"`),typeof z=="string"?z.split("").map((q=>q.charCodeAt(0))):z),this._parseBuffer.length<z.length&&this._parseBuffer.length<H&&(this._parseBuffer=new Uint32Array(Math.min(z.length,H))),ve||this._dirtyRowTracker.clearRange(),z.length>H)for(let q=re;q<z.length;q+=H){const ee=q+H<z.length?q+H:z.length,se=typeof z=="string"?this._stringDecoder.decode(z.substring(q,ee),this._parseBuffer):this._utf8Decoder.decode(z.subarray(q,ee),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,se))return this._preserveStack($,I,se,q),this._logSlowResolvingAsync(N),N}else if(!ve){const q=typeof z=="string"?this._stringDecoder.decode(z,this._parseBuffer):this._utf8Decoder.decode(z,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,q))return this._preserveStack($,I,q,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===$&&this._activeBuffer.y===I||this._onCursorMove.fire();const ge=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Q,this._bufferService.rows-1),Math.min(ge,this._bufferService.rows-1))}print(z,O,N){let $,I;const re=this._charsetService.charset,ve=this._optionsService.rawOptions.screenReaderMode,ge=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,ee=this._curAttrData;let se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-O>0&&se.getWidth(this._activeBuffer.x-1)===2&&se.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ee);let we=this._parser.precedingJoinState;for(let he=O;he<N;++he){if($=z[he],$<127&&re){const Ke=re[String.fromCharCode($)];Ke&&($=Ke.charCodeAt(0))}const pe=this._unicodeService.charProperties($,we);I=D.UnicodeService.extractWidth(pe);const ke=D.UnicodeService.extractShouldJoin(pe),Be=ke?D.UnicodeService.extractWidth(we):0;if(we=pe,ve&&this._onA11yChar.fire((0,E.stringFromCodePoint)($)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-Be>ge){if(Q){const Ke=se;let xe=this._activeBuffer.x-Be;for(this._activeBuffer.x=Be,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Be>0&&se instanceof S.BufferLine&&se.copyCellsFrom(Ke,xe,0,Be,!1);xe<ge;)Ke.setCellFromCodepoint(xe++,0,1,ee)}else if(this._activeBuffer.x=ge-1,I===2)continue}if(ke&&this._activeBuffer.x){const Ke=se.getWidth(this._activeBuffer.x-1)?1:2;se.addCodepointToCell(this._activeBuffer.x-Ke,$,I);for(let xe=I-Be;--xe>=0;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}else if(q&&(se.insertCells(this._activeBuffer.x,I-Be,this._activeBuffer.getNullCell(ee)),se.getWidth(ge-1)===2&&se.setCellFromCodepoint(ge-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,ee)),se.setCellFromCodepoint(this._activeBuffer.x++,$,I,ee),I>0)for(;--I;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}this._parser.precedingJoinState=we,this._activeBuffer.x<ge&&N-O>0&&se.getWidth(this._activeBuffer.x)===0&&!se.hasContent(this._activeBuffer.x)&&se.setCellFromCodepoint(this._activeBuffer.x,0,1,ee),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(z,O){return z.final!=="t"||z.prefix||z.intermediates?this._parser.registerCsiHandler(z,O):this._parser.registerCsiHandler(z,(N=>!U(N.params[0],this._optionsService.rawOptions.windowOptions)||O(N)))}registerDcsHandler(z,O){return this._parser.registerDcsHandler(z,new k.DcsHandler(O))}registerEscHandler(z,O){return this._parser.registerEscHandler(z,O)}registerOscHandler(z,O){return this._parser.registerOscHandler(z,new R.OscHandler(O))}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 z;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&&((z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&z.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const z=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-z),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(z=this._bufferService.cols-1){this._activeBuffer.x=Math.min(z,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(z,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=z,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=z,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(z,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+z,this._activeBuffer.y+O)}cursorUp(z){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,z.params[0]||1)):this._moveCursor(0,-(z.params[0]||1)),!0}cursorDown(z){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,z.params[0]||1)):this._moveCursor(0,z.params[0]||1),!0}cursorForward(z){return this._moveCursor(z.params[0]||1,0),!0}cursorBackward(z){return this._moveCursor(-(z.params[0]||1),0),!0}cursorNextLine(z){return this.cursorDown(z),this._activeBuffer.x=0,!0}cursorPrecedingLine(z){return this.cursorUp(z),this._activeBuffer.x=0,!0}cursorCharAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(z){return this._setCursor(z.length>=2?(z.params[1]||1)-1:0,(z.params[0]||1)-1),!0}charPosAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(z){return this._moveCursor(z.params[0]||1,0),!0}linePosAbsolute(z){return this._setCursor(this._activeBuffer.x,(z.params[0]||1)-1),!0}vPositionRelative(z){return this._moveCursor(0,z.params[0]||1),!0}hVPosition(z){return this.cursorPosition(z),!0}tabClear(z){const O=z.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=z.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=z.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(z){const O=z.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(z,O,N,$=!1,I=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);re.replaceCells(O,N,this._activeBuffer.getNullCell(this._eraseAttrData()),I),$&&(re.isWrapped=!1)}_resetBufferLine(z,O=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),N.isWrapped=!1)}eraseInDisplay(z,O=!1){let N;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);N<this._bufferService.rows;N++)this._resetBufferLine(N,O);this._dirtyRowTracker.markDirty(N);break;case 1:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N,0,this._activeBuffer.x+1,!0,O),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,O);this._dirtyRowTracker.markDirty(0);break;case 3:const $=this._activeBuffer.lines.length-this._bufferService.rows;$>0&&(this._activeBuffer.lines.trimStart($),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-$,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-$,0),this._onScroll.fire(0))}return!0}eraseInLine(z,O=!1){switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,O);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,O)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(z){this._restrictCursor();let O=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y,$=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-$+1;for(;O--;)this._activeBuffer.lines.splice(I-1,1),this._activeBuffer.lines.splice(N,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(z){this._restrictCursor();let O=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y;let $;for($=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-$;O--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice($,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(z){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.insertCells(this._activeBuffer.x,z.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(z){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.deleteCells(this._activeBuffer.x,z.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(z){let O=z.params[0]||1;for(;O--;)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(z){let O=z.params[0]||1;for(;O--;)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(S.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.deleteCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.insertCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.insertCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.deleteCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(z){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(z.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(z){const O=this._parser.precedingJoinState;if(!O)return!0;const N=z.params[0]||1,$=D.UnicodeService.extractWidth(O),I=this._activeBuffer.x-$,re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(I),ve=new Uint32Array(re.length*N);let ge=0;for(let q=0;q<re.length;){const ee=re.codePointAt(q)||0;ve[ge++]=ee,q+=ee>65535?2:1}let Q=ge;for(let q=1;q<N;++q)ve.copyWithin(Q,0,ge),Q+=ge;return this.print(ve,0,Q),!0}sendDeviceAttributesPrimary(z){return z.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(z){return z.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(z.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(z){return(this._optionsService.rawOptions.termName+"").indexOf(z)===0}setMode(z){for(let O=0;O<z.length;O++)switch(z.params[O]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(z){for(let O=0;O<z.length;O++)switch(z.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),this._charsetService.setgCharset(1,b.DEFAULT_CHARSET),this._charsetService.setgCharset(2,b.DEFAULT_CHARSET),this._charsetService.setgCharset(3,b.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(z){for(let O=0;O<z.length;O++)switch(z.params[O]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(z){for(let O=0;O<z.length;O++)switch(z.params[O]){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(),z.params[O]===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(z,O){const N=this._coreService.decPrivateModes,{activeProtocol:$,activeEncoding:I}=this._coreMouseService,re=this._coreService,{buffers:ve,cols:ge}=this._bufferService,{active:Q,alt:q}=ve,ee=this._optionsService.rawOptions,se=ke=>ke?1:2,we=z.params[0];return he=we,pe=O?we===2?4:we===4?se(re.modes.insertMode):we===12?3:we===20?se(ee.convertEol):0:we===1?se(N.applicationCursorKeys):we===3?ee.windowOptions.setWinLines?ge===80?2:ge===132?1:0:0:we===6?se(N.origin):we===7?se(N.wraparound):we===8?3:we===9?se($==="X10"):we===12?se(ee.cursorBlink):we===25?se(!re.isCursorHidden):we===45?se(N.reverseWraparound):we===66?se(N.applicationKeypad):we===67?4:we===1e3?se($==="VT200"):we===1002?se($==="DRAG"):we===1003?se($==="ANY"):we===1004?se(N.sendFocus):we===1005?4:we===1006?se(I==="SGR"):we===1015?4:we===1016?se(I==="SGR_PIXELS"):we===1048?1:we===47||we===1047||we===1049?se(Q===q):we===2004?se(N.bracketedPasteMode):0,re.triggerDataEvent(`${u.C0.ESC}[${O?"":"?"}${he};${pe}$y`),!0;var he,pe}_updateAttrColor(z,O,N,$,I){return O===2?(z|=50331648,z&=-16777216,z|=A.AttributeData.fromColorRGB([N,$,I])):O===5&&(z&=-50331904,z|=33554432|255&N),z}_extractColor(z,O,N){const $=[0,0,-1,0,0,0];let I=0,re=0;do{if($[re+I]=z.params[O+re],z.hasSubParams(O+re)){const ve=z.getSubParams(O+re);let ge=0;do $[1]===5&&(I=1),$[re+ge+1+I]=ve[ge];while(++ge<ve.length&&ge+re+1+I<$.length);break}if($[1]===5&&re+I>=2||$[1]===2&&re+I>=5)break;$[1]&&(I=1)}while(++re+O<z.length&&re+I<$.length);for(let ve=2;ve<$.length;++ve)$[ve]===-1&&($[ve]=0);switch($[0]){case 38:N.fg=this._updateAttrColor(N.fg,$[1],$[3],$[4],$[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,$[1],$[3],$[4],$[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,$[1],$[3],$[4],$[5])}return re}_processUnderline(z,O){O.extended=O.extended.clone(),(!~z||z>5)&&(z=1),O.extended.underlineStyle=z,O.fg|=268435456,z===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(z){z.fg=S.DEFAULT_ATTR_DATA.fg,z.bg=S.DEFAULT_ATTR_DATA.bg,z.extended=z.extended.clone(),z.extended.underlineStyle=0,z.extended.underlineColor&=-67108864,z.updateExtended()}charAttributes(z){if(z.length===1&&z.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=z.length;let N;const $=this._curAttrData;for(let I=0;I<O;I++)N=z.params[I],N>=30&&N<=37?($.fg&=-50331904,$.fg|=16777216|N-30):N>=40&&N<=47?($.bg&=-50331904,$.bg|=16777216|N-40):N>=90&&N<=97?($.fg&=-50331904,$.fg|=16777224|N-90):N>=100&&N<=107?($.bg&=-50331904,$.bg|=16777224|N-100):N===0?this._processSGR0($):N===1?$.fg|=134217728:N===3?$.bg|=67108864:N===4?($.fg|=268435456,this._processUnderline(z.hasSubParams(I)?z.getSubParams(I)[0]:1,$)):N===5?$.fg|=536870912:N===7?$.fg|=67108864:N===8?$.fg|=1073741824:N===9?$.fg|=2147483648:N===2?$.bg|=134217728:N===21?this._processUnderline(2,$):N===22?($.fg&=-134217729,$.bg&=-134217729):N===23?$.bg&=-67108865:N===24?($.fg&=-268435457,this._processUnderline(0,$)):N===25?$.fg&=-536870913:N===27?$.fg&=-67108865:N===28?$.fg&=-1073741825:N===29?$.fg&=2147483647:N===39?($.fg&=-67108864,$.fg|=16777215&S.DEFAULT_ATTR_DATA.fg):N===49?($.bg&=-67108864,$.bg|=16777215&S.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?I+=this._extractColor(z,I,$):N===53?$.bg|=1073741824:N===55?$.bg&=-1073741825:N===59?($.extended=$.extended.clone(),$.extended.underlineColor=-1,$.updateExtended()):N===100?($.fg&=-67108864,$.fg|=16777215&S.DEFAULT_ATTR_DATA.fg,$.bg&=-67108864,$.bg|=16777215&S.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0}deviceStatus(z){switch(z.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${O};${N}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const O=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${O};${N}R`)}return!0}softReset(z){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=S.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(z){const O=z.params[0]||1;switch(O){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 N=O%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(z){const O=z.params[0]||1;let N;return(z.length<2||(N=z.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0}windowOptions(z){if(!U(z.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=z.length>1?z.params[1]:0;switch(z.params[0]){case 14:O!==2&&this._onRequestWindowsOptionsReport.fire(F.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(F.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:O!==0&&O!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),O!==0&&O!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:O!==0&&O!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),O!==0&&O!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(z){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(z){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(z){return this._windowTitle=z,this._onTitleChange.fire(z),!0}setIconName(z){return this._iconName=z,!0}setOrReportIndexedColor(z){const O=[],N=z.split(";");for(;N.length>1;){const $=N.shift(),I=N.shift();if(/^\d+$/.exec($)){const re=parseInt($);if(W(re))if(I==="?")O.push({type:0,index:re});else{const ve=(0,M.parseColor)(I);ve&&O.push({type:1,index:re,color:ve})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(z){const O=z.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(z,O){this._getCurrentLinkId()&&this._finishHyperlink();const N=z.split(":");let $;const I=N.findIndex((re=>re.startsWith("id=")));return I!==-1&&($=N[I].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:$,uri:O}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(z,O){const N=z.split(";");for(let $=0;$<N.length&&!(O>=this._specialColors.length);++$,++O)if(N[$]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const I=(0,M.parseColor)(N[$]);I&&this._onColor.fire([{type:1,index:this._specialColors[O],color:I}])}return!0}setOrReportFgColor(z){return this._setOrReportSpecialColor(z,0)}setOrReportBgColor(z){return this._setOrReportSpecialColor(z,1)}setOrReportCursorColor(z){return this._setOrReportSpecialColor(z,2)}restoreIndexedColor(z){if(!z)return this._onColor.fire([{type:2}]),!0;const O=[],N=z.split(";");for(let $=0;$<N.length;++$)if(/^\d+$/.exec(N[$])){const I=parseInt(N[$]);W(I)&&O.push({type:2,index:I})}return O.length&&this._onColor.fire(O),!0}restoreFgColor(z){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(z){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(z){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),!0}selectCharset(z){return z.length!==2?(this.selectDefaultCharset(),!0):(z[0]==="/"||this._charsetService.setgCharset(j[z[0]],b.CHARSETS[z[1]]||b.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const z=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,z,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=S.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=S.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(z){return this._charsetService.setgLevel(z),!0}screenAlignmentPattern(){const z=new y.CellData;z.content=4194373,z.fg=this._curAttrData.fg,z.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O<this._bufferService.rows;++O){const N=this._activeBuffer.ybase+this._activeBuffer.y+O,$=this._activeBuffer.lines.get(N);$&&($.fill(z),$.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(z,O){const N=this._bufferService.buffer,$=this._optionsService.rawOptions;return(I=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${I}${u.C0.ESC}\\`),!0))(z==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:z==='"p'?'P1$r61;1"p':z==="r"?`P1$r${N.scrollTop+1};${N.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[$.cursorStyle]-($.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,O){this._dirtyRowTracker.markRangeDirty(z,O)}}o.InputHandler=Y;let G=class{constructor(Z){this._bufferService=Z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Z){Z<this.start?this.start=Z:Z>this.end&&(this.end=Z)}markRangeDirty(Z,z){Z>z&&(K=Z,Z=z,z=K),Z<this.start&&(this.start=Z),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function W(Z){return 0<=Z&&Z<256}G=h([m(0,L.IBufferService)],G)},844:(f,o)=>{function c(h){for(const m of h)m.dispose();h.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.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 m=this._disposables.indexOf(h);m!==-1&&this._disposables.splice(m,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var m;this._isDisposed||h===this._value||((m=this._value)==null||m.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}},o.toDisposable=function(h){return{dispose:h}},o.disposeArray=c,o.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(m,u,b){this._data[m]||(this._data[m]={}),this._data[m][u]=b}get(m,u){return this._data[m]?this._data[m][u]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(h,m,u,b,C){this._data.get(h,m)||this._data.set(h,m,new c),this._data.get(h,m).set(u,b,C)}get(h,m,u,b){var C;return(C=this._data.get(h,m))==null?void 0:C.get(u,b)}clear(){this._data.clear()}}},6114:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,h=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const m=c.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),o.isIpad=h==="iPad",o.isIphone=h==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),o.isLinux=h.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const m=this._getKey(h);if(m===void 0||(c=this._search(m),c===-1)||this._getKey(this._array[c])!==m)return!1;do if(this._array[c]===h)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===m);return!1}*getKeyIterator(h){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===h)}forEachByKey(h,m){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do m(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let m=0,u=this._array.length-1;for(;u>=m;){let b=m+u>>1;const C=this._getKey(this._array[b]);if(C>h)u=b-1;else{if(!(C<h)){for(;b>0&&this._getKey(this._array[b-1])===h;)b--;return b}m=b+1}}return m}}},7226:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const h=c(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(C){this._idleCallback=void 0;let T=0,E=0,S=C.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(T=Date.now(),this._tasks[this._i]()||this._i++,T=Math.max(1,Date.now()-T),E=Math.max(T,E),v=C.timeRemaining(),1.5*E>v)return S-T<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(S-T))}ms`),void this._start();S=v}this.clear()}}class u extends m{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const T=Date.now()+C;return{timeRemaining:()=>Math.max(0,T-Date.now())}}}o.PriorityTaskQueue=u,o.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:u,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}flush(){this._queue.flush()}}},9282:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const h=c(643);o.updateWindowsModeWrappedState=function(m){const u=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),b=u==null?void 0:u.get(m.cols-1),C=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);C&&b&&(C.isWrapped=b[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&b[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new c;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}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}}o.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,b=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=b}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=h},9092:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const h=c(6349),m=c(7226),u=c(3734),b=c(8437),C=c(4634),T=c(511),E=c(643),S=c(4863),v=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(_,y,A){this._hasScrollback=_,this._optionsService=y,this._bufferService=A,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=b.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=T.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=T.CellData.fromCharData([0,E.WHITESPACE_CELL_CHAR,E.WHITESPACE_CELL_WIDTH,E.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.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(_){return _?(this._nullCell.fg=_.fg,this._nullCell.bg=_.bg,this._nullCell.extended=_.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(_){return _?(this._whitespaceCell.fg=_.fg,this._whitespaceCell.bg=_.bg,this._whitespaceCell.extended=_.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(_,y){return new b.BufferLine(this._bufferService.cols,this.getNullCell(_),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const _=this.ybase+this.y-this.ydisp;return _>=0&&_<this._rows}_getCorrectBufferLength(_){if(!this._hasScrollback)return _;const y=_+this._optionsService.rawOptions.scrollback;return y>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(_){if(this.lines.length===0){_===void 0&&(_=b.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(_))}}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(_,y){const A=this.getNullCell(b.DEFAULT_ATTR_DATA);let L=0;const D=this._getCorrectBufferLength(y);if(D>this.lines.maxLength&&(this.lines.maxLength=D),this.lines.length>0){if(this._cols<_)for(let k=0;k<this.lines.length;k++)L+=+this.lines.get(k).resize(_,A);let R=0;if(this._rows<y)for(let k=this._rows;k<y;k++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new b.BufferLine(_,A)):this.ybase>0&&this.lines.length<=this.ybase+this.y+R+1?(this.ybase--,R++,this.ydisp>0&&this.ydisp--):this.lines.push(new b.BufferLine(_,A)));else for(let k=this._rows;k>y;k--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(D<this.lines.maxLength){const k=this.lines.length-D;k>0&&(this.lines.trimStart(k),this.ybase=Math.max(this.ybase-k,0),this.ydisp=Math.max(this.ydisp-k,0),this.savedY=Math.max(this.savedY-k,0)),this.lines.maxLength=D}this.x=Math.min(this.x,_-1),this.y=Math.min(this.y,y-1),R&&(this.y+=R),this.savedX=Math.min(this.savedX,_-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(_,y),this._cols>_))for(let R=0;R<this.lines.length;R++)L+=+this.lines.get(R).resize(_,A);this._cols=_,this._rows=y,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let _=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,_=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return _}get _isReflowEnabled(){const _=this._optionsService.rawOptions.windowsPty;return _&&_.buildNumber?this._hasScrollback&&_.backend==="conpty"&&_.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(_,y){this._cols!==_&&(_>this._cols?this._reflowLarger(_,y):this._reflowSmaller(_,y))}_reflowLarger(_,y){const A=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,_,this.ybase+this.y,this.getNullCell(b.DEFAULT_ATTR_DATA));if(A.length>0){const L=(0,C.reflowLargerCreateNewLayout)(this.lines,A);(0,C.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(_,y,L.countRemoved)}}_reflowLargerAdjustViewport(_,y,A){const L=this.getNullCell(b.DEFAULT_ATTR_DATA);let D=A;for(;D-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new b.BufferLine(_,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-A,0)}_reflowSmaller(_,y){const A=this.getNullCell(b.DEFAULT_ATTR_DATA),L=[];let D=0;for(let R=this.lines.length-1;R>=0;R--){let k=this.lines.get(R);if(!k||!k.isWrapped&&k.getTrimmedLength()<=_)continue;const M=[k];for(;k.isWrapped&&R>0;)k=this.lines.get(--R),M.unshift(k);const j=this.ybase+this.y;if(j>=R&&j<R+M.length)continue;const H=M[M.length-1].getTrimmedLength(),U=(0,C.reflowSmallerGetNewLineLengths)(M,this._cols,_),F=U.length-M.length;let K;K=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+F):Math.max(0,this.lines.length-this.lines.maxLength+F);const Y=[];for(let N=0;N<F;N++){const $=this.getBlankLine(b.DEFAULT_ATTR_DATA,!0);Y.push($)}Y.length>0&&(L.push({start:R+M.length+D,newLines:Y}),D+=Y.length),M.push(...Y);let G=U.length-1,W=U[G];W===0&&(G--,W=U[G]);let Z=M.length-F-1,z=H;for(;Z>=0;){const N=Math.min(z,W);if(M[G]===void 0)break;if(M[G].copyCellsFrom(M[Z],z-N,W-N,N,!0),W-=N,W===0&&(G--,W=U[G]),z-=N,z===0){Z--;const $=Math.max(Z,0);z=(0,C.getWrappedLineTrimmedLength)(M,$,this._cols)}}for(let N=0;N<M.length;N++)U[N]<_&&M[N].setCell(U[N],A);let O=F-K;for(;O-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+D)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+F,this.ybase+y-1)}if(L.length>0){const R=[],k=[];for(let G=0;G<this.lines.length;G++)k.push(this.lines.get(G));const M=this.lines.length;let j=M-1,H=0,U=L[H];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+D);let F=0;for(let G=Math.min(this.lines.maxLength-1,M+D-1);G>=0;G--)if(U&&U.start>j+F){for(let W=U.newLines.length-1;W>=0;W--)this.lines.set(G--,U.newLines[W]);G++,R.push({index:j+1,amount:U.newLines.length}),F+=U.newLines.length,U=L[++H]}else this.lines.set(G,k[j--]);let K=0;for(let G=R.length-1;G>=0;G--)R[G].index+=K,this.lines.onInsertEmitter.fire(R[G]),K+=R[G].amount;const Y=Math.max(0,M+D-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(_,y,A=0,L){const D=this.lines.get(_);return D?D.translateToString(y,A,L):""}getWrappedRangeForLine(_){let y=_,A=_;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;A+1<this.lines.length&&this.lines.get(A+1).isWrapped;)A++;return{first:y,last:A}}setupTabStops(_){for(_!=null?this.tabs[_]||(_=this.prevStop(_)):(this.tabs={},_=0);_<this._cols;_+=this._optionsService.rawOptions.tabStopWidth)this.tabs[_]=!0}prevStop(_){for(_==null&&(_=this.x);!this.tabs[--_]&&_>0;);return _>=this._cols?this._cols-1:_<0?0:_}nextStop(_){for(_==null&&(_=this.x);!this.tabs[++_]&&_<this._cols;);return _>=this._cols?this._cols-1:_<0?0:_}clearMarkers(_){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===_&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].dispose(),this.markers.splice(_--,1);this._isClearing=!1}addMarker(_){const y=new S.Marker(_);return this.markers.push(y),y.register(this.lines.onTrim((A=>{y.line-=A,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((A=>{y.line>=A.index&&(y.line+=A.amount)}))),y.register(this.lines.onDelete((A=>{y.line>=A.index&&y.line<A.index+A.amount&&y.dispose(),y.line>A.index&&(y.line-=A.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(_){this._isClearing||this.markers.splice(this.markers.indexOf(_),1)}}},8437:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const h=c(3734),m=c(511),u=c(643),b=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let C=0;class T{constructor(S,v,_=!1){this.isWrapped=_,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*S);const y=v||m.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let A=0;A<S;++A)this.setCell(A,y);this.length=S}get(S){const v=this._data[3*S+0],_=2097151&v;return[this._data[3*S+1],2097152&v?this._combined[S]:_?(0,b.stringFromCodePoint)(_):"",v>>22,2097152&v?this._combined[S].charCodeAt(this._combined[S].length-1):_]}set(S,v){this._data[3*S+1]=v[u.CHAR_DATA_ATTR_INDEX],v[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[S]=v[1],this._data[3*S+0]=2097152|S|v[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*S+0]=v[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(S){return this._data[3*S+0]>>22}hasWidth(S){return 12582912&this._data[3*S+0]}getFg(S){return this._data[3*S+1]}getBg(S){return this._data[3*S+2]}hasContent(S){return 4194303&this._data[3*S+0]}getCodePoint(S){const v=this._data[3*S+0];return 2097152&v?this._combined[S].charCodeAt(this._combined[S].length-1):2097151&v}isCombined(S){return 2097152&this._data[3*S+0]}getString(S){const v=this._data[3*S+0];return 2097152&v?this._combined[S]:2097151&v?(0,b.stringFromCodePoint)(2097151&v):""}isProtected(S){return 536870912&this._data[3*S+2]}loadCell(S,v){return C=3*S,v.content=this._data[C+0],v.fg=this._data[C+1],v.bg=this._data[C+2],2097152&v.content&&(v.combinedData=this._combined[S]),268435456&v.bg&&(v.extended=this._extendedAttrs[S]),v}setCell(S,v){2097152&v.content&&(this._combined[S]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[S]=v.extended),this._data[3*S+0]=v.content,this._data[3*S+1]=v.fg,this._data[3*S+2]=v.bg}setCellFromCodepoint(S,v,_,y){268435456&y.bg&&(this._extendedAttrs[S]=y.extended),this._data[3*S+0]=v|_<<22,this._data[3*S+1]=y.fg,this._data[3*S+2]=y.bg}addCodepointToCell(S,v,_){let y=this._data[3*S+0];2097152&y?this._combined[S]+=(0,b.stringFromCodePoint)(v):2097151&y?(this._combined[S]=(0,b.stringFromCodePoint)(2097151&y)+(0,b.stringFromCodePoint)(v),y&=-2097152,y|=2097152):y=v|4194304,_&&(y&=-12582913,y|=_<<22),this._data[3*S+0]=y}insertCells(S,v,_){if((S%=this.length)&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S-1,0,1,_),v<this.length-S){const y=new m.CellData;for(let A=this.length-S-v-1;A>=0;--A)this.setCell(S+v+A,this.loadCell(S+A,y));for(let A=0;A<v;++A)this.setCell(S+A,_)}else for(let y=S;y<this.length;++y)this.setCell(y,_);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,_)}deleteCells(S,v,_){if(S%=this.length,v<this.length-S){const y=new m.CellData;for(let A=0;A<this.length-S-v;++A)this.setCell(S+A,this.loadCell(S+v+A,y));for(let A=this.length-v;A<this.length;++A)this.setCell(A,_)}else for(let y=S;y<this.length;++y)this.setCell(y,_);S&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S-1,0,1,_),this.getWidth(S)!==0||this.hasContent(S)||this.setCellFromCodepoint(S,0,1,_)}replaceCells(S,v,_,y=!1){if(y)for(S&&this.getWidth(S-1)===2&&!this.isProtected(S-1)&&this.setCellFromCodepoint(S-1,0,1,_),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,_);S<v&&S<this.length;)this.isProtected(S)||this.setCell(S,_),S++;else for(S&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S-1,0,1,_),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,_);S<v&&S<this.length;)this.setCell(S++,_)}resize(S,v){if(S===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const _=3*S;if(S>this.length){if(this._data.buffer.byteLength>=4*_)this._data=new Uint32Array(this._data.buffer,0,_);else{const y=new Uint32Array(_);y.set(this._data),this._data=y}for(let y=this.length;y<S;++y)this.setCell(y,v)}else{this._data=this._data.subarray(0,_);const y=Object.keys(this._combined);for(let L=0;L<y.length;L++){const D=parseInt(y[L],10);D>=S&&delete this._combined[D]}const A=Object.keys(this._extendedAttrs);for(let L=0;L<A.length;L++){const D=parseInt(A[L],10);D>=S&&delete this._extendedAttrs[D]}}return this.length=S,4*_*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const S=new Uint32Array(this._data.length);return S.set(this._data),this._data=S,1}return 0}fill(S,v=!1){if(v)for(let _=0;_<this.length;++_)this.isProtected(_)||this.setCell(_,S);else{this._combined={},this._extendedAttrs={};for(let _=0;_<this.length;++_)this.setCell(_,S)}}copyFrom(S){this.length!==S.length?this._data=new Uint32Array(S._data):this._data.set(S._data),this.length=S.length,this._combined={};for(const v in S._combined)this._combined[v]=S._combined[v];this._extendedAttrs={};for(const v in S._extendedAttrs)this._extendedAttrs[v]=S._extendedAttrs[v];this.isWrapped=S.isWrapped}clone(){const S=new T(0);S._data=new Uint32Array(this._data),S.length=this.length;for(const v in this._combined)S._combined[v]=this._combined[v];for(const v in this._extendedAttrs)S._extendedAttrs[v]=this._extendedAttrs[v];return S.isWrapped=this.isWrapped,S}getTrimmedLength(){for(let S=this.length-1;S>=0;--S)if(4194303&this._data[3*S+0])return S+(this._data[3*S+0]>>22);return 0}getNoBgTrimmedLength(){for(let S=this.length-1;S>=0;--S)if(4194303&this._data[3*S+0]||50331648&this._data[3*S+2])return S+(this._data[3*S+0]>>22);return 0}copyCellsFrom(S,v,_,y,A){const L=S._data;if(A)for(let R=y-1;R>=0;R--){for(let k=0;k<3;k++)this._data[3*(_+R)+k]=L[3*(v+R)+k];268435456&L[3*(v+R)+2]&&(this._extendedAttrs[_+R]=S._extendedAttrs[v+R])}else for(let R=0;R<y;R++){for(let k=0;k<3;k++)this._data[3*(_+R)+k]=L[3*(v+R)+k];268435456&L[3*(v+R)+2]&&(this._extendedAttrs[_+R]=S._extendedAttrs[v+R])}const D=Object.keys(S._combined);for(let R=0;R<D.length;R++){const k=parseInt(D[R],10);k>=v&&(this._combined[k-v+_]=S._combined[k])}}translateToString(S,v,_,y){v=v??0,_=_??this.length,S&&(_=Math.min(_,this.getTrimmedLength())),y&&(y.length=0);let A="";for(;v<_;){const L=this._data[3*v+0],D=2097151&L,R=2097152&L?this._combined[v]:D?(0,b.stringFromCodePoint)(D):u.WHITESPACE_CELL_CHAR;if(A+=R,y)for(let k=0;k<R.length;++k)y.push(v);v+=L>>22||1}return y&&y.push(v),A}}o.BufferLine=T},4841:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,h){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(f,o)=>{function c(h,m,u){if(m===h.length-1)return h[m].getTrimmedLength();const b=!h[m].hasContent(u-1)&&h[m].getWidth(u-1)===1,C=h[m+1].getWidth(0)===2;return b&&C?u-1:u}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(h,m,u,b,C){const T=[];for(let E=0;E<h.length-1;E++){let S=E,v=h.get(++S);if(!v.isWrapped)continue;const _=[h.get(E)];for(;S<h.length&&v.isWrapped;)_.push(v),v=h.get(++S);if(b>=E&&b<S){E+=_.length-1;continue}let y=0,A=c(_,y,m),L=1,D=0;for(;L<_.length;){const k=c(_,L,m),M=k-D,j=u-A,H=Math.min(M,j);_[y].copyCellsFrom(_[L],D,A,H,!1),A+=H,A===u&&(y++,A=0),D+=H,D===k&&(L++,D=0),A===0&&y!==0&&_[y-1].getWidth(u-1)===2&&(_[y].copyCellsFrom(_[y-1],u-1,A++,1,!1),_[y-1].setCell(u-1,C))}_[y].replaceCells(A,u,C);let R=0;for(let k=_.length-1;k>0&&(k>y||_[k].getTrimmedLength()===0);k--)R++;R>0&&(T.push(E+_.length-R),T.push(R)),E+=_.length-1}return T},o.reflowLargerCreateNewLayout=function(h,m){const u=[];let b=0,C=m[b],T=0;for(let E=0;E<h.length;E++)if(C===E){const S=m[++b];h.onDeleteEmitter.fire({index:E-T,amount:S}),E+=S-1,T+=S,C=m[++b]}else u.push(E);return{layout:u,countRemoved:T}},o.reflowLargerApplyNewLayout=function(h,m){const u=[];for(let b=0;b<m.length;b++)u.push(h.get(m[b]));for(let b=0;b<u.length;b++)h.set(b,u[b]);h.length=m.length},o.reflowSmallerGetNewLineLengths=function(h,m,u){const b=[],C=h.map(((v,_)=>c(h,_,m))).reduce(((v,_)=>v+_));let T=0,E=0,S=0;for(;S<C;){if(C-S<u){b.push(C-S);break}T+=u;const v=c(h,E,m);T>v&&(T-=v,E++);const _=h[E].getWidth(T-1)===2;_&&T--;const y=_?u-1:u;b.push(y),S+=y}return b},o.getWrappedLineTrimmedLength=c},5295:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const h=c(8460),m=c(844),u=c(9092);class b extends m.Disposable{constructor(T,E){super(),this._optionsService=T,this._bufferService=E,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 u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.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(T){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(T),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(T,E){this._normal.resize(T,E),this._alt.resize(T,E),this.setupTabStops(T)}setupTabStops(T){this._normal.setupTabStops(T),this._alt.setupTabStops(T)}}o.BufferSet=b},511:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const h=c(482),m=c(643),u=c(3734);class b extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(T){const E=new b;return E.setFromCharData(T),E}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(T){this.fg=T[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let E=!1;if(T[m.CHAR_DATA_CHAR_INDEX].length>2)E=!0;else if(T[m.CHAR_DATA_CHAR_INDEX].length===2){const S=T[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=S&&S<=56319){const v=T[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(S-55296)+v-56320+65536|T[m.CHAR_DATA_WIDTH_INDEX]<<22:E=!0}else E=!0}else this.content=T[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|T[m.CHAR_DATA_WIDTH_INDEX]<<22;E&&(this.combinedData=T[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|T[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=b},643:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const h=c(8460),m=c(844);class u{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=u._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,m.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}o.Marker=u,u._nextId=1},7116:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,o)=>{var c,h,m;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
58
|
+
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""})(c||(o.C0=c={})),(function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="
",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""})(h||(o.C1=h={})),(function(u){u.ST=`${c.ESC}\\`})(m||(o.C1_ESCAPED=m={}))},7399:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const h=c(2584),m={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:["'",'"']};o.evaluateKeyboardEvent=function(u,b,C,T){const E={type:0,cancel:!1,key:void 0},S=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?E.key=b?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?E.key=b?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?E.key=b?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(E.key=b?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:E.key=u.ctrlKey?"\b":h.C0.DEL,u.altKey&&(E.key=h.C0.ESC+E.key);break;case 9:if(u.shiftKey){E.key=h.C0.ESC+"[Z";break}E.key=h.C0.HT,E.cancel=!0;break;case 13:E.key=u.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,E.cancel=!0;break;case 27:E.key=h.C0.ESC,u.altKey&&(E.key=h.C0.ESC+h.C0.ESC),E.cancel=!0;break;case 37:if(u.metaKey)break;S?(E.key=h.C0.ESC+"[1;"+(S+1)+"D",E.key===h.C0.ESC+"[1;3D"&&(E.key=h.C0.ESC+(C?"b":"[1;5D"))):E.key=b?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;S?(E.key=h.C0.ESC+"[1;"+(S+1)+"C",E.key===h.C0.ESC+"[1;3C"&&(E.key=h.C0.ESC+(C?"f":"[1;5C"))):E.key=b?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;S?(E.key=h.C0.ESC+"[1;"+(S+1)+"A",C||E.key!==h.C0.ESC+"[1;3A"||(E.key=h.C0.ESC+"[1;5A")):E.key=b?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;S?(E.key=h.C0.ESC+"[1;"+(S+1)+"B",C||E.key!==h.C0.ESC+"[1;3B"||(E.key=h.C0.ESC+"[1;5B")):E.key=b?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(E.key=h.C0.ESC+"[2~");break;case 46:E.key=S?h.C0.ESC+"[3;"+(S+1)+"~":h.C0.ESC+"[3~";break;case 36:E.key=S?h.C0.ESC+"[1;"+(S+1)+"H":b?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:E.key=S?h.C0.ESC+"[1;"+(S+1)+"F":b?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?E.type=2:u.ctrlKey?E.key=h.C0.ESC+"[5;"+(S+1)+"~":E.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?E.type=3:u.ctrlKey?E.key=h.C0.ESC+"[6;"+(S+1)+"~":E.key=h.C0.ESC+"[6~";break;case 112:E.key=S?h.C0.ESC+"[1;"+(S+1)+"P":h.C0.ESC+"OP";break;case 113:E.key=S?h.C0.ESC+"[1;"+(S+1)+"Q":h.C0.ESC+"OQ";break;case 114:E.key=S?h.C0.ESC+"[1;"+(S+1)+"R":h.C0.ESC+"OR";break;case 115:E.key=S?h.C0.ESC+"[1;"+(S+1)+"S":h.C0.ESC+"OS";break;case 116:E.key=S?h.C0.ESC+"[15;"+(S+1)+"~":h.C0.ESC+"[15~";break;case 117:E.key=S?h.C0.ESC+"[17;"+(S+1)+"~":h.C0.ESC+"[17~";break;case 118:E.key=S?h.C0.ESC+"[18;"+(S+1)+"~":h.C0.ESC+"[18~";break;case 119:E.key=S?h.C0.ESC+"[19;"+(S+1)+"~":h.C0.ESC+"[19~";break;case 120:E.key=S?h.C0.ESC+"[20;"+(S+1)+"~":h.C0.ESC+"[20~";break;case 121:E.key=S?h.C0.ESC+"[21;"+(S+1)+"~":h.C0.ESC+"[21~";break;case 122:E.key=S?h.C0.ESC+"[23;"+(S+1)+"~":h.C0.ESC+"[23~";break;case 123:E.key=S?h.C0.ESC+"[24;"+(S+1)+"~":h.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(C&&!T||!u.altKey||u.metaKey)!C||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?E.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(E.key=h.C0.US),u.key==="@"&&(E.key=h.C0.NUL)):u.keyCode===65&&(E.type=1);else{const v=m[u.keyCode],_=v==null?void 0:v[u.shiftKey?1:0];if(_)E.key=h.C0.ESC+_;else if(u.keyCode>=65&&u.keyCode<=90){const y=u.ctrlKey?u.keyCode-64:u.keyCode+32;let A=String.fromCharCode(y);u.shiftKey&&(A=A.toUpperCase()),E.key=h.C0.ESC+A}else if(u.keyCode===32)E.key=h.C0.ESC+(u.ctrlKey?h.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let y=u.code.slice(3,4);u.shiftKey||(y=y.toLowerCase()),E.key=h.C0.ESC+y,E.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?E.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?E.key=h.C0.NUL:u.keyCode>=51&&u.keyCode<=55?E.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?E.key=h.C0.DEL:u.keyCode===219?E.key=h.C0.ESC:u.keyCode===220?E.key=h.C0.FS:u.keyCode===221&&(E.key=h.C0.GS)}return E}},482:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,h=0,m=c.length){let u="";for(let b=h;b<m;++b){let C=c[b];C>65535?(C-=65536,u+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):u+=String.fromCharCode(C)}return u},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const m=c.length;if(!m)return 0;let u=0,b=0;if(this._interim){const C=c.charCodeAt(b++);56320<=C&&C<=57343?h[u++]=1024*(this._interim-55296)+C-56320+65536:(h[u++]=this._interim,h[u++]=C),this._interim=0}for(let C=b;C<m;++C){const T=c.charCodeAt(C);if(55296<=T&&T<=56319){if(++C>=m)return this._interim=T,u;const E=c.charCodeAt(C);56320<=E&&E<=57343?h[u++]=1024*(T-55296)+E-56320+65536:(h[u++]=T,h[u++]=E)}else T!==65279&&(h[u++]=T)}return u}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const m=c.length;if(!m)return 0;let u,b,C,T,E=0,S=0,v=0;if(this.interim[0]){let A=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let D,R=0;for(;(D=63&this.interim[++R])&&R<4;)L<<=6,L|=D;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=k-R;for(;v<M;){if(v>=m)return 0;if(D=c[v++],(192&D)!=128){v--,A=!0;break}this.interim[R++]=D,L<<=6,L|=63&D}A||(k===2?L<128?v--:h[E++]=L:k===3?L<2048||L>=55296&&L<=57343||L===65279||(h[E++]=L):L<65536||L>1114111||(h[E++]=L)),this.interim.fill(0)}const _=m-4;let y=v;for(;y<m;){for(;!(!(y<_)||128&(u=c[y])||128&(b=c[y+1])||128&(C=c[y+2])||128&(T=c[y+3]));)h[E++]=u,h[E++]=b,h[E++]=C,h[E++]=T,y+=4;if(u=c[y++],u<128)h[E++]=u;else if((224&u)==192){if(y>=m)return this.interim[0]=u,E;if(b=c[y++],(192&b)!=128){y--;continue}if(S=(31&u)<<6|63&b,S<128){y--;continue}h[E++]=S}else if((240&u)==224){if(y>=m)return this.interim[0]=u,E;if(b=c[y++],(192&b)!=128){y--;continue}if(y>=m)return this.interim[0]=u,this.interim[1]=b,E;if(C=c[y++],(192&C)!=128){y--;continue}if(S=(15&u)<<12|(63&b)<<6|63&C,S<2048||S>=55296&&S<=57343||S===65279)continue;h[E++]=S}else if((248&u)==240){if(y>=m)return this.interim[0]=u,E;if(b=c[y++],(192&b)!=128){y--;continue}if(y>=m)return this.interim[0]=u,this.interim[1]=b,E;if(C=c[y++],(192&C)!=128){y--;continue}if(y>=m)return this.interim[0]=u,this.interim[1]=b,this.interim[2]=C,E;if(T=c[y++],(192&T)!=128){y--;continue}if(S=(7&u)<<18|(63&b)<<12|(63&C)<<6|63&T,S<65536||S>1114111)continue;h[E++]=S}}return E}}},225:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const h=c(1480),m=[[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]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let b;o.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let C=0;C<m.length;++C)b.fill(0,m[C][0],m[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?b[C]:(function(T,E){let S,v=0,_=E.length-1;if(T<E[0][0]||T>E[_][1])return!1;for(;_>=v;)if(S=v+_>>1,T>E[S][1])v=S+1;else{if(!(T<E[S][0]))return!0;_=S-1}return!1})(C,u)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,T){let E=this.wcwidth(C),S=E===0&&T!==0;if(S){const v=h.UnicodeService.extractWidth(T);v===0?S=!1:v>E&&(E=v)}return h.UnicodeService.createPropertyValue(0,E,S)}}},5981:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const h=c(8460),m=c(844);class u extends m.Disposable{constructor(C){super(),this._action=C,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,T){if(T!==void 0&&this._syncCalls>T)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let E;for(this._isSyncWriting=!0;E=this._writeBuffer.shift();){this._action(E);const S=this._callbacks.shift();S&&S()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,T){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(T),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(T)}_innerWrite(C=0,T=!0){const E=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const S=this._writeBuffer[this._bufferOffset],v=this._action(S,T);if(v){const y=A=>Date.now()-E>=12?setTimeout((()=>this._innerWrite(0,A))):this._innerWrite(E,A);return void v.catch((A=>(queueMicrotask((()=>{throw A})),Promise.resolve(!1)))).then(y)}const _=this._callbacks[this._bufferOffset];if(_&&_(),this._bufferOffset++,this._pendingData-=S.length,Date.now()-E>=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()}}o.WriteBuffer=u},5941:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\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 m(u,b){const C=u.toString(16),T=C.length<2?"0"+C:C;switch(b){case 4:return C[0];case 8:return T;case 12:return(T+T).slice(0,3);default:return T+T}}o.parseColor=function(u){if(!u)return;let b=u.toLowerCase();if(b.indexOf("rgb:")===0){b=b.slice(4);const C=c.exec(b);if(C){const T=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/T*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/T*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/T*255)]}}else if(b.indexOf("#")===0&&(b=b.slice(1),h.exec(b)&&[3,6,9,12].includes(b.length))){const C=b.length/3,T=[0,0,0];for(let E=0;E<3;++E){const S=parseInt(b.slice(C*E,C*E+C),16);T[E]=C===1?S<<4:C===2?S:C===3?S>>4:S>>8}return T}},o.toRgbString=function(u,b=16){const[C,T,E]=u;return`rgb:${m(C,b)}/${m(T,b)}/${m(E,b)}`}},5770:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const h=c(482),m=c(8742),u=c(5770),b=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=b,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=b}registerHandler(T,E){this._handlers[T]===void 0&&(this._handlers[T]=[]);const S=this._handlers[T];return S.push(E),{dispose:()=>{const v=S.indexOf(E);v!==-1&&S.splice(v,1)}}}clearHandler(T){this._handlers[T]&&delete this._handlers[T]}setHandlerFallback(T){this._handlerFb=T}reset(){if(this._active.length)for(let T=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;T>=0;--T)this._active[T].unhook(!1);this._stack.paused=!1,this._active=b,this._ident=0}hook(T,E){if(this.reset(),this._ident=T,this._active=this._handlers[T]||b,this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(T,E,S){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(T,E,S);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(T,E,S))}unhook(T,E=!0){if(this._active.length){let S=!1,v=this._active.length-1,_=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,S=E,_=this._stack.fallThrough,this._stack.paused=!1),!_&&S===!1){for(;v>=0&&(S=this._active[v].unhook(T),S!==!0);v--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,S;v--}for(;v>=0;v--)if(S=this._active[v].unhook(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,S}else this._handlerFb(this._ident,"UNHOOK",T);this._active=b,this._ident=0}};const C=new m.Params;C.addParam(0),o.DcsHandler=class{constructor(T){this._handler=T,this._data="",this._params=C,this._hitLimit=!1}hook(T){this._params=T.length>1||T.params[0]?T.clone():C,this._data="",this._hitLimit=!1}put(T,E,S){this._hitLimit||(this._data+=(0,h.utf32ToString)(T,E,S),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(T){let E=!1;if(this._hitLimit)E=!1;else if(T&&(E=this._handler(this._data,this._params),E instanceof Promise))return E.then((S=>(this._params=C,this._data="",this._hitLimit=!1,S)));return this._params=C,this._data="",this._hitLimit=!1,E}}},2015:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const h=c(844),m=c(8742),u=c(6242),b=c(6351);class C{constructor(v){this.table=new Uint8Array(v)}setDefault(v,_){this.table.fill(v<<4|_)}add(v,_,y,A){this.table[_<<8|v]=y<<4|A}addMany(v,_,y,A){for(let L=0;L<v.length;L++)this.table[_<<8|v[L]]=y<<4|A}}o.TransitionTable=C;const T=160;o.VT500_TRANSITION_TABLE=(function(){const S=new C(4095),v=Array.apply(null,Array(256)).map(((R,k)=>k)),_=(R,k)=>v.slice(R,k),y=_(32,127),A=_(0,24);A.push(25),A.push.apply(A,_(28,32));const L=_(0,14);let D;for(D in S.setDefault(1,0),S.addMany(y,0,2,0),L)S.addMany([24,26,153,154],D,3,0),S.addMany(_(128,144),D,3,0),S.addMany(_(144,152),D,3,0),S.add(156,D,0,0),S.add(27,D,11,1),S.add(157,D,4,8),S.addMany([152,158,159],D,0,7),S.add(155,D,11,3),S.add(144,D,11,9);return S.addMany(A,0,3,0),S.addMany(A,1,3,1),S.add(127,1,0,1),S.addMany(A,8,0,8),S.addMany(A,3,3,3),S.add(127,3,0,3),S.addMany(A,4,3,4),S.add(127,4,0,4),S.addMany(A,6,3,6),S.addMany(A,5,3,5),S.add(127,5,0,5),S.addMany(A,2,3,2),S.add(127,2,0,2),S.add(93,1,4,8),S.addMany(y,8,5,8),S.add(127,8,5,8),S.addMany([156,27,24,26,7],8,6,0),S.addMany(_(28,32),8,0,8),S.addMany([88,94,95],1,0,7),S.addMany(y,7,0,7),S.addMany(A,7,0,7),S.add(156,7,0,0),S.add(127,7,0,7),S.add(91,1,11,3),S.addMany(_(64,127),3,7,0),S.addMany(_(48,60),3,8,4),S.addMany([60,61,62,63],3,9,4),S.addMany(_(48,60),4,8,4),S.addMany(_(64,127),4,7,0),S.addMany([60,61,62,63],4,0,6),S.addMany(_(32,64),6,0,6),S.add(127,6,0,6),S.addMany(_(64,127),6,0,0),S.addMany(_(32,48),3,9,5),S.addMany(_(32,48),5,9,5),S.addMany(_(48,64),5,0,6),S.addMany(_(64,127),5,7,0),S.addMany(_(32,48),4,9,5),S.addMany(_(32,48),1,9,2),S.addMany(_(32,48),2,9,2),S.addMany(_(48,127),2,10,0),S.addMany(_(48,80),1,10,0),S.addMany(_(81,88),1,10,0),S.addMany([89,90,92],1,10,0),S.addMany(_(96,127),1,10,0),S.add(80,1,11,9),S.addMany(A,9,0,9),S.add(127,9,0,9),S.addMany(_(28,32),9,0,9),S.addMany(_(32,48),9,9,12),S.addMany(_(48,60),9,8,10),S.addMany([60,61,62,63],9,9,10),S.addMany(A,11,0,11),S.addMany(_(32,128),11,0,11),S.addMany(_(28,32),11,0,11),S.addMany(A,10,0,10),S.add(127,10,0,10),S.addMany(_(28,32),10,0,10),S.addMany(_(48,60),10,8,10),S.addMany([60,61,62,63],10,0,11),S.addMany(_(32,48),10,9,12),S.addMany(A,12,0,12),S.add(127,12,0,12),S.addMany(_(28,32),12,0,12),S.addMany(_(32,48),12,9,12),S.addMany(_(48,64),12,0,11),S.addMany(_(64,127),12,12,13),S.addMany(_(64,127),10,12,13),S.addMany(_(64,127),9,12,13),S.addMany(A,13,13,13),S.addMany(y,13,13,13),S.add(127,13,0,13),S.addMany([27,156,24,26],13,14,0),S.add(T,0,2,0),S.add(T,8,5,8),S.add(T,6,0,6),S.add(T,11,0,11),S.add(T,13,13,13),S})();class E extends h.Disposable{constructor(v=o.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 m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(_,y,A)=>{},this._executeHandlerFb=_=>{},this._csiHandlerFb=(_,y)=>{},this._escHandlerFb=_=>{},this._errorHandlerFb=_=>_,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 u.OscParser),this._dcsParser=this.register(new b.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,_=[64,126]){let y=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=v.prefix.charCodeAt(0),y&&60>y||y>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 L=0;L<v.intermediates.length;++L){const D=v.intermediates.charCodeAt(L);if(32>D||D>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=D}}if(v.final.length!==1)throw new Error("final must be a single byte");const A=v.final.charCodeAt(0);if(_[0]>A||A>_[1])throw new Error(`final must be in range ${_[0]} .. ${_[1]}`);return y<<=8,y|=A,y}identToString(v){const _=[];for(;v;)_.push(String.fromCharCode(255&v)),v>>=8;return _.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,_){const y=this._identifier(v,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const A=this._escHandlers[y];return A.push(_),{dispose:()=>{const L=A.indexOf(_);L!==-1&&A.splice(L,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,_){this._executeHandlers[v.charCodeAt(0)]=_}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,_){const y=this._identifier(v);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const A=this._csiHandlers[y];return A.push(_),{dispose:()=>{const L=A.indexOf(_);L!==-1&&A.splice(L,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,_){return this._dcsParser.registerHandler(this._identifier(v),_)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,_){return this._oscParser.registerHandler(v,_)}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,_,y,A,L){this._parseStack.state=v,this._parseStack.handlers=_,this._parseStack.handlerPos=y,this._parseStack.transition=A,this._parseStack.chunkPos=L}parse(v,_,y){let A,L=0,D=0,R=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,R=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const k=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&M>-1){for(;M>=0&&(A=k[M](this._params),A!==!0);M--)if(A instanceof Promise)return this._parseStack.handlerPos=M,A}this._parseStack.handlers=[];break;case 4:if(y===!1&&M>-1){for(;M>=0&&(A=k[M](),A!==!0);M--)if(A instanceof Promise)return this._parseStack.handlerPos=M,A}this._parseStack.handlers=[];break;case 6:if(L=v[this._parseStack.chunkPos],A=this._dcsParser.unhook(L!==24&&L!==26,y),A)return A;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=v[this._parseStack.chunkPos],A=this._oscParser.end(L!==24&&L!==26,y),A)return A;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,R=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=R;k<_;++k){switch(L=v[k],D=this._transitions.table[this.currentState<<8|(L<160?L:T)],D>>4){case 2:for(let F=k+1;;++F){if(F>=_||(L=v[F])<32||L>126&&L<T){this._printHandler(v,k,F),k=F-1;break}if(++F>=_||(L=v[F])<32||L>126&&L<T){this._printHandler(v,k,F),k=F-1;break}if(++F>=_||(L=v[F])<32||L>126&&L<T){this._printHandler(v,k,F),k=F-1;break}if(++F>=_||(L=v[F])<32||L>126&&L<T){this._printHandler(v,k,F),k=F-1;break}}break;case 3:this._executeHandlers[L]?this._executeHandlers[L]():this._executeHandlerFb(L),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const M=this._csiHandlers[this._collect<<8|L];let j=M?M.length-1:-1;for(;j>=0&&(A=M[j](this._params),A!==!0);j--)if(A instanceof Promise)return this._preserveStack(3,M,j,D,k),A;j<0&&this._csiHandlerFb(this._collect<<8|L,this._params),this.precedingJoinState=0;break;case 8:do switch(L){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(L-48)}while(++k<_&&(L=v[k])>47&&L<60);k--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const H=this._escHandlers[this._collect<<8|L];let U=H?H.length-1:-1;for(;U>=0&&(A=H[U](),A!==!0);U--)if(A instanceof Promise)return this._preserveStack(4,H,U,D,k),A;U<0&&this._escHandlerFb(this._collect<<8|L),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|L,this._params);break;case 13:for(let F=k+1;;++F)if(F>=_||(L=v[F])===24||L===26||L===27||L>127&&L<T){this._dcsParser.put(v,k,F),k=F-1;break}break;case 14:if(A=this._dcsParser.unhook(L!==24&&L!==26),A)return this._preserveStack(6,[],0,D,k),A;L===27&&(D|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let F=k+1;;F++)if(F>=_||(L=v[F])<32||L>127&&L<T){this._oscParser.put(v,k,F),k=F-1;break}break;case 6:if(A=this._oscParser.end(L!==24&&L!==26),A)return this._preserveStack(5,[],0,D,k),A;L===27&&(D|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&D}}}o.EscapeSequenceParser=E},6242:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const h=c(5770),m=c(482),u=[];o.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(b,C){this._handlers[b]===void 0&&(this._handlers[b]=[]);const T=this._handlers[b];return T.push(C),{dispose:()=>{const E=T.indexOf(C);E!==-1&&T.splice(E,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].start();else this._handlerFb(this._id,"START")}_put(b,C,T){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(b,C,T);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(b,C,T))}start(){this.reset(),this._state=1}put(b,C,T){if(this._state!==3){if(this._state===1)for(;C<T;){const E=b[C++];if(E===59){this._state=2,this._start();break}if(E<48||57<E)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+E-48}this._state===2&&T-C>0&&this._put(b,C,T)}}end(b,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let T=!1,E=this._active.length-1,S=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,T=C,S=this._stack.fallThrough,this._stack.paused=!1),!S&&T===!1){for(;E>=0&&(T=this._active[E].end(b),T!==!0);E--)if(T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,T;E--}for(;E>=0;E--)if(T=this._active[E].end(!1),T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,T}else this._handlerFb(this._id,"END",b);this._active=u,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(b){this._handler=b,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(b,C,T){this._hitLimit||(this._data+=(0,m.utf32ToString)(b,C,T),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(b){let C=!1;if(this._hitLimit)C=!1;else if(b&&(C=this._handler(this._data),C instanceof Promise))return C.then((T=>(this._data="",this._hitLimit=!1,T)));return this._data="",this._hitLimit=!1,C}}},8742:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class h{static fromArray(u){const b=new h;if(!u.length)return b;for(let C=Array.isArray(u[0])?1:0;C<u.length;++C){const T=u[C];if(Array.isArray(T))for(let E=0;E<T.length;++E)b.addSubParam(T[E]);else b.addParam(T)}return b}constructor(u=32,b=32){if(this.maxLength=u,this.maxSubParamsLength=b,b>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(b),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new h(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let b=0;b<this.length;++b){u.push(this.params[b]);const C=this._subParamsIdx[b]>>8,T=255&this._subParamsIdx[b];T-C>0&&u.push(Array.prototype.slice.call(this._subParams,C,T))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>c?c:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>c?c:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const b=this._subParamsIdx[u]>>8,C=255&this._subParamsIdx[u];return C-b>0?this._subParams.subarray(b,C):null}getSubParamsAll(){const u={};for(let b=0;b<this.length;++b){const C=this._subParamsIdx[b]>>8,T=255&this._subParamsIdx[b];T-C>0&&(u[b]=this._subParams.slice(C,T))}return u}addDigit(u){let b;if(this._rejectDigits||!(b=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,T=C[b-1];C[b-1]=~T?Math.min(10*T+u,c):u}}o.Params=h},5741:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,h){const m={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(m),h.dispose=()=>this._wrappedAddonDispose(m),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===c){h=m;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(h,1)}}},8771:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const h=c(3785),m=c(511);o.BufferApiView=class{constructor(u,b){this._buffer=u,this.type=b}init(u){return this._buffer=u,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(u){const b=this._buffer.lines.get(u);if(b)return new h.BufferLineApiView(b)}getNullCell(){return new m.CellData}}},3785:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const h=c(511);o.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,u){if(!(m<0||m>=this._line.length))return u?(this._line.loadCell(m,u),u):this._line.loadCell(m,new h.CellData)}translateToString(m,u,b){return this._line.translateToString(m,u,b)}}},8285:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const h=c(8771),m=c(8460),u=c(844);class b extends u.Disposable{constructor(T){super(),this._core=T,this._onBufferChange=this.register(new m.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)}}o.BufferNamespaceApi=b},7975:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(m=>h(m.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((m,u)=>h(m,u.toArray())))}addDcsHandler(c,h){return this.registerDcsHandler(c,h)}registerEscHandler(c,h){return this._core.registerEscHandler(c,h)}addEscHandler(c,h){return this.registerEscHandler(c,h)}registerOscHandler(c,h){return this._core.registerOscHandler(c,h)}addOscHandler(c,h){return this.registerOscHandler(c,h)}}},7090:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(f,o,c){var h=this&&this.__decorate||function(S,v,_,y){var A,L=arguments.length,D=L<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,v,_,y);else for(var R=S.length-1;R>=0;R--)(A=S[R])&&(D=(L<3?A(D):L>3?A(v,_,D):A(v,_))||D);return L>3&&D&&Object.defineProperty(v,_,D),D},m=this&&this.__param||function(S,v){return function(_,y){v(_,y,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const u=c(8460),b=c(844),C=c(5295),T=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let E=o.BufferService=class extends b.Disposable{get buffer(){return this.buffers.active}constructor(S){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(S.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(S.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(S,this))}resize(S,v){this.cols=S,this.rows=v,this.buffers.resize(S,v),this._onResize.fire({cols:S,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(S,v=!1){const _=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===S.fg&&y.getBg(0)===S.bg||(y=_.getBlankLine(S,v),this._cachedBlankLine=y),y.isWrapped=v;const A=_.ybase+_.scrollTop,L=_.ybase+_.scrollBottom;if(_.scrollTop===0){const D=_.lines.isFull;L===_.lines.length-1?D?_.lines.recycle().copyFrom(y):_.lines.push(y.clone()):_.lines.splice(L+1,0,y.clone()),D?this.isUserScrolling&&(_.ydisp=Math.max(_.ydisp-1,0)):(_.ybase++,this.isUserScrolling||_.ydisp++)}else{const D=L-A+1;_.lines.shiftElements(A+1,D-1,-1),_.lines.set(L,y.clone())}this.isUserScrolling||(_.ydisp=_.ybase),this._onScroll.fire(_.ydisp)}scrollLines(S,v,_){const y=this.buffer;if(S<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else S+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const A=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+S,y.ybase),0),A!==y.ydisp&&(v||this._onScroll.fire(y.ydisp))}};o.BufferService=E=h([m(0,T.IOptionsService)],E)},7994:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,h){this._charsets[c]=h,this.glevel===c&&(this.charset=h)}}},1753:function(f,o,c){var h=this&&this.__decorate||function(y,A,L,D){var R,k=arguments.length,M=k<3?A:D===null?D=Object.getOwnPropertyDescriptor(A,L):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,A,L,D);else for(var j=y.length-1;j>=0;j--)(R=y[j])&&(M=(k<3?R(M):k>3?R(A,L,M):R(A,L))||M);return k>3&&M&&Object.defineProperty(A,L,M),M},m=this&&this.__param||function(y,A){return function(L,D){A(L,D,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const u=c(2585),b=c(8460),C=c(844),T={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function E(y,A){let L=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(L|=64,L|=y.action):(L|=3&y.button,4&y.button&&(L|=64),8&y.button&&(L|=128),y.action===32?L|=32:y.action!==0||A||(L|=3)),L}const S=String.fromCharCode,v={DEFAULT:y=>{const A=[E(y,!1)+32,y.col+32,y.row+32];return A[0]>255||A[1]>255||A[2]>255?"":`\x1B[M${S(A[0])}${S(A[1])}${S(A[2])}`},SGR:y=>{const A=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${E(y,!0)};${y.col};${y.row}${A}`},SGR_PIXELS:y=>{const A=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${E(y,!0)};${y.x};${y.y}${A}`}};let _=o.CoreMouseService=class extends C.Disposable{constructor(y,A){super(),this._bufferService=y,this._coreService=A,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new b.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(T))this.addProtocol(L,T[L]);for(const L of Object.keys(v))this.addEncoding(L,v[L]);this.reset()}addProtocol(y,A){this._protocols[y]=A}addEncoding(y,A){this._encodings[y]=A}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const A=this._encodings[this._activeEncoding](y);return A&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(A):this._coreService.triggerDataEvent(A,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,A,L){if(L){if(y.x!==A.x||y.y!==A.y)return!1}else if(y.col!==A.col||y.row!==A.row)return!1;return y.button===A.button&&y.action===A.action&&y.ctrl===A.ctrl&&y.alt===A.alt&&y.shift===A.shift}};o.CoreMouseService=_=h([m(0,u.IBufferService),m(1,u.ICoreService)],_)},6975:function(f,o,c){var h=this&&this.__decorate||function(_,y,A,L){var D,R=arguments.length,k=R<3?y:L===null?L=Object.getOwnPropertyDescriptor(y,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,y,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(y,A,k):D(y,A))||k);return R>3&&k&&Object.defineProperty(y,A,k),k},m=this&&this.__param||function(_,y){return function(A,L){y(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const u=c(1439),b=c(8460),C=c(844),T=c(2585),E=Object.freeze({insertMode:!1}),S=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=o.CoreService=class extends C.Disposable{constructor(_,y,A){super(),this._bufferService=_,this._logService=y,this._optionsService=A,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new b.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new b.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(E),this.decPrivateModes=(0,u.clone)(S)}reset(){this.modes=(0,u.clone)(E),this.decPrivateModes=(0,u.clone)(S)}triggerDataEvent(_,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const A=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&A.ybase!==A.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${_}"`,(()=>_.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(_)}triggerBinaryEvent(_){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${_}"`,(()=>_.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(_))}};o.CoreService=v=h([m(0,T.IBufferService),m(1,T.ILogService),m(2,T.IOptionsService)],v)},9074:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const h=c(8055),m=c(8460),u=c(844),b=c(6106);let C=0,T=0;class E extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new b.SortedList((_=>_==null?void 0:_.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(_){if(_.marker.isDisposed)return;const y=new S(_);if(y){const A=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),A.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const _ of this._decorations.values())_.dispose();this._decorations.clear()}*getDecorationsAtCell(_,y,A){let L=0,D=0;for(const R of this._decorations.getKeyIterator(y))L=R.options.x??0,D=L+(R.options.width??1),_>=L&&_<D&&(!A||(R.options.layer??"bottom")===A)&&(yield R)}forEachDecorationAtCell(_,y,A,L){this._decorations.forEachByKey(y,(D=>{C=D.options.x??0,T=C+(D.options.width??1),_>=C&&_<T&&(!A||(D.options.layer??"bottom")===A)&&L(D)}))}}o.DecorationService=E;class S extends u.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(_){super(),this.options=_,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=_.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const h=c(2585),m=c(8343);class u{constructor(...C){this._entries=new Map;for(const[T,E]of C)this.set(T,E)}set(C,T){const E=this._entries.get(C);return this._entries.set(C,T),E}forEach(C){for(const[T,E]of this._entries.entries())C(T,E)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}o.ServiceCollection=u,o.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(b,C){this._services.set(b,C)}getService(b){return this._services.get(b)}createInstance(b,...C){const T=(0,m.getServiceDependencies)(b).sort(((v,_)=>v.index-_.index)),E=[];for(const v of T){const _=this._services.get(v.id);if(!_)throw new Error(`[createInstance] ${b.name} depends on UNKNOWN service ${v.id}.`);E.push(_)}const S=T.length>0?T[0].index:C.length;if(C.length!==S)throw new Error(`[createInstance] First service dependency of ${b.name} at position ${S+1} conflicts with ${C.length} static arguments`);return new b(...C,...E)}}},7866:function(f,o,c){var h=this&&this.__decorate||function(S,v,_,y){var A,L=arguments.length,D=L<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,v,_,y);else for(var R=S.length-1;R>=0;R--)(A=S[R])&&(D=(L<3?A(D):L>3?A(v,_,D):A(v,_))||D);return L>3&&D&&Object.defineProperty(v,_,D),D},m=this&&this.__param||function(S,v){return function(_,y){v(_,y,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const u=c(844),b=c(2585),C={trace:b.LogLevelEnum.TRACE,debug:b.LogLevelEnum.DEBUG,info:b.LogLevelEnum.INFO,warn:b.LogLevelEnum.WARN,error:b.LogLevelEnum.ERROR,off:b.LogLevelEnum.OFF};let T,E=o.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(S){super(),this._optionsService=S,this._logLevel=b.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),T=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(S){for(let v=0;v<S.length;v++)typeof S[v]=="function"&&(S[v]=S[v]())}_log(S,v,_){this._evalLazyOptionalParams(_),S.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,..._)}trace(S,...v){var _;this._logLevel<=b.LogLevelEnum.TRACE&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.trace.bind(this._optionsService.options.logger))??console.log,S,v)}debug(S,...v){var _;this._logLevel<=b.LogLevelEnum.DEBUG&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.debug.bind(this._optionsService.options.logger))??console.log,S,v)}info(S,...v){var _;this._logLevel<=b.LogLevelEnum.INFO&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.info.bind(this._optionsService.options.logger))??console.info,S,v)}warn(S,...v){var _;this._logLevel<=b.LogLevelEnum.WARN&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.warn.bind(this._optionsService.options.logger))??console.warn,S,v)}error(S,...v){var _;this._logLevel<=b.LogLevelEnum.ERROR&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.error.bind(this._optionsService.options.logger))??console.error,S,v)}};o.LogService=E=h([m(0,b.IOptionsService)],E),o.setTraceLogger=function(S){T=S},o.traceCall=function(S,v,_){if(typeof _.value!="function")throw new Error("not supported");const y=_.value;_.value=function(...A){if(T.logLevel!==b.LogLevelEnum.TRACE)return y.apply(this,A);T.trace(`GlyphRenderer#${y.name}(${A.map((D=>JSON.stringify(D))).join(", ")})`);const L=y.apply(this,A);return T.trace(`GlyphRenderer#${y.name} return`,L),L}}},7302:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const h=c(8460),m=c(844),u=c(6114);o.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:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const b=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends m.Disposable{constructor(E){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const S={...o.DEFAULT_OPTIONS};for(const v in E)if(v in S)try{const _=E[v];S[v]=this._sanitizeAndValidateOption(v,_)}catch(_){console.error(_)}this.rawOptions=S,this.options={...S},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,S){return this.onOptionChange((v=>{v===E&&S(this.rawOptions[E])}))}onMultipleOptionChange(E,S){return this.onOptionChange((v=>{E.indexOf(v)!==-1&&S()}))}_setupOptions(){const E=v=>{if(!(v in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},S=(v,_)=>{if(!(v in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);_=this._sanitizeAndValidateOption(v,_),this.rawOptions[v]!==_&&(this.rawOptions[v]=_,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const _={get:E.bind(this,v),set:S.bind(this,v)};Object.defineProperty(this.options,v,_)}}_sanitizeAndValidateOption(E,S){switch(E){case"cursorStyle":if(S||(S=o.DEFAULT_OPTIONS[E]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(S))throw new Error(`"${S}" is not a valid value for ${E}`);break;case"wordSeparator":S||(S=o.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof S=="number"&&1<=S&&S<=1e3)break;S=b.includes(S)?S:o.DEFAULT_OPTIONS[E];break;case"cursorWidth":S=Math.floor(S);case"lineHeight":case"tabStopWidth":if(S<1)throw new Error(`${E} cannot be less than 1, value: ${S}`);break;case"minimumContrastRatio":S=Math.max(1,Math.min(21,Math.round(10*S)/10));break;case"scrollback":if((S=Math.min(S,4294967295))<0)throw new Error(`${E} cannot be less than 0, value: ${S}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(S<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${S}`);break;case"rows":case"cols":if(!S&&S!==0)throw new Error(`${E} must be numeric, value: ${S}`);break;case"windowsPty":S=S??{}}return S}}o.OptionsService=C},2660:function(f,o,c){var h=this&&this.__decorate||function(C,T,E,S){var v,_=arguments.length,y=_<3?T:S===null?S=Object.getOwnPropertyDescriptor(T,E):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(C,T,E,S);else for(var A=C.length-1;A>=0;A--)(v=C[A])&&(y=(_<3?v(y):_>3?v(T,E,y):v(T,E))||y);return _>3&&y&&Object.defineProperty(T,E,y),y},m=this&&this.__param||function(C,T){return function(E,S){T(E,S,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const u=c(2585);let b=o.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const T=this._bufferService.buffer;if(C.id===void 0){const A=T.addMarker(T.ybase+T.y),L={data:C,id:this._nextId++,lines:[A]};return A.onDispose((()=>this._removeMarkerFromLink(L,A))),this._dataByLinkId.set(L.id,L),L.id}const E=C,S=this._getEntryIdKey(E),v=this._entriesWithId.get(S);if(v)return this.addLineToLink(v.id,T.ybase+T.y),v.id;const _=T.addMarker(T.ybase+T.y),y={id:this._nextId++,key:this._getEntryIdKey(E),data:E,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(y,_))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(C,T){const E=this._dataByLinkId.get(C);if(E&&E.lines.every((S=>S.line!==T))){const S=this._bufferService.buffer.addMarker(T);E.lines.push(S),S.onDispose((()=>this._removeMarkerFromLink(E,S)))}}getLinkData(C){var T;return(T=this._dataByLinkId.get(C))==null?void 0:T.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,T){const E=C.lines.indexOf(T);E!==-1&&(C.lines.splice(E,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};o.OscLinkService=b=h([m(0,u.IBufferService)],b)},8343:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",h="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(m){return m[h]||[]},o.createDecorator=function(m){if(o.serviceRegistry.has(m))return o.serviceRegistry.get(m);const u=function(b,C,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,S,v){S[c]===S?S[h].push({id:E,index:v}):(S[h]=[{id:E,index:v}],S[c]=S)})(u,b,T)};return u.toString=()=>m,o.serviceRegistry.set(m,u),u}},2585:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const h=c(8343);var m;o.IBufferService=(0,h.createDecorator)("BufferService"),o.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),o.ICoreService=(0,h.createDecorator)("CoreService"),o.ICharsetService=(0,h.createDecorator)("CharsetService"),o.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(m||(o.LogLevelEnum=m={})),o.ILogService=(0,h.createDecorator)("LogService"),o.IOptionsService=(0,h.createDecorator)("OptionsService"),o.IOscLinkService=(0,h.createDecorator)("OscLinkService"),o.IUnicodeService=(0,h.createDecorator)("UnicodeService"),o.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const h=c(8460),m=c(225);class u{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,T,E=!1){return(16777215&C)<<3|(3&T)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const C=new m.UnicodeV6;this.register(C),this._active=C.version,this._activeProvider=C}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(C){if(!this._providers[C])throw new Error(`unknown Unicode version "${C}"`);this._active=C,this._activeProvider=this._providers[C],this._onChange.fire(C)}register(C){this._providers[C.version]=C}wcwidth(C){return this._activeProvider.wcwidth(C)}getStringCellWidth(C){let T=0,E=0;const S=C.length;for(let v=0;v<S;++v){let _=C.charCodeAt(v);if(55296<=_&&_<=56319){if(++v>=S)return T+this.wcwidth(_);const L=C.charCodeAt(v);56320<=L&&L<=57343?_=1024*(_-55296)+L-56320+65536:T+=this.wcwidth(L)}const y=this.charProperties(_,E);let A=u.extractWidth(y);u.extractShouldJoin(y)&&(A-=u.extractWidth(E)),T+=A,E=y}return T}charProperties(C,T){return this._activeProvider.charProperties(C,T)}}o.UnicodeService=u}},l={};function d(f){var o=l[f];if(o!==void 0)return o.exports;var c=l[f]={exports:{}};return s[f].call(c.exports,c,c.exports,d),c.exports}var p={};return(()=>{var f=p;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const o=d(9042),c=d(3236),h=d(844),m=d(5741),u=d(8285),b=d(7975),C=d(7090),T=["cols","rows"];class E extends h.Disposable{constructor(v){super(),this._core=this.register(new c.Terminal(v)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const _=A=>this._core.options[A],y=(A,L)=>{this._checkReadonlyOptions(A),this._core.options[A]=L};for(const A in this._core.options){const L={get:_.bind(this,A),set:y.bind(this,A)};Object.defineProperty(this._publicOptions,A,L)}}_checkReadonlyOptions(v){if(T.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 b.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let _="none";switch(this._core.coreMouseService.activeProtocol){case"X10":_="x10";break;case"VT200":_="vt200";break;case"DRAG":_="drag";break;case"ANY":_="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:_,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const _ in v)this._publicOptions[_]=v[_]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,_=!0){this._core.input(v,_)}resize(v,_){this._verifyIntegers(v,_),this._core.resize(v,_)}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,_,y){this._verifyIntegers(v,_,y),this._core.select(v,_,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,_){this._verifyIntegers(v,_),this._core.selectLines(v,_)}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,_){this._core.write(v,_)}writeln(v,_){this._core.write(v),this._core.write(`\r
|
|
59
|
+
`,_)}paste(v){this._core.paste(v)}refresh(v,_){this._verifyIntegers(v,_),this._core.refresh(v,_)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return o}_verifyIntegers(...v){for(const _ of v)if(_===1/0||isNaN(_)||_%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const _ of v)if(_&&(_===1/0||isNaN(_)||_%1!=0||_<0))throw new Error("This API only accepts positive integers")}}f.Terminal=E})(),p})()))})(Vu)),Vu.exports}var m1=p1();class g1{constructor(r,s){Am(this,"socket");const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal/${encodeURIComponent(r)}`;this.socket=new WebSocket(d),this.socket.addEventListener("message",p=>{var o,c,h;let f;try{f=JSON.parse(p.data)}catch(m){(o=s.onError)==null||o.call(s,`Terminal message parse failed for session ${r}. Reason: ${Lo(m)}`);return}f.type==="output"?s.onOutput(f.data):f.type==="error"?(c=s.onError)==null||c.call(s,f.message):(h=s.onStatus)==null||h.call(s,f)}),this.socket.addEventListener("error",()=>{var p;(p=s.onError)==null||p.call(s,`Terminal WebSocket connection failed for session ${r}. URL: ${d}. Check that the VCM backend is running and the session still exists.`)})}sendInput(r){this.send({type:"input",data:r})}resize(r,s){this.send({type:"resize",cols:r,rows:s})}close(){this.socket.close()}send(r){const s=JSON.stringify(r);if(this.socket.readyState===WebSocket.OPEN){this.socket.send(s);return}this.socket.addEventListener("open",()=>this.socket.send(s),{once:!0})}}function Oo({sessionId:n,active:r=!0,onEvent:s}){const l=te.useRef(null),d=te.useRef(null),p=te.useRef(null),f=te.useRef(null),o=te.useRef(r),c=te.useRef(s);function h(m={}){const u=l.current,b=d.current,C=p.current,T=f.current;if(!u||!b||!C||!T)return!1;const E=u.getBoundingClientRect();return E.width<qm||E.height<$m||(C.fit(),T.cols<Gm||T.rows<Vm)?!1:(b.resize(T.cols,T.rows),m.focus&&T.focus(),!0)}return te.useEffect(()=>{c.current=s},[s]),te.useEffect(()=>{o.current=r},[r]),te.useEffect(()=>{if(!l.current)return;const m=new m1.Terminal({cursorBlink:!0,convertEol:!0,drawBoldTextInBrightColors:!0,fontFamily:"Menlo, Monaco, Consolas, monospace",fontSize:13,fontWeight:"400",fontWeightBold:"700",lineHeight:1.35,macOptionIsMeta:!0,scrollback:1e4,theme:_1}),u=new h1.FitAddon;m.loadAddon(u),m.loadAddon(new d1.WebLinksAddon),m.open(l.current),f.current=m,p.current=u;const b=l.current.getBoundingClientRect();b.width>=qm&&b.height>=$m&&u.fit();const C=new g1(n,{onOutput(A){m.write(A)},onStatus(A){var L;(L=c.current)==null||L.call(c,A.type)},onError(A){var L;m.writeln(`\r
|
|
60
|
+
[VCM] ${A}`),(L=c.current)==null||L.call(c,A)}});d.current=C,m.cols>=Gm&&m.rows>=Vm&&C.resize(m.cols,m.rows);const T=m.onData(A=>{C.sendInput(A)});let E=0,S=0,v=0;const _=()=>{E&&window.cancelAnimationFrame(E),E=window.requestAnimationFrame(()=>{E=0,h({focus:o.current})})},y=new ResizeObserver(()=>{_()});return y.observe(l.current),S=window.requestAnimationFrame(_),v=window.setTimeout(_,120),()=>{E&&window.cancelAnimationFrame(E),S&&window.cancelAnimationFrame(S),v&&window.clearTimeout(v),y.disconnect(),T.dispose(),C.close(),m.dispose(),d.current=null,f.current=null,p.current=null}},[n]),te.useEffect(()=>{if(!r)return;const m=[],u=[];return m.push(window.requestAnimationFrame(()=>{h({focus:!0}),m.push(window.requestAnimationFrame(()=>h({focus:!0})))})),u.push(window.setTimeout(()=>h({focus:!0}),160)),u.push(window.setTimeout(()=>h({focus:!0}),360)),()=>{for(const b of m)window.cancelAnimationFrame(b);for(const b of u)window.clearTimeout(b)}},[r]),te.useEffect(()=>{const m=()=>{o.current&&h()};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]),x.jsx("div",{className:"terminal-frame",ref:l,onMouseDown:()=>{var m;return(m=f.current)==null?void 0:m.focus()}})}const qm=160,$m=80,Gm=20,Vm=5,_1={background:"#0d1117",foreground:"#d6deeb",cursor:"#ffd866",cursorAccent:"#0d1117",selectionBackground:"#264f78",selectionForeground:"#ffffff",black:"#1f2430",red:"#ff5c57",green:"#5af78e",yellow:"#f3f99d",blue:"#57c7ff",magenta:"#ff6ac1",cyan:"#9aedfe",white:"#f1f1f0",brightBlack:"#686868",brightRed:"#ff5c57",brightGreen:"#5af78e",brightYellow:"#f3f99d",brightBlue:"#57c7ff",brightMagenta:"#ff6ac1",brightCyan:"#9aedfe",brightWhite:"#ffffff"},i_=[{value:"bypassPermissions",label:"bypassPermissions",description:"Bypass prompts; recommended in DevContainer worktrees"},{value:"plan",label:"plan",description:"Plan-only permission mode"},{value:"default",label:"default",description:"Claude Code default permission behavior"}],r_=[{value:"default",label:"Default",description:"Account default"},{value:"best",label:"Best",description:"Fable 5 or latest Opus"},{value:"fable",label:"Fable 5",description:"1M context, v2.1.170+"},{value:"opus",label:"Opus",description:"latest Opus"},{value:"opus[1m]",label:"Opus 1M",description:"Force 1M context"},{value:"claude-opus-4-8",label:"Opus 4.8",description:"Current Opus"},{value:"claude-opus-4-8[1m]",label:"Opus 4.8 1M",description:"Opus 4.8 + 1M context"}],v1=[{value:"default",label:"Default",description:"CLI or project default"},{value:"low",label:"Low",description:"Fastest reasoning"},{value:"medium",label:"Medium",description:"Balanced reasoning"},{value:"high",label:"High",description:"Deeper reasoning"},{value:"xhigh",label:"XHigh",description:"Extra high reasoning"}],s_=[...v1,{value:"max",label:"Max",description:"Maximum reasoning"},{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}];function Bi({status:n}){return x.jsx("span",{className:`status-badge status-${n}`,children:n.replaceAll("_"," ")})}function Oh({role:n,session:r,permissionMode:s,model:l,effort:d,busy:p=!1,onPermissionModeChange:f,onModelChange:o,onEffortChange:c,onStart:h,onResume:m,onStop:u,onRestart:b,onNotifyHarnessUpdated:C}){const T=(r==null?void 0:r.status)==="running",E=!!(r!=null&&r.claudeSessionId&&!T),S=!T&&!(r!=null&&r.claudeSessionId),v=!!(r!=null&&r.harnessOutdated);return x.jsxs("div",{className:"session-controls",children:[x.jsxs("label",{className:"session-option-field permission-mode-field",children:[x.jsx("span",{children:"Permission"}),x.jsx("select",{value:s,onChange:_=>f(_.target.value),children:i_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("label",{className:"session-option-field model-field",children:[x.jsx("span",{children:"Model"}),x.jsx("select",{value:l,onChange:_=>o(_.target.value),children:r_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("label",{className:"session-option-field effort-field",children:[x.jsx("span",{children:"Effort"}),x.jsx("select",{value:d,onChange:_=>c(_.target.value),children:s_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("div",{className:"session-toolbar",children:[x.jsx("button",{type:"button",disabled:p||!S,onClick:h,children:"Start"}),x.jsx("button",{type:"button",disabled:p||!E,onClick:m,children:"Resume"}),x.jsx("button",{type:"button",disabled:p||!r,onClick:b,children:"Restart"}),x.jsx("button",{type:"button",disabled:p||!r,onClick:u,children:"Stop"})]}),v?x.jsxs("div",{className:"session-harness-notice",children:[x.jsx(Bi,{status:"outdated"}),x.jsxs("span",{children:["Harness updated",(r==null?void 0:r.harnessRevision)!==void 0&&r.harnessCurrentRevision!==void 0?` (${r.harnessRevision} -> ${r.harnessCurrentRevision})`:""]}),x.jsx("button",{type:"button",disabled:p||!T||!C,onClick:C,children:"Notify role"})]}):null]})}function y1({busy:n,effort:r,model:s,open:l,permissionMode:d,taskSlug:p,bootstrapStatus:f,engineerSession:o,status:c,onClose:h,onEffortChange:m,onModelChange:u,onPermissionModeChange:b,onEngineerResume:C,onEngineerRestart:T,onEngineerStart:E,onEngineerStop:S,onEngineerNotifyHarnessUpdated:v,onOpenRepositoryDiff:_,onReviewTaskHarness:y,onRefresh:A}){const[L,D]=te.useState(null),[R,k]=te.useState(null),[M,j]=te.useState(""),[H,U]=te.useState(!1),[F,K]=te.useState(!1),[,Y]=ji(null),[G,W]=te.useState(null),Z=(c==null?void 0:c.files)??[],z=Z.filter(ee=>ee.kind.startsWith("agent-")),O=z.filter(ee=>Wm(ee)),N=z.filter(ee=>!Wm(ee)),$=Z.filter(ee=>ee.kind.startsWith("skill-")),I=Z.filter(ee=>ee.kind.startsWith("tool-")),re=Z.filter(ee=>ee.kind==="root-claude"||ee.kind==="gitignore"||ee.kind==="pull-request-template"),ve=!!(R&&M!==R.content);te.useEffect(()=>{l||(D(null),k(null),j(""),U(!1),Y(null))},[Z,l,L]),te.useEffect(()=>{if(!l||!L||!p)return;let ee=!1;return K(!0),Y(null),U(!1),ye.getHarnessFileContent(p,L).then(se=>{ee||(k(se),j(se.content))}).catch(se=>{ee||Y(_t(`Load harness file ${L}`,se))}).finally(()=>{ee||K(!1)}),()=>{ee=!0}},[l,L,p]);async function ge(){if(!(!R||!R.editable||!ve||!p)){K(!0),Y(null);try{const ee=await ye.updateHarnessFileContent(p,R.path,{content:M});k(ee.file),j(ee.file.content),U(!1),A()}catch(ee){Y(_t(`Save harness file ${R.path}`,ee))}finally{K(!1)}}}function Q(){D(null),k(null),j(""),U(!1),Y(null)}async function q(ee){Y(null);try{await S1(ee),W(ee),window.setTimeout(()=>{W(se=>se===ee?null:se)},1200)}catch(se){Y(_t(`Copy harness file path ${ee}`,se))}}return l?x.jsx(x.Fragment,{children:x.jsx("div",{className:"modal-backdrop harness-studio-backdrop",children:x.jsxs("section",{className:"harness-studio-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Studio",children:[x.jsxs("header",{className:"harness-studio-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Harness Studio"}),p?null:x.jsx("p",{className:"muted",children:"Create or select a task before editing harness files."})]}),x.jsxs("div",{className:"harness-studio-header-actions",children:[x.jsx("button",{type:"button",disabled:n||!p,onClick:y,children:"Review Task Harness"}),x.jsx("button",{type:"button",disabled:n,onClick:_,children:"Review Diff"}),x.jsx("button",{type:"button",disabled:n,onClick:A,children:"Refresh"}),x.jsx("button",{type:"button",onClick:h,children:"Close"})]})]}),x.jsxs("div",{className:"harness-studio-layout",children:[x.jsx("aside",{className:L?"harness-studio-left harness-studio-left-preview":"harness-studio-left",children:L?x.jsxs("section",{className:"harness-studio-section harness-studio-file-preview",children:[x.jsxs("header",{className:"harness-studio-file-editor-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:(R==null?void 0:R.title)??"Harness File"}),x.jsx("p",{className:"muted",children:(R==null?void 0:R.path)??L})]}),x.jsxs("div",{className:"harness-studio-file-editor-actions",children:[R?x.jsx(Bi,{status:R.editable?"ok":"unknown"}):null,H?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:F||!p||!(R!=null&&R.editable)||!ve,onClick:()=>void ge(),children:"Save"}),x.jsx("button",{type:"button",disabled:F,onClick:()=>{j((R==null?void 0:R.content)??""),U(!1)},children:"Cancel"})]}):x.jsx("button",{type:"button",disabled:F||!p||!(R!=null&&R.editable),onClick:()=>U(!0),children:"Edit"}),x.jsx("button",{type:"button",onClick:Q,children:"Return"})]})]}),R!=null&&R.readonlyReason?x.jsx("p",{className:"muted",children:R.readonlyReason}):null,x.jsx("textarea",{className:H?"harness-studio-file-textarea is-editing":"harness-studio-file-textarea",value:M,spellCheck:!1,readOnly:!H,disabled:F,onChange:ee=>j(ee.target.value)})]}):x.jsxs(x.Fragment,{children:[x.jsx(Ia,{title:"VCM Roles",files:O,selectedPath:L,copiedPath:G,onCopy:ee=>void q(ee),onSelect:D}),x.jsx(Ia,{title:"Auxiliary Roles",files:N,selectedPath:L,copiedPath:G,onCopy:ee=>void q(ee),onSelect:D}),x.jsx(ph,{title:"Overview",children:x.jsxs("section",{className:"harness-studio-overview",children:[x.jsxs("div",{className:"harness-studio-metrics",children:[x.jsx(Ls,{label:"Fixed install",value:c?c.initialized?c.needsApply?"updates":"current":"new":"unknown"}),x.jsx(Ls,{label:"Revision",value:String((c==null?void 0:c.harnessRevision)??0)}),x.jsx(Ls,{label:"Managed files",value:String(Z.length)}),x.jsx(Ls,{label:"Pending updates",value:String((c==null?void 0:c.plannedChanges.length)??0)}),x.jsx(Ls,{label:"Bootstrap",value:(f==null?void 0:f.status.replaceAll("_"," "))??"unknown"}),x.jsx(Ls,{label:"Engineer",value:Km(o)})]}),c!=null&&c.warnings.length?x.jsx("ul",{className:"warnings",children:c.warnings.map(ee=>x.jsx("li",{children:ee},ee))}):null]})}),x.jsx(Ia,{title:"Skills",files:$,selectedPath:L,copiedPath:G,onCopy:ee=>void q(ee),onSelect:D,collapsible:!0}),x.jsx(Ia,{title:"Root Context",files:re,selectedPath:L,copiedPath:G,onCopy:ee=>void q(ee),onSelect:D,collapsible:!0}),x.jsx(Ia,{title:"Tools",files:I,selectedPath:L,copiedPath:G,onCopy:ee=>void q(ee),onSelect:D,collapsible:!0}),x.jsx(ph,{title:"Project Docs",children:x.jsx("ul",{className:"harness-studio-doc-list",children:(f==null?void 0:f.checks.map(ee=>x.jsxs("li",{children:[x.jsx("span",{children:ee.path??ee.label}),x.jsx(Bi,{status:ee.status})]},ee.key)))??x.jsx("li",{children:x.jsx("span",{children:"No bootstrap status loaded."})})})})]})}),x.jsxs("section",{className:"harness-studio-section harness-studio-engineer",children:[x.jsxs("div",{className:"harness-studio-engineer-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:"Harness Engineer"}),x.jsx("p",{className:"muted",children:Km(o)})]}),x.jsx(Bi,{status:(o==null?void 0:o.status)??"unknown"})]}),x.jsx(Oh,{role:"harness-engineer",session:o??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:b,onModelChange:u,onEffortChange:m,onStart:E,onResume:C,onRestart:T,onStop:S,onNotifyHarnessUpdated:v}),x.jsx("div",{className:"harness-engineer-terminal",children:(o==null?void 0:o.status)==="running"?x.jsx(Oo,{sessionId:o.id,active:l},o.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"harness-engineer"}),x.jsx("span",{children:o!=null&&o.claudeSessionId?"Resume this project Harness Engineer session.":"Start this project Harness Engineer session."})]})})]})]})]})})}):null}function Ls({label:n,value:r}){return x.jsxs("div",{className:"harness-studio-metric",children:[x.jsx("span",{children:n}),x.jsx("strong",{children:r})]})}function Ia({title:n,files:r,selectedPath:s,copiedPath:l,onCopy:d,onSelect:p,collapsible:f=!1}){const o=x.jsx("ol",{className:"harness-studio-file-list",children:r.length?r.map(c=>x.jsxs("li",{className:c.path===s?"selected":void 0,children:[x.jsx("button",{className:"harness-studio-file-path-button",type:"button",title:c.path,onClick:()=>p(c.path),children:c.path}),x.jsx("button",{className:"harness-studio-file-copy-button",type:"button",title:`Copy ${c.path}`,onClick:()=>d(c.path),children:l===c.path?"Copied":"Copy"}),x.jsx(Bi,{status:c.action})]},c.path)):x.jsx("li",{children:x.jsx("span",{children:"No files."})})});return f?x.jsx(ph,{title:n,children:o}):x.jsxs("section",{className:"harness-studio-section",children:[x.jsx("h3",{children:n}),o]})}function ph({title:n,children:r}){return x.jsxs("details",{className:"harness-studio-section harness-studio-collapsible-section",children:[x.jsxs("summary",{children:[x.jsx("h3",{children:n}),x.jsx("span",{children:"Show"})]}),x.jsx("div",{className:"harness-studio-collapsible-content",children:r})]})}function Wm(n){return n.kind==="agent-project-manager"||n.kind==="agent-architect"||n.kind==="agent-coder"||n.kind==="agent-reviewer"||n.kind==="agent-gate-reviewer"}function Km(n){return n?n.status==="running"?`${n.status} / ${n.activityStatus??"idle"}`:n.status:"not started"}async function S1(n){var s;if((s=navigator.clipboard)!=null&&s.writeText){await navigator.clipboard.writeText(n);return}const r=document.createElement("textarea");r.value=n,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.left="-9999px",document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove()}function b1({open:n,taskSlug:r,onClose:s}){var k;const[l,d]=te.useState(null),[p,f]=te.useState(null),[o,c]=te.useState(null),[h,m]=te.useState(null),[u,b]=te.useState(null),[C,T]=te.useState(!1),[E,S]=te.useState(!1),[,v]=ji(null),[_,y]=te.useState(null),A=te.useMemo(()=>(l==null?void 0:l.files.find(M=>M.path===o))??(l==null?void 0:l.files[0])??null,[l,o]);async function L(M=p){var j;T(!0),v(null);try{if(!r)throw new Error("Create or select a task before reviewing harness commits.");const H=await ye.getRepositoryDiff(r,M);d(H),m(null),f(((j=H.commit)==null?void 0:j.sha)??null),c(U=>{var F;return U&&H.files.some(K=>K.path===U)?U:((F=H.files[0])==null?void 0:F.path)??null})}catch(H){v(_t(M?`Load commit diff ${M}`:"Load latest commit diff",H))}finally{T(!1)}}te.useEffect(()=>{n&&(f(null),y(null),L(null))},[n,r]);async function D(M){b(M),v(null);try{if(!r)throw new Error("Create or select a task before reviewing file diffs.");const j=await ye.getRepositoryFileDiff(r,M);m(j),c(M)}catch(j){v(_t(`Load task file diff for ${M}`,j))}finally{b(null)}}async function R(){if(v(null),y(null),!r){v("Create or select a task before merging the task branch.");return}if(!l){v("Load the commit diff before merging the task branch.");return}const M=l.commits.length?l.commits.map(H=>`- ${H.shortSha} ${H.subject}`):["- No new commits found."];if(window.confirm([`Merge ${l.sourceBranch} into ${l.targetBranch}?`,"","VCM will run a fast-forward merge only.","The merge will fail if the task worktree or connected repository has uncommitted changes.","If the connected repository branch has diverged, rebase or merge manually first.","","Commits:",...M].join(`
|
|
61
|
+
`))){S(!0);try{const H=await ye.mergeRepositoryDiffToCurrentBranch(r);y(H.changed?`Merged ${H.sourceBranch} into ${H.targetBranch} at ${H.afterSha.slice(0,12)}.`:`${H.targetBranch} already includes ${H.sourceBranch}.`),f(null),await L(null)}catch(H){v(_t("Merge task branch to connected repository branch",H))}finally{S(!1)}}}return n?x.jsx("div",{className:"modal-backdrop repository-diff-backdrop",children:x.jsxs("section",{className:"repository-diff-modal",role:"dialog","aria-modal":"true","aria-label":"Commit Diff",children:[x.jsxs("header",{className:"repository-diff-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Commit Diff"}),x.jsx("p",{children:l?`${((k=l.commit)==null?void 0:k.shortSha)??"HEAD"} · ${l.summary.totalFiles} files · +${l.summary.additions} / -${l.summary.deletions}`:"Review a new commit on the active task worktree branch."})]}),x.jsxs("div",{className:"repository-diff-header-actions",children:[x.jsxs("label",{className:"repository-diff-commit-picker",children:[x.jsx("span",{children:"Commit"}),x.jsx("select",{value:p??"",disabled:C||!(l!=null&&l.commits.length),onChange:M=>{const j=M.target.value||null;f(j),L(j)},children:l==null?void 0:l.commits.map(M=>x.jsxs("option",{value:M.sha,children:[M.shortSha," · ",M.subject]},M.sha))})]}),x.jsx("button",{type:"button",disabled:C,onClick:()=>void L(),children:"Refresh"}),x.jsx("button",{type:"button",disabled:C||E||!r||!(l!=null&&l.commits.length),onClick:()=>void R(),children:E?"Merging...":"Merge to Main"}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]})]}),_?x.jsx("p",{className:"success-banner",children:_}):null,l!=null&&l.warnings.length?x.jsx("ul",{className:"warnings repository-diff-warnings",children:l.warnings.map(M=>x.jsx("li",{children:M},M))}):null,x.jsxs("div",{className:"repository-diff-body",children:[x.jsxs("aside",{className:"repository-diff-sidebar",children:[x.jsx(C1,{report:l,busy:C}),x.jsxs("ol",{className:"repository-diff-file-list",children:[l==null?void 0:l.files.map(M=>x.jsx("li",{className:[(A==null?void 0:A.path)===M.path&&!h?"selected":"",(h==null?void 0:h.path)===M.path?"task-diff-selected":""].filter(Boolean).join(" "),children:x.jsxs("div",{className:"repository-diff-file-row",children:[x.jsxs("button",{className:"repository-diff-file-select",type:"button",onClick:()=>{m(null),c(M.path)},children:[x.jsx("span",{children:M.path}),x.jsxs("small",{children:[gh(M.status)," · ",Ym(M.stage)," · ",mh(M.category)]})]}),x.jsx("button",{className:"repository-diff-task-file-button",type:"button",disabled:u===M.path,title:"View this file diff across the whole task worktree",onClick:()=>void D(M.path),children:u===M.path?"...":"Task diff"})]})},M.path)),l&&l.files.length===0?x.jsx("li",{className:"repository-diff-empty",children:l.commits.length===0?"No new commits on this task branch.":"No files in this commit."}):null]})]}),x.jsx("main",{className:"repository-diff-main",children:h?x.jsx(w1,{diff:h,onClose:()=>m(null)}):A?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"repository-diff-file-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:A.path}),x.jsxs("p",{children:[mh(A.category)," · ",gh(A.status)," · ",Ym(A.stage)]})]}),x.jsxs("span",{className:"repository-diff-stats",children:["+",A.additions," / -",A.deletions]})]}),A.binary?x.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,A.truncated?x.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,x.jsx("pre",{className:"repository-diff-code","aria-label":`${A.path} diff`,children:a_(A.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:C?"Loading commit diff...":"No diff selected."})})]})]})}):null}function C1({report:n,busy:r}){var l;const s=n==null?void 0:n.summary;return x.jsxs("div",{className:"repository-diff-summary",children:[x.jsx("strong",{children:r?"Loading":n?"Commit changes":"Not loaded"}),s?x.jsxs(x.Fragment,{children:[x.jsxs("span",{children:[s.harnessFiles," harness files"]}),x.jsxs("span",{children:[s.productCodeFiles," product code files"]}),x.jsxs("span",{children:[s.committedFiles," committed files"]}),x.jsxs("span",{children:[(n==null?void 0:n.commits.length)??0," branch commits"]}),x.jsx("span",{children:((l=n==null?void 0:n.commit)==null?void 0:l.subject)??"HEAD"})]}):null]})}function w1({diff:n,onClose:r}){const s=n.file;return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"repository-diff-file-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:n.path}),x.jsxs("p",{children:["Task diff · ",n.targetBranch," ",n.baseSha.slice(0,12)," → ",n.sourceBranch," worktree ",n.headSha.slice(0,12)]})]}),x.jsxs("div",{className:"repository-diff-task-file-actions",children:[s?x.jsxs("span",{className:"repository-diff-stats",children:["+",s.additions," / -",s.deletions]}):null,x.jsx("button",{type:"button",onClick:r,children:"Commit diff"})]})]}),n.warnings.length>0?x.jsx("ul",{className:"warnings repository-diff-warnings",children:n.warnings.map(l=>x.jsx("li",{children:l},l))}):null,s?x.jsxs(x.Fragment,{children:[x.jsxs("p",{className:"muted",children:[mh(s.category)," · ",gh(s.status)," · whole task comparison"]}),s.binary?x.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,s.truncated?x.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,x.jsx("pre",{className:"repository-diff-code","aria-label":`${n.path} task diff`,children:a_(s.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:"No task-level diff for this file."})]})}function mh(n){switch(n){case"fixed_harness":return"fixed harness";case"tools_hooks":return"tools/hooks";case"generated_context":return"generated context";case"project_docs":return"project docs";case"product_code":return"product code"}}function Ym(n){return n.replaceAll("_"," ")}function gh(n){return n.replaceAll("_"," ")}function a_(n){return n.split(`
|
|
62
|
+
`).filter(r=>!E1(r)).map((r,s)=>x.jsx("span",{className:`repository-diff-line ${x1(r)}`,children:r||" "},`${s}:${r}`))}function x1(n){return n.startsWith("+")&&!n.startsWith("+++")?"repository-diff-line-added":n.startsWith("-")&&!n.startsWith("---")?"repository-diff-line-deleted":n.startsWith("@@")?"repository-diff-line-hunk":"repository-diff-line-context"}function E1(n){return n.startsWith("diff --git")||n.startsWith("index ")||n.startsWith("new file mode ")||n.startsWith("deleted file mode ")||n.startsWith("similarity index ")||n.startsWith("rename from ")||n.startsWith("rename to ")||n.startsWith("--- ")||n.startsWith("+++ ")}function k1({busy:n,effort:r,model:s,open:l,permissionMode:d,session:p,onClose:f,onEffortChange:o,onModelChange:c,onPermissionModeChange:h,onResume:m,onRestart:u,onStart:b,onStop:C,onNotifyHarnessUpdated:T}){return l?x.jsx("div",{className:"modal-backdrop translator-session-backdrop",children:x.jsxs("section",{className:"translator-session-modal",role:"dialog","aria-modal":"true","aria-label":"Translator Session",children:[x.jsxs("header",{className:"translator-session-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Translator Session"}),x.jsx("p",{children:A1(p)})]}),x.jsx("button",{type:"button",onClick:f,children:"Close"})]}),x.jsx(Oh,{role:"translator",session:p??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:h,onModelChange:c,onEffortChange:o,onStart:b,onResume:m,onRestart:u,onStop:C,onNotifyHarnessUpdated:T}),x.jsx("div",{className:"translator-session-terminal",children:(p==null?void 0:p.status)==="running"?x.jsx(Oo,{sessionId:p.id,active:l},p.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"translator"}),x.jsx("span",{children:p!=null&&p.claudeSessionId?"Resume this project translator session.":"Start the project translator session."})]})})]})}):null}function A1(n){if(!n)return"not started";const r=n.status==="running"?` · ${n.activityStatus??"idle"}`:"";return`${n.status}${r}`}function T1(n,r){const s={};return(n[n.length-1]===""?[...n,""]:n).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const R1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,D1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,M1={};function Xm(n,r){return(M1.jsx?D1:R1).test(n)}const L1=/[ \t\n\f\r]/g;function O1(n){return typeof n=="object"?n.type==="text"?Qm(n.value):!1:Qm(n)}function Qm(n){return n.replace(L1,"")===""}class Za{constructor(r,s,l){this.normal=s,this.property=r,l&&(this.space=l)}}Za.prototype.normal={};Za.prototype.property={};Za.prototype.space=void 0;function l_(n,r){const s={},l={};for(const d of n)Object.assign(s,d.property),Object.assign(l,d.normal);return new Za(s,l,r)}function _h(n){return n.toLowerCase()}class vn{constructor(r,s){this.attribute=s,this.property=r}}vn.prototype.attribute="";vn.prototype.booleanish=!1;vn.prototype.boolean=!1;vn.prototype.commaOrSpaceSeparated=!1;vn.prototype.commaSeparated=!1;vn.prototype.defined=!1;vn.prototype.mustUseProperty=!1;vn.prototype.number=!1;vn.prototype.overloadedBoolean=!1;vn.prototype.property="";vn.prototype.spaceSeparated=!1;vn.prototype.space=void 0;let B1=0;const Ue=Pr(),Bt=Pr(),vh=Pr(),be=Pr(),ft=Pr(),Hs=Pr(),Mn=Pr();function Pr(){return 2**++B1}const yh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:Bt,commaOrSpaceSeparated:Mn,commaSeparated:Hs,number:be,overloadedBoolean:vh,spaceSeparated:ft},Symbol.toStringTag,{value:"Module"})),Wu=Object.keys(yh);class Bh extends vn{constructor(r,s,l,d){let p=-1;if(super(r,s),Jm(this,"space",d),typeof l=="number")for(;++p<Wu.length;){const f=Wu[p];Jm(this,Wu[p],(l&yh[f])===yh[f])}}}Bh.prototype.defined=!0;function Jm(n,r,s){s&&(n[r]=s)}function Fs(n){const r={},s={};for(const[l,d]of Object.entries(n.properties)){const p=new Bh(l,n.transform(n.attributes||{},l),d,n.space);n.mustUseProperty&&n.mustUseProperty.includes(l)&&(p.mustUseProperty=!0),r[l]=p,s[_h(l)]=l,s[_h(p.attribute)]=l}return new Za(r,s,n.space)}const o_=Fs({properties:{ariaActiveDescendant:null,ariaAtomic:Bt,ariaAutoComplete:null,ariaBusy:Bt,ariaChecked:Bt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:ft,ariaCurrent:null,ariaDescribedBy:ft,ariaDetails:null,ariaDisabled:Bt,ariaDropEffect:ft,ariaErrorMessage:null,ariaExpanded:Bt,ariaFlowTo:ft,ariaGrabbed:Bt,ariaHasPopup:null,ariaHidden:Bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ft,ariaLevel:be,ariaLive:null,ariaModal:Bt,ariaMultiLine:Bt,ariaMultiSelectable:Bt,ariaOrientation:null,ariaOwns:ft,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Bt,ariaReadOnly:Bt,ariaRelevant:null,ariaRequired:Bt,ariaRoleDescription:ft,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Bt,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(n,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function c_(n,r){return r in n?n[r]:r}function u_(n,r){return c_(n,r.toLowerCase())}const j1=Fs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Hs,acceptCharset:ft,accessKey:ft,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:ft,autoFocus:Ue,autoPlay:Ue,blocking:ft,capture:null,charSet:null,checked:Ue,cite:null,className:ft,cols:be,colSpan:null,content:null,contentEditable:Bt,controls:Ue,controlsList:ft,coords:be|Hs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:vh,draggable:Bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:ft,height:be,hidden:vh,high:be,href:null,hrefLang:null,htmlFor:ft,httpEquiv:ft,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:ft,itemRef:ft,itemScope:Ue,itemType:ft,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ue,optimum:be,pattern:null,ping:ft,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:ft,required:Ue,reversed:Ue,rows:be,rowSpan:be,sandbox:ft,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Bt,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ft,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Bt,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ue,disableRemotePlayback:Ue,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:u_}),N1=Fs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Mn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:ft,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Hs,g2:Hs,glyphName:Hs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:Mn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ft,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Mn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Mn,rev:Mn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Mn,requiredFeatures:Mn,requiredFonts:Mn,requiredFormats:Mn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:Mn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Mn,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Mn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:c_}),h_=Fs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,r){return"xlink:"+r.slice(5).toLowerCase()}}),f_=Fs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:u_}),d_=Fs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,r){return"xml:"+r.slice(3).toLowerCase()}}),H1={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},z1=/[A-Z]/g,Zm=/-[a-z]/g,I1=/^data[-\w.:]+$/i;function U1(n,r){const s=_h(r);let l=r,d=vn;if(s in n.normal)return n.property[n.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&I1.test(r)){if(r.charAt(4)==="-"){const p=r.slice(5).replace(Zm,F1);l="data"+p.charAt(0).toUpperCase()+p.slice(1)}else{const p=r.slice(4);if(!Zm.test(p)){let f=p.replace(z1,P1);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=Bh}return new d(l,r)}function P1(n){return"-"+n.toLowerCase()}function F1(n){return n.charAt(1).toUpperCase()}const q1=l_([o_,j1,h_,f_,d_],"html"),jh=l_([o_,N1,h_,f_,d_],"svg");function $1(n){return n.join(" ").trim()}var Os={},Ku,eg;function G1(){if(eg)return Ku;eg=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,p=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,o=/^\s+|\s+$/g,c=`
|
|
63
|
+
`,h="/",m="*",u="",b="comment",C="declaration";function T(S,v){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];v=v||{};var _=1,y=1;function A(K){var Y=K.match(r);Y&&(_+=Y.length);var G=K.lastIndexOf(c);y=~G?K.length-G:y+K.length}function L(){var K={line:_,column:y};return function(Y){return Y.position=new D(K),M(),Y}}function D(K){this.start=K,this.end={line:_,column:y},this.source=v.source}D.prototype.content=S;function R(K){var Y=new Error(v.source+":"+_+":"+y+": "+K);if(Y.reason=K,Y.filename=v.source,Y.line=_,Y.column=y,Y.source=S,!v.silent)throw Y}function k(K){var Y=K.exec(S);if(Y){var G=Y[0];return A(G),S=S.slice(G.length),Y}}function M(){k(s)}function j(K){var Y;for(K=K||[];Y=H();)Y!==!1&&K.push(Y);return K}function H(){var K=L();if(!(h!=S.charAt(0)||m!=S.charAt(1))){for(var Y=2;u!=S.charAt(Y)&&(m!=S.charAt(Y)||h!=S.charAt(Y+1));)++Y;if(Y+=2,u===S.charAt(Y-1))return R("End of comment missing");var G=S.slice(2,Y-2);return y+=2,A(G),S=S.slice(Y),y+=2,K({type:b,comment:G})}}function U(){var K=L(),Y=k(l);if(Y){if(H(),!k(d))return R("property missing ':'");var G=k(p),W=K({type:C,property:E(Y[0].replace(n,u)),value:G?E(G[0].replace(n,u)):u});return k(f),W}}function F(){var K=[];j(K);for(var Y;Y=U();)Y!==!1&&(K.push(Y),j(K));return K}return M(),F()}function E(S){return S?S.replace(o,u):u}return Ku=T,Ku}var tg;function V1(){if(tg)return Os;tg=1;var n=Os&&Os.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Os,"__esModule",{value:!0}),Os.default=s;const r=n(G1());function s(l,d){let p=null;if(!l||typeof l!="string")return p;const f=(0,r.default)(l),o=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:h,value:m}=c;o?d(h,m,c):m&&(p=p||{},p[h]=m)}),p}return Os}var Ua={},ng;function W1(){if(ng)return Ua;ng=1,Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,d=/^-(ms)-/,p=function(h){return!h||s.test(h)||n.test(h)},f=function(h,m){return m.toUpperCase()},o=function(h,m){return"".concat(m,"-")},c=function(h,m){return m===void 0&&(m={}),p(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(d,o):h=h.replace(l,o),h.replace(r,f))};return Ua.camelCase=c,Ua}var Pa,ig;function K1(){if(ig)return Pa;ig=1;var n=Pa&&Pa.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=n(V1()),s=W1();function l(d,p){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(o,c){o&&c&&(f[(0,s.camelCase)(o,p)]=c)}),f}return l.default=l,Pa=l,Pa}var Y1=K1();const X1=Qg(Y1),p_=m_("end"),Nh=m_("start");function m_(n){return r;function r(s){const l=s&&s.position&&s.position[n]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function Q1(n){const r=Nh(n),s=p_(n);if(r&&s)return{start:r,end:s}}function Ga(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?rg(n.position):"start"in n||"end"in n?rg(n):"line"in n||"column"in n?Sh(n):""}function Sh(n){return sg(n&&n.line)+":"+sg(n&&n.column)}function rg(n){return Sh(n&&n.start)+"-"+Sh(n&&n.end)}function sg(n){return n&&typeof n=="number"?n:1}class nn extends Error{constructor(r,s,l){super(),typeof s=="string"&&(l=s,s=void 0);let d="",p={},f=!1;if(s&&("line"in s&&"column"in s?p={place:s}:"start"in s&&"end"in s?p={place:s}:"type"in s?p={ancestors:[s],place:s.position}:p={...s}),typeof r=="string"?d=r:!p.cause&&r&&(f=!0,d=r.message,p.cause=r),!p.ruleId&&!p.source&&typeof l=="string"){const c=l.indexOf(":");c===-1?p.ruleId=l:(p.source=l.slice(0,c),p.ruleId=l.slice(c+1))}if(!p.place&&p.ancestors&&p.ancestors){const c=p.ancestors[p.ancestors.length-1];c&&(p.place=c.position)}const o=p.place&&"start"in p.place?p.place.start:p.place;this.ancestors=p.ancestors||void 0,this.cause=p.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=o?o.line:void 0,this.name=Ga(p.place)||"1:1",this.place=p.place||void 0,this.reason=this.message,this.ruleId=p.ruleId||void 0,this.source=p.source||void 0,this.stack=f&&p.cause&&typeof p.cause.stack=="string"?p.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}nn.prototype.file="";nn.prototype.name="";nn.prototype.reason="";nn.prototype.message="";nn.prototype.stack="";nn.prototype.column=void 0;nn.prototype.line=void 0;nn.prototype.ancestors=void 0;nn.prototype.cause=void 0;nn.prototype.fatal=void 0;nn.prototype.place=void 0;nn.prototype.ruleId=void 0;nn.prototype.source=void 0;const Hh={}.hasOwnProperty,J1=new Map,Z1=/[A-Z]/g,eS=new Set(["table","tbody","thead","tfoot","tr"]),tS=new Set(["td","th"]),g_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function nS(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let l;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=uS(s,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=cS(s,r.jsx,r.jsxs)}const d={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:l,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?jh:q1,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},p=__(d,n,void 0);return p&&typeof p!="string"?p:d.create(n,d.Fragment,{children:p||void 0},void 0)}function __(n,r,s){if(r.type==="element")return iS(n,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return rS(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return aS(n,r,s);if(r.type==="mdxjsEsm")return sS(n,r);if(r.type==="root")return lS(n,r,s);if(r.type==="text")return oS(n,r)}function iS(n,r,s){const l=n.schema;let d=l;r.tagName.toLowerCase()==="svg"&&l.space==="html"&&(d=jh,n.schema=d),n.ancestors.push(r);const p=y_(n,r.tagName,!1),f=hS(n,r);let o=Ih(n,r);return eS.has(r.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!O1(c):!0})),v_(n,f,p,r),zh(f,o),n.ancestors.pop(),n.schema=l,n.create(r,p,f,s)}function rS(n,r){if(r.data&&r.data.estree&&n.evaluater){const l=r.data.estree.body[0];return l.type,n.evaluater.evaluateExpression(l.expression)}Xa(n,r.position)}function sS(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);Xa(n,r.position)}function aS(n,r,s){const l=n.schema;let d=l;r.name==="svg"&&l.space==="html"&&(d=jh,n.schema=d),n.ancestors.push(r);const p=r.name===null?n.Fragment:y_(n,r.name,!0),f=fS(n,r),o=Ih(n,r);return v_(n,f,p,r),zh(f,o),n.ancestors.pop(),n.schema=l,n.create(r,p,f,s)}function lS(n,r,s){const l={};return zh(l,Ih(n,r)),n.create(r,n.Fragment,l,s)}function oS(n,r){return r.value}function v_(n,r,s,l){typeof s!="string"&&s!==n.Fragment&&n.passNode&&(r.node=l)}function zh(n,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(n.children=s)}}function cS(n,r,s){return l;function l(d,p,f,o){const h=Array.isArray(f.children)?s:r;return o?h(p,f,o):h(p,f)}}function uS(n,r){return s;function s(l,d,p,f){const o=Array.isArray(p.children),c=Nh(l);return r(d,p,f,o,{columnNumber:c?c.column-1:void 0,fileName:n,lineNumber:c?c.line:void 0},void 0)}}function hS(n,r){const s={};let l,d;for(d in r.properties)if(d!=="children"&&Hh.call(r.properties,d)){const p=dS(n,d,r.properties[d]);if(p){const[f,o]=p;n.tableCellAlignToStyle&&f==="align"&&typeof o=="string"&&tS.has(r.tagName)?l=o:s[f]=o}}if(l){const p=s.style||(s.style={});p[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return s}function fS(n,r){const s={};for(const l of r.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&n.evaluater){const p=l.data.estree.body[0];p.type;const f=p.expression;f.type;const o=f.properties[0];o.type,Object.assign(s,n.evaluater.evaluateExpression(o.argument))}else Xa(n,r.position);else{const d=l.name;let p;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&n.evaluater){const o=l.value.data.estree.body[0];o.type,p=n.evaluater.evaluateExpression(o.expression)}else Xa(n,r.position);else p=l.value===null?!0:l.value;s[d]=p}return s}function Ih(n,r){const s=[];let l=-1;const d=n.passKeys?new Map:J1;for(;++l<r.children.length;){const p=r.children[l];let f;if(n.passKeys){const c=p.type==="element"?p.tagName:p.type==="mdxJsxFlowElement"||p.type==="mdxJsxTextElement"?p.name:void 0;if(c){const h=d.get(c)||0;f=c+"-"+h,d.set(c,h+1)}}const o=__(n,p,f);o!==void 0&&s.push(o)}return s}function dS(n,r,s){const l=U1(n.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=l.commaSeparated?T1(s):$1(s)),l.property==="style"){let d=typeof s=="object"?s:pS(n,String(s));return n.stylePropertyNameCase==="css"&&(d=mS(d)),["style",d]}return[n.elementAttributeNameCase==="react"&&l.space?H1[l.property]||l.property:l.attribute,s]}}function pS(n,r){try{return X1(r,{reactCompat:!0})}catch(s){if(n.ignoreInvalidStyle)return{};const l=s,d=new nn("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw d.file=n.filePath||void 0,d.url=g_+"#cannot-parse-style-attribute",d}}function y_(n,r,s){let l;if(!s)l={type:"Literal",value:r};else if(r.includes(".")){const d=r.split(".");let p=-1,f;for(;++p<d.length;){const o=Xm(d[p])?{type:"Identifier",name:d[p]}:{type:"Literal",value:d[p]};f=f?{type:"MemberExpression",object:f,property:o,computed:!!(p&&o.type==="Literal"),optional:!1}:o}l=f}else l=Xm(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(l.type==="Literal"){const d=l.value;return Hh.call(n.components,d)?n.components[d]:d}if(n.evaluater)return n.evaluater.evaluateExpression(l);Xa(n)}function Xa(n,r){const s=new nn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=n.filePath||void 0,s.url=g_+"#cannot-handle-mdx-estrees-without-createevaluater",s}function mS(n){const r={};let s;for(s in n)Hh.call(n,s)&&(r[gS(s)]=n[s]);return r}function gS(n){let r=n.replace(Z1,_S);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function _S(n){return"-"+n.toLowerCase()}const Yu={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},vS={};function Uh(n,r){const s=vS,l=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return S_(n,l,d)}function S_(n,r,s){if(yS(n)){if("value"in n)return n.type==="html"&&!s?"":n.value;if(r&&"alt"in n&&n.alt)return n.alt;if("children"in n)return ag(n.children,r,s)}return Array.isArray(n)?ag(n,r,s):""}function ag(n,r,s){const l=[];let d=-1;for(;++d<n.length;)l[d]=S_(n[d],r,s);return l.join("")}function yS(n){return!!(n&&typeof n=="object")}const lg=document.createElement("i");function Ph(n){const r="&"+n+";";lg.innerHTML=r;const s=lg.textContent;return s.charCodeAt(s.length-1)===59&&n!=="semi"||s===r?!1:s}function Ln(n,r,s,l){const d=n.length;let p=0,f;if(r<0?r=-r>d?0:d+r:r=r>d?d:r,s=s>0?s:0,l.length<1e4)f=Array.from(l),f.unshift(r,s),n.splice(...f);else for(s&&n.splice(r,s);p<l.length;)f=l.slice(p,p+1e4),f.unshift(r,0),n.splice(...f),p+=1e4,r+=1e4}function Gn(n,r){return n.length>0?(Ln(n,n.length,0,r),n):r}const og={}.hasOwnProperty;function b_(n){const r={};let s=-1;for(;++s<n.length;)SS(r,n[s]);return r}function SS(n,r){let s;for(s in r){const d=(og.call(n,s)?n[s]:void 0)||(n[s]={}),p=r[s];let f;if(p)for(f in p){og.call(d,f)||(d[f]=[]);const o=p[f];bS(d[f],Array.isArray(o)?o:o?[o]:[])}}}function bS(n,r){let s=-1;const l=[];for(;++s<r.length;)(r[s].add==="after"?n:l).push(r[s]);Ln(n,0,0,l)}function C_(n,r){const s=Number.parseInt(n,r);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"�":String.fromCodePoint(s)}function ii(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const an=mr(/[A-Za-z]/),tn=mr(/[\dA-Za-z]/),CS=mr(/[#-'*+\--9=?A-Z^-~]/);function Eo(n){return n!==null&&(n<32||n===127)}const bh=mr(/\d/),wS=mr(/[\dA-Fa-f]/),xS=mr(/[!-/:-@[-`{-~]/);function Me(n){return n!==null&&n<-2}function ut(n){return n!==null&&(n<0||n===32)}function Ge(n){return n===-2||n===-1||n===32}const Bo=mr(new RegExp("\\p{P}|\\p{S}","u")),Ir=mr(/\s/);function mr(n){return r;function r(s){return s!==null&&s>-1&&n.test(String.fromCharCode(s))}}function qs(n){const r=[];let s=-1,l=0,d=0;for(;++s<n.length;){const p=n.charCodeAt(s);let f="";if(p===37&&tn(n.charCodeAt(s+1))&&tn(n.charCodeAt(s+2)))d=2;else if(p<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(p))||(f=String.fromCharCode(p));else if(p>55295&&p<57344){const o=n.charCodeAt(s+1);p<56320&&o>56319&&o<57344?(f=String.fromCharCode(p,o),d=1):f="�"}else f=String.fromCharCode(p);f&&(r.push(n.slice(l,s),encodeURIComponent(f)),l=s+d+1,f=""),d&&(s+=d,d=0)}return r.join("")+n.slice(l)}function Xe(n,r,s,l){const d=l?l-1:Number.POSITIVE_INFINITY;let p=0;return f;function f(c){return Ge(c)?(n.enter(s),o(c)):r(c)}function o(c){return Ge(c)&&p++<d?(n.consume(c),o):(n.exit(s),r(c))}}const ES={tokenize:kS};function kS(n){const r=n.attempt(this.parser.constructs.contentInitial,l,d);let s;return r;function l(o){if(o===null){n.consume(o);return}return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),Xe(n,r,"linePrefix")}function d(o){return n.enter("paragraph"),p(o)}function p(o){const c=n.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=c),s=c,f(o)}function f(o){if(o===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(o);return}return Me(o)?(n.consume(o),n.exit("chunkText"),p):(n.consume(o),f)}}const AS={tokenize:TS},cg={tokenize:RS};function TS(n){const r=this,s=[];let l=0,d,p,f;return o;function o(y){if(l<s.length){const A=s[l];return r.containerState=A[1],n.attempt(A[0].continuation,c,h)(y)}return h(y)}function c(y){if(l++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,d&&_();const A=r.events.length;let L=A,D;for(;L--;)if(r.events[L][0]==="exit"&&r.events[L][1].type==="chunkFlow"){D=r.events[L][1].end;break}v(l);let R=A;for(;R<r.events.length;)r.events[R][1].end={...D},R++;return Ln(r.events,L+1,0,r.events.slice(A)),r.events.length=R,h(y)}return o(y)}function h(y){if(l===s.length){if(!d)return b(y);if(d.currentConstruct&&d.currentConstruct.concrete)return T(y);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(cg,m,u)(y)}function m(y){return d&&_(),v(l),b(y)}function u(y){return r.parser.lazy[r.now().line]=l!==s.length,f=r.now().offset,T(y)}function b(y){return r.containerState={},n.attempt(cg,C,T)(y)}function C(y){return l++,s.push([r.currentConstruct,r.containerState]),b(y)}function T(y){if(y===null){d&&_(),v(0),n.consume(y);return}return d=d||r.parser.flow(r.now()),n.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:p}),E(y)}function E(y){if(y===null){S(n.exit("chunkFlow"),!0),v(0),n.consume(y);return}return Me(y)?(n.consume(y),S(n.exit("chunkFlow")),l=0,r.interrupt=void 0,o):(n.consume(y),E)}function S(y,A){const L=r.sliceStream(y);if(A&&L.push(null),y.previous=p,p&&(p.next=y),p=y,d.defineSkip(y.start),d.write(L),r.parser.lazy[y.start.line]){let D=d.events.length;for(;D--;)if(d.events[D][1].start.offset<f&&(!d.events[D][1].end||d.events[D][1].end.offset>f))return;const R=r.events.length;let k=R,M,j;for(;k--;)if(r.events[k][0]==="exit"&&r.events[k][1].type==="chunkFlow"){if(M){j=r.events[k][1].end;break}M=!0}for(v(l),D=R;D<r.events.length;)r.events[D][1].end={...j},D++;Ln(r.events,k+1,0,r.events.slice(R)),r.events.length=D}}function v(y){let A=s.length;for(;A-- >y;){const L=s[A];r.containerState=L[1],L[0].exit.call(r,n)}s.length=y}function _(){d.write([null]),p=void 0,d=void 0,r.containerState._closeFlow=void 0}}function RS(n,r,s){return Xe(n,n.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Is(n){if(n===null||ut(n)||Ir(n))return 1;if(Bo(n))return 2}function jo(n,r,s){const l=[];let d=-1;for(;++d<n.length;){const p=n[d].resolveAll;p&&!l.includes(p)&&(r=p(r,s),l.push(p))}return r}const Ch={name:"attention",resolveAll:DS,tokenize:MS};function DS(n,r){let s=-1,l,d,p,f,o,c,h,m;for(;++s<n.length;)if(n[s][0]==="enter"&&n[s][1].type==="attentionSequence"&&n[s][1]._close){for(l=s;l--;)if(n[l][0]==="exit"&&n[l][1].type==="attentionSequence"&&n[l][1]._open&&r.sliceSerialize(n[l][1]).charCodeAt(0)===r.sliceSerialize(n[s][1]).charCodeAt(0)){if((n[l][1]._close||n[s][1]._open)&&(n[s][1].end.offset-n[s][1].start.offset)%3&&!((n[l][1].end.offset-n[l][1].start.offset+n[s][1].end.offset-n[s][1].start.offset)%3))continue;c=n[l][1].end.offset-n[l][1].start.offset>1&&n[s][1].end.offset-n[s][1].start.offset>1?2:1;const u={...n[l][1].end},b={...n[s][1].start};ug(u,-c),ug(b,c),f={type:c>1?"strongSequence":"emphasisSequence",start:u,end:{...n[l][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...n[s][1].start},end:b},p={type:c>1?"strongText":"emphasisText",start:{...n[l][1].end},end:{...n[s][1].start}},d={type:c>1?"strong":"emphasis",start:{...f.start},end:{...o.end}},n[l][1].end={...f.start},n[s][1].start={...o.end},h=[],n[l][1].end.offset-n[l][1].start.offset&&(h=Gn(h,[["enter",n[l][1],r],["exit",n[l][1],r]])),h=Gn(h,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",p,r]]),h=Gn(h,jo(r.parser.constructs.insideSpan.null,n.slice(l+1,s),r)),h=Gn(h,[["exit",p,r],["enter",o,r],["exit",o,r],["exit",d,r]]),n[s][1].end.offset-n[s][1].start.offset?(m=2,h=Gn(h,[["enter",n[s][1],r],["exit",n[s][1],r]])):m=0,Ln(n,l-1,s-l+3,h),s=l+h.length-m-2;break}}for(s=-1;++s<n.length;)n[s][1].type==="attentionSequence"&&(n[s][1].type="data");return n}function MS(n,r){const s=this.parser.constructs.attentionMarkers.null,l=this.previous,d=Is(l);let p;return f;function f(c){return p=c,n.enter("attentionSequence"),o(c)}function o(c){if(c===p)return n.consume(c),o;const h=n.exit("attentionSequence"),m=Is(c),u=!m||m===2&&d||s.includes(c),b=!d||d===2&&m||s.includes(l);return h._open=!!(p===42?u:u&&(d||!b)),h._close=!!(p===42?b:b&&(m||!u)),r(c)}}function ug(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}const LS={name:"autolink",tokenize:OS};function OS(n,r,s){let l=0;return d;function d(C){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),p}function p(C){return an(C)?(n.consume(C),f):C===64?s(C):h(C)}function f(C){return C===43||C===45||C===46||tn(C)?(l=1,o(C)):h(C)}function o(C){return C===58?(n.consume(C),l=0,c):(C===43||C===45||C===46||tn(C))&&l++<32?(n.consume(C),o):(l=0,h(C))}function c(C){return C===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.exit("autolink"),r):C===null||C===32||C===60||Eo(C)?s(C):(n.consume(C),c)}function h(C){return C===64?(n.consume(C),m):CS(C)?(n.consume(C),h):s(C)}function m(C){return tn(C)?u(C):s(C)}function u(C){return C===46?(n.consume(C),l=0,m):C===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.exit("autolink"),r):b(C)}function b(C){if((C===45||tn(C))&&l++<63){const T=C===45?b:u;return n.consume(C),T}return s(C)}}const el={partial:!0,tokenize:BS};function BS(n,r,s){return l;function l(p){return Ge(p)?Xe(n,d,"linePrefix")(p):d(p)}function d(p){return p===null||Me(p)?r(p):s(p)}}const w_={continuation:{tokenize:NS},exit:HS,name:"blockQuote",tokenize:jS};function jS(n,r,s){const l=this;return d;function d(f){if(f===62){const o=l.containerState;return o.open||(n.enter("blockQuote",{_container:!0}),o.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),p}return s(f)}function p(f){return Ge(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(f))}}function NS(n,r,s){const l=this;return d;function d(f){return Ge(f)?Xe(n,p,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):p(f)}function p(f){return n.attempt(w_,r,s)(f)}}function HS(n){n.exit("blockQuote")}const x_={name:"characterEscape",tokenize:zS};function zS(n,r,s){return l;function l(p){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(p),n.exit("escapeMarker"),d}function d(p){return xS(p)?(n.enter("characterEscapeValue"),n.consume(p),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):s(p)}}const E_={name:"characterReference",tokenize:IS};function IS(n,r,s){const l=this;let d=0,p,f;return o;function o(u){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),c}function c(u){return u===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(u),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),p=31,f=tn,m(u))}function h(u){return u===88||u===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(u),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),p=6,f=wS,m):(n.enter("characterReferenceValue"),p=7,f=bh,m(u))}function m(u){if(u===59&&d){const b=n.exit("characterReferenceValue");return f===tn&&!Ph(l.sliceSerialize(b))?s(u):(n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),n.exit("characterReference"),r)}return f(u)&&d++<p?(n.consume(u),m):s(u)}}const hg={partial:!0,tokenize:PS},fg={concrete:!0,name:"codeFenced",tokenize:US};function US(n,r,s){const l=this,d={partial:!0,tokenize:L};let p=0,f=0,o;return c;function c(D){return h(D)}function h(D){const R=l.events[l.events.length-1];return p=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,o=D,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),m(D)}function m(D){return D===o?(f++,n.consume(D),m):f<3?s(D):(n.exit("codeFencedFenceSequence"),Ge(D)?Xe(n,u,"whitespace")(D):u(D))}function u(D){return D===null||Me(D)?(n.exit("codeFencedFence"),l.interrupt?r(D):n.check(hg,E,A)(D)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),b(D))}function b(D){return D===null||Me(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),u(D)):Ge(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Xe(n,C,"whitespace")(D)):D===96&&D===o?s(D):(n.consume(D),b)}function C(D){return D===null||Me(D)?u(D):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),T(D))}function T(D){return D===null||Me(D)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),u(D)):D===96&&D===o?s(D):(n.consume(D),T)}function E(D){return n.attempt(d,A,S)(D)}function S(D){return n.enter("lineEnding"),n.consume(D),n.exit("lineEnding"),v}function v(D){return p>0&&Ge(D)?Xe(n,_,"linePrefix",p+1)(D):_(D)}function _(D){return D===null||Me(D)?n.check(hg,E,A)(D):(n.enter("codeFlowValue"),y(D))}function y(D){return D===null||Me(D)?(n.exit("codeFlowValue"),_(D)):(n.consume(D),y)}function A(D){return n.exit("codeFenced"),r(D)}function L(D,R,k){let M=0;return j;function j(Y){return D.enter("lineEnding"),D.consume(Y),D.exit("lineEnding"),H}function H(Y){return D.enter("codeFencedFence"),Ge(Y)?Xe(D,U,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):U(Y)}function U(Y){return Y===o?(D.enter("codeFencedFenceSequence"),F(Y)):k(Y)}function F(Y){return Y===o?(M++,D.consume(Y),F):M>=f?(D.exit("codeFencedFenceSequence"),Ge(Y)?Xe(D,K,"whitespace")(Y):K(Y)):k(Y)}function K(Y){return Y===null||Me(Y)?(D.exit("codeFencedFence"),R(Y)):k(Y)}}}function PS(n,r,s){const l=this;return d;function d(f){return f===null?s(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),p)}function p(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}const Xu={name:"codeIndented",tokenize:qS},FS={partial:!0,tokenize:$S};function qS(n,r,s){const l=this;return d;function d(h){return n.enter("codeIndented"),Xe(n,p,"linePrefix",5)(h)}function p(h){const m=l.events[l.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?f(h):s(h)}function f(h){return h===null?c(h):Me(h)?n.attempt(FS,f,c)(h):(n.enter("codeFlowValue"),o(h))}function o(h){return h===null||Me(h)?(n.exit("codeFlowValue"),f(h)):(n.consume(h),o)}function c(h){return n.exit("codeIndented"),r(h)}}function $S(n,r,s){const l=this;return d;function d(f){return l.parser.lazy[l.now().line]?s(f):Me(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),d):Xe(n,p,"linePrefix",5)(f)}function p(f){const o=l.events[l.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):Me(f)?d(f):s(f)}}const GS={name:"codeText",previous:WS,resolve:VS,tokenize:KS};function VS(n){let r=n.length-4,s=3,l,d;if((n[s][1].type==="lineEnding"||n[s][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(l=s;++l<r;)if(n[l][1].type==="codeTextData"){n[s][1].type="codeTextPadding",n[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(l=s-1,r++;++l<=r;)d===void 0?l!==r&&n[l][1].type!=="lineEnding"&&(d=l):(l===r||n[l][1].type==="lineEnding")&&(n[d][1].type="codeTextData",l!==d+2&&(n[d][1].end=n[l-1][1].end,n.splice(d+2,l-d-2),r-=l-d-2,l=d+2),d=void 0);return n}function WS(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function KS(n,r,s){let l=0,d,p;return f;function f(u){return n.enter("codeText"),n.enter("codeTextSequence"),o(u)}function o(u){return u===96?(n.consume(u),l++,o):(n.exit("codeTextSequence"),c(u))}function c(u){return u===null?s(u):u===32?(n.enter("space"),n.consume(u),n.exit("space"),c):u===96?(p=n.enter("codeTextSequence"),d=0,m(u)):Me(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),c):(n.enter("codeTextData"),h(u))}function h(u){return u===null||u===32||u===96||Me(u)?(n.exit("codeTextData"),c(u)):(n.consume(u),h)}function m(u){return u===96?(n.consume(u),d++,m):d===l?(n.exit("codeTextSequence"),n.exit("codeText"),r(u)):(p.type="codeTextData",h(u))}}class YS{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,s){const l=s??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(r,l):r>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(r,s,l){const d=s||0;this.setCursor(Math.trunc(r));const p=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return l&&Fa(this.left,l),p.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Fa(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Fa(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const s=this.left.splice(r,Number.POSITIVE_INFINITY);Fa(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Fa(this.left,s.reverse())}}}function Fa(n,r){let s=0;if(r.length<1e4)n.push(...r);else for(;s<r.length;)n.push(...r.slice(s,s+1e4)),s+=1e4}function k_(n){const r={};let s=-1,l,d,p,f,o,c,h;const m=new YS(n);for(;++s<m.length;){for(;s in r;)s=r[s];if(l=m.get(s),s&&l[1].type==="chunkFlow"&&m.get(s-1)[1].type==="listItemPrefix"&&(c=l[1]._tokenizer.events,p=0,p<c.length&&c[p][1].type==="lineEndingBlank"&&(p+=2),p<c.length&&c[p][1].type==="content"))for(;++p<c.length&&c[p][1].type!=="content";)c[p][1].type==="chunkText"&&(c[p][1]._isInFirstContentOfListItem=!0,p++);if(l[0]==="enter")l[1].contentType&&(Object.assign(r,XS(m,s)),s=r[s],h=!0);else if(l[1]._container){for(p=s,d=void 0;p--;)if(f=m.get(p),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(d&&(m.get(d)[1].type="lineEndingBlank"),f[1].type="lineEnding",d=p);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;d&&(l[1].end={...m.get(d)[1].start},o=m.slice(d,s),o.unshift(l),m.splice(d,s-d+1,o))}}return Ln(n,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function XS(n,r){const s=n.get(r)[1],l=n.get(r)[2];let d=r-1;const p=[];let f=s._tokenizer;f||(f=l.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const o=f.events,c=[],h={};let m,u,b=-1,C=s,T=0,E=0;const S=[E];for(;C;){for(;n.get(++d)[1]!==C;);p.push(d),C._tokenizer||(m=l.sliceStream(C),C.next||m.push(null),u&&f.defineSkip(C.start),C._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(m),C._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),u=C,C=C.next}for(C=s;++b<o.length;)o[b][0]==="exit"&&o[b-1][0]==="enter"&&o[b][1].type===o[b-1][1].type&&o[b][1].start.line!==o[b][1].end.line&&(E=b+1,S.push(E),C._tokenizer=void 0,C.previous=void 0,C=C.next);for(f.events=[],C?(C._tokenizer=void 0,C.previous=void 0):S.pop(),b=S.length;b--;){const v=o.slice(S[b],S[b+1]),_=p.pop();c.push([_,_+v.length-1]),n.splice(_,2,v)}for(c.reverse(),b=-1;++b<c.length;)h[T+c[b][0]]=T+c[b][1],T+=c[b][1]-c[b][0]-1;return h}const QS={resolve:ZS,tokenize:eb},JS={partial:!0,tokenize:tb};function ZS(n){return k_(n),n}function eb(n,r){let s;return l;function l(o){return n.enter("content"),s=n.enter("chunkContent",{contentType:"content"}),d(o)}function d(o){return o===null?p(o):Me(o)?n.check(JS,f,p)(o):(n.consume(o),d)}function p(o){return n.exit("chunkContent"),n.exit("content"),r(o)}function f(o){return n.consume(o),n.exit("chunkContent"),s.next=n.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,d}}function tb(n,r,s){const l=this;return d;function d(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),Xe(n,p,"linePrefix")}function p(f){if(f===null||Me(f))return s(f);const o=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):n.interrupt(l.parser.constructs.flow,s,r)(f)}}function A_(n,r,s,l,d,p,f,o,c){const h=c||Number.POSITIVE_INFINITY;let m=0;return u;function u(v){return v===60?(n.enter(l),n.enter(d),n.enter(p),n.consume(v),n.exit(p),b):v===null||v===32||v===41||Eo(v)?s(v):(n.enter(l),n.enter(f),n.enter(o),n.enter("chunkString",{contentType:"string"}),E(v))}function b(v){return v===62?(n.enter(p),n.consume(v),n.exit(p),n.exit(d),n.exit(l),r):(n.enter(o),n.enter("chunkString",{contentType:"string"}),C(v))}function C(v){return v===62?(n.exit("chunkString"),n.exit(o),b(v)):v===null||v===60||Me(v)?s(v):(n.consume(v),v===92?T:C)}function T(v){return v===60||v===62||v===92?(n.consume(v),C):C(v)}function E(v){return!m&&(v===null||v===41||ut(v))?(n.exit("chunkString"),n.exit(o),n.exit(f),n.exit(l),r(v)):m<h&&v===40?(n.consume(v),m++,E):v===41?(n.consume(v),m--,E):v===null||v===32||v===40||Eo(v)?s(v):(n.consume(v),v===92?S:E)}function S(v){return v===40||v===41||v===92?(n.consume(v),E):E(v)}}function T_(n,r,s,l,d,p){const f=this;let o=0,c;return h;function h(C){return n.enter(l),n.enter(d),n.consume(C),n.exit(d),n.enter(p),m}function m(C){return o>999||C===null||C===91||C===93&&!c||C===94&&!o&&"_hiddenFootnoteSupport"in f.parser.constructs?s(C):C===93?(n.exit(p),n.enter(d),n.consume(C),n.exit(d),n.exit(l),r):Me(C)?(n.enter("lineEnding"),n.consume(C),n.exit("lineEnding"),m):(n.enter("chunkString",{contentType:"string"}),u(C))}function u(C){return C===null||C===91||C===93||Me(C)||o++>999?(n.exit("chunkString"),m(C)):(n.consume(C),c||(c=!Ge(C)),C===92?b:u)}function b(C){return C===91||C===92||C===93?(n.consume(C),o++,u):u(C)}}function R_(n,r,s,l,d,p){let f;return o;function o(b){return b===34||b===39||b===40?(n.enter(l),n.enter(d),n.consume(b),n.exit(d),f=b===40?41:b,c):s(b)}function c(b){return b===f?(n.enter(d),n.consume(b),n.exit(d),n.exit(l),r):(n.enter(p),h(b))}function h(b){return b===f?(n.exit(p),c(f)):b===null?s(b):Me(b)?(n.enter("lineEnding"),n.consume(b),n.exit("lineEnding"),Xe(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===f||b===null||Me(b)?(n.exit("chunkString"),h(b)):(n.consume(b),b===92?u:m)}function u(b){return b===f||b===92?(n.consume(b),m):m(b)}}function Va(n,r){let s;return l;function l(d){return Me(d)?(n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),s=!0,l):Ge(d)?Xe(n,l,s?"linePrefix":"lineSuffix")(d):r(d)}}const nb={name:"definition",tokenize:rb},ib={partial:!0,tokenize:sb};function rb(n,r,s){const l=this;let d;return p;function p(C){return n.enter("definition"),f(C)}function f(C){return T_.call(l,n,o,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(C)}function o(C){return d=ii(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),C===58?(n.enter("definitionMarker"),n.consume(C),n.exit("definitionMarker"),c):s(C)}function c(C){return ut(C)?Va(n,h)(C):h(C)}function h(C){return A_(n,m,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(C)}function m(C){return n.attempt(ib,u,u)(C)}function u(C){return Ge(C)?Xe(n,b,"whitespace")(C):b(C)}function b(C){return C===null||Me(C)?(n.exit("definition"),l.parser.defined.push(d),r(C)):s(C)}}function sb(n,r,s){return l;function l(o){return ut(o)?Va(n,d)(o):s(o)}function d(o){return R_(n,p,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function p(o){return Ge(o)?Xe(n,f,"whitespace")(o):f(o)}function f(o){return o===null||Me(o)?r(o):s(o)}}const ab={name:"hardBreakEscape",tokenize:lb};function lb(n,r,s){return l;function l(p){return n.enter("hardBreakEscape"),n.consume(p),d}function d(p){return Me(p)?(n.exit("hardBreakEscape"),r(p)):s(p)}}const ob={name:"headingAtx",resolve:cb,tokenize:ub};function cb(n,r){let s=n.length-2,l=3,d,p;return n[l][1].type==="whitespace"&&(l+=2),s-2>l&&n[s][1].type==="whitespace"&&(s-=2),n[s][1].type==="atxHeadingSequence"&&(l===s-1||s-4>l&&n[s-2][1].type==="whitespace")&&(s-=l+1===s?2:4),s>l&&(d={type:"atxHeadingText",start:n[l][1].start,end:n[s][1].end},p={type:"chunkText",start:n[l][1].start,end:n[s][1].end,contentType:"text"},Ln(n,l,s-l+1,[["enter",d,r],["enter",p,r],["exit",p,r],["exit",d,r]])),n}function ub(n,r,s){let l=0;return d;function d(m){return n.enter("atxHeading"),p(m)}function p(m){return n.enter("atxHeadingSequence"),f(m)}function f(m){return m===35&&l++<6?(n.consume(m),f):m===null||ut(m)?(n.exit("atxHeadingSequence"),o(m)):s(m)}function o(m){return m===35?(n.enter("atxHeadingSequence"),c(m)):m===null||Me(m)?(n.exit("atxHeading"),r(m)):Ge(m)?Xe(n,o,"whitespace")(m):(n.enter("atxHeadingText"),h(m))}function c(m){return m===35?(n.consume(m),c):(n.exit("atxHeadingSequence"),o(m))}function h(m){return m===null||m===35||ut(m)?(n.exit("atxHeadingText"),o(m)):(n.consume(m),h)}}const hb=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],dg=["pre","script","style","textarea"],fb={concrete:!0,name:"htmlFlow",resolveTo:mb,tokenize:gb},db={partial:!0,tokenize:vb},pb={partial:!0,tokenize:_b};function mb(n){let r=n.length;for(;r--&&!(n[r][0]==="enter"&&n[r][1].type==="htmlFlow"););return r>1&&n[r-2][1].type==="linePrefix"&&(n[r][1].start=n[r-2][1].start,n[r+1][1].start=n[r-2][1].start,n.splice(r-2,2)),n}function gb(n,r,s){const l=this;let d,p,f,o,c;return h;function h(I){return m(I)}function m(I){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(I),u}function u(I){return I===33?(n.consume(I),b):I===47?(n.consume(I),p=!0,E):I===63?(n.consume(I),d=3,l.interrupt?r:O):an(I)?(n.consume(I),f=String.fromCharCode(I),S):s(I)}function b(I){return I===45?(n.consume(I),d=2,C):I===91?(n.consume(I),d=5,o=0,T):an(I)?(n.consume(I),d=4,l.interrupt?r:O):s(I)}function C(I){return I===45?(n.consume(I),l.interrupt?r:O):s(I)}function T(I){const re="CDATA[";return I===re.charCodeAt(o++)?(n.consume(I),o===re.length?l.interrupt?r:U:T):s(I)}function E(I){return an(I)?(n.consume(I),f=String.fromCharCode(I),S):s(I)}function S(I){if(I===null||I===47||I===62||ut(I)){const re=I===47,ve=f.toLowerCase();return!re&&!p&&dg.includes(ve)?(d=1,l.interrupt?r(I):U(I)):hb.includes(f.toLowerCase())?(d=6,re?(n.consume(I),v):l.interrupt?r(I):U(I)):(d=7,l.interrupt&&!l.parser.lazy[l.now().line]?s(I):p?_(I):y(I))}return I===45||tn(I)?(n.consume(I),f+=String.fromCharCode(I),S):s(I)}function v(I){return I===62?(n.consume(I),l.interrupt?r:U):s(I)}function _(I){return Ge(I)?(n.consume(I),_):j(I)}function y(I){return I===47?(n.consume(I),j):I===58||I===95||an(I)?(n.consume(I),A):Ge(I)?(n.consume(I),y):j(I)}function A(I){return I===45||I===46||I===58||I===95||tn(I)?(n.consume(I),A):L(I)}function L(I){return I===61?(n.consume(I),D):Ge(I)?(n.consume(I),L):y(I)}function D(I){return I===null||I===60||I===61||I===62||I===96?s(I):I===34||I===39?(n.consume(I),c=I,R):Ge(I)?(n.consume(I),D):k(I)}function R(I){return I===c?(n.consume(I),c=null,M):I===null||Me(I)?s(I):(n.consume(I),R)}function k(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||ut(I)?L(I):(n.consume(I),k)}function M(I){return I===47||I===62||Ge(I)?y(I):s(I)}function j(I){return I===62?(n.consume(I),H):s(I)}function H(I){return I===null||Me(I)?U(I):Ge(I)?(n.consume(I),H):s(I)}function U(I){return I===45&&d===2?(n.consume(I),G):I===60&&d===1?(n.consume(I),W):I===62&&d===4?(n.consume(I),N):I===63&&d===3?(n.consume(I),O):I===93&&d===5?(n.consume(I),z):Me(I)&&(d===6||d===7)?(n.exit("htmlFlowData"),n.check(db,$,F)(I)):I===null||Me(I)?(n.exit("htmlFlowData"),F(I)):(n.consume(I),U)}function F(I){return n.check(pb,K,$)(I)}function K(I){return n.enter("lineEnding"),n.consume(I),n.exit("lineEnding"),Y}function Y(I){return I===null||Me(I)?F(I):(n.enter("htmlFlowData"),U(I))}function G(I){return I===45?(n.consume(I),O):U(I)}function W(I){return I===47?(n.consume(I),f="",Z):U(I)}function Z(I){if(I===62){const re=f.toLowerCase();return dg.includes(re)?(n.consume(I),N):U(I)}return an(I)&&f.length<8?(n.consume(I),f+=String.fromCharCode(I),Z):U(I)}function z(I){return I===93?(n.consume(I),O):U(I)}function O(I){return I===62?(n.consume(I),N):I===45&&d===2?(n.consume(I),O):U(I)}function N(I){return I===null||Me(I)?(n.exit("htmlFlowData"),$(I)):(n.consume(I),N)}function $(I){return n.exit("htmlFlow"),r(I)}}function _b(n,r,s){const l=this;return d;function d(f){return Me(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),p):s(f)}function p(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}function vb(n,r,s){return l;function l(d){return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),n.attempt(el,r,s)}}const yb={name:"htmlText",tokenize:Sb};function Sb(n,r,s){const l=this;let d,p,f;return o;function o(O){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(O),c}function c(O){return O===33?(n.consume(O),h):O===47?(n.consume(O),L):O===63?(n.consume(O),y):an(O)?(n.consume(O),k):s(O)}function h(O){return O===45?(n.consume(O),m):O===91?(n.consume(O),p=0,T):an(O)?(n.consume(O),_):s(O)}function m(O){return O===45?(n.consume(O),C):s(O)}function u(O){return O===null?s(O):O===45?(n.consume(O),b):Me(O)?(f=u,W(O)):(n.consume(O),u)}function b(O){return O===45?(n.consume(O),C):u(O)}function C(O){return O===62?G(O):O===45?b(O):u(O)}function T(O){const N="CDATA[";return O===N.charCodeAt(p++)?(n.consume(O),p===N.length?E:T):s(O)}function E(O){return O===null?s(O):O===93?(n.consume(O),S):Me(O)?(f=E,W(O)):(n.consume(O),E)}function S(O){return O===93?(n.consume(O),v):E(O)}function v(O){return O===62?G(O):O===93?(n.consume(O),v):E(O)}function _(O){return O===null||O===62?G(O):Me(O)?(f=_,W(O)):(n.consume(O),_)}function y(O){return O===null?s(O):O===63?(n.consume(O),A):Me(O)?(f=y,W(O)):(n.consume(O),y)}function A(O){return O===62?G(O):y(O)}function L(O){return an(O)?(n.consume(O),D):s(O)}function D(O){return O===45||tn(O)?(n.consume(O),D):R(O)}function R(O){return Me(O)?(f=R,W(O)):Ge(O)?(n.consume(O),R):G(O)}function k(O){return O===45||tn(O)?(n.consume(O),k):O===47||O===62||ut(O)?M(O):s(O)}function M(O){return O===47?(n.consume(O),G):O===58||O===95||an(O)?(n.consume(O),j):Me(O)?(f=M,W(O)):Ge(O)?(n.consume(O),M):G(O)}function j(O){return O===45||O===46||O===58||O===95||tn(O)?(n.consume(O),j):H(O)}function H(O){return O===61?(n.consume(O),U):Me(O)?(f=H,W(O)):Ge(O)?(n.consume(O),H):M(O)}function U(O){return O===null||O===60||O===61||O===62||O===96?s(O):O===34||O===39?(n.consume(O),d=O,F):Me(O)?(f=U,W(O)):Ge(O)?(n.consume(O),U):(n.consume(O),K)}function F(O){return O===d?(n.consume(O),d=void 0,Y):O===null?s(O):Me(O)?(f=F,W(O)):(n.consume(O),F)}function K(O){return O===null||O===34||O===39||O===60||O===61||O===96?s(O):O===47||O===62||ut(O)?M(O):(n.consume(O),K)}function Y(O){return O===47||O===62||ut(O)?M(O):s(O)}function G(O){return O===62?(n.consume(O),n.exit("htmlTextData"),n.exit("htmlText"),r):s(O)}function W(O){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(O),n.exit("lineEnding"),Z}function Z(O){return Ge(O)?Xe(n,z,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):z(O)}function z(O){return n.enter("htmlTextData"),f(O)}}const Fh={name:"labelEnd",resolveAll:xb,resolveTo:Eb,tokenize:kb},bb={tokenize:Ab},Cb={tokenize:Tb},wb={tokenize:Rb};function xb(n){let r=-1;const s=[];for(;++r<n.length;){const l=n[r][1];if(s.push(n[r]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const d=l.type==="labelImage"?4:2;l.type="data",r+=d}}return n.length!==s.length&&Ln(n,0,n.length,s),n}function Eb(n,r){let s=n.length,l=0,d,p,f,o;for(;s--;)if(d=n[s][1],p){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;n[s][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(f){if(n[s][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(p=s,d.type!=="labelLink")){l=2;break}}else d.type==="labelEnd"&&(f=s);const c={type:n[p][1].type==="labelLink"?"link":"image",start:{...n[p][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[p][1].start},end:{...n[f][1].end}},m={type:"labelText",start:{...n[p+l+2][1].end},end:{...n[f-2][1].start}};return o=[["enter",c,r],["enter",h,r]],o=Gn(o,n.slice(p+1,p+l+3)),o=Gn(o,[["enter",m,r]]),o=Gn(o,jo(r.parser.constructs.insideSpan.null,n.slice(p+l+4,f-3),r)),o=Gn(o,[["exit",m,r],n[f-2],n[f-1],["exit",h,r]]),o=Gn(o,n.slice(f+1)),o=Gn(o,[["exit",c,r]]),Ln(n,p,n.length,o),n}function kb(n,r,s){const l=this;let d=l.events.length,p,f;for(;d--;)if((l.events[d][1].type==="labelImage"||l.events[d][1].type==="labelLink")&&!l.events[d][1]._balanced){p=l.events[d][1];break}return o;function o(b){return p?p._inactive?u(b):(f=l.parser.defined.includes(ii(l.sliceSerialize({start:p.end,end:l.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(b),n.exit("labelMarker"),n.exit("labelEnd"),c):s(b)}function c(b){return b===40?n.attempt(bb,m,f?m:u)(b):b===91?n.attempt(Cb,m,f?h:u)(b):f?m(b):u(b)}function h(b){return n.attempt(wb,m,u)(b)}function m(b){return r(b)}function u(b){return p._balanced=!0,s(b)}}function Ab(n,r,s){return l;function l(u){return n.enter("resource"),n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),d}function d(u){return ut(u)?Va(n,p)(u):p(u)}function p(u){return u===41?m(u):A_(n,f,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function f(u){return ut(u)?Va(n,c)(u):m(u)}function o(u){return s(u)}function c(u){return u===34||u===39||u===40?R_(n,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):m(u)}function h(u){return ut(u)?Va(n,m)(u):m(u)}function m(u){return u===41?(n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),n.exit("resource"),r):s(u)}}function Tb(n,r,s){const l=this;return d;function d(o){return T_.call(l,n,p,f,"reference","referenceMarker","referenceString")(o)}function p(o){return l.parser.defined.includes(ii(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?r(o):s(o)}function f(o){return s(o)}}function Rb(n,r,s){return l;function l(p){return n.enter("reference"),n.enter("referenceMarker"),n.consume(p),n.exit("referenceMarker"),d}function d(p){return p===93?(n.enter("referenceMarker"),n.consume(p),n.exit("referenceMarker"),n.exit("reference"),r):s(p)}}const Db={name:"labelStartImage",resolveAll:Fh.resolveAll,tokenize:Mb};function Mb(n,r,s){const l=this;return d;function d(o){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(o),n.exit("labelImageMarker"),p}function p(o){return o===91?(n.enter("labelMarker"),n.consume(o),n.exit("labelMarker"),n.exit("labelImage"),f):s(o)}function f(o){return o===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(o):r(o)}}const Lb={name:"labelStartLink",resolveAll:Fh.resolveAll,tokenize:Ob};function Ob(n,r,s){const l=this;return d;function d(f){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelLink"),p}function p(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(f):r(f)}}const Qu={name:"lineEnding",tokenize:Bb};function Bb(n,r){return s;function s(l){return n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),Xe(n,r,"linePrefix")}}const Co={name:"thematicBreak",tokenize:jb};function jb(n,r,s){let l=0,d;return p;function p(h){return n.enter("thematicBreak"),f(h)}function f(h){return d=h,o(h)}function o(h){return h===d?(n.enter("thematicBreakSequence"),c(h)):l>=3&&(h===null||Me(h))?(n.exit("thematicBreak"),r(h)):s(h)}function c(h){return h===d?(n.consume(h),l++,c):(n.exit("thematicBreakSequence"),Ge(h)?Xe(n,o,"whitespace")(h):o(h))}}const _n={continuation:{tokenize:Ib},exit:Pb,name:"list",tokenize:zb},Nb={partial:!0,tokenize:Fb},Hb={partial:!0,tokenize:Ub};function zb(n,r,s){const l=this,d=l.events[l.events.length-1];let p=d&&d[1].type==="linePrefix"?d[2].sliceSerialize(d[1],!0).length:0,f=0;return o;function o(C){const T=l.containerState.type||(C===42||C===43||C===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!l.containerState.marker||C===l.containerState.marker:bh(C)){if(l.containerState.type||(l.containerState.type=T,n.enter(T,{_container:!0})),T==="listUnordered")return n.enter("listItemPrefix"),C===42||C===45?n.check(Co,s,h)(C):h(C);if(!l.interrupt||C===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),c(C)}return s(C)}function c(C){return bh(C)&&++f<10?(n.consume(C),c):(!l.interrupt||f<2)&&(l.containerState.marker?C===l.containerState.marker:C===41||C===46)?(n.exit("listItemValue"),h(C)):s(C)}function h(C){return n.enter("listItemMarker"),n.consume(C),n.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||C,n.check(el,l.interrupt?s:m,n.attempt(Nb,b,u))}function m(C){return l.containerState.initialBlankLine=!0,p++,b(C)}function u(C){return Ge(C)?(n.enter("listItemPrefixWhitespace"),n.consume(C),n.exit("listItemPrefixWhitespace"),b):s(C)}function b(C){return l.containerState.size=p+l.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(C)}}function Ib(n,r,s){const l=this;return l.containerState._closeFlow=void 0,n.check(el,d,p);function d(o){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Xe(n,r,"listItemIndent",l.containerState.size+1)(o)}function p(o){return l.containerState.furtherBlankLines||!Ge(o)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,f(o)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,n.attempt(Hb,r,f)(o))}function f(o){return l.containerState._closeFlow=!0,l.interrupt=void 0,Xe(n,n.attempt(_n,r,s),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Ub(n,r,s){const l=this;return Xe(n,d,"listItemIndent",l.containerState.size+1);function d(p){const f=l.events[l.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===l.containerState.size?r(p):s(p)}}function Pb(n){n.exit(this.containerState.type)}function Fb(n,r,s){const l=this;return Xe(n,d,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(p){const f=l.events[l.events.length-1];return!Ge(p)&&f&&f[1].type==="listItemPrefixWhitespace"?r(p):s(p)}}const pg={name:"setextUnderline",resolveTo:qb,tokenize:$b};function qb(n,r){let s=n.length,l,d,p;for(;s--;)if(n[s][0]==="enter"){if(n[s][1].type==="content"){l=s;break}n[s][1].type==="paragraph"&&(d=s)}else n[s][1].type==="content"&&n.splice(s,1),!p&&n[s][1].type==="definition"&&(p=s);const f={type:"setextHeading",start:{...n[l][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",p?(n.splice(d,0,["enter",f,r]),n.splice(p+1,0,["exit",n[l][1],r]),n[l][1].end={...n[p][1].end}):n[l][1]=f,n.push(["exit",f,r]),n}function $b(n,r,s){const l=this;let d;return p;function p(h){let m=l.events.length,u;for(;m--;)if(l.events[m][1].type!=="lineEnding"&&l.events[m][1].type!=="linePrefix"&&l.events[m][1].type!=="content"){u=l.events[m][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||u)?(n.enter("setextHeadingLine"),d=h,f(h)):s(h)}function f(h){return n.enter("setextHeadingLineSequence"),o(h)}function o(h){return h===d?(n.consume(h),o):(n.exit("setextHeadingLineSequence"),Ge(h)?Xe(n,c,"lineSuffix")(h):c(h))}function c(h){return h===null||Me(h)?(n.exit("setextHeadingLine"),r(h)):s(h)}}const Gb={tokenize:Vb};function Vb(n){const r=this,s=n.attempt(el,l,n.attempt(this.parser.constructs.flowInitial,d,Xe(n,n.attempt(this.parser.constructs.flow,d,n.attempt(QS,d)),"linePrefix")));return s;function l(p){if(p===null){n.consume(p);return}return n.enter("lineEndingBlank"),n.consume(p),n.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function d(p){if(p===null){n.consume(p);return}return n.enter("lineEnding"),n.consume(p),n.exit("lineEnding"),r.currentConstruct=void 0,s}}const Wb={resolveAll:M_()},Kb=D_("string"),Yb=D_("text");function D_(n){return{resolveAll:M_(n==="text"?Xb:void 0),tokenize:r};function r(s){const l=this,d=this.parser.constructs[n],p=s.attempt(d,f,o);return f;function f(m){return h(m)?p(m):o(m)}function o(m){if(m===null){s.consume(m);return}return s.enter("data"),s.consume(m),c}function c(m){return h(m)?(s.exit("data"),p(m)):(s.consume(m),c)}function h(m){if(m===null)return!0;const u=d[m];let b=-1;if(u)for(;++b<u.length;){const C=u[b];if(!C.previous||C.previous.call(l,l.previous))return!0}return!1}}}function M_(n){return r;function r(s,l){let d=-1,p;for(;++d<=s.length;)p===void 0?s[d]&&s[d][1].type==="data"&&(p=d,d++):(!s[d]||s[d][1].type!=="data")&&(d!==p+2&&(s[p][1].end=s[d-1][1].end,s.splice(p+2,d-p-2),d=p+2),p=void 0);return n?n(s,l):s}}function Xb(n,r){let s=0;for(;++s<=n.length;)if((s===n.length||n[s][1].type==="lineEnding")&&n[s-1][1].type==="data"){const l=n[s-1][1],d=r.sliceStream(l);let p=d.length,f=-1,o=0,c;for(;p--;){const h=d[p];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)o++,f--;if(f)break;f=-1}else if(h===-2)c=!0,o++;else if(h!==-1){p++;break}}if(r._contentTypeTextTrailing&&s===n.length&&(o=0),o){const h={type:s===n.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:p?f:l.start._bufferIndex+f,_index:l.start._index+p,line:l.end.line,column:l.end.column-o,offset:l.end.offset-o},end:{...l.end}};l.end={...h.start},l.start.offset===l.end.offset?Object.assign(l,h):(n.splice(s,0,["enter",h,r],["exit",h,r]),s+=2)}s++}return n}const Qb={42:_n,43:_n,45:_n,48:_n,49:_n,50:_n,51:_n,52:_n,53:_n,54:_n,55:_n,56:_n,57:_n,62:w_},Jb={91:nb},Zb={[-2]:Xu,[-1]:Xu,32:Xu},eC={35:ob,42:Co,45:[pg,Co],60:fb,61:pg,95:Co,96:fg,126:fg},tC={38:E_,92:x_},nC={[-5]:Qu,[-4]:Qu,[-3]:Qu,33:Db,38:E_,42:Ch,60:[LS,yb],91:Lb,92:[ab,x_],93:Fh,95:Ch,96:GS},iC={null:[Ch,Wb]},rC={null:[42,95]},sC={null:[]},aC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:rC,contentInitial:Jb,disable:sC,document:Qb,flow:eC,flowInitial:Zb,insideSpan:iC,string:tC,text:nC},Symbol.toStringTag,{value:"Module"}));function lC(n,r,s){let l={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const d={},p=[];let f=[],o=[];const c={attempt:R(L),check:R(D),consume:_,enter:y,exit:A,interrupt:R(D,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:T,parser:n,previous:null,sliceSerialize:b,sliceStream:C,write:u};let m=r.tokenize.call(h,c);return r.resolveAll&&p.push(r),h;function u(H){return f=Gn(f,H),S(),f[f.length-1]!==null?[]:(k(r,0),h.events=jo(p,h.events,h),h.events)}function b(H,U){return cC(C(H),U)}function C(H){return oC(f,H)}function T(){const{_bufferIndex:H,_index:U,line:F,column:K,offset:Y}=l;return{_bufferIndex:H,_index:U,line:F,column:K,offset:Y}}function E(H){d[H.line]=H.column,j()}function S(){let H;for(;l._index<f.length;){const U=f[l._index];if(typeof U=="string")for(H=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===H&&l._bufferIndex<U.length;)v(U.charCodeAt(l._bufferIndex));else v(U)}}function v(H){m=m(H)}function _(H){Me(H)?(l.line++,l.column=1,l.offset+=H===-3?2:1,j()):H!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===f[l._index].length&&(l._bufferIndex=-1,l._index++)),h.previous=H}function y(H,U){const F=U||{};return F.type=H,F.start=T(),h.events.push(["enter",F,h]),o.push(F),F}function A(H){const U=o.pop();return U.end=T(),h.events.push(["exit",U,h]),U}function L(H,U){k(H,U.from)}function D(H,U){U.restore()}function R(H,U){return F;function F(K,Y,G){let W,Z,z,O;return Array.isArray(K)?$(K):"tokenize"in K?$([K]):N(K);function N(ge){return Q;function Q(q){const ee=q!==null&&ge[q],se=q!==null&&ge.null,we=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(se)?se:se?[se]:[]];return $(we)(q)}}function $(ge){return W=ge,Z=0,ge.length===0?G:I(ge[Z])}function I(ge){return Q;function Q(q){return O=M(),z=ge,ge.partial||(h.currentConstruct=ge),ge.name&&h.parser.constructs.disable.null.includes(ge.name)?ve():ge.tokenize.call(U?Object.assign(Object.create(h),U):h,c,re,ve)(q)}}function re(ge){return H(z,O),Y}function ve(ge){return O.restore(),++Z<W.length?I(W[Z]):G}}}function k(H,U){H.resolveAll&&!p.includes(H)&&p.push(H),H.resolve&&Ln(h.events,U,h.events.length-U,H.resolve(h.events.slice(U),h)),H.resolveTo&&(h.events=H.resolveTo(h.events,h))}function M(){const H=T(),U=h.previous,F=h.currentConstruct,K=h.events.length,Y=Array.from(o);return{from:K,restore:G};function G(){l=H,h.previous=U,h.currentConstruct=F,h.events.length=K,o=Y,j()}}function j(){l.line in d&&l.column<2&&(l.column=d[l.line],l.offset+=d[l.line]-1)}}function oC(n,r){const s=r.start._index,l=r.start._bufferIndex,d=r.end._index,p=r.end._bufferIndex;let f;if(s===d)f=[n[s].slice(l,p)];else{if(f=n.slice(s,d),l>-1){const o=f[0];typeof o=="string"?f[0]=o.slice(l):f.shift()}p>0&&f.push(n[d].slice(0,p))}return f}function cC(n,r){let s=-1;const l=[];let d;for(;++s<n.length;){const p=n[s];let f;if(typeof p=="string")f=p;else switch(p){case-5:{f="\r";break}case-4:{f=`
|
|
64
|
+
`;break}case-3:{f=`\r
|
|
65
|
+
`;break}case-2:{f=r?" ":" ";break}case-1:{if(!r&&d)continue;f=" ";break}default:f=String.fromCharCode(p)}d=p===-2,l.push(f)}return l.join("")}function uC(n){const l={constructs:b_([aC,...(n||{}).extensions||[]]),content:d(ES),defined:[],document:d(AS),flow:d(Gb),lazy:{},string:d(Kb),text:d(Yb)};return l;function d(p){return f;function f(o){return lC(l,p,o)}}}function hC(n){for(;!k_(n););return n}const mg=/[\0\t\n\r]/g;function fC(){let n=1,r="",s=!0,l;return d;function d(p,f,o){const c=[];let h,m,u,b,C;for(p=r+(typeof p=="string"?p.toString():new TextDecoder(f||void 0).decode(p)),u=0,r="",s&&(p.charCodeAt(0)===65279&&u++,s=void 0);u<p.length;){if(mg.lastIndex=u,h=mg.exec(p),b=h&&h.index!==void 0?h.index:p.length,C=p.charCodeAt(b),!h){r=p.slice(u);break}if(C===10&&u===b&&l)c.push(-3),l=void 0;else switch(l&&(c.push(-5),l=void 0),u<b&&(c.push(p.slice(u,b)),n+=b-u),C){case 0:{c.push(65533),n++;break}case 9:{for(m=Math.ceil(n/4)*4,c.push(-2);n++<m;)c.push(-1);break}case 10:{c.push(-4),n=1;break}default:l=!0,n=1}u=b+1}return o&&(l&&c.push(-5),r&&c.push(r),c.push(null)),c}}const dC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function pC(n){return n.replace(dC,mC)}function mC(n,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),p=d===120||d===88;return C_(s.slice(p?2:1),p?16:10)}return Ph(s)||n}const L_={}.hasOwnProperty;function gC(n,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),_C(s)(hC(uC(s).document().write(fC()(n,r,!0))))}function _C(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:p(wt),autolinkProtocol:M,autolinkEmail:M,atxHeading:p(Be),blockQuote:p(se),characterEscape:M,characterReference:M,codeFenced:p(we),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:p(we,f),codeText:p(he,f),codeTextData:M,data:M,codeFlowValue:M,definition:p(pe),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:p(ke),hardBreakEscape:p(Ke),hardBreakTrailing:p(Ke),htmlFlow:p(xe,f),htmlFlowData:M,htmlText:p(xe,f),htmlTextData:M,image:p(rt),label:f,link:p(wt),listItem:p(It),listItemValue:b,listOrdered:p(yt,u),listUnordered:p(yt),paragraph:p(yn),reference:I,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:p(Be),strong:p(xt),thematicBreak:p(jt)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:ee,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:ge,characterReference:Q,codeFenced:c(S),codeFencedFence:E,codeFencedFenceInfo:C,codeFencedFenceMeta:T,codeFlowValue:j,codeIndented:c(v),codeText:c(Y),codeTextData:j,data:j,definition:c(),definitionDestinationString:A,definitionLabelString:_,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(F),htmlFlowData:j,htmlText:c(K),htmlTextData:j,image:c(W),label:z,labelText:Z,lineEnding:H,link:c(G),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:re,resourceDestinationString:O,resourceTitleString:N,resource:$,setextHeading:c(k),setextHeadingLineSequence:R,setextHeadingText:D,strong:c(),thematicBreak:c()}};O_(r,(n||{}).mdastExtensions||[]);const s={};return l;function l(ue){let Se={type:"root",children:[]};const Ae={stack:[Se],tokenStack:[],config:r,enter:o,exit:h,buffer:f,resume:m,data:s},Le=[];let je=-1;for(;++je<ue.length;)if(ue[je][1].type==="listOrdered"||ue[je][1].type==="listUnordered")if(ue[je][0]==="enter")Le.push(je);else{const mt=Le.pop();je=d(ue,mt,je)}for(je=-1;++je<ue.length;){const mt=r[ue[je][0]];L_.call(mt,ue[je][1].type)&&mt[ue[je][1].type].call(Object.assign({sliceSerialize:ue[je][2].sliceSerialize},Ae),ue[je][1])}if(Ae.tokenStack.length>0){const mt=Ae.tokenStack[Ae.tokenStack.length-1];(mt[1]||gg).call(Ae,void 0,mt[0])}for(Se.position={start:dr(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:dr(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},je=-1;++je<r.transforms.length;)Se=r.transforms[je](Se)||Se;return Se}function d(ue,Se,Ae){let Le=Se-1,je=-1,mt=!1,Fe,St,vt,Nt;for(;++Le<=Ae;){const Qe=ue[Le];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?je++:je--,Nt=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(Fe&&!Nt&&!je&&!vt&&(vt=Le),Nt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Nt=void 0}if(!je&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||je===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(Fe){let rn=Le;for(St=void 0;rn--;){const Ht=ue[rn];if(Ht[1].type==="lineEnding"||Ht[1].type==="lineEndingBlank"){if(Ht[0]==="exit")continue;St&&(ue[St][1].type="lineEndingBlank",mt=!0),Ht[1].type="lineEnding",St=rn}else if(!(Ht[1].type==="linePrefix"||Ht[1].type==="blockQuotePrefix"||Ht[1].type==="blockQuotePrefixWhitespace"||Ht[1].type==="blockQuoteMarker"||Ht[1].type==="listItemIndent"))break}vt&&(!St||vt<St)&&(Fe._spread=!0),Fe.end=Object.assign({},St?ue[St][1].start:Qe[1].end),ue.splice(St||Le,0,["exit",Fe,Qe[2]]),Le++,Ae++}if(Qe[1].type==="listItemPrefix"){const rn={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};Fe=rn,ue.splice(Le,0,["enter",rn,Qe[2]]),Le++,Ae++,vt=void 0,Nt=!0}}}return ue[Se][1]._spread=mt,Ae}function p(ue,Se){return Ae;function Ae(Le){o.call(this,ue(Le),Le),Se&&Se.call(this,Le)}}function f(){this.stack.push({type:"fragment",children:[]})}function o(ue,Se,Ae){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([Se,Ae||void 0]),ue.position={start:dr(Se.start),end:void 0}}function c(ue){return Se;function Se(Ae){ue&&ue.call(this,Ae),h.call(this,Ae)}}function h(ue,Se){const Ae=this.stack.pop(),Le=this.tokenStack.pop();if(Le)Le[0].type!==ue.type&&(Se?Se.call(this,ue,Le[0]):(Le[1]||gg).call(this,ue,Le[0]));else throw new Error("Cannot close `"+ue.type+"` ("+Ga({start:ue.start,end:ue.end})+"): it’s not open");Ae.position.end=dr(ue.end)}function m(){return Uh(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function b(ue){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function C(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=ue}function T(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=ue}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue.replace(/(\r?\n|\r)$/g,"")}function _(ue){const Se=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=Se,Ae.identifier=ii(this.sliceSerialize(ue)).toLowerCase()}function y(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ue}function A(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ue}function L(ue){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Ae=this.sliceSerialize(ue).length;Se.depth=Ae}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function R(ue){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function M(ue){const Ae=this.stack[this.stack.length-1].children;let Le=Ae[Ae.length-1];(!Le||Le.type!=="text")&&(Le=tt(),Le.position={start:dr(ue.start),end:void 0},Ae.push(Le)),this.stack.push(Le)}function j(ue){const Se=this.stack.pop();Se.value+=this.sliceSerialize(ue),Se.position.end=dr(ue.end)}function H(ue){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=Se.children[Se.children.length-1];Ae.position.end=dr(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Se.type)&&(M.call(this,ue),j.call(this,ue))}function U(){this.data.atHardBreak=!0}function F(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue}function K(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue}function Y(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue}function G(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Se,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function W(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Se,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function Z(ue){const Se=this.sliceSerialize(ue),Ae=this.stack[this.stack.length-2];Ae.label=pC(Se),Ae.identifier=ii(Se).toLowerCase()}function z(){const ue=this.stack[this.stack.length-1],Se=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const Le=ue.children;Ae.children=Le}else Ae.alt=Se}function O(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ue}function N(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ue}function $(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function re(ue){const Se=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=Se,Ae.identifier=ii(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function ve(ue){this.data.characterReferenceType=ue.type}function ge(ue){const Se=this.sliceSerialize(ue),Ae=this.data.characterReferenceType;let Le;Ae?(Le=C_(Se,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=Ph(Se);const je=this.stack[this.stack.length-1];je.value+=Le}function Q(ue){const Se=this.stack.pop();Se.position.end=dr(ue.end)}function q(ue){j.call(this,ue);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(ue)}function ee(ue){j.call(this,ue);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(ue)}function se(){return{type:"blockquote",children:[]}}function we(){return{type:"code",lang:null,meta:null,value:""}}function he(){return{type:"inlineCode",value:""}}function pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ke(){return{type:"emphasis",children:[]}}function Be(){return{type:"heading",depth:0,children:[]}}function Ke(){return{type:"break"}}function xe(){return{type:"html",value:""}}function rt(){return{type:"image",title:null,url:"",alt:null}}function wt(){return{type:"link",title:null,url:"",children:[]}}function yt(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function It(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function yn(){return{type:"paragraph",children:[]}}function xt(){return{type:"strong",children:[]}}function tt(){return{type:"text",value:""}}function jt(){return{type:"thematicBreak"}}}function dr(n){return{line:n.line,column:n.column,offset:n.offset}}function O_(n,r){let s=-1;for(;++s<r.length;){const l=r[s];Array.isArray(l)?O_(n,l):vC(n,l)}}function vC(n,r){let s;for(s in r)if(L_.call(r,s))switch(s){case"canContainEols":{const l=r[s];l&&n[s].push(...l);break}case"transforms":{const l=r[s];l&&n[s].push(...l);break}case"enter":case"exit":{const l=r[s];l&&Object.assign(n[s],l);break}}}function gg(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+Ga({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+Ga({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+Ga({start:r.start,end:r.end})+") is still open")}function yC(n){const r=this;r.parser=s;function s(l){return gC(l,{...r.data("settings"),...n,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function SC(n,r){const s={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(r),!0)};return n.patch(r,s),n.applyData(r,s)}function bC(n,r){const s={type:"element",tagName:"br",properties:{},children:[]};return n.patch(r,s),[n.applyData(r,s),{type:"text",value:`
|
|
66
|
+
`}]}function CC(n,r){const s=r.value?r.value+`
|
|
67
|
+
`:"",l={},d=r.lang?r.lang.split(/\s+/):[];d.length>0&&(l.className=["language-"+d[0]]);let p={type:"element",tagName:"code",properties:l,children:[{type:"text",value:s}]};return r.meta&&(p.data={meta:r.meta}),n.patch(r,p),p=n.applyData(r,p),p={type:"element",tagName:"pre",properties:{},children:[p]},n.patch(r,p),p}function wC(n,r){const s={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function xC(n,r){const s={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function EC(n,r){const s=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",l=String(r.identifier).toUpperCase(),d=qs(l.toLowerCase()),p=n.footnoteOrder.indexOf(l);let f,o=n.footnoteCounts.get(l);o===void 0?(o=0,n.footnoteOrder.push(l),f=n.footnoteOrder.length):f=p+1,o+=1,n.footnoteCounts.set(l,o);const c={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+d,id:s+"fnref-"+d+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(r,c);const h={type:"element",tagName:"sup",properties:{},children:[c]};return n.patch(r,h),n.applyData(r,h)}function kC(n,r){const s={type:"element",tagName:"h"+r.depth,properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function AC(n,r){if(n.options.allowDangerousHtml){const s={type:"raw",value:r.value};return n.patch(r,s),n.applyData(r,s)}}function B_(n,r){const s=r.referenceType;let l="]";if(s==="collapsed"?l+="[]":s==="full"&&(l+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+l}];const d=n.all(r),p=d[0];p&&p.type==="text"?p.value="["+p.value:d.unshift({type:"text",value:"["});const f=d[d.length-1];return f&&f.type==="text"?f.value+=l:d.push({type:"text",value:l}),d}function TC(n,r){const s=String(r.identifier).toUpperCase(),l=n.definitionById.get(s);if(!l)return B_(n,r);const d={src:qs(l.url||""),alt:r.alt};l.title!==null&&l.title!==void 0&&(d.title=l.title);const p={type:"element",tagName:"img",properties:d,children:[]};return n.patch(r,p),n.applyData(r,p)}function RC(n,r){const s={src:qs(r.url)};r.alt!==null&&r.alt!==void 0&&(s.alt=r.alt),r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,l),n.applyData(r,l)}function DC(n,r){const s={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,s);const l={type:"element",tagName:"code",properties:{},children:[s]};return n.patch(r,l),n.applyData(r,l)}function MC(n,r){const s=String(r.identifier).toUpperCase(),l=n.definitionById.get(s);if(!l)return B_(n,r);const d={href:qs(l.url||"")};l.title!==null&&l.title!==void 0&&(d.title=l.title);const p={type:"element",tagName:"a",properties:d,children:n.all(r)};return n.patch(r,p),n.applyData(r,p)}function LC(n,r){const s={href:qs(r.url)};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,l),n.applyData(r,l)}function OC(n,r,s){const l=n.all(r),d=s?BC(s):j_(r),p={},f=[];if(typeof r.checked=="boolean"){const m=l[0];let u;m&&m.type==="element"&&m.tagName==="p"?u=m:(u={type:"element",tagName:"p",properties:{},children:[]},l.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),p.className=["task-list-item"]}let o=-1;for(;++o<l.length;){const m=l[o];(d||o!==0||m.type!=="element"||m.tagName!=="p")&&f.push({type:"text",value:`
|
|
68
|
+
`}),m.type==="element"&&m.tagName==="p"&&!d?f.push(...m.children):f.push(m)}const c=l[l.length-1];c&&(d||c.type!=="element"||c.tagName!=="p")&&f.push({type:"text",value:`
|
|
69
|
+
`});const h={type:"element",tagName:"li",properties:p,children:f};return n.patch(r,h),n.applyData(r,h)}function BC(n){let r=!1;if(n.type==="list"){r=n.spread||!1;const s=n.children;let l=-1;for(;!r&&++l<s.length;)r=j_(s[l])}return r}function j_(n){const r=n.spread;return r??n.children.length>1}function jC(n,r){const s={},l=n.all(r);let d=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++d<l.length;){const f=l[d];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const p={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:n.wrap(l,!0)};return n.patch(r,p),n.applyData(r,p)}function NC(n,r){const s={type:"element",tagName:"p",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function HC(n,r){const s={type:"root",children:n.wrap(n.all(r))};return n.patch(r,s),n.applyData(r,s)}function zC(n,r){const s={type:"element",tagName:"strong",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function IC(n,r){const s=n.all(r),l=s.shift(),d=[];if(l){const f={type:"element",tagName:"thead",properties:{},children:n.wrap([l],!0)};n.patch(r.children[0],f),d.push(f)}if(s.length>0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(s,!0)},o=Nh(r.children[1]),c=p_(r.children[r.children.length-1]);o&&c&&(f.position={start:o,end:c}),d.push(f)}const p={type:"element",tagName:"table",properties:{},children:n.wrap(d,!0)};return n.patch(r,p),n.applyData(r,p)}function UC(n,r,s){const l=s?s.children:void 0,p=(l?l.indexOf(r):1)===0?"th":"td",f=s&&s.type==="table"?s.align:void 0,o=f?f.length:r.children.length;let c=-1;const h=[];for(;++c<o;){const u=r.children[c],b={},C=f?f[c]:void 0;C&&(b.align=C);let T={type:"element",tagName:p,properties:b,children:[]};u&&(T.children=n.all(u),n.patch(u,T),T=n.applyData(u,T)),h.push(T)}const m={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(r,m),n.applyData(r,m)}function PC(n,r){const s={type:"element",tagName:"td",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}const _g=9,vg=32;function FC(n){const r=String(n),s=/\r?\n|\r/g;let l=s.exec(r),d=0;const p=[];for(;l;)p.push(yg(r.slice(d,l.index),d>0,!0),l[0]),d=l.index+l[0].length,l=s.exec(r);return p.push(yg(r.slice(d),d>0,!1)),p.join("")}function yg(n,r,s){let l=0,d=n.length;if(r){let p=n.codePointAt(l);for(;p===_g||p===vg;)l++,p=n.codePointAt(l)}if(s){let p=n.codePointAt(d-1);for(;p===_g||p===vg;)d--,p=n.codePointAt(d-1)}return d>l?n.slice(l,d):""}function qC(n,r){const s={type:"text",value:FC(String(r.value))};return n.patch(r,s),n.applyData(r,s)}function $C(n,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,s),n.applyData(r,s)}const GC={blockquote:SC,break:bC,code:CC,delete:wC,emphasis:xC,footnoteReference:EC,heading:kC,html:AC,imageReference:TC,image:RC,inlineCode:DC,linkReference:MC,link:LC,listItem:OC,list:jC,paragraph:NC,root:HC,strong:zC,table:IC,tableCell:PC,tableRow:UC,text:qC,thematicBreak:$C,toml:go,yaml:go,definition:go,footnoteDefinition:go};function go(){}const N_=-1,No=0,Wa=1,ko=2,qh=3,$h=4,Gh=5,Vh=6,H_=7,z_=8,VC=typeof self=="object"?self:globalThis,Sg=(n,r)=>{switch(n){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+n)}return new VC[n](r)},WC=(n,r)=>{const s=(d,p)=>(n.set(p,d),d),l=d=>{if(n.has(d))return n.get(d);const[p,f]=r[d];switch(p){case No:case N_:return s(f,d);case Wa:{const o=s([],d);for(const c of f)o.push(l(c));return o}case ko:{const o=s({},d);for(const[c,h]of f)o[l(c)]=l(h);return o}case qh:return s(new Date(f),d);case $h:{const{source:o,flags:c}=f;return s(new RegExp(o,c),d)}case Gh:{const o=s(new Map,d);for(const[c,h]of f)o.set(l(c),l(h));return o}case Vh:{const o=s(new Set,d);for(const c of f)o.add(l(c));return o}case H_:{const{name:o,message:c}=f;return s(Sg(o,c),d)}case z_:return s(BigInt(f),d);case"BigInt":return s(Object(BigInt(f)),d);case"ArrayBuffer":return s(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:o}=new Uint8Array(f);return s(new DataView(o),f)}}return s(Sg(p,f),d)};return l},bg=n=>WC(new Map,n)(0),Bs="",{toString:KC}={},{keys:YC}=Object,qa=n=>{const r=typeof n;if(r!=="object"||!n)return[No,r];const s=KC.call(n).slice(8,-1);switch(s){case"Array":return[Wa,Bs];case"Object":return[ko,Bs];case"Date":return[qh,Bs];case"RegExp":return[$h,Bs];case"Map":return[Gh,Bs];case"Set":return[Vh,Bs];case"DataView":return[Wa,s]}return s.includes("Array")?[Wa,s]:s.includes("Error")?[H_,s]:[ko,s]},_o=([n,r])=>n===No&&(r==="function"||r==="symbol"),XC=(n,r,s,l)=>{const d=(f,o)=>{const c=l.push(f)-1;return s.set(o,c),c},p=f=>{if(s.has(f))return s.get(f);let[o,c]=qa(f);switch(o){case No:{let m=f;switch(c){case"bigint":o=z_,m=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+c);m=null;break;case"undefined":return d([N_],f)}return d([o,m],f)}case Wa:{if(c){let b=f;return c==="DataView"?b=new Uint8Array(f.buffer):c==="ArrayBuffer"&&(b=new Uint8Array(f)),d([c,[...b]],f)}const m=[],u=d([o,m],f);for(const b of f)m.push(p(b));return u}case ko:{if(c)switch(c){case"BigInt":return d([c,f.toString()],f);case"Boolean":case"Number":case"String":return d([c,f.valueOf()],f)}if(r&&"toJSON"in f)return p(f.toJSON());const m=[],u=d([o,m],f);for(const b of YC(f))(n||!_o(qa(f[b])))&&m.push([p(b),p(f[b])]);return u}case qh:return d([o,f.toISOString()],f);case $h:{const{source:m,flags:u}=f;return d([o,{source:m,flags:u}],f)}case Gh:{const m=[],u=d([o,m],f);for(const[b,C]of f)(n||!(_o(qa(b))||_o(qa(C))))&&m.push([p(b),p(C)]);return u}case Vh:{const m=[],u=d([o,m],f);for(const b of f)(n||!_o(qa(b)))&&m.push(p(b));return u}}const{message:h}=f;return d([o,{name:c,message:h}],f)};return p},Cg=(n,{json:r,lossy:s}={})=>{const l=[];return XC(!(r||s),!!r,new Map,l)(n),l},Ao=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?bg(Cg(n,r)):structuredClone(n):(n,r)=>bg(Cg(n,r));function QC(n,r){const s=[{type:"text",value:"↩"}];return r>1&&s.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),s}function JC(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function ZC(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",s=n.options.footnoteBackContent||QC,l=n.options.footnoteBackLabel||JC,d=n.options.footnoteLabel||"Footnotes",p=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<n.footnoteOrder.length;){const h=n.footnoteById.get(n.footnoteOrder[c]);if(!h)continue;const m=n.all(h),u=String(h.identifier).toUpperCase(),b=qs(u.toLowerCase());let C=0;const T=[],E=n.footnoteCounts.get(u);for(;E!==void 0&&++C<=E;){T.length>0&&T.push({type:"text",value:" "});let _=typeof s=="string"?s:s(c,C);typeof _=="string"&&(_={type:"text",value:_}),T.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+b+(C>1?"-"+C:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(c,C),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const S=m[m.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const _=S.children[S.children.length-1];_&&_.type==="text"?_.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...T)}else m.push(...T);const v={type:"element",tagName:"li",properties:{id:r+"fn-"+b},children:n.wrap(m,!0)};n.patch(h,v),o.push(v)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:p,properties:{...Ao(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
|
|
70
|
+
`},{type:"element",tagName:"ol",properties:{},children:n.wrap(o,!0)},{type:"text",value:`
|
|
71
|
+
`}]}}const Ho=(function(n){if(n==null)return iw;if(typeof n=="function")return zo(n);if(typeof n=="object")return Array.isArray(n)?ew(n):tw(n);if(typeof n=="string")return nw(n);throw new Error("Expected function, string, or object as test")});function ew(n){const r=[];let s=-1;for(;++s<n.length;)r[s]=Ho(n[s]);return zo(l);function l(...d){let p=-1;for(;++p<r.length;)if(r[p].apply(this,d))return!0;return!1}}function tw(n){const r=n;return zo(s);function s(l){const d=l;let p;for(p in n)if(d[p]!==r[p])return!1;return!0}}function nw(n){return zo(r);function r(s){return s&&s.type===n}}function zo(n){return r;function r(s,l,d){return!!(rw(s)&&n.call(this,s,typeof l=="number"?l:void 0,d||void 0))}}function iw(){return!0}function rw(n){return n!==null&&typeof n=="object"&&"type"in n}const I_=[],sw=!0,wh=!1,aw="skip";function U_(n,r,s,l){let d;typeof r=="function"&&typeof s!="function"?(l=s,s=r):d=r;const p=Ho(d),f=l?-1:1;o(n,void 0,[])();function o(c,h,m){const u=c&&typeof c=="object"?c:{};if(typeof u.type=="string"){const C=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(c.type+(C?"<"+C+">":""))+")"})}return b;function b(){let C=I_,T,E,S;if((!r||p(c,h,m[m.length-1]||void 0))&&(C=lw(s(c,m)),C[0]===wh))return C;if("children"in c&&c.children){const v=c;if(v.children&&C[0]!==aw)for(E=(l?v.children.length:-1)+f,S=m.concat(v);E>-1&&E<v.children.length;){const _=v.children[E];if(T=o(_,E,S)(),T[0]===wh)return T;E=typeof T[1]=="number"?T[1]:E+f}}return C}}}function lw(n){return Array.isArray(n)?n:typeof n=="number"?[sw,n]:n==null?I_:[n]}function Wh(n,r,s,l){let d,p,f;typeof r=="function"&&typeof s!="function"?(p=void 0,f=r,d=s):(p=r,f=s,d=l),U_(n,p,o,d);function o(c,h){const m=h[h.length-1],u=m?m.children.indexOf(c):void 0;return f(c,u,m)}}const xh={}.hasOwnProperty,ow={};function cw(n,r){const s=r||ow,l=new Map,d=new Map,p=new Map,f={...GC,...s.handlers},o={all:h,applyData:hw,definitionById:l,footnoteById:d,footnoteCounts:p,footnoteOrder:[],handlers:f,one:c,options:s,patch:uw,wrap:dw};return Wh(n,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const u=m.type==="definition"?l:d,b=String(m.identifier).toUpperCase();u.has(b)||u.set(b,m)}}),o;function c(m,u){const b=m.type,C=o.handlers[b];if(xh.call(o.handlers,b)&&C)return C(o,m,u);if(o.options.passThrough&&o.options.passThrough.includes(b)){if("children"in m){const{children:E,...S}=m,v=Ao(S);return v.children=o.all(m),v}return Ao(m)}return(o.options.unknownHandler||fw)(o,m,u)}function h(m){const u=[];if("children"in m){const b=m.children;let C=-1;for(;++C<b.length;){const T=o.one(b[C],m);if(T){if(C&&b[C-1].type==="break"&&(!Array.isArray(T)&&T.type==="text"&&(T.value=wg(T.value)),!Array.isArray(T)&&T.type==="element")){const E=T.children[0];E&&E.type==="text"&&(E.value=wg(E.value))}Array.isArray(T)?u.push(...T):u.push(T)}}}return u}}function uw(n,r){n.position&&(r.position=Q1(n))}function hw(n,r){let s=r;if(n&&n.data){const l=n.data.hName,d=n.data.hChildren,p=n.data.hProperties;if(typeof l=="string")if(s.type==="element")s.tagName=l;else{const f="children"in s?s.children:[s];s={type:"element",tagName:l,properties:{},children:f}}s.type==="element"&&p&&Object.assign(s.properties,Ao(p)),"children"in s&&s.children&&d!==null&&d!==void 0&&(s.children=d)}return s}function fw(n,r){const s=r.data||{},l="value"in r&&!(xh.call(s,"hProperties")||xh.call(s,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:n.all(r)};return n.patch(r,l),n.applyData(r,l)}function dw(n,r){const s=[];let l=-1;for(r&&s.push({type:"text",value:`
|
|
72
|
+
`});++l<n.length;)l&&s.push({type:"text",value:`
|
|
73
|
+
`}),s.push(n[l]);return r&&n.length>0&&s.push({type:"text",value:`
|
|
74
|
+
`}),s}function wg(n){let r=0,s=n.charCodeAt(r);for(;s===9||s===32;)r++,s=n.charCodeAt(r);return n.slice(r)}function xg(n,r){const s=cw(n,r),l=s.one(n,void 0),d=ZC(s),p=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return d&&p.children.push({type:"text",value:`
|
|
75
|
+
`},d),p}function pw(n,r){return n&&"run"in n?async function(s,l){const d=xg(s,{file:l,...r});await n.run(d,l)}:function(s,l){return xg(s,{file:l,...n||r})}}function Eg(n){if(n)throw n}var Ju,kg;function mw(){if(kg)return Ju;kg=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=function(h){return typeof Array.isArray=="function"?Array.isArray(h):r.call(h)==="[object Array]"},p=function(h){if(!h||r.call(h)!=="[object Object]")return!1;var m=n.call(h,"constructor"),u=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!u)return!1;var b;for(b in h);return typeof b>"u"||n.call(h,b)},f=function(h,m){s&&m.name==="__proto__"?s(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},o=function(h,m){if(m==="__proto__")if(n.call(h,m)){if(l)return l(h,m).value}else return;return h[m]};return Ju=function c(){var h,m,u,b,C,T,E=arguments[0],S=1,v=arguments.length,_=!1;for(typeof E=="boolean"&&(_=E,E=arguments[1]||{},S=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});S<v;++S)if(h=arguments[S],h!=null)for(m in h)u=o(E,m),b=o(h,m),E!==b&&(_&&b&&(p(b)||(C=d(b)))?(C?(C=!1,T=u&&d(u)?u:[]):T=u&&p(u)?u:{},f(E,{name:m,newValue:c(_,T,b)})):typeof b<"u"&&f(E,{name:m,newValue:b}));return E},Ju}var gw=mw();const Zu=Qg(gw);function Eh(n){if(typeof n!="object"||n===null)return!1;const r=Object.getPrototypeOf(n);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function _w(){const n=[],r={run:s,use:l};return r;function s(...d){let p=-1;const f=d.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);o(null,...d);function o(c,...h){const m=n[++p];let u=-1;if(c){f(c);return}for(;++u<d.length;)(h[u]===null||h[u]===void 0)&&(h[u]=d[u]);d=h,m?vw(m,o)(...h):f(null,...h)}}function l(d){if(typeof d!="function")throw new TypeError("Expected `middelware` to be a function, not "+d);return n.push(d),r}}function vw(n,r){let s;return l;function l(...f){const o=n.length>f.length;let c;o&&f.push(d);try{c=n.apply(this,f)}catch(h){const m=h;if(o&&s)throw m;return d(m)}o||(c&&c.then&&typeof c.then=="function"?c.then(p,d):c instanceof Error?d(c):p(c))}function d(f,...o){s||(s=!0,r(f,...o))}function p(f){d(null,f)}}const fi={basename:yw,dirname:Sw,extname:bw,join:Cw,sep:"/"};function yw(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');tl(n);let s=0,l=-1,d=n.length,p;if(r===void 0||r.length===0||r.length>n.length){for(;d--;)if(n.codePointAt(d)===47){if(p){s=d+1;break}}else l<0&&(p=!0,l=d+1);return l<0?"":n.slice(s,l)}if(r===n)return"";let f=-1,o=r.length-1;for(;d--;)if(n.codePointAt(d)===47){if(p){s=d+1;break}}else f<0&&(p=!0,f=d+1),o>-1&&(n.codePointAt(d)===r.codePointAt(o--)?o<0&&(l=d):(o=-1,l=f));return s===l?l=f:l<0&&(l=n.length),n.slice(s,l)}function Sw(n){if(tl(n),n.length===0)return".";let r=-1,s=n.length,l;for(;--s;)if(n.codePointAt(s)===47){if(l){r=s;break}}else l||(l=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function bw(n){tl(n);let r=n.length,s=-1,l=0,d=-1,p=0,f;for(;r--;){const o=n.codePointAt(r);if(o===47){if(f){l=r+1;break}continue}s<0&&(f=!0,s=r+1),o===46?d<0?d=r:p!==1&&(p=1):d>-1&&(p=-1)}return d<0||s<0||p===0||p===1&&d===s-1&&d===l+1?"":n.slice(d,s)}function Cw(...n){let r=-1,s;for(;++r<n.length;)tl(n[r]),n[r]&&(s=s===void 0?n[r]:s+"/"+n[r]);return s===void 0?".":ww(s)}function ww(n){tl(n);const r=n.codePointAt(0)===47;let s=xw(n,!r);return s.length===0&&!r&&(s="."),s.length>0&&n.codePointAt(n.length-1)===47&&(s+="/"),r?"/"+s:s}function xw(n,r){let s="",l=0,d=-1,p=0,f=-1,o,c;for(;++f<=n.length;){if(f<n.length)o=n.codePointAt(f);else{if(o===47)break;o=47}if(o===47){if(!(d===f-1||p===1))if(d!==f-1&&p===2){if(s.length<2||l!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(c=s.lastIndexOf("/"),c!==s.length-1){c<0?(s="",l=0):(s=s.slice(0,c),l=s.length-1-s.lastIndexOf("/")),d=f,p=0;continue}}else if(s.length>0){s="",l=0,d=f,p=0;continue}}r&&(s=s.length>0?s+"/..":"..",l=2)}else s.length>0?s+="/"+n.slice(d+1,f):s=n.slice(d+1,f),l=f-d-1;d=f,p=0}else o===46&&p>-1?p++:p=-1}return s}function tl(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const Ew={cwd:kw};function kw(){return"/"}function kh(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function Aw(n){if(typeof n=="string")n=new URL(n);else if(!kh(n)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(n.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return Tw(n)}function Tw(n){if(n.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const r=n.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const l=r.codePointAt(s+2);if(l===70||l===102){const d=new TypeError("File URL path must not include encoded / characters");throw d.code="ERR_INVALID_FILE_URL_PATH",d}}return decodeURIComponent(r)}const eh=["history","path","basename","stem","extname","dirname"];class P_{constructor(r){let s;r?kh(r)?s={path:r}:typeof r=="string"||Rw(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":Ew.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<eh.length;){const p=eh[l];p in s&&s[p]!==void 0&&s[p]!==null&&(this[p]=p==="history"?[...s[p]]:s[p])}let d;for(d in s)eh.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?fi.basename(this.path):void 0}set basename(r){nh(r,"basename"),th(r,"basename"),this.path=fi.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?fi.dirname(this.path):void 0}set dirname(r){Ag(this.basename,"dirname"),this.path=fi.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?fi.extname(this.path):void 0}set extname(r){if(th(r,"extname"),Ag(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=fi.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){kh(r)&&(r=Aw(r)),nh(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?fi.basename(this.path,this.extname):void 0}set stem(r){nh(r,"stem"),th(r,"stem"),this.path=fi.join(this.dirname||"",r+(this.extname||""))}fail(r,s,l){const d=this.message(r,s,l);throw d.fatal=!0,d}info(r,s,l){const d=this.message(r,s,l);return d.fatal=void 0,d}message(r,s,l){const d=new nn(r,s,l);return this.path&&(d.name=this.path+":"+d.name,d.file=this.path),d.fatal=!1,this.messages.push(d),d}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function th(n,r){if(n&&n.includes(fi.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+fi.sep+"`")}function nh(n,r){if(!n)throw new Error("`"+r+"` cannot be empty")}function Ag(n,r){if(!n)throw new Error("Setting `"+r+"` requires `path` to be set too")}function Rw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Dw=(function(n){const l=this.constructor.prototype,d=l[n],p=function(){return d.apply(p,arguments)};return Object.setPrototypeOf(p,l),p}),Mw={}.hasOwnProperty;class Kh extends Dw{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=_w()}copy(){const r=new Kh;let s=-1;for(;++s<this.attachers.length;){const l=this.attachers[s];r.use(...l)}return r.data(Zu(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(sh("data",this.frozen),this.namespace[r]=s,this):Mw.call(this.namespace,r)&&this.namespace[r]||void 0:r?(sh("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const d=s.call(r,...l);typeof d=="function"&&this.transformers.use(d)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=vo(r),l=this.parser||this.Parser;return ih("parse",l),l(String(s),s)}process(r,s){const l=this;return this.freeze(),ih("process",this.parser||this.Parser),rh("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(p,f){const o=vo(r),c=l.parse(o);l.run(c,o,function(m,u,b){if(m||!u||!b)return h(m);const C=u,T=l.stringify(C,b);Bw(T)?b.value=T:b.result=T,h(m,b)});function h(m,u){m||!u?f(m):p?p(u):s(void 0,u)}}}processSync(r){let s=!1,l;return this.freeze(),ih("processSync",this.parser||this.Parser),rh("processSync",this.compiler||this.Compiler),this.process(r,d),Rg("processSync","process",s),l;function d(p,f){s=!0,Eg(p),l=f}}run(r,s,l){Tg(r),this.freeze();const d=this.transformers;return!l&&typeof s=="function"&&(l=s,s=void 0),l?p(void 0,l):new Promise(p);function p(f,o){const c=vo(s);d.run(r,c,h);function h(m,u,b){const C=u||r;m?o(m):f?f(C):l(void 0,C,b)}}}runSync(r,s){let l=!1,d;return this.run(r,s,p),Rg("runSync","run",l),d;function p(f,o){Eg(f),d=o,l=!0}}stringify(r,s){this.freeze();const l=vo(s),d=this.compiler||this.Compiler;return rh("stringify",d),Tg(r),d(r,l)}use(r,...s){const l=this.attachers,d=this.namespace;if(sh("use",this.frozen),r!=null)if(typeof r=="function")c(r,s);else if(typeof r=="object")Array.isArray(r)?o(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function p(h){if(typeof h=="function")c(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...u]=h;c(m,u)}else f(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function f(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(h.plugins),h.settings&&(d.settings=Zu(!0,d.settings,h.settings))}function o(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const u=h[m];p(u)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function c(h,m){let u=-1,b=-1;for(;++u<l.length;)if(l[u][0]===h){b=u;break}if(b===-1)l.push([h,...m]);else if(m.length>0){let[C,...T]=m;const E=l[b][1];Eh(E)&&Eh(C)&&(C=Zu(!0,E,C)),l[b]=[h,C,...T]}}}}const Lw=new Kh().freeze();function ih(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function rh(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function sh(n,r){if(r)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Tg(n){if(!Eh(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Rg(n,r,s){if(!s)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function vo(n){return Ow(n)?n:new P_(n)}function Ow(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function Bw(n){return typeof n=="string"||jw(n)}function jw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Nw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Dg=[],Mg={allowDangerousHtml:!0},Hw=/^(https?|ircs?|mailto|xmpp)$/i,zw=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function F_(n){const r=Iw(n),s=Uw(n);return Pw(r.runSync(r.parse(s),s),n)}function Iw(n){const r=n.rehypePlugins||Dg,s=n.remarkPlugins||Dg,l=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Mg}:Mg;return Lw().use(yC).use(s).use(pw,l).use(r)}function Uw(n){const r=n.children||"",s=new P_;return typeof r=="string"&&(s.value=r),s}function Pw(n,r){const s=r.allowedElements,l=r.allowElement,d=r.components,p=r.disallowedElements,f=r.skipHtml,o=r.unwrapDisallowed,c=r.urlTransform||Fw;for(const m of zw)Object.hasOwn(r,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+Nw+m.id,void 0);return Wh(n,h),nS(n,{Fragment:x.Fragment,components:d,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function h(m,u,b){if(m.type==="raw"&&b&&typeof u=="number")return f?b.children.splice(u,1):b.children[u]={type:"text",value:m.value},u;if(m.type==="element"){let C;for(C in Yu)if(Object.hasOwn(Yu,C)&&Object.hasOwn(m.properties,C)){const T=m.properties[C],E=Yu[C];(E===null||E.includes(m.tagName))&&(m.properties[C]=c(String(T||""),C,m))}}if(m.type==="element"){let C=s?!s.includes(m.tagName):p?p.includes(m.tagName):!1;if(!C&&l&&typeof u=="number"&&(C=!l(m,u,b)),C&&b&&typeof u=="number")return o&&m.children?b.children.splice(u,1,...m.children):b.children.splice(u,1),u}}}function Fw(n){const r=n.indexOf(":"),s=n.indexOf("?"),l=n.indexOf("#"),d=n.indexOf("/");return r===-1||d!==-1&&r>d||s!==-1&&r>s||l!==-1&&r>l||Hw.test(n.slice(0,r))?n:""}function Lg(n,r){const s=String(n);if(typeof r!="string")throw new TypeError("Expected character");let l=0,d=s.indexOf(r);for(;d!==-1;)l++,d=s.indexOf(r,d+r.length);return l}function qw(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function $w(n,r,s){const d=Ho((s||{}).ignore||[]),p=Gw(r);let f=-1;for(;++f<p.length;)U_(n,"text",o);function o(h,m){let u=-1,b;for(;++u<m.length;){const C=m[u],T=b?b.children:void 0;if(d(C,T?T.indexOf(C):void 0,b))return;b=C}if(b)return c(h,m)}function c(h,m){const u=m[m.length-1],b=p[f][0],C=p[f][1];let T=0;const S=u.children.indexOf(h);let v=!1,_=[];b.lastIndex=0;let y=b.exec(h.value);for(;y;){const A=y.index,L={index:y.index,input:y.input,stack:[...m,h]};let D=C(...y,L);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?b.lastIndex=A+1:(T!==A&&_.push({type:"text",value:h.value.slice(T,A)}),Array.isArray(D)?_.push(...D):D&&_.push(D),T=A+y[0].length,v=!0),!b.global)break;y=b.exec(h.value)}return v?(T<h.value.length&&_.push({type:"text",value:h.value.slice(T)}),u.children.splice(S,1,..._)):_=[h],S+_.length}}function Gw(n){const r=[];if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const s=!n[0]||Array.isArray(n[0])?n:[n];let l=-1;for(;++l<s.length;){const d=s[l];r.push([Vw(d[0]),Ww(d[1])])}return r}function Vw(n){return typeof n=="string"?new RegExp(qw(n),"g"):n}function Ww(n){return typeof n=="function"?n:function(){return n}}const ah="phrasing",lh=["autolink","link","image","label"];function Kw(){return{transforms:[tx],enter:{literalAutolink:Xw,literalAutolinkEmail:oh,literalAutolinkHttp:oh,literalAutolinkWww:oh},exit:{literalAutolink:ex,literalAutolinkEmail:Zw,literalAutolinkHttp:Qw,literalAutolinkWww:Jw}}}function Yw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ah,notInConstruct:lh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ah,notInConstruct:lh},{character:":",before:"[ps]",after:"\\/",inConstruct:ah,notInConstruct:lh}]}}function Xw(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function oh(n){this.config.enter.autolinkProtocol.call(this,n)}function Qw(n){this.config.exit.autolinkProtocol.call(this,n)}function Jw(n){this.config.exit.data.call(this,n);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(n)}function Zw(n){this.config.exit.autolinkEmail.call(this,n)}function ex(n){this.exit(n)}function tx(n){$w(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,nx],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ix]],{ignore:["link","linkReference"]})}function nx(n,r,s,l,d){let p="";if(!q_(d)||(/^w/i.test(r)&&(s=r+s,r="",p="http://"),!rx(s)))return!1;const f=sx(s+l);if(!f[0])return!1;const o={type:"link",title:null,url:p+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[o,{type:"text",value:f[1]}]:o}function ix(n,r,s,l){return!q_(l,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function rx(n){const r=n.split(".");return!(r.length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))}function sx(n){const r=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let s=r[0],l=s.indexOf(")");const d=Lg(n,"(");let p=Lg(n,")");for(;l!==-1&&d>p;)n+=s.slice(0,l+1),s=s.slice(l+1),l=s.indexOf(")"),p++;return[n,s]}function q_(n,r){const s=n.input.charCodeAt(n.index-1);return(n.index===0||Ir(s)||Bo(s))&&(!r||s!==47)}$_.peek=px;function ax(){this.buffer()}function lx(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function ox(){this.buffer()}function cx(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function ux(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=ii(this.sliceSerialize(n)).toLowerCase(),s.label=r}function hx(n){this.exit(n)}function fx(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=ii(this.sliceSerialize(n)).toLowerCase(),s.label=r}function dx(n){this.exit(n)}function px(){return"["}function $_(n,r,s,l){const d=s.createTracker(l);let p=d.move("[^");const f=s.enter("footnoteReference"),o=s.enter("reference");return p+=d.move(s.safe(s.associationId(n),{after:"]",before:p})),o(),f(),p+=d.move("]"),p}function mx(){return{enter:{gfmFootnoteCallString:ax,gfmFootnoteCall:lx,gfmFootnoteDefinitionLabelString:ox,gfmFootnoteDefinition:cx},exit:{gfmFootnoteCallString:ux,gfmFootnoteCall:hx,gfmFootnoteDefinitionLabelString:fx,gfmFootnoteDefinition:dx}}}function gx(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:$_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(l,d,p,f){const o=p.createTracker(f);let c=o.move("[^");const h=p.enter("footnoteDefinition"),m=p.enter("label");return c+=o.move(p.safe(p.associationId(l),{before:c,after:"]"})),m(),c+=o.move("]:"),l.children&&l.children.length>0&&(o.shift(4),c+=o.move((r?`
|
|
76
|
+
`:" ")+p.indentLines(p.containerFlow(l,o.current()),r?G_:_x))),h(),c}}function _x(n,r,s){return r===0?n:G_(n,r,s)}function G_(n,r,s){return(s?"":" ")+n}const vx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];V_.peek=wx;function yx(){return{canContainEols:["delete"],enter:{strikethrough:bx},exit:{strikethrough:Cx}}}function Sx(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:vx}],handlers:{delete:V_}}}function bx(n){this.enter({type:"delete",children:[]},n)}function Cx(n){this.exit(n)}function V_(n,r,s,l){const d=s.createTracker(l),p=s.enter("strikethrough");let f=d.move("~~");return f+=s.containerPhrasing(n,{...d.current(),before:f,after:"~"}),f+=d.move("~~"),p(),f}function wx(){return"~"}function xx(n){return n.length}function Ex(n,r){const s=r||{},l=(s.align||[]).concat(),d=s.stringLength||xx,p=[],f=[],o=[],c=[];let h=0,m=-1;for(;++m<n.length;){const E=[],S=[];let v=-1;for(n[m].length>h&&(h=n[m].length);++v<n[m].length;){const _=kx(n[m][v]);if(s.alignDelimiters!==!1){const y=d(_);S[v]=y,(c[v]===void 0||y>c[v])&&(c[v]=y)}E.push(_)}f[m]=E,o[m]=S}let u=-1;if(typeof l=="object"&&"length"in l)for(;++u<h;)p[u]=Og(l[u]);else{const E=Og(l);for(;++u<h;)p[u]=E}u=-1;const b=[],C=[];for(;++u<h;){const E=p[u];let S="",v="";E===99?(S=":",v=":"):E===108?S=":":E===114&&(v=":");let _=s.alignDelimiters===!1?1:Math.max(1,c[u]-S.length-v.length);const y=S+"-".repeat(_)+v;s.alignDelimiters!==!1&&(_=S.length+_+v.length,_>c[u]&&(c[u]=_),C[u]=_),b[u]=y}f.splice(1,0,b),o.splice(1,0,C),m=-1;const T=[];for(;++m<f.length;){const E=f[m],S=o[m];u=-1;const v=[];for(;++u<h;){const _=E[u]||"";let y="",A="";if(s.alignDelimiters!==!1){const L=c[u]-(S[u]||0),D=p[u];D===114?y=" ".repeat(L):D===99?L%2?(y=" ".repeat(L/2+.5),A=" ".repeat(L/2-.5)):(y=" ".repeat(L/2),A=y):A=" ".repeat(L)}s.delimiterStart!==!1&&!u&&v.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&_==="")&&(s.delimiterStart!==!1||u)&&v.push(" "),s.alignDelimiters!==!1&&v.push(y),v.push(_),s.alignDelimiters!==!1&&v.push(A),s.padding!==!1&&v.push(" "),(s.delimiterEnd!==!1||u!==h-1)&&v.push("|")}T.push(s.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return T.join(`
|
|
77
|
+
`)}function kx(n){return n==null?"":String(n)}function Og(n){const r=typeof n=="string"?n.codePointAt(0):0;return r===67||r===99?99:r===76||r===108?108:r===82||r===114?114:0}function Ax(n,r,s,l){const d=s.enter("blockquote"),p=s.createTracker(l);p.move("> "),p.shift(2);const f=s.indentLines(s.containerFlow(n,p.current()),Tx);return d(),f}function Tx(n,r,s){return">"+(s?"":" ")+n}function Rx(n,r){return Bg(n,r.inConstruct,!0)&&!Bg(n,r.notInConstruct,!1)}function Bg(n,r,s){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return s;let l=-1;for(;++l<r.length;)if(n.includes(r[l]))return!0;return!1}function jg(n,r,s,l){let d=-1;for(;++d<s.unsafe.length;)if(s.unsafe[d].character===`
|
|
78
|
+
`&&Rx(s.stack,s.unsafe[d]))return/[ \t]/.test(l.before)?"":" ";return`\\
|
|
79
|
+
`}function Dx(n,r){const s=String(n);let l=s.indexOf(r),d=l,p=0,f=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===d?++p>f&&(f=p):p=1,d=l+r.length,l=s.indexOf(r,d);return f}function Mx(n,r){return!!(r.options.fences===!1&&n.value&&!n.lang&&/[^ \r\n]/.test(n.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(n.value))}function Lx(n){const r=n.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function Ox(n,r,s,l){const d=Lx(s),p=n.value||"",f=d==="`"?"GraveAccent":"Tilde";if(Mx(n,s)){const u=s.enter("codeIndented"),b=s.indentLines(p,Bx);return u(),b}const o=s.createTracker(l),c=d.repeat(Math.max(Dx(p,d)+1,3)),h=s.enter("codeFenced");let m=o.move(c);if(n.lang){const u=s.enter(`codeFencedLang${f}`);m+=o.move(s.safe(n.lang,{before:m,after:" ",encode:["`"],...o.current()})),u()}if(n.lang&&n.meta){const u=s.enter(`codeFencedMeta${f}`);m+=o.move(" "),m+=o.move(s.safe(n.meta,{before:m,after:`
|
|
80
|
+
`,encode:["`"],...o.current()})),u()}return m+=o.move(`
|
|
81
|
+
`),p&&(m+=o.move(p+`
|
|
82
|
+
`)),m+=o.move(c),h(),m}function Bx(n,r,s){return(s?"":" ")+n}function Yh(n){const r=n.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function jx(n,r,s,l){const d=Yh(s),p=d==='"'?"Quote":"Apostrophe",f=s.enter("definition");let o=s.enter("label");const c=s.createTracker(l);let h=c.move("[");return h+=c.move(s.safe(s.associationId(n),{before:h,after:"]",...c.current()})),h+=c.move("]: "),o(),!n.url||/[\0- \u007F]/.test(n.url)?(o=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(o=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":`
|
|
83
|
+
`,...c.current()}))),o(),n.title&&(o=s.enter(`title${p}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),o()),f(),h}function Nx(n){const r=n.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function Qa(n){return"&#x"+n.toString(16).toUpperCase()+";"}function To(n,r,s){const l=Is(n),d=Is(r);return l===void 0?d===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===1?d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}W_.peek=Hx;function W_(n,r,s,l){const d=Nx(s),p=s.enter("emphasis"),f=s.createTracker(l),o=f.move(d);let c=f.move(s.containerPhrasing(n,{after:d,before:o,...f.current()}));const h=c.charCodeAt(0),m=To(l.before.charCodeAt(l.before.length-1),h,d);m.inside&&(c=Qa(h)+c.slice(1));const u=c.charCodeAt(c.length-1),b=To(l.after.charCodeAt(0),u,d);b.inside&&(c=c.slice(0,-1)+Qa(u));const C=f.move(d);return p(),s.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},o+c+C}function Hx(n,r,s){return s.options.emphasis||"*"}function zx(n,r){let s=!1;return Wh(n,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return s=!0,wh}),!!((!n.depth||n.depth<3)&&Uh(n)&&(r.options.setext||s))}function Ix(n,r,s,l){const d=Math.max(Math.min(6,n.depth||1),1),p=s.createTracker(l);if(zx(n,s)){const m=s.enter("headingSetext"),u=s.enter("phrasing"),b=s.containerPhrasing(n,{...p.current(),before:`
|
|
84
|
+
`,after:`
|
|
85
|
+
`});return u(),m(),b+`
|
|
86
|
+
`+(d===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
87
|
+
`))+1))}const f="#".repeat(d),o=s.enter("headingAtx"),c=s.enter("phrasing");p.move(f+" ");let h=s.containerPhrasing(n,{before:"# ",after:`
|
|
88
|
+
`,...p.current()});return/^[\t ]/.test(h)&&(h=Qa(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,s.options.closeAtx&&(h+=" "+f),c(),o(),h}K_.peek=Ux;function K_(n){return n.value||""}function Ux(){return"<"}Y_.peek=Px;function Y_(n,r,s,l){const d=Yh(s),p=d==='"'?"Quote":"Apostrophe",f=s.enter("image");let o=s.enter("label");const c=s.createTracker(l);let h=c.move("![");return h+=c.move(s.safe(n.alt,{before:h,after:"]",...c.current()})),h+=c.move("]("),o(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(o=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(o=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":")",...c.current()}))),o(),n.title&&(o=s.enter(`title${p}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),o()),h+=c.move(")"),f(),h}function Px(){return"!"}X_.peek=Fx;function X_(n,r,s,l){const d=n.referenceType,p=s.enter("imageReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("![");const h=s.safe(n.alt,{before:c,after:"]",...o.current()});c+=o.move(h+"]["),f();const m=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...o.current()});return f(),s.stack=m,p(),d==="full"||!h||h!==u?c+=o.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function Fx(){return"!"}Q_.peek=qx;function Q_(n,r,s){let l=n.value||"",d="`",p=-1;for(;new RegExp("(^|[^`])"+d+"([^`]|$)").test(l);)d+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++p<s.unsafe.length;){const f=s.unsafe[p],o=s.compilePattern(f);let c;if(f.atBreak)for(;c=o.exec(l);){let h=c.index;l.charCodeAt(h)===10&&l.charCodeAt(h-1)===13&&h--,l=l.slice(0,h)+" "+l.slice(c.index+1)}}return d+l+d}function qx(){return"`"}function J_(n,r){const s=Uh(n);return!!(!r.options.resourceLink&&n.url&&!n.title&&n.children&&n.children.length===1&&n.children[0].type==="text"&&(s===n.url||"mailto:"+s===n.url)&&/^[a-z][a-z+.-]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))}Z_.peek=$x;function Z_(n,r,s,l){const d=Yh(s),p=d==='"'?"Quote":"Apostrophe",f=s.createTracker(l);let o,c;if(J_(n,s)){const m=s.stack;s.stack=[],o=s.enter("autolink");let u=f.move("<");return u+=f.move(s.containerPhrasing(n,{before:u,after:">",...f.current()})),u+=f.move(">"),o(),s.stack=m,u}o=s.enter("link"),c=s.enter("label");let h=f.move("[");return h+=f.move(s.containerPhrasing(n,{before:h,after:"](",...f.current()})),h+=f.move("]("),c(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(c=s.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(s.safe(n.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=s.enter("destinationRaw"),h+=f.move(s.safe(n.url,{before:h,after:n.title?" ":")",...f.current()}))),c(),n.title&&(c=s.enter(`title${p}`),h+=f.move(" "+d),h+=f.move(s.safe(n.title,{before:h,after:d,...f.current()})),h+=f.move(d),c()),h+=f.move(")"),o(),h}function $x(n,r,s){return J_(n,s)?"<":"["}ev.peek=Gx;function ev(n,r,s,l){const d=n.referenceType,p=s.enter("linkReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("[");const h=s.containerPhrasing(n,{before:c,after:"]",...o.current()});c+=o.move(h+"]["),f();const m=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...o.current()});return f(),s.stack=m,p(),d==="full"||!h||h!==u?c+=o.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function Gx(){return"["}function Xh(n){const r=n.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function Vx(n){const r=Xh(n),s=n.options.bulletOther;if(!s)return r==="*"?"-":"*";if(s!=="*"&&s!=="+"&&s!=="-")throw new Error("Cannot serialize items with `"+s+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(s===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+s+"`) to be different");return s}function Wx(n){const r=n.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function tv(n){const r=n.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function Kx(n,r,s,l){const d=s.enter("list"),p=s.bulletCurrent;let f=n.ordered?Wx(s):Xh(s);const o=n.ordered?f==="."?")":".":Vx(s);let c=r&&s.bulletLastUsed?f===s.bulletLastUsed:!1;if(!n.ordered){const m=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&m&&(!m.children||!m.children[0])&&s.stack[s.stack.length-1]==="list"&&s.stack[s.stack.length-2]==="listItem"&&s.stack[s.stack.length-3]==="list"&&s.stack[s.stack.length-4]==="listItem"&&s.indexStack[s.indexStack.length-1]===0&&s.indexStack[s.indexStack.length-2]===0&&s.indexStack[s.indexStack.length-3]===0&&(c=!0),tv(s)===f&&m){let u=-1;for(;++u<n.children.length;){const b=n.children[u];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(f=o),s.bulletCurrent=f;const h=s.containerFlow(n,l);return s.bulletLastUsed=f,s.bulletCurrent=p,d(),h}function Yx(n){const r=n.options.listItemIndent||"one";if(r!=="tab"&&r!=="one"&&r!=="mixed")throw new Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}function Xx(n,r,s,l){const d=Yx(s);let p=s.bulletCurrent||Xh(s);r&&r.type==="list"&&r.ordered&&(p=(typeof r.start=="number"&&r.start>-1?r.start:1)+(s.options.incrementListMarker===!1?0:r.children.indexOf(n))+p);let f=p.length+1;(d==="tab"||d==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const o=s.createTracker(l);o.move(p+" ".repeat(f-p.length)),o.shift(f);const c=s.enter("listItem"),h=s.indentLines(s.containerFlow(n,o.current()),m);return c(),h;function m(u,b,C){return b?(C?"":" ".repeat(f))+u:(C?p:p+" ".repeat(f-p.length))+u}}function Qx(n,r,s,l){const d=s.enter("paragraph"),p=s.enter("phrasing"),f=s.containerPhrasing(n,l);return p(),d(),f}const Jx=Ho(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Zx(n,r,s,l){return(n.children.some(function(f){return Jx(f)})?s.containerPhrasing:s.containerFlow).call(s,n,l)}function eE(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}nv.peek=tE;function nv(n,r,s,l){const d=eE(s),p=s.enter("strong"),f=s.createTracker(l),o=f.move(d+d);let c=f.move(s.containerPhrasing(n,{after:d,before:o,...f.current()}));const h=c.charCodeAt(0),m=To(l.before.charCodeAt(l.before.length-1),h,d);m.inside&&(c=Qa(h)+c.slice(1));const u=c.charCodeAt(c.length-1),b=To(l.after.charCodeAt(0),u,d);b.inside&&(c=c.slice(0,-1)+Qa(u));const C=f.move(d+d);return p(),s.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},o+c+C}function tE(n,r,s){return s.options.strong||"*"}function nE(n,r,s,l){return s.safe(n.value,l)}function iE(n){const r=n.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function rE(n,r,s){const l=(tv(s)+(s.options.ruleSpaces?" ":"")).repeat(iE(s));return s.options.ruleSpaces?l.slice(0,-1):l}const iv={blockquote:Ax,break:jg,code:Ox,definition:jx,emphasis:W_,hardBreak:jg,heading:Ix,html:K_,image:Y_,imageReference:X_,inlineCode:Q_,link:Z_,linkReference:ev,list:Kx,listItem:Xx,paragraph:Qx,root:Zx,strong:nv,text:nE,thematicBreak:rE};function sE(){return{enter:{table:aE,tableData:Ng,tableHeader:Ng,tableRow:oE},exit:{codeText:cE,table:lE,tableData:ch,tableHeader:ch,tableRow:ch}}}function aE(n){const r=n._align;this.enter({type:"table",align:r.map(function(s){return s==="none"?null:s}),children:[]},n),this.data.inTable=!0}function lE(n){this.exit(n),this.data.inTable=void 0}function oE(n){this.enter({type:"tableRow",children:[]},n)}function ch(n){this.exit(n)}function Ng(n){this.enter({type:"tableCell",children:[]},n)}function cE(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,uE));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(n)}function uE(n,r){return r==="|"?r:n}function hE(n){const r=n||{},s=r.tableCellPadding,l=r.tablePipeAlign,d=r.stringLength,p=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
89
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:f,tableCell:c,tableRow:o}};function f(C,T,E,S){return h(m(C,E,S),C.align)}function o(C,T,E,S){const v=u(C,E,S),_=h([v]);return _.slice(0,_.indexOf(`
|
|
90
|
+
`))}function c(C,T,E,S){const v=E.enter("tableCell"),_=E.enter("phrasing"),y=E.containerPhrasing(C,{...S,before:p,after:p});return _(),v(),y}function h(C,T){return Ex(C,{align:T,alignDelimiters:l,padding:s,stringLength:d})}function m(C,T,E){const S=C.children;let v=-1;const _=[],y=T.enter("table");for(;++v<S.length;)_[v]=u(S[v],T,E);return y(),_}function u(C,T,E){const S=C.children;let v=-1;const _=[],y=T.enter("tableRow");for(;++v<S.length;)_[v]=c(S[v],C,T,E);return y(),_}function b(C,T,E){let S=iv.inlineCode(C,T,E);return E.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function fE(){return{exit:{taskListCheckValueChecked:Hg,taskListCheckValueUnchecked:Hg,paragraph:pE}}}function dE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:mE}}}function Hg(n){const r=this.stack[this.stack.length-2];r.type,r.checked=n.type==="taskListCheckValueChecked"}function pE(n){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const s=this.stack[this.stack.length-1];s.type;const l=s.children[0];if(l&&l.type==="text"){const d=r.children;let p=-1,f;for(;++p<d.length;){const o=d[p];if(o.type==="paragraph"){f=o;break}}f===s&&(l.value=l.value.slice(1),l.value.length===0?s.children.shift():s.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,s.position.start=Object.assign({},l.position.start)))}}this.exit(n)}function mE(n,r,s,l){const d=n.children[0],p=typeof n.checked=="boolean"&&d&&d.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",o=s.createTracker(l);p&&o.move(f);let c=iv.listItem(n,r,s,{...l,...o.current()});return p&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(m){return m+f}}function gE(){return[Kw(),mx(),yx(),sE(),fE()]}function _E(n){return{extensions:[Yw(),gx(n),Sx(),hE(n),dE()]}}const vE={tokenize:xE,partial:!0},rv={tokenize:EE,partial:!0},sv={tokenize:kE,partial:!0},av={tokenize:AE,partial:!0},yE={tokenize:TE,partial:!0},lv={name:"wwwAutolink",tokenize:CE,previous:cv},ov={name:"protocolAutolink",tokenize:wE,previous:uv},Ni={name:"emailAutolink",tokenize:bE,previous:hv},pi={};function SE(){return{text:pi}}let Nr=48;for(;Nr<123;)pi[Nr]=Ni,Nr++,Nr===58?Nr=65:Nr===91&&(Nr=97);pi[43]=Ni;pi[45]=Ni;pi[46]=Ni;pi[95]=Ni;pi[72]=[Ni,ov];pi[104]=[Ni,ov];pi[87]=[Ni,lv];pi[119]=[Ni,lv];function bE(n,r,s){const l=this;let d,p;return f;function f(u){return!Ah(u)||!hv.call(l,l.previous)||Qh(l.events)?s(u):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),o(u))}function o(u){return Ah(u)?(n.consume(u),o):u===64?(n.consume(u),c):s(u)}function c(u){return u===46?n.check(yE,m,h)(u):u===45||u===95||tn(u)?(p=!0,n.consume(u),c):m(u)}function h(u){return n.consume(u),d=!0,c}function m(u){return p&&d&&an(l.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),r(u)):s(u)}}function CE(n,r,s){const l=this;return d;function d(f){return f!==87&&f!==119||!cv.call(l,l.previous)||Qh(l.events)?s(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(vE,n.attempt(rv,n.attempt(sv,p),s),s)(f))}function p(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),r(f)}}function wE(n,r,s){const l=this;let d="",p=!1;return f;function f(u){return(u===72||u===104)&&uv.call(l,l.previous)&&!Qh(l.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),d+=String.fromCodePoint(u),n.consume(u),o):s(u)}function o(u){if(an(u)&&d.length<5)return d+=String.fromCodePoint(u),n.consume(u),o;if(u===58){const b=d.toLowerCase();if(b==="http"||b==="https")return n.consume(u),c}return s(u)}function c(u){return u===47?(n.consume(u),p?h:(p=!0,c)):s(u)}function h(u){return u===null||Eo(u)||ut(u)||Ir(u)||Bo(u)?s(u):n.attempt(rv,n.attempt(sv,m),s)(u)}function m(u){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),r(u)}}function xE(n,r,s){let l=0;return d;function d(f){return(f===87||f===119)&&l<3?(l++,n.consume(f),d):f===46&&l===3?(n.consume(f),p):s(f)}function p(f){return f===null?s(f):r(f)}}function EE(n,r,s){let l,d,p;return f;function f(h){return h===46||h===95?n.check(av,c,o)(h):h===null||ut(h)||Ir(h)||h!==45&&Bo(h)?c(h):(p=!0,n.consume(h),f)}function o(h){return h===95?l=!0:(d=l,l=void 0),n.consume(h),f}function c(h){return d||l||!p?s(h):r(h)}}function kE(n,r){let s=0,l=0;return d;function d(f){return f===40?(s++,n.consume(f),d):f===41&&l<s?p(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?n.check(av,r,p)(f):f===null||ut(f)||Ir(f)?r(f):(n.consume(f),d)}function p(f){return f===41&&l++,n.consume(f),d}}function AE(n,r,s){return l;function l(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(n.consume(o),l):o===38?(n.consume(o),p):o===93?(n.consume(o),d):o===60||o===null||ut(o)||Ir(o)?r(o):s(o)}function d(o){return o===null||o===40||o===91||ut(o)||Ir(o)?r(o):l(o)}function p(o){return an(o)?f(o):s(o)}function f(o){return o===59?(n.consume(o),l):an(o)?(n.consume(o),f):s(o)}}function TE(n,r,s){return l;function l(p){return n.consume(p),d}function d(p){return tn(p)?s(p):r(p)}}function cv(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||ut(n)}function uv(n){return!an(n)}function hv(n){return!(n===47||Ah(n))}function Ah(n){return n===43||n===45||n===46||n===95||tn(n)}function Qh(n){let r=n.length,s=!1;for(;r--;){const l=n[r][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){s=!0;break}if(l._gfmAutolinkLiteralWalkedInto){s=!1;break}}return n.length>0&&!s&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const RE={tokenize:HE,partial:!0};function DE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:BE,continuation:{tokenize:jE},exit:NE}},text:{91:{name:"gfmFootnoteCall",tokenize:OE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ME,resolveTo:LE}}}}function ME(n,r,s){const l=this;let d=l.events.length;const p=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let f;for(;d--;){const c=l.events[d][1];if(c.type==="labelImage"){f=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!f||!f._balanced)return s(c);const h=ii(l.sliceSerialize({start:f.end,end:l.now()}));return h.codePointAt(0)!==94||!p.includes(h.slice(1))?s(c):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(c),n.exit("gfmFootnoteCallLabelMarker"),r(c))}}function LE(n,r){let s=n.length;for(;s--;)if(n[s][1].type==="labelImage"&&n[s][0]==="enter"){n[s][1];break}n[s+1][1].type="data",n[s+3][1].type="gfmFootnoteCallLabelMarker";const l={type:"gfmFootnoteCall",start:Object.assign({},n[s+3][1].start),end:Object.assign({},n[n.length-1][1].end)},d={type:"gfmFootnoteCallMarker",start:Object.assign({},n[s+3][1].end),end:Object.assign({},n[s+3][1].end)};d.end.column++,d.end.offset++,d.end._bufferIndex++;const p={type:"gfmFootnoteCallString",start:Object.assign({},d.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},p.start),end:Object.assign({},p.end)},o=[n[s+1],n[s+2],["enter",l,r],n[s+3],n[s+4],["enter",d,r],["exit",d,r],["enter",p,r],["enter",f,r],["exit",f,r],["exit",p,r],n[n.length-2],n[n.length-1],["exit",l,r]];return n.splice(s,n.length-s+1,...o),n}function OE(n,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let p=0,f;return o;function o(u){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),c}function c(u){return u!==94?s(u):(n.enter("gfmFootnoteCallMarker"),n.consume(u),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",h)}function h(u){if(p>999||u===93&&!f||u===null||u===91||ut(u))return s(u);if(u===93){n.exit("chunkString");const b=n.exit("gfmFootnoteCallString");return d.includes(ii(l.sliceSerialize(b)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):s(u)}return ut(u)||(f=!0),p++,n.consume(u),u===92?m:h}function m(u){return u===91||u===92||u===93?(n.consume(u),p++,h):h(u)}}function BE(n,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let p,f=0,o;return c;function c(T){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(T){return T===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",m):s(T)}function m(T){if(f>999||T===93&&!o||T===null||T===91||ut(T))return s(T);if(T===93){n.exit("chunkString");const E=n.exit("gfmFootnoteDefinitionLabelString");return p=ii(l.sliceSerialize(E)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),b}return ut(T)||(o=!0),f++,n.consume(T),T===92?u:m}function u(T){return T===91||T===92||T===93?(n.consume(T),f++,m):m(T)}function b(T){return T===58?(n.enter("definitionMarker"),n.consume(T),n.exit("definitionMarker"),d.includes(p)||d.push(p),Xe(n,C,"gfmFootnoteDefinitionWhitespace")):s(T)}function C(T){return r(T)}}function jE(n,r,s){return n.check(el,r,n.attempt(RE,r,s))}function NE(n){n.exit("gfmFootnoteDefinition")}function HE(n,r,s){const l=this;return Xe(n,d,"gfmFootnoteDefinitionIndent",5);function d(p){const f=l.events[l.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(p):s(p)}}function zE(n){let s=(n||{}).singleTilde;const l={name:"strikethrough",tokenize:p,resolveAll:d};return s==null&&(s=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function d(f,o){let c=-1;for(;++c<f.length;)if(f[c][0]==="enter"&&f[c][1].type==="strikethroughSequenceTemporary"&&f[c][1]._close){let h=c;for(;h--;)if(f[h][0]==="exit"&&f[h][1].type==="strikethroughSequenceTemporary"&&f[h][1]._open&&f[c][1].end.offset-f[c][1].start.offset===f[h][1].end.offset-f[h][1].start.offset){f[c][1].type="strikethroughSequence",f[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},f[h][1].start),end:Object.assign({},f[c][1].end)},u={type:"strikethroughText",start:Object.assign({},f[h][1].end),end:Object.assign({},f[c][1].start)},b=[["enter",m,o],["enter",f[h][1],o],["exit",f[h][1],o],["enter",u,o]],C=o.parser.constructs.insideSpan.null;C&&Ln(b,b.length,0,jo(C,f.slice(h+1,c),o)),Ln(b,b.length,0,[["exit",u,o],["enter",f[c][1],o],["exit",f[c][1],o],["exit",m,o]]),Ln(f,h-1,c-h+3,b),c=h+b.length-2;break}}for(c=-1;++c<f.length;)f[c][1].type==="strikethroughSequenceTemporary"&&(f[c][1].type="data");return f}function p(f,o,c){const h=this.previous,m=this.events;let u=0;return b;function b(T){return h===126&&m[m.length-1][1].type!=="characterEscape"?c(T):(f.enter("strikethroughSequenceTemporary"),C(T))}function C(T){const E=Is(h);if(T===126)return u>1?c(T):(f.consume(T),u++,C);if(u<2&&!s)return c(T);const S=f.exit("strikethroughSequenceTemporary"),v=Is(T);return S._open=!v||v===2&&!!E,S._close=!E||E===2&&!!v,o(T)}}}class IE{constructor(){this.map=[]}add(r,s,l){UE(this,r,s,l)}consume(r){if(this.map.sort(function(p,f){return p[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const l=[];for(;s>0;)s-=1,l.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];l.push(r.slice()),r.length=0;let d=l.pop();for(;d;){for(const p of d)r.push(p);d=l.pop()}this.map.length=0}}function UE(n,r,s,l){let d=0;if(!(s===0&&l.length===0)){for(;d<n.map.length;){if(n.map[d][0]===r){n.map[d][1]+=s,n.map[d][2].push(...l);return}d+=1}n.map.push([r,s,l])}}function PE(n,r){let s=!1;const l=[];for(;r<n.length;){const d=n[r];if(s){if(d[0]==="enter")d[1].type==="tableContent"&&l.push(n[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(d[1].type==="tableContent"){if(n[r-1][1].type==="tableDelimiterMarker"){const p=l.length-1;l[p]=l[p]==="left"?"center":"right"}}else if(d[1].type==="tableDelimiterRow")break}else d[0]==="enter"&&d[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return l}function FE(){return{flow:{null:{name:"table",tokenize:qE,resolveAll:$E}}}}function qE(n,r,s){const l=this;let d=0,p=0,f;return o;function o(j){let H=l.events.length-1;for(;H>-1;){const K=l.events[H][1].type;if(K==="lineEnding"||K==="linePrefix")H--;else break}const U=H>-1?l.events[H][1].type:null,F=U==="tableHead"||U==="tableRow"?D:c;return F===D&&l.parser.lazy[l.now().line]?s(j):F(j)}function c(j){return n.enter("tableHead"),n.enter("tableRow"),h(j)}function h(j){return j===124||(f=!0,p+=1),m(j)}function m(j){return j===null?s(j):Me(j)?p>1?(p=0,l.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(j),n.exit("lineEnding"),C):s(j):Ge(j)?Xe(n,m,"whitespace")(j):(p+=1,f&&(f=!1,d+=1),j===124?(n.enter("tableCellDivider"),n.consume(j),n.exit("tableCellDivider"),f=!0,m):(n.enter("data"),u(j)))}function u(j){return j===null||j===124||ut(j)?(n.exit("data"),m(j)):(n.consume(j),j===92?b:u)}function b(j){return j===92||j===124?(n.consume(j),u):u(j)}function C(j){return l.interrupt=!1,l.parser.lazy[l.now().line]?s(j):(n.enter("tableDelimiterRow"),f=!1,Ge(j)?Xe(n,T,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):T(j))}function T(j){return j===45||j===58?S(j):j===124?(f=!0,n.enter("tableCellDivider"),n.consume(j),n.exit("tableCellDivider"),E):L(j)}function E(j){return Ge(j)?Xe(n,S,"whitespace")(j):S(j)}function S(j){return j===58?(p+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(j),n.exit("tableDelimiterMarker"),v):j===45?(p+=1,v(j)):j===null||Me(j)?A(j):L(j)}function v(j){return j===45?(n.enter("tableDelimiterFiller"),_(j)):L(j)}function _(j){return j===45?(n.consume(j),_):j===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(j),n.exit("tableDelimiterMarker"),y):(n.exit("tableDelimiterFiller"),y(j))}function y(j){return Ge(j)?Xe(n,A,"whitespace")(j):A(j)}function A(j){return j===124?T(j):j===null||Me(j)?!f||d!==p?L(j):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(j)):L(j)}function L(j){return s(j)}function D(j){return n.enter("tableRow"),R(j)}function R(j){return j===124?(n.enter("tableCellDivider"),n.consume(j),n.exit("tableCellDivider"),R):j===null||Me(j)?(n.exit("tableRow"),r(j)):Ge(j)?Xe(n,R,"whitespace")(j):(n.enter("data"),k(j))}function k(j){return j===null||j===124||ut(j)?(n.exit("data"),R(j)):(n.consume(j),j===92?M:k)}function M(j){return j===92||j===124?(n.consume(j),k):k(j)}}function $E(n,r){let s=-1,l=!0,d=0,p=[0,0,0,0],f=[0,0,0,0],o=!1,c=0,h,m,u;const b=new IE;for(;++s<n.length;){const C=n[s],T=C[1];C[0]==="enter"?T.type==="tableHead"?(o=!1,c!==0&&(zg(b,r,c,h,m),m=void 0,c=0),h={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},b.add(s,0,[["enter",h,r]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(l=!0,u=void 0,p=[0,0,0,0],f=[0,s+1,0,0],o&&(o=!1,m={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},b.add(s,0,[["enter",m,r]])),d=T.type==="tableDelimiterRow"?2:m?3:1):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(l=!1,f[2]===0&&(p[1]!==0&&(f[0]=f[1],u=yo(b,r,p,d,void 0,u),p=[0,0,0,0]),f[2]=s)):T.type==="tableCellDivider"&&(l?l=!1:(p[1]!==0&&(f[0]=f[1],u=yo(b,r,p,d,void 0,u)),p=f,f=[p[1],s,0,0])):T.type==="tableHead"?(o=!0,c=s):T.type==="tableRow"||T.type==="tableDelimiterRow"?(c=s,p[1]!==0?(f[0]=f[1],u=yo(b,r,p,d,s,u)):f[1]!==0&&(u=yo(b,r,f,d,s,u)),d=0):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&zg(b,r,c,h,m),b.consume(r.events),s=-1;++s<r.events.length;){const C=r.events[s];C[0]==="enter"&&C[1].type==="table"&&(C[1]._align=PE(r.events,s))}return n}function yo(n,r,s,l,d,p){const f=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",o="tableContent";s[0]!==0&&(p.end=Object.assign({},js(r.events,s[0])),n.add(s[0],0,[["exit",p,r]]));const c=js(r.events,s[1]);if(p={type:f,start:Object.assign({},c),end:Object.assign({},c)},n.add(s[1],0,[["enter",p,r]]),s[2]!==0){const h=js(r.events,s[2]),m=js(r.events,s[3]),u={type:o,start:Object.assign({},h),end:Object.assign({},m)};if(n.add(s[2],0,[["enter",u,r]]),l!==2){const b=r.events[s[2]],C=r.events[s[3]];if(b[1].end=Object.assign({},C[1].end),b[1].type="chunkText",b[1].contentType="text",s[3]>s[2]+1){const T=s[2]+1,E=s[3]-s[2]-1;n.add(T,E,[])}}n.add(s[3]+1,0,[["exit",u,r]])}return d!==void 0&&(p.end=Object.assign({},js(r.events,d)),n.add(d,0,[["exit",p,r]]),p=void 0),p}function zg(n,r,s,l,d){const p=[],f=js(r.events,s);d&&(d.end=Object.assign({},f),p.push(["exit",d,r])),l.end=Object.assign({},f),p.push(["exit",l,r]),n.add(s+1,0,p)}function js(n,r){const s=n[r],l=s[0]==="enter"?"start":"end";return s[1][l]}const GE={name:"tasklistCheck",tokenize:WE};function VE(){return{text:{91:GE}}}function WE(n,r,s){const l=this;return d;function d(c){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?s(c):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),p)}function p(c){return ut(c)?(n.enter("taskListCheckValueUnchecked"),n.consume(c),n.exit("taskListCheckValueUnchecked"),f):c===88||c===120?(n.enter("taskListCheckValueChecked"),n.consume(c),n.exit("taskListCheckValueChecked"),f):s(c)}function f(c){return c===93?(n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),o):s(c)}function o(c){return Me(c)?r(c):Ge(c)?n.check({tokenize:KE},r,s)(c):s(c)}}function KE(n,r,s){return Xe(n,l,"whitespace");function l(d){return d===null?s(d):r(d)}}function YE(n){return b_([SE(),DE(),zE(n),FE(),VE()])}const XE={};function fv(n){const r=this,s=n||XE,l=r.data(),d=l.micromarkExtensions||(l.micromarkExtensions=[]),p=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),f=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);d.push(YE(s)),p.push(gE()),f.push(_E(s))}const dv=1e3,Ns=new Map;let Ka;function QE(n,r,s){const l=Symbol(n),d=Math.max(dv,s.intervalMs),p=Date.now();return Ns.set(n,{id:n,intervalMs:d,nextRunAt:s.runImmediately===!1?p+d:p,inFlight:!1,run:r,token:l}),JE(),pv(),()=>{const f=Ns.get(n);(f==null?void 0:f.token)===l&&(Ns.delete(n),Ns.size===0&&Ka!==void 0&&(window.clearInterval(Ka),Ka=void 0))}}function JE(){Ka!==void 0||typeof window>"u"||(Ka=window.setInterval(()=>{pv()},dv))}async function pv(){const n=Date.now();for(const r of Ns.values())r.inFlight||r.nextRunAt>n||ZE(r)}async function ZE(n){n.inFlight=!0;try{await n.run()}catch{}finally{const r=Ns.get(n.id);(r==null?void 0:r.token)===n.token&&(r.inFlight=!1,r.nextRunAt=Date.now()+r.intervalMs)}}function Ja(n,r,s){const l=te.useRef(r);te.useEffect(()=>{l.current=r},[r]),te.useEffect(()=>{if(!(!n||s.enabled===!1))return QE(n,()=>l.current(),{intervalMs:s.intervalMs,runImmediately:s.runImmediately})},[n,s.enabled,s.intervalMs,s.runImmediately])}const Ro=`
|
|
91
|
+
|
|
92
|
+
--- Translation ---
|
|
93
|
+
`;function e2({active:n=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:l,role:d,sessionId:p,panelState:f,onClearSession:o,onEntry:c,onFailures:h}){const[m,u]=te.useState(""),[b,C]=te.useState(""),[T,E]=te.useState(!1),[S,v]=te.useState(Date.now()),[_,y]=te.useState(!1),[,A]=ji(""),L=te.useRef(null),D=f.entries,R=f.failures,k=f.status;te.useEffect(()=>{if(!n)return;const O=L.current;if(!O)return;const N=window.requestAnimationFrame(()=>{O.scrollTop=O.scrollHeight});return()=>window.cancelAnimationFrame(N)},[n,D]);const M=o2(D);te.useEffect(()=>{if(!M)return;v(Date.now());const O=window.setInterval(()=>v(Date.now()),250);return()=>window.clearInterval(O)},[M]);async function j(O=!1){const N=m;y(!0),A(""),E(!1);try{const $=await ye.translateUserInput(l,d,{text:N,mode:O?"auto-send":"review-before-send",useContext:!1,send:O});$.sent?(u(""),E(!1)):(u(gv(N,$.englishPreview)),E(!0))}catch($){A(_t("Translate composer input",$))}finally{y(!1)}}async function H(){const O=b.trim();if(O){y(!0),A("");try{const N=await ye.translateManualOutput(l,d,{text:O});c(p,d,N),C("")}catch(N){A(_t("Translate pasted English output",N))}finally{y(!1)}}}async function U(){const O=T?Ug(m):m;if(O.trim()){y(!0),A("");try{await ye.sendTranslatedInput(l,d,{englishText:O}),u(""),E(!1)}catch(N){A(_t("Send translated English input to role",N))}finally{y(!1)}}}function F(O){O.key!=="Enter"||O.shiftKey||O.nativeEvent.isComposing||(O.preventDefault(),!_&&m.trim()&&(T?U():j(r)))}async function K(){o(p,d),await ye.clearTranslationSession(p).catch(O=>A(_t("Clear conversation translation panel",O)))}async function Y(){y(!0),A("");try{const O=await ye.ignoreTranslationFailures(p);h(p,d,O.failures)}catch(O){A(_t("Ignore failed conversation translations",O))}finally{y(!1)}}async function G(O){y(!0),A("");try{const N=await ye.retryTranslation(p,O.translationId);c(p,d,N)}catch(N){A(_t("Retry latest failed conversation translation",N))}finally{y(!1)}}const W=c2(D,k,S),Z=R.length,z=n2(R);return x.jsxs("aside",{className:"translation-panel",children:[x.jsxs("header",{className:"translation-panel-header",children:[x.jsxs("div",{className:"translation-panel-titlebar",children:[x.jsx("h2",{children:"Translation"}),x.jsxs("div",{className:"translation-panel-actions",children:[Z>0?x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",disabled:_,onClick:()=>void Y(),children:["Ignore ",Z]}),z?x.jsx("button",{type:"button",disabled:_,onClick:()=>void G(z),children:"Retry latest"}):null]}):null,x.jsx("button",{type:"button",onClick:()=>void K(),children:"Clear"})]})]}),x.jsx("div",{className:"translation-status-row",children:x.jsxs("p",{children:["Claude Code · target ",t2(s)," · ",W]})})]}),x.jsxs("div",{className:"translation-entry-list",ref:L,children:[D.length===0?x.jsx("p",{className:"muted",children:"Translated Claude Code output will appear here."}):null,D.map(O=>x.jsx(a2,{entry:O},O.id))]}),x.jsxs("div",{className:"translation-composer",children:[x.jsxs("div",{className:"translation-composer-row translation-manual-row",children:[x.jsx("textarea",{value:b,onChange:O=>C(O.target.value),placeholder:"Paste English to translate on demand..."}),x.jsx("div",{className:"translation-composer-actions",children:x.jsx("button",{type:"button",disabled:_||!b.trim(),onClick:()=>void H(),children:"Translate"})})]}),x.jsxs("div",{className:"translation-composer-row",children:[x.jsx("textarea",{value:m,onChange:O=>{u(O.target.value),(!O.target.value.trim()||T&&!f2(O.target.value))&&E(!1)},onKeyDown:F,placeholder:"输入中文,先翻译成英文工程指令..."}),x.jsx("div",{className:"translation-composer-actions",children:x.jsx("button",{type:"button",disabled:_||!T||!Ug(m).trim(),onClick:()=>void U(),children:"Send English"})})]})]})]})}function t2(n){var r;return((r=t_.find(s=>s.value===n))==null?void 0:r.label)??n}function n2(n){let r,s=Number.NEGATIVE_INFINITY;for(const l of n){const d=Date.parse(l.failedAt),p=Number.isFinite(d)?d:Number.NEGATIVE_INFINITY;(!r||p>=s)&&(r=l,s=p)}return r}function i2({open:n,taskSlug:r,targetLanguage:s,onClose:l}){const[d,p]=te.useState(!1),[,f]=ji(""),[o,c]=te.useState(null),[h,m]=te.useState(""),[u,b]=te.useState(""),[C,T]=te.useState(""),[E,S]=te.useState(!1),[v,_]=te.useState(null),[y,A]=te.useState(""),[L,D]=te.useState(""),[R,k]=te.useState(""),[M,j]=te.useState(!1);Ja(n?`file-translation:${h||"none"}`:null,()=>H(!0),{intervalMs:2e3,runImmediately:!0});async function H(G=!1){try{const W=await ye.getTranslationState();c(W);const Z=h?W.fileIndex.jobs.some(z=>z.id===h):!1;if((!h||!Z)&&W.fileIndex.jobs[0])U(W.fileIndex.jobs[0].id);else if(!W.fileIndex.jobs[0])m(""),b(""),T("");else if(G&&h){const z=await ye.readFileTranslation(h);b(z.output),T(z.report)}}catch(W){f(_t("Load file translation list",W))}}async function U(G){m(G),b(""),T("");try{const W=await ye.readFileTranslation(G);b(W.output),T(W.report)}catch(W){f(_t(`Read translated file ${G}`,W))}}async function F(){S(!0),await K(y,L)}async function K(G="",W=""){j(!0),f("");try{const Z=await ye.browseTranslationSourceFiles({path:G,query:W,limit:250});_(Z),A(Z.currentPath),D(W)}catch(Z){f(_t("Browse translation source files",Z))}finally{j(!1)}}async function Y(G=R){const W=G.trim();if(W){p(!0),f("");try{if(!r)throw new Error("Create or select a task before translating files.");const Z=await ye.createFileTranslation({taskSlug:r,sourcePath:W,targetLanguage:s});S(!1),await H(),await U(Z.id)}catch(Z){f(_t(`Create file translation for ${W}`,Z))}finally{p(!1)}}}return n?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:x.jsx(s2,{busy:d,state:o,selectedJobId:h,output:u,report:C,onClose:()=>{S(!1),l()},onRefresh:()=>void H(),onSelectJob:G=>void U(G),onTranslate:()=>void F()})}),E?x.jsx(r2,{busy:d||M,state:v,currentPath:y,query:L,selectedPath:R,onBrowse:(G,W)=>void K(G,W),onClose:()=>S(!1),onQueryChange:D,onSelectPath:k,onTranslate:()=>void Y()}):null]}):null}function r2({busy:n,state:r,currentPath:s,query:l,selectedPath:d,onBrowse:p,onClose:f,onQueryChange:o,onSelectPath:c,onTranslate:h}){const m=(r==null?void 0:r.entries)??[],u=m.filter(C=>C.type==="directory"),b=m.filter(C=>C.type==="file");return x.jsx("div",{className:"modal-backdrop translation-file-browser-backdrop",children:x.jsxs("section",{className:"translation-file-browser-modal",role:"dialog","aria-modal":"true","aria-label":"Select Source File",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Select Source File"}),x.jsx("p",{children:s||"."})]}),x.jsx("button",{type:"button",onClick:f,children:"Close"})]}),x.jsxs("div",{className:"translation-file-browser-controls",children:[x.jsxs("div",{className:"translation-file-browser-nav",children:[x.jsx("button",{type:"button",disabled:n||!s,onClick:()=>p((r==null?void 0:r.parentPath)??"",""),children:"Up"}),x.jsx("button",{type:"button",disabled:n||!s,onClick:()=>p("",""),children:"Root"})]}),x.jsxs("form",{className:"translation-file-browser-search",onSubmit:C=>{C.preventDefault(),p(s,l)},children:[x.jsx("input",{value:l,onChange:C=>o(C.target.value),placeholder:"Search files"}),x.jsx("button",{type:"submit",disabled:n,children:"Search"}),x.jsx("button",{type:"button",disabled:n||!l,onClick:()=>p(s,""),children:"Clear"})]})]}),x.jsxs("div",{className:"translation-file-browser-layout",children:[x.jsxs("div",{className:"translation-file-browser-list",children:[n&&!r?x.jsx("p",{className:"muted",children:"Loading files..."}):null,!n&&m.length===0?x.jsx("p",{className:"muted",children:"No source files found."}):null,u.length>0?x.jsxs("div",{className:"translation-file-browser-group",children:[x.jsx("h3",{children:"Folders"}),u.map(C=>x.jsx(Ig,{entry:C,selected:d===C.path,onBrowse:p,onSelectPath:c},C.path))]}):null,b.length>0?x.jsxs("div",{className:"translation-file-browser-group",children:[x.jsx("h3",{children:"Files"}),b.map(C=>x.jsx(Ig,{entry:C,selected:d===C.path,onBrowse:p,onSelectPath:c},C.path))]}):null,r!=null&&r.truncated?x.jsx("p",{className:"translation-entry-note",children:"Result limit reached."}):null]}),x.jsxs("aside",{className:"translation-file-browser-selection",children:[x.jsxs("label",{children:[x.jsx("span",{children:"Source path"}),x.jsx("input",{value:d,onChange:C=>c(C.target.value)})]}),x.jsx("button",{type:"button",disabled:n||!d.trim(),onClick:h,children:"Translate File"})]})]})]})})}function Ig({entry:n,selected:r,onBrowse:s,onSelectPath:l}){const d=n.type==="directory";return x.jsxs("button",{className:r?"translation-file-browser-entry is-selected":"translation-file-browser-entry",type:"button",onClick:()=>d?s(n.path,""):l(n.path),onDoubleClick:()=>d?s(n.path,""):void 0,children:[x.jsx("span",{children:d?"DIR":"FILE"}),x.jsx("strong",{children:n.name}),x.jsx("small",{children:n.path})]})}function s2({busy:n,state:r,selectedJobId:s,output:l,report:d,onClose:p,onRefresh:f,onSelectJob:o,onTranslate:c}){const h=(r==null?void 0:r.fileIndex.jobs)??[],m=h.find(u=>u.id===s);return x.jsxs("section",{className:"file-translation-modal",role:"dialog","aria-modal":"true","aria-label":"File Translation",children:[x.jsxs("header",{className:"file-translation-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"File Translation"}),x.jsx("p",{children:"Claude Code · 中英互译"})]}),x.jsxs("div",{className:"file-translation-toolbar",children:[x.jsx("button",{type:"button",disabled:n,onClick:c,children:"Translate"}),x.jsx("button",{type:"button",disabled:n,onClick:f,children:"Refresh"}),x.jsx("button",{type:"button",onClick:p,children:"Close"})]})]}),r!=null&&r.memoryInitialized?null:x.jsx("p",{className:"translation-entry-note",children:"Translation memory is not initialized. Run Bootstrap from the sidebar before important file translations."}),x.jsxs("div",{className:"file-translation-layout",children:[x.jsxs("div",{className:"file-translation-list",children:[h.length===0?x.jsx("p",{className:"muted",children:"No translated files yet."}):null,h.map(u=>x.jsxs("button",{className:u.id===s?"file-translation-item is-active":"file-translation-item",type:"button",onClick:()=>o(u.id),children:[x.jsx("strong",{children:u.sourcePath}),x.jsxs("span",{children:[u.status," · ",u.targetLanguage]})]},u.id))]}),x.jsx("div",{className:"file-translation-preview",children:m?x.jsxs(x.Fragment,{children:[x.jsxs("header",{children:[x.jsx("strong",{children:m.sourcePath}),x.jsx("span",{children:m.status})]}),x.jsx("div",{className:"translation-markdown",children:x.jsx(F_,{remarkPlugins:[fv],children:l||d||"Translation output is not available yet."})})]}):x.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function a2({entry:n}){if(n.sourceKind==="conversation-boundary")return x.jsx(l2,{entry:n});const r=h2(n),s=n.sourceKind==="tool-output",l=n.direction==="user-input-to-english",d=["translation-entry",`is-${n.sourceKind}`,l?"is-user-input":""].filter(Boolean).join(" ");return x.jsxs("article",{className:d,children:[s?x.jsx("pre",{children:r}):x.jsx("div",{className:"translation-markdown",children:x.jsx(F_,{remarkPlugins:[fv],children:r})}),n.warning?x.jsx("p",{className:"translation-entry-note",children:n.warning}):null,n.error?x.jsx("p",{className:"translation-entry-note is-error",children:n.error}):null]})}function l2({entry:n}){const r=n.boundaryKind==="end"?"结束":"开始",s=n.conversationTurn??0,l=p2(n.occurredAt??n.createdAt);return x.jsxs("div",{className:"translation-conversation-boundary","aria-label":`${r} 第 ${s} 轮 ${l}`,children:[x.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"}),x.jsx("span",{children:r}),x.jsxs("span",{children:["第 ",s," 轮"]}),x.jsx("time",{children:l}),x.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"})]})}function o2(n){const r=n.find(mv);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function c2(n,r,s){const l=n.find(mv);if(l)return`translating ${d2(Math.max(0,s-u2(l)))}`;const d=n.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function mv(n){return n.status==="queued"||n.status==="translating"}function u2(n){const r=Date.parse(n.translationStartedAt??n.createdAt);return Number.isFinite(r)?r:Date.now()}function h2(n){return n.status==="queued"||n.status==="translating"?n.sourceText:n.status==="translated"?n.direction==="user-input-to-english"?gv(n.sourceText,n.translatedText):n.translatedText:n.translatedText||n.sourceText}function gv(n,r){return`${n.trimEnd()}${Ro}${r.trimStart()}`}function f2(n){return n.includes(Ro)}function Ug(n){const r=n.indexOf(Ro);return r===-1?n:n.slice(r+Ro.length)}function d2(n){if(n<1e3)return`${Math.max(.1,n/1e3).toFixed(1)}s`;const r=n/1e3;if(r<60)return`${r.toFixed(1)}s`;const s=Math.floor(r/60),l=Math.floor(r%60).toString().padStart(2,"0");return`${s}:${l}`}function p2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}const m2=8;function g2(){const[n,r]=te.useState([]);return te.useEffect(()=>{const s=p=>{var c,h;const f=(h=(c=p.detail)==null?void 0:c.message)==null?void 0:h.trim();if(!f)return;const o=new Date().toISOString();r(m=>{const u=m.find(b=>b.message===f);return u?[{...u,count:u.count+1,updatedAt:o},...m.filter(b=>b.id!==u.id)]:[{id:`ui_error_${Date.now()}_${Math.random().toString(16).slice(2)}`,message:f,count:1,createdAt:o,updatedAt:o},...m].slice(0,m2)})},l=p=>{var o;const f=((o=p.detail)==null?void 0:o.actions)??[];f.length!==0&&r(c=>c.filter(h=>!f.some(m=>h.message.startsWith(`${m} failed.`))))},d=p=>{var o,c;const f=(c=(o=p.detail)==null?void 0:o.message)==null?void 0:c.trim();f&&r(h=>h.filter(m=>m.message!==f))};return window.addEventListener(hh,s),window.addEventListener(fh,l),window.addEventListener(dh,d),()=>{window.removeEventListener(hh,s),window.removeEventListener(fh,l),window.removeEventListener(dh,d)}},[]),n.length===0?null:x.jsxs("aside",{className:"ui-error-center",role:"alert","aria-live":"polite","aria-label":"Application errors",children:[x.jsxs("header",{className:"ui-error-center-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Errors"}),x.jsxs("p",{children:[n.length," active"]})]}),x.jsx("button",{type:"button",onClick:()=>r([]),children:"Clear"})]}),x.jsx("ol",{className:"ui-error-list",children:n.map(s=>x.jsxs("li",{children:[x.jsxs("div",{children:[x.jsx("p",{children:s.message}),x.jsxs("span",{children:[_2(s.updatedAt),s.count>1?` · repeated ${s.count} times`:""]})]}),x.jsx("button",{type:"button","aria-label":"Dismiss error",onClick:()=>r(l=>l.filter(d=>d.id!==s.id)),children:"Close"})]},s.id))})]})}function _2(n){return new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function v2(n,r){return n.find(s=>s.taskSlug===r)??n[0]??null}const y2=3,S2=3e4,wo=new Map;function _v(n,r){const s=_t(n,r);if(!b2(r))return wo.set(n,{consecutiveFailures:1,lastMessage:s,lastReportedAt:Date.now()}),s;const l=wo.get(n),d=((l==null?void 0:l.consecutiveFailures)??0)+1,p=Date.now(),f=d>=y2&&(!l||l.lastMessage!==s||p-l.lastReportedAt>=S2);return wo.set(n,{consecutiveFailures:d,lastMessage:s,lastReportedAt:f?p:(l==null?void 0:l.lastReportedAt)??0}),f?s:null}function Do(n){wo.delete(n),c1([n])}function b2(n){const r=Lo(n);return r.includes("could not reach the VCM backend")||r.includes("Failed to fetch")||r.includes("NetworkError")||r.includes("Load failed")||r.includes("ERR_CONNECTION")}function C2(n,r){const s=zs.map(l=>({role:l.name,permissionMode:n.roles[l.name].permissionMode,model:n.roles[l.name].model,effort:n.roles[l.name].effort}));if(r.gateReviewerEnabled){const l=n.roles["gate-reviewer"];s.push({role:"gate-reviewer",permissionMode:l.permissionMode,model:l.model,effort:l.effort})}return s}const w2=["architecture-plan","validation-adequacy","final-diff"];function x2({events:n,maxEvents:r=8,showHeader:s=!0}){const l=r===null?n:n.slice(-r);return x.jsxs("section",{className:"event-log",children:[s?x.jsx("h2",{children:"Events"}):null,n.length===0?x.jsx("p",{className:"muted",children:"No terminal events yet."}):x.jsx("ol",{children:l.map((d,p)=>x.jsx("li",{children:d},`${d}-${p}`))})]})}function di({checked:n,className:r,disabled:s,label:l,stateLabel:d,title:p,onChange:f}){const o=["switch-control",n?"is-on":"is-off",r].filter(Boolean).join(" "),c=d??(n?"on":"off");return x.jsxs("button",{type:"button",role:"switch","aria-checked":n,"aria-label":`${l}: ${c}`,className:o,disabled:s,title:p,onClick:()=>f(!n),children:[x.jsx("span",{className:"switch-control-label",children:l}),x.jsx("span",{className:"switch-control-track","aria-hidden":"true",children:x.jsx("span",{className:"switch-control-thumb"})})]})}function E2({status:n,bootstrapStatus:r,applyResult:s,hasActiveTask:l=!1,autoTaskHarnessReviewEnabled:d,busy:p=!1,onRefresh:f,onApply:o,onOpenStudio:c,onOpenRepositoryDiff:h,onAutoTaskHarnessReviewChange:m,onStartBootstrap:u,onRestartBootstrap:b,onStopBootstrap:C,onRunBootstrap:T}){const[E,S]=te.useState(!1),[v,_]=te.useState("bypassPermissions"),[y,A]=te.useState("default"),[L,D]=te.useState("default"),R=r==null?void 0:r.session,k=(r==null?void 0:r.status)==="running",M=(R==null?void 0:R.status)==="running",j=(r==null?void 0:r.status)!=="complete",H={permissionMode:v,model:y,effort:L};return l?n?x.jsxs("section",{className:"harness-panel",children:[x.jsxs("div",{className:"harness-stage",children:[x.jsxs("div",{className:"harness-panel-header",children:[x.jsxs("div",{children:[x.jsx("strong",{children:"Fixed install"}),x.jsx("p",{className:"muted",children:n.initialized?n.needsApply?`${n.plannedChanges.length} pending updates`:"Up to date":"Not initialized"})]}),x.jsx("div",{className:"harness-actions",children:n.initialized?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:p,onClick:()=>void f(),children:"Refresh"}),n.needsApply?x.jsx("button",{type:"button",disabled:p,onClick:()=>void o(),children:"Update"}):null]}):x.jsx("button",{type:"button",disabled:p,onClick:()=>void o(),children:"Initialize"})})]}),n.initialized&&n.needsApply?x.jsxs(x.Fragment,{children:[x.jsx("h3",{className:"harness-file-list-title",children:"Files to update"}),x.jsx("ol",{className:"harness-file-list",children:n.plannedChanges.map(U=>x.jsxs("li",{children:[x.jsx("span",{children:U.path}),x.jsx(Bi,{status:U.action})]},`${U.path}:${U.action}`))})]}):null]}),x.jsxs("div",{className:"harness-stage",children:[x.jsxs("div",{className:"harness-panel-header",children:[x.jsx("div",{children:x.jsx("strong",{children:"Harness Studio"})}),x.jsx("div",{className:"harness-actions",children:x.jsx("button",{type:"button",disabled:p,onClick:c,children:"Open Studio"})})]}),x.jsx("button",{className:"harness-review-diff-button",type:"button",disabled:p,onClick:h,children:"Review Diff"}),x.jsx(di,{checked:d,className:"sidebar-switch",disabled:p,label:"Auto task harness review",title:"Automatically ask Harness Engineer to review task harness after final acceptance completes",onChange:m})]}),j?x.jsx("div",{className:"harness-stage",children:x.jsxs("div",{className:"harness-panel-header",children:[x.jsxs("div",{children:[x.jsx("strong",{children:"Bootstrap"}),x.jsx("p",{className:"muted",children:r?k2(r.status):"not loaded"})]}),x.jsx("div",{className:"harness-actions",children:x.jsx("button",{type:"button",disabled:p||!(r!=null&&r.canStart),onClick:()=>{S(!0)},children:"Open Bootstrap"})})]})}):null,s!=null&&s.changedFiles.length?x.jsx("div",{className:"harness-result",children:x.jsx("p",{className:"muted",children:s.message})}):null,n.warnings.length>0?x.jsx("ul",{className:"warnings",children:n.warnings.map(U=>x.jsx("li",{children:U},U))}):null,r!=null&&r.warnings.length?x.jsx("ul",{className:"warnings",children:r.warnings.map(U=>x.jsx("li",{children:U},U))}):null,j&&E?x.jsx("div",{className:"harness-bootstrap-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Engineer bootstrap session",children:x.jsxs("div",{className:"harness-bootstrap-modal-surface",children:[x.jsxs("header",{className:"harness-bootstrap-modal-header",children:[x.jsxs("div",{children:[x.jsx("strong",{children:"Harness Engineer Bootstrap"}),x.jsx("p",{className:"muted",children:(R==null?void 0:R.command)??"Start Harness Engineer, then run bootstrap when ready."})]}),x.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[R?x.jsx(Bi,{status:R.status}):null,x.jsx("button",{type:"button",onClick:()=>S(!1),children:"Close"})]})]}),x.jsxs("div",{className:"harness-bootstrap-controls",children:[x.jsxs("label",{children:[x.jsx("span",{children:"Permission"}),x.jsx("select",{value:v,disabled:p||k||M,onChange:U=>_(U.target.value),children:i_.map(U=>x.jsx("option",{value:U.value,children:U.label},U.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Model"}),x.jsx("select",{value:y,disabled:p||k||M,onChange:U=>A(U.target.value),children:r_.map(U=>x.jsx("option",{value:U.value,children:U.label},U.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Effort"}),x.jsx("select",{value:L,disabled:p||k||M,onChange:U=>D(U.target.value),children:s_.map(U=>x.jsx("option",{value:U.value,children:U.label},U.value))})]}),x.jsxs("div",{className:"harness-bootstrap-control-actions",children:[x.jsx("button",{type:"button",disabled:p||k||!(r!=null&&r.canStart),onClick:()=>void u(H),children:"Start"}),x.jsx("button",{type:"button",disabled:p||k||!(r!=null&&r.canStart),onClick:()=>void b(H),children:"Restart"}),x.jsx("button",{type:"button",disabled:p||!R,onClick:()=>void C(),children:"Stop"}),x.jsx("button",{type:"button",disabled:p||k||!M,onClick:()=>void T(),children:"Run bootstrap"})]})]}),x.jsx("div",{className:"harness-bootstrap-terminal",children:M?x.jsx(Oo,{sessionId:R.id,active:E}):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"Harness Bootstrap"}),x.jsx("span",{children:"Start Harness Engineer first. When it is ready, click Run bootstrap to send the prompt."})]})})]})}):null]}):null:x.jsx("section",{className:"harness-panel",children:x.jsxs("div",{className:"harness-result",children:[x.jsx("strong",{children:"Task required"}),x.jsx("p",{className:"muted",children:"Create or select a task before changing VCM Harness. Harness changes are committed in the active task worktree."})]})})}function k2(n){return n.replaceAll("_"," ")}function Jh(n){return{total:n.length,accepted:n.filter(r=>r.acceptedAt).length,delivered:n.filter(r=>r.deliveredAt).length}}function A2(n,r=6){const s=[...n].sort(D2).map((d,p)=>({message:d,sequence:p+1}));return[...r===null?s:s.slice(-r)].sort((d,p)=>p.sequence-d.sequence)}function T2({messages:n,orchestration:r,busy:s,maxMessages:l=6,showControls:d=!0,showHeader:p=!0,onModeChange:f,onMarkAllDone:o}){const[c,h]=te.useState(null),m=Jh(n),u=(r==null?void 0:r.mode)??"auto",b=A2(n,l);async function C(T){await M2(T.body),h(T.id),window.setTimeout(()=>h(E=>E===T.id?null:E),1200)}return x.jsxs("section",{className:"message-panel",children:[p?x.jsxs("div",{className:"message-panel-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Messages"}),x.jsxs("p",{className:"muted",children:[m.total," total / ",m.accepted," accepted"]})]}),d&&f?x.jsx("div",{className:"message-controls",children:x.jsx(di,{checked:u==="auto",className:"message-mode-toggle",disabled:s,label:"Auto orchestration",onChange:T=>f(T?"auto":"manual")})}):null,d&&o?x.jsx("button",{type:"button",disabled:s,onClick:o,children:"Mark All Done"}):null]}):null,n.length===0?x.jsx("p",{className:"muted",children:"No role messages yet."}):x.jsx("ol",{className:"message-list",children:b.map(({message:T,sequence:E})=>x.jsxs("li",{className:"message-item",children:[x.jsxs("div",{className:"message-item-main",children:[x.jsxs("div",{className:"message-meta",children:[x.jsxs("span",{className:"message-sequence",children:["#",E]}),x.jsx("time",{dateTime:Mo(T),children:R2(Mo(T))}),x.jsxs("strong",{children:[T.fromRole," ","->"," ",T.toRole]}),x.jsx("span",{children:T.type})]}),x.jsx("p",{children:T.body}),T.failureReason?x.jsx("span",{className:"message-reason",children:T.failureReason}):null,T.bodyPath?x.jsx("span",{className:"message-path",children:T.bodyPath}):null]}),x.jsx("div",{className:"message-actions",children:x.jsx("button",{type:"button",disabled:s,onClick:()=>void C(T),children:c===T.id?"Copied":"Copy"})})]},T.id))})]})}function R2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Mo(n){return n.acceptedAt??n.deliveredAt??n.dispatchingAt??n.createdAt}function D2(n,r){const s=Mo(n).localeCompare(Mo(r));if(s!==0)return s;const l=n.createdAt.localeCompare(r.createdAt);return l!==0?l:n.id.localeCompare(r.id)}async function M2(n){var s;if((s=navigator.clipboard)!=null&&s.writeText){await navigator.clipboard.writeText(n);return}const r=document.createElement("textarea");r.value=n,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.left="-9999px",document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove()}function L2({defaultPath:n="",recentPaths:r=[],busy:s=!1,onConnect:l}){const[d,p]=te.useState(n);te.useEffect(()=>{n&&p(n)},[n]);async function f(o){o.preventDefault(),await l(d)}return x.jsx("form",{className:"repo-connect",onSubmit:f,children:x.jsxs("div",{className:r.length>0?"inline-form has-recent-paths":"inline-form",children:[x.jsx("input",{"aria-label":"Repository path",id:"repo-path",value:d,onChange:o=>p(o.target.value),placeholder:"/path/to/repo"}),r.length>0?x.jsxs("select",{"aria-label":"Recent repositories",className:"repo-recent-select",value:"",onChange:o=>{o.target.value&&p(o.target.value)},children:[x.jsx("option",{value:"",children:"Recent"}),r.map(o=>x.jsx("option",{value:o,children:o},o))]}):null,x.jsx("button",{type:"submit",disabled:s||!d.trim(),children:"Connect"})]})})}function O2({tasks:n,activeTaskSlug:r,onSelect:s}){return x.jsx("nav",{className:"task-nav","aria-label":"Tasks",children:n.map(l=>x.jsxs("button",{className:l.taskSlug===r?"task-nav-item is-active":"task-nav-item",type:"button",onClick:()=>s(l.taskSlug),children:[x.jsx("span",{children:l.title||l.taskSlug}),x.jsx(Bi,{status:l.status})]},l.taskSlug))})}function B2({project:n,recentRepositoryPaths:r,tasks:s,activeTaskSlug:l,messages:d,orchestration:p,events:f,roundState:o,gateReview:c,translationEnabled:h,translationAutoSendEnabled:m,translationTargetLanguage:u,translationOutputMode:b,translationMemoryInitialized:C,translatorSession:T,harnessStatus:E,harnessBootstrapStatus:S,harnessApplyResult:v,autoTaskHarnessReviewEnabled:_,gatewayStatus:y,gatewayQrLogin:A,gatewayQrCheck:L,gatewayLarkRegistration:D,gatewayLarkRegistrationCheck:R,busy:k,onConnect:M,onRefreshConnectedRepository:j,onPullConnectedRepository:H,onRefreshHarness:U,onApplyHarness:F,onStartHarnessBootstrap:K,onRestartHarnessBootstrap:Y,onStopHarnessBootstrap:G,onRunHarnessBootstrap:W,onOpenHarnessStudio:Z,onOpenRepositoryDiff:z,onAutoTaskHarnessReviewChange:O,onRefreshGateway:N,onGatewayEnabledChange:$,onGatewaySettingsChange:I,onGatewayTranslationChange:re,onStartGatewayQrLogin:ve,onStartGatewayLarkRegistration:ge,onResetGatewayBinding:Q,onGateReviewGateEnabledChange:q,onTranslationEnabledChange:ee,onTranslationAutoSendChange:se,onTranslationTargetLanguageChange:we,onTranslationOutputModeChange:he,onOpenFileTranslation:pe,onOpenTranslatorSession:ke,onCreateTranslationBootstrap:Be,onUpdateTranslationMemory:Ke,onCreateTask:xe,onCloseTask:rt,onSelectTask:wt,themeMode:yt,onAutoOrchestrationChange:It,onThemeModeChange:yn,pauseAlertSound:xt,onPauseAlertSoundChange:tt,roleRetryEnabled:jt,onRoleRetryEnabledChange:ue,permissionRequestMode:Se,onPermissionRequestModeChange:Ae,launchTemplate:Le,canSaveLaunchTemplate:je,canOneClickStart:mt,onSaveLaunchTemplate:Fe,onOneClickStart:St,onMarkAllMessagesDone:vt,onDeleteMessageHistory:Nt}){const[Qe,rn]=te.useState(""),[Ht,ln]=te.useState(!1),[Vn,Wn]=te.useState(!1),[Pt,on]=te.useState(()=>l?null:"repository"),Kn=Jh(d),Xt=Qe.trim(),$s=z2(n,l,E),Qt=s.filter(ze=>ze.cleanupStatus!=="cleaned"),Sn=Qt.find(ze=>ze.taskSlug===l)??null;te.useEffect(()=>{on(ze=>!l&&ze===null?n?"task":"repository":ze)},[l,n]);function Ft(ze,mi){on(mi?ze:null)}async function Hi(ze){ze.preventDefault(),await xe({taskSlug:Xt}),rn("")}return x.jsxs("div",{className:"project-dashboard",children:[x.jsx("header",{className:"brand-header",children:x.jsx("strong",{children:"VibeCodingMaster"})}),x.jsx(Hr,{title:"Repository",open:Pt==="repository",onOpenChange:ze=>{Ft("repository",ze),ze&&n&&j()},children:x.jsxs("div",{className:"repository-panel",children:[x.jsx(L2,{defaultPath:(n==null?void 0:n.repoRoot)??"",recentPaths:r,busy:k,onConnect:M}),n?x.jsx(F2,{busy:k,project:n,onPull:H}):null]})}),x.jsx(Hr,{title:"Settings",open:Pt==="settings",onOpenChange:ze=>Ft("settings",ze),children:x.jsxs("div",{className:"sidebar-settings",children:[x.jsxs("button",{"aria-label":`Theme mode: ${Fg(yt)}`,className:"settings-toggle theme-mode-toggle",disabled:k,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>yn(W2(yt)),children:[x.jsx("span",{children:"Theme"}),x.jsx("span",{children:Fg(yt)})]}),x.jsx(di,{checked:((p==null?void 0:p.mode)??"auto")==="auto",className:"sidebar-switch",disabled:k||!l,label:"Auto orchestration",title:l?"Automatically dispatch role messages during the active task":"Create or select a task first",onChange:It}),x.jsx(di,{checked:xt,className:"sidebar-switch",disabled:k,label:"Pause alert sound",title:"Play a sound when VCM shows the fixed flow pause dialog",onChange:ze=>tt(ze)}),x.jsx(di,{checked:jt,className:"sidebar-switch",disabled:k,label:"CC auto retry",title:"Retry temporary Claude Code turn failures before showing the flow pause alert",onChange:ze=>ue(ze)}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Permission requests"}),x.jsxs("select",{value:Se,disabled:k,onChange:ze=>Ae(ze.target.value),children:[x.jsx("option",{value:"off",children:"off"}),x.jsx("option",{value:"allowAll",children:"allow all"})]})]}),x.jsxs("button",{className:"settings-toggle",disabled:k||!je,title:"Save the current core role launch settings and optional Gate Reviewer settings",type:"button",onClick:Fe,children:[x.jsx("span",{children:"Save launch template"}),x.jsx("span",{children:je?"ready":"open task"})]}),mt?x.jsxs("button",{className:"settings-toggle is-active",disabled:k,title:j2(Le),type:"button",onClick:St,children:[x.jsx("span",{children:"One-click start"}),x.jsx("span",{children:vv(Le)})]}):null,l?x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",onClick:()=>ln(!0),children:[x.jsx("span",{children:"Messages"}),x.jsxs("span",{className:"muted",children:[Kn.total," total"]})]}),x.jsxs("button",{type:"button",onClick:()=>Wn(!0),children:[x.jsx("span",{children:"Events"}),x.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),x.jsx(Hr,{title:"Translation",open:Pt==="translation",onOpenChange:ze=>Ft("translation",ze),children:x.jsx(N2,{busy:k,enabled:h,autoSendEnabled:m,targetLanguage:u,outputMode:b,memoryInitialized:C,baseUnavailableReason:$s,translatorSession:T,onAutoSendChange:se,onCreateBootstrap:Be,onEnabledChange:ee,onUpdateMemory:Ke,onTargetLanguageChange:we,onOutputModeChange:he,onOpenFileTranslation:pe,onOpenTranslatorSession:ke})}),n&&l?x.jsx(Hr,{title:"Gate Review Gates",open:Pt==="gate-review-gates",onOpenChange:ze=>Ft("gate-review-gates",ze),children:x.jsx(I2,{busy:k,state:c,onGateEnabledChange:q})}):null,x.jsx(Hr,{title:"Gateway",open:Pt==="gateway",onOpenChange:ze=>{Ft("gateway",ze),ze&&N()},children:x.jsx(P2,{busy:k,qrCheck:L,qrLogin:A,larkRegistration:D,larkRegistrationCheck:R,status:y,onEnabledChange:$,onSettingsChange:I,onResetBinding:Q,onStartLarkRegistration:ge,onStartQrLogin:ve,onTranslationChange:re})}),n?x.jsx(Hr,{title:"VCM Harness",open:Pt==="vcm-harness",onOpenChange:ze=>Ft("vcm-harness",ze),children:x.jsx(E2,{status:E,bootstrapStatus:S,applyResult:v,hasActiveTask:!!Sn,autoTaskHarnessReviewEnabled:_,busy:k,onRefresh:U,onApply:F,onOpenStudio:Z,onOpenRepositoryDiff:z,onAutoTaskHarnessReviewChange:O,onStartBootstrap:K,onRestartBootstrap:Y,onStopBootstrap:G,onRunBootstrap:W})}):null,n?x.jsx(Hr,{title:"Task",open:Pt==="task",onOpenChange:ze=>Ft("task",ze),children:Qt.length>0?x.jsxs("div",{className:"task-panel",children:[x.jsx(O2,{tasks:Qt,activeTaskSlug:l,onSelect:wt}),Sn?x.jsx("div",{className:"task-panel-actions",children:x.jsx("button",{className:"danger-button",disabled:k,type:"button",onClick:rt,children:"Close Task"})}):null]}):x.jsx("div",{className:"task-create",children:x.jsxs("form",{onSubmit:Hi,children:[x.jsx("input",{value:Qe,onChange:ze=>rn(ze.target.value),placeholder:"task name"}),x.jsxs("div",{className:"task-create-preview",children:[x.jsxs("small",{children:["branch: ",Xt?`feature/${Xt}`:"feature/<task>"]}),x.jsxs("small",{children:["worktree: ",Xt?`.claude/worktrees/${Xt}`:".claude/worktrees/<task>"]})]}),x.jsx("button",{type:"submit",disabled:k||!Xt,children:"Create"})]})})}):null,n&&Sn?x.jsx(G2,{task:Sn,roundState:o}):null,Ht?x.jsx(Y2,{busy:k,messages:d,orchestration:p,onClose:()=>ln(!1),onMarkAllDone:()=>{l&&vt(l)},onDeleteMessageHistory:()=>{l&&Nt(l)}}):null,Vn?x.jsx(K2,{events:f,onClose:()=>Wn(!1)}):null]})}function vv(n){return[n.autoOrchestration?"auto":"manual"].join(" + ")}function j2(n){const r=Object.entries(n.roles).map(([s,l])=>`${s}: ${l.permissionMode} / ${l.model} / ${l.effort}`).join("; ");return`Launch template: ${vv(n)}; ${r}`}function N2({autoSendEnabled:n,baseUnavailableReason:r,busy:s,enabled:l,memoryInitialized:d,outputMode:p,targetLanguage:f,translatorSession:o,onAutoSendChange:c,onCreateBootstrap:h,onEnabledChange:m,onUpdateMemory:u,onOutputModeChange:b,onTargetLanguageChange:C,onOpenFileTranslation:T,onOpenTranslatorSession:E}){const S=!!(s||r),v=(o==null?void 0:o.status)==="running",_=!!(l&&!r&&v),y=r??(v?null:"Start Translator session first."),A=!!(s||y),D=r??"Open Translator session",R=y??"Translation tools are ready";return x.jsxs("div",{className:"sidebar-settings",children:[x.jsx(di,{checked:_,className:"sidebar-switch",disabled:S||!v,label:"Conversation translation",title:R,onChange:m}),x.jsx(di,{checked:n,className:"sidebar-switch",disabled:S,label:"Auto-send",onChange:c}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Language"}),x.jsx("select",{value:f,disabled:S,onChange:k=>C(k.target.value),children:t_.map(k=>x.jsx("option",{value:k.value,children:k.label},k.value))})]}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Reply scope"}),x.jsx("select",{value:p,disabled:S,onChange:k=>b(k.target.value),children:Z0.map(k=>x.jsx("option",{value:k.value,children:k.label},k.value))})]}),x.jsxs("button",{className:"settings-toggle",disabled:A,title:R,type:"button",onClick:T,children:[x.jsx("span",{children:"File translation"}),x.jsx("span",{children:"open"})]}),d?null:x.jsxs("button",{className:"settings-toggle",disabled:A,title:R,type:"button",onClick:h,children:[x.jsx("span",{children:"Bootstrap"}),x.jsx("span",{children:"run"})]}),x.jsxs("button",{className:"settings-toggle",disabled:A,title:R,type:"button",onClick:u,children:[x.jsx("span",{children:"Update memory"}),x.jsx("span",{children:"run"})]}),y?x.jsx("p",{className:"settings-help-text",children:y}):null,x.jsxs("div",{className:"settings-status-row",children:[x.jsx("span",{children:"Session status"}),x.jsx("strong",{children:H2(o)})]}),x.jsxs("button",{className:"settings-toggle",disabled:S,title:D,type:"button",onClick:E,children:[x.jsx("span",{children:"Open Session"}),x.jsx("span",{children:"open"})]})]})}function H2(n){return n?n.status==="running"?n.activityStatus??"idle":n.status:"not started"}function z2(n,r,s){return n?r?s?s.initialized?null:"Initialize VCM Harness first.":"Load VCM Harness status first.":"Create or select a task first.":"Connect a repository first."}function I2({busy:n,onGateEnabledChange:r,state:s}){return x.jsx("div",{className:"sidebar-settings",children:w2.map(l=>{const d=s==null?void 0:s.gates[l],p=!!(d!=null&&d.required);return x.jsx(di,{checked:p,className:"sidebar-switch",disabled:n||!s,label:U2(l),title:d!=null&&d.status?`status: ${d.status}`:void 0,onChange:f=>r(l,f)},l)})})}function U2(n){switch(n){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"final-diff":return"Final diff"}return n}function P2({busy:n,larkRegistration:r,larkRegistrationCheck:s,onEnabledChange:l,onResetBinding:d,onSettingsChange:p,onStartLarkRegistration:f,onStartQrLogin:o,onTranslationChange:c,qrCheck:h,qrLogin:m,status:u}){const b=(u==null?void 0:u.channel)==="lark",C=(u==null?void 0:u.channel)==="lark"?!!(u.binding.appIdConfigured&&u.binding.appSecretConfigured):!!(u!=null&&u.binding.tokenConfigured),T=(u==null?void 0:u.channel)==="lark"?!!(u.binding.appIdConfigured&&u.binding.appSecretConfigured):!!(u!=null&&u.binding.tokenConfigured);return x.jsxs("div",{className:"gateway-panel",children:[x.jsxs("label",{className:"compact-field",children:[x.jsx("span",{children:"Channel"}),x.jsxs("select",{disabled:n||!u,value:(u==null?void 0:u.channel)??"weixin-ilink",onChange:E=>{p({channel:E.currentTarget.value==="lark"?"lark":"weixin-ilink"})},children:[x.jsx("option",{value:"weixin-ilink",children:"Weixin iLink"}),x.jsx("option",{value:"lark",children:"Lark"})]})]}),x.jsxs("div",{className:"gateway-actions",children:[x.jsx(di,{checked:!!(u!=null&&u.enabled),className:"sidebar-switch",disabled:n||!u||!u.enabled&&!C,label:"Gateway",title:C?"Enable or disable PM messages and task-changing Gateway commands":"Configure the selected Gateway channel first",onChange:E=>l(E)}),x.jsx(di,{checked:!!(u!=null&&u.translationEnabled),className:"sidebar-switch",disabled:n||!u,label:"Translation",onChange:E=>c(E)}),b?x.jsx("button",{type:"button",disabled:n,onClick:f,children:"Start QR Setup"}):T?x.jsx("button",{className:"danger-button",type:"button",disabled:n,onClick:d,children:"Reset Binding"}):x.jsx("button",{type:"button",disabled:n,onClick:o,children:"Start QR Login"})]}),b?x.jsxs("div",{className:"gateway-lark-settings",children:[x.jsx("p",{className:"muted",children:u!=null&&u.binding.appIdConfigured&&u.binding.appSecretConfigured?`Lark app configured${u.binding.larkBotName?` · ${u.binding.larkBotName}`:""}.`:"Use QR setup to create and configure the Lark bot automatically."}),r?x.jsxs("p",{className:"muted",children:["QR setup: ",(s==null?void 0:s.status)??r.status,s!=null&&s.message?` · ${s.message}`:""]}):null]}):m?x.jsx("p",{className:"muted",children:"QR login started. Use the login dialog to confirm binding."}):null,!b&&h?x.jsxs("p",{className:"muted",children:["QR status: ",h.status,h.message?` · ${h.message}`:""]}):null]})}function F2({busy:n,onPull:r,project:s}){const l=s.pullDisabledReason,d=!!s.canPull;return x.jsxs("div",{className:"project-summary",children:[x.jsxs("dl",{children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Base path"}),x.jsx("dd",{children:s.repoRoot})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Branch"}),x.jsx("dd",{children:q2(s)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Remote"}),x.jsx("dd",{children:s.upstreamBranch??"no upstream"})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Status"}),x.jsx("dd",{children:$2(s)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Commit"}),x.jsx("dd",{children:s.shortHeadCommit??s.headCommit??"unknown"})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Working tree"}),x.jsx("dd",{children:s.isDirty?"uncommitted changes":"clean"})]})]}),x.jsxs("div",{className:"connected-repo-actions",children:[x.jsx("button",{type:"button",disabled:n||!d,title:l??"Pull latest changes with git pull --ff-only",onClick:()=>void r(),children:"Pull"}),x.jsx("span",{className:"muted",children:s.checkedAt?`checked ${Th(s.checkedAt)}`:"status not refreshed"})]}),l?x.jsx("p",{className:"muted",children:l}):null,s.warnings.length>0?x.jsx("ul",{className:"warnings",children:s.warnings.map(p=>x.jsx("li",{children:p},p))}):null]})}function q2(n){return n.branch||"unknown"}function $2(n){if(!n.upstreamBranch)return"no upstream";const r=n.ahead??0,s=n.behind??0;return r===0&&s===0?"up to date":r>0&&s>0?`ahead ${r}, behind ${s}`:r>0?`ahead ${r}`:`behind ${s}`}function G2({roundState:n,task:r}){var m;const[s,l]=te.useState(()=>Date.now()),d=!!(n!=null&&n.startedAt),p=yv(r.createdAt,s),f=Pg(n,(n==null?void 0:n.totalCcActiveMs)??0,s),o=d&&n?Pg(n,n.currentRoundCcActiveMs,s):0,c=d&&n?V2(n,s):0,h=((m=r.title)==null?void 0:m.trim())||r.taskSlug;return te.useEffect(()=>{const u=window.setInterval(()=>l(Date.now()),1e3);return()=>window.clearInterval(u)},[]),x.jsxs("section",{className:"task-status-dock","aria-label":"VCM Session status",children:[x.jsxs("div",{className:"task-status-dock-title",children:[x.jsx("strong",{title:h,children:h}),x.jsx("span",{className:`status-badge status-${r.status}`,children:r.status})]}),x.jsxs("dl",{className:"task-status-stats",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Session start"}),x.jsx("dd",{children:Th(r.createdAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Session total"}),x.jsx("dd",{children:So(p)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Rounds"}),x.jsx("dd",{children:(n==null?void 0:n.totalRoundCount)??0})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Role runtime"}),x.jsx("dd",{children:So(f)})]})]}),d&&n?x.jsxs("div",{className:"current-round-status",children:[x.jsxs("div",{className:"current-round-title",children:[x.jsx("span",{children:n.status==="running"?"Current Round":"Last Round"}),x.jsx("span",{className:`status-badge status-${n.status}`,children:n.status})]}),x.jsxs("dl",{className:"task-status-stats",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Started"}),x.jsx("dd",{children:Th(n.startedAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Total"}),x.jsx("dd",{children:So(c)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Role runtime"}),x.jsx("dd",{children:So(o)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Turn count"}),x.jsx("dd",{children:n.turnCount})]})]})]}):null]})}function Pg(n,r,s){if(!(n!=null&&n.activeTurnStartedAt)||n.status!=="running")return r;const l=Date.parse(n.updatedAt);return Number.isFinite(l)?r+Math.max(0,s-l):r}function V2(n,r){const s=n.status==="running"?r:Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return yv(n.startedAt??"",Number.isFinite(s)?s:r)}function yv(n,r){const s=Date.parse(n);return Number.isFinite(s)?Math.max(0,r-s):0}function Th(n){if(!n)return"-";const r=new Date(n);return Number.isNaN(r.getTime())?"-":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(r)}function So(n){const r=Math.max(0,Math.floor(n/1e3)),s=Math.floor(r/3600),l=Math.floor(r%3600/60),d=r%60;return s>0?l>0?`${s}h ${l}m`:`${s}h`:l>0?d>0?`${l}m ${d}s`:`${l}m`:`${d}s`}function W2(n){return n==="system"?"light":n==="light"?"dark":"system"}function Fg(n){return n==="system"?"System":n==="light"?"Light":"Dark"}function K2({events:n,onClose:r}){return x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{className:"event-modal",role:"dialog","aria-modal":"true","aria-label":"Events",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Events"}),x.jsxs("p",{className:"muted",children:[n.length," total"]})]}),x.jsx("button",{type:"button",onClick:r,children:"Close"})]}),x.jsx(x2,{events:n,maxEvents:null,showHeader:!1})]})})}function Y2({busy:n,messages:r,orchestration:s,onClose:l,onMarkAllDone:d,onDeleteMessageHistory:p}){const f=Jh(r);function o(){window.confirm(["Clear all pending route-file messages?","","Use this only after you manually copied or handled stuck route-file messages.","VCM will clear non-empty handoff message files so Stop-hook orchestration can continue."].join(`
|
|
94
|
+
`))&&d()}function c(){window.confirm([`Delete ${f.total} message histor${f.total===1?"y item":"y items"}?`,"","This removes message history from the Messages panel.","Pending route-file messages are not touched."].join(`
|
|
95
|
+
`))&&p()}return x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{className:"message-modal",role:"dialog","aria-modal":"true","aria-label":"Messages",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Messages"}),x.jsxs("p",{className:"muted",children:[f.total," total / ",f.accepted," accepted",s?` · ${s.mode}`:""]})]}),x.jsxs("div",{className:"modal-actions",children:[x.jsx("button",{type:"button",disabled:n,onClick:o,children:"Mark All Done"}),x.jsx("button",{type:"button",disabled:n||f.total===0,onClick:c,children:"Delete All"}),x.jsx("button",{type:"button",onClick:l,children:"Close"})]})]}),x.jsx(T2,{busy:n,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function Hr({children:n,onOpenChange:r,open:s,title:l}){return x.jsxs("section",{className:"sidebar-section",children:[x.jsxs("button",{"aria-expanded":s,className:"sidebar-section-toggle",type:"button",onClick:()=>{r==null||r(!s)},children:[x.jsx("span",{children:l}),x.jsx("span",{"aria-hidden":"true",className:"sidebar-section-chevron"})]}),s?x.jsx("div",{className:"sidebar-section-content",children:n}):null]})}function Sv(n,r){return n.find(s=>s.role===r)}function X2({activeRole:n,roles:r=Mh,sessions:s,onSelect:l}){return x.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const p=Sv(s,d.name),f=(p==null?void 0:p.status)==="running"?p.activityStatus??"idle":(p==null?void 0:p.status)??"not_started";return x.jsxs("button",{className:d.name===n?"role-tab is-active":"role-tab",type:"button",role:"tab","aria-selected":d.name===n,onClick:()=>l(d.name),children:[x.jsx("span",{children:d.label}),x.jsx(Bi,{status:f})]},d.name)})})}function Q2({role:n,session:r,permissionMode:s,model:l,effort:d,active:p=!0,busy:f,translationEnabled:o,translationAutoSendEnabled:c,translationTargetLanguage:h,translationPanelState:m,onClearTranslationSession:u,onTranslationEntry:b,onTranslationFailures:C,onPermissionModeChange:T,onModelChange:E,onEffortChange:S,onStart:v,onResume:_,onStop:y,onRestart:A,onNotifyHarnessUpdated:L,onTerminalEvent:D}){const R=p&&X0(n)&&o&&(r==null?void 0:r.status)==="running";return x.jsx("section",{className:"session-console",children:x.jsxs("div",{className:R?"session-console-body has-translation":"session-console-body",children:[x.jsxs("div",{className:"terminal-pane",children:[x.jsx(Oh,{role:n,session:r,permissionMode:s,model:l,effort:d,busy:f,onPermissionModeChange:T,onModelChange:E,onEffortChange:S,onStart:v,onResume:_,onStop:y,onRestart:A,onNotifyHarnessUpdated:L}),(r==null?void 0:r.status)==="running"?x.jsx(Oo,{sessionId:r.id,active:p,onEvent:D},r.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:n}),x.jsx("span",{children:r!=null&&r.claudeSessionId?"Resume this role to reconnect its Claude Code conversation.":"Start this role to open an embedded Claude Code terminal."})]})]}),R?x.jsx("div",{className:"translation-pane",children:x.jsx(e2,{active:p,autoSendEnabled:c,targetLanguage:h,taskSlug:r.taskSlug,role:n,sessionId:r.id,panelState:m??{role:n,status:"ready",entries:[],failures:[]},onClearSession:u??(()=>{}),onEntry:b??(()=>{}),onFailures:C??(()=>{})},`${n}:${r.id}`)}):null]})})}function J2(n,r,s){var p;if(!n||s.mode!=="auto")return null;const l=new Map(n.map(f=>[f.id,f])),d=r.filter(f=>{var o;return f.dispatchingAt?((o=l.get(f.id))==null?void 0:o.dispatchingAt)!==f.dispatchingAt:!1});return d.length===0?null:((p=d.sort(Z2)[d.length-1])==null?void 0:p.toRole)??null}function Z2(n,r){const s=n.dispatchingAt??n.deliveredAt??n.acceptedAt??"",l=r.dispatchingAt??r.deliveredAt??r.acceptedAt??"";return s!==l?s.localeCompare(l):n.createdAt.localeCompare(r.createdAt)}const uh=500;function Rh(n){return{taskSlug:n,cursor:1,sessions:{}}}function ek(n,r,s){return n.sessions[r]??Us(s)}function tk(n,r){const l={...sk(n,r.taskSlug).sessions};for(const d of r.sessions)l[d.sessionId]={...Us(d.role),...l[d.sessionId],role:d.role,status:d.status};for(const d of r.events){const p=l[d.sessionId]??Us(d.role);if(d.event.type==="status")l[d.sessionId]={...p,role:d.role,status:d.event.status};else if(d.event.type==="failures")l[d.sessionId]={...p,role:d.role,failures:d.event.failures};else if(d.event.type==="entry"){const f=Cv(bv(p.entries,d.event.entry));l[d.sessionId]={...p,role:d.role,entries:f.entries,failures:f.removedIds.size>0?p.failures.filter(o=>!f.removedIds.has(o.translationId)):p.failures}}}return{taskSlug:r.taskSlug,cursor:r.nextCursor,sessions:l}}function nk(n,r,s){return{...n,sessions:{...n.sessions,[r]:Us(s)}}}function ik(n,r,s,l){const d=n.sessions[r]??Us(s),p=Cv(bv(d.entries,l));return{...n,sessions:{...n.sessions,[r]:{...d,role:s,entries:p.entries,failures:p.removedIds.size>0?d.failures.filter(f=>!p.removedIds.has(f.translationId)):d.failures}}}}function rk(n,r,s,l){const d=n.sessions[r]??Us(s);return{...n,sessions:{...n.sessions,[r]:{...d,role:s,failures:l}}}}function sk(n,r){return n.taskSlug===r?n:Rh(r)}function Us(n){return{role:n,status:"ready",entries:[],failures:[]}}function bv(n,r){return n.findIndex(l=>l.id===r.id)===-1?[...n,r]:n.map(l=>l.id===r.id?r:l)}function Cv(n){if(n.length<=uh)return{entries:n,removedIds:new Set};const r=n.slice(0,n.length-uh);return{entries:n.slice(-uh),removedIds:new Set(r.map(s=>s.id))}}const ak={"project-manager":"bypassPermissions",architect:"bypassPermissions",coder:"bypassPermissions",reviewer:"bypassPermissions","gate-reviewer":"bypassPermissions",translator:"bypassPermissions","harness-engineer":"bypassPermissions"},lk={"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"},ok={"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"medium","harness-engineer":"medium"};function ck({task:n,activeRole:r,gateReviewerEnabled:s,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:p,launchTemplate:f,refreshNonce:o=0,onTaskChanged:c,onActiveRoleChange:h,onMessagesChanged:m,onOrchestrationChanged:u,onRoundStateChanged:b,onEventsChanged:C,onLaunchStateChanged:T}){const[E,S]=te.useState(null),[v,_]=te.useState(()=>$g(f)),[y,A]=te.useState(()=>Gg(f)),[L,D]=te.useState(()=>Vg(f)),[R,k]=te.useState(!1),[,M]=ji(""),[j,H]=te.useState([]),[U,F]=te.useState(null),[K,Y]=te.useState(()=>Rh(n.taskSlug)),G=te.useRef(null),W=te.useRef(""),Z=te.useRef(1),z=te.useMemo(()=>JSON.stringify(f),[f]),O=!!(E!=null&&E.sessions.some(he=>he.role==="gate-reviewer")),N=s||O,$=[...zs,...N?[Zg]:[]],I=te.useCallback((he,pe)=>{var Ke;const ke=((Ke=G.current)==null?void 0:Ke.taskSlug)===n.taskSlug?G.current.messages:null,Be=J2(ke,he,pe);G.current={taskSlug:n.taskSlug,messages:he},F(pe),m==null||m(he),u==null||u(pe),Be&&(h(Be),q(`auto switched to ${Be} before VCM dispatch`))},[h,m,u,n.taskSlug]),re=te.useCallback((he,pe,ke,Be)=>{S(he),I(pe,ke),b==null||b(Be)},[I,b]),ve=te.useCallback(async()=>{const he=await ye.getTaskWorkspaceState(n.taskSlug);re(he.taskStatus,he.messages,he.orchestration,he.roundState),Do("Poll task workspace state"),M(pe=>xo(pe,["Load task workspace state","Poll task workspace state"]))},[re,n.taskSlug]),ge=te.useCallback((he,pe)=>{const ke=_v(he,pe);ke&&M(ke)},[]);Ja(`task-workspace:${n.taskSlug}:${o}`,()=>ve().catch(he=>{ge("Poll task workspace state",he)}),{intervalMs:3e3,runImmediately:!0}),Ja(l?`task-translation-feed:${n.taskSlug}`:null,async()=>{try{const he=await ye.pollTranslationTaskFeed(n.taskSlug,Z.current);Z.current=he.nextCursor,Y(pe=>tk(pe,he)),Do("Poll task translation feed"),M(pe=>xo(pe,["Poll task translation feed"]))}catch(he){ge("Poll task translation feed",he)}},{intervalMs:1e3,runImmediately:!0}),te.useEffect(()=>{H([]),C==null||C([])},[C,n.taskSlug]),te.useEffect(()=>{Z.current=1,Y(Rh(n.taskSlug))},[n.taskSlug]),te.useEffect(()=>{_($g(f)),A(Gg(f)),D(Vg(f))},[z,n.taskSlug]),te.useEffect(()=>{E&&!N&&r==="gate-reviewer"&&h("project-manager"),E&&r==="translator"&&h("project-manager")},[r,N,h,E]),te.useEffect(()=>{const he=E==null?void 0:E.task;if(!he||he.taskSlug!==n.taskSlug)return;const pe=qg(he);if(pe===qg(n)){W.current="";return}W.current!==pe&&(W.current=pe,c().catch(ke=>{W.current="",M(_t("Refresh task list after task status changed",ke))}))},[c,E==null?void 0:E.task,n]),te.useEffect(()=>{const he=(E==null?void 0:E.sessions)??[],pe=he.filter(xe=>uk(xe.role)),ke=new Set(pe.map(xe=>xe.role)),Be=he.some(xe=>xe.role==="gate-reviewer"),Ke={};for(const xe of Ps)Ke[xe.name]={permissionMode:v[xe.name],model:y[xe.name],effort:L[xe.name]};T==null||T({taskSlug:n.taskSlug,roles:Ke,autoOrchestration:((U==null?void 0:U.mode)??"auto")==="auto",statusLoaded:!!E,sessionCount:pe.length,hasAnySession:pe.length>0,hasGateReviewerSession:Be,allRolesHaveSession:zs.every(xe=>ke.has(xe.name))})},[y,L,T,U==null?void 0:U.mode,v,E,n.taskSlug]);async function Q(he,pe="Run role session action"){k(!0),M("");try{await he(),await ve(),await c()}catch(ke){M(_t(pe,ke))}finally{k(!1)}}function q(he){H(pe=>{const ke=[...pe,`${new Date().toLocaleTimeString()} ${he}`];return C==null||C(ke),ke})}function ee(he,pe){_(ke=>({...ke,[he]:pe}))}function se(he,pe){A(ke=>({...ke,[he]:pe}))}function we(he,pe){D(ke=>({...ke,[he]:pe}))}return x.jsxs("div",{className:"task-workspace",children:[x.jsxs("header",{className:"workspace-header",children:[x.jsx("div",{className:"workspace-title-line",children:x.jsx("h1",{children:n.title||n.taskSlug})}),x.jsx(X2,{activeRole:r,roles:$,sessions:(E==null?void 0:E.sessions)??[],onSelect:h})]}),x.jsx("div",{className:"workspace-grid",children:x.jsx("div",{className:"workspace-main",children:x.jsx("div",{className:"role-console-stack",children:$.map(he=>{const pe=he.name,ke=pe===r,Be=(E==null?void 0:E.sessions)??[],Ke=Sv(Be,pe),xe=Ke?ek(K,Ke.id,pe):void 0;return x.jsx("div",{className:ke?"role-console-panel is-active":"role-console-panel","aria-hidden":!ke,children:x.jsx(Q2,{role:pe,session:Ke,permissionMode:v[pe],model:y[pe],effort:L[pe],active:ke,busy:R,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:p,translationPanelState:xe,onClearTranslationSession:(rt,wt)=>{Y(yt=>nk(yt,rt,wt))},onTranslationEntry:(rt,wt,yt)=>{Y(It=>ik(It,rt,wt,yt))},onTranslationFailures:(rt,wt,yt)=>{Y(It=>rk(It,rt,wt,yt))},onPermissionModeChange:rt=>ee(pe,rt),onModelChange:rt=>se(pe,rt),onEffortChange:rt=>we(pe,rt),onStart:()=>void Q(async()=>{await ye.startRoleSession(n.taskSlug,pe,{cols:100,rows:28,permissionMode:v[pe],model:y[pe],effort:L[pe]}),q(`started ${pe} with ${v[pe]} / ${y[pe]} / ${L[pe]}`)},`Start ${pe} session`),onResume:()=>void Q(async()=>{await ye.resumeRoleSession(n.taskSlug,pe,{cols:100,rows:28,permissionMode:v[pe],model:y[pe],effort:L[pe]}),q(`resumed ${pe} with ${v[pe]} / ${y[pe]} / ${L[pe]}`)},`Resume ${pe} session`),onStop:()=>void Q(async()=>{await ye.stopRoleSession(n.taskSlug,pe),q(`stopped ${pe}`)},`Stop ${pe} session`),onRestart:()=>void Q(async()=>{await ye.restartRoleSession(n.taskSlug,pe,{cols:100,rows:28,permissionMode:v[pe],model:y[pe],effort:L[pe]}),q(`restarted ${pe} with ${v[pe]} / ${y[pe]} / ${L[pe]}`)},`Restart ${pe} session`),onNotifyHarnessUpdated:()=>void Q(async()=>{await ye.notifyRoleHarnessUpdated(n.taskSlug,pe),q(`notified ${pe} to reload latest harness`)},`Notify ${pe} to reload harness`),onTerminalEvent:rt=>q(`${he.label}: ${rt}`)})},pe)})})})})]})}function uk(n){return zs.some(r=>r.name===n)}function qg(n){return[n.status,n.updatedAt,n.cleanupStatus??"",n.cleanedAt??""].join(":")}function $g(n){var s;const r={...ak};for(const l of Ps)r[l.name]=((s=n.roles[l.name])==null?void 0:s.permissionMode)??r[l.name];return r}function Gg(n){var s;const r={...lk};for(const l of Ps)r[l.name]=((s=n.roles[l.name])==null?void 0:s.model)??r[l.name];return r}function Vg(n){var s;const r={...ok};for(const l of Ps)r[l.name]=((s=n.roles[l.name])==null?void 0:s.effort)??r[l.name];return r}const hk=120*1e3,Wg=1400,fk=3;function dk(n){return!!(n!=null&&n.initialized)}function pk(){const[n,r]=te.useState(null),[s,l]=te.useState([]),[d,p]=te.useState(null),[f,o]=te.useState(null),[c,h]=te.useState(null),[m,u]=te.useState(null),[b,C]=te.useState(null),[T,E]=te.useState(null),[S,v]=te.useState(null),[_,y]=te.useState(null),[A,L]=te.useState(null),[D,R]=te.useState(!1),[k,M]=te.useState(null),[j,H]=te.useState(null),[U,F]=te.useState(!1),[K,Y]=te.useState([]),[G,W]=te.useState(null),[Z,z]=te.useState(null),[O,N]=te.useState(null),[$,I]=te.useState(null),[re,ve]=te.useState(null),[ge,Q]=te.useState(null),[q,ee]=te.useState("project-manager"),[se,we]=te.useState("system"),[he,pe]=te.useState(!0),[ke,Be]=te.useState(!0),[Ke,xe]=te.useState("off"),[rt,wt]=te.useState(!1),[yt,It]=te.useState(!1),[yn,xt]=te.useState(!1),[tt,jt]=te.useState(Q0),[ue,Se]=te.useState(J0),[Ae,Le]=te.useState(!1),[je,mt]=te.useState(!1),[Fe,St]=te.useState(!1),[vt,Nt]=te.useState(!1),[Qe,rn]=te.useState(!1),[Ht,ln]=te.useState(null),[Vn,Wn]=te.useState("bypassPermissions"),[Pt,on]=te.useState("default"),[Kn,Xt]=te.useState("medium"),[$s,Qt]=te.useState(null),[Sn,Ft]=te.useState("bypassPermissions"),[Hi,ze]=te.useState("default"),[mi,Fr]=te.useState("medium"),[zi,Gs]=te.useState(()=>e1()),[Yn,nl]=te.useState(null),[ri,Tt]=te.useState(0),[qt,Xn]=te.useState(null),[Vs,Io]=te.useState(null),[il,rl]=te.useState(!1),[On,qr]=te.useState(!1),[,cn]=ji(""),gi=te.useRef({}),si=te.useRef({}),_i=te.useRef({}),ot=te.useRef(null),$r=te.useRef(""),ie=te.useMemo(()=>v2(K,G),[K,G]),Rt=(Yn==null?void 0:Yn.taskSlug)===(ie==null?void 0:ie.taskSlug)?Yn:null,ai=c===(ie==null?void 0:ie.taskSlug)?d:null,sl=m===(ie==null?void 0:ie.taskSlug)?f:null,al=!!(n&&ie&&dk(ai)),ll=(Ht==null?void 0:Ht.status)==="running",Gr=!!(S!=null&&S.running),gr=!!(yt&&al&&ll),Vr=!!(Rt!=null&&Rt.statusLoaded),Qn=!!(ie&&(Rt!=null&&Rt.statusLoaded)&&!Rt.hasAnySession),ht=te.useCallback(V=>{we(V.themeMode),pe(V.flowPauseAlerts),Be(V.roleRetryEnabled),xe(V.permissionRequestMode),wt(V.autoTaskHarnessReviewEnabled),It(V.translationEnabled),xt(V.translationAutoSendEnabled),jt(V.translationTargetLanguage),Se(V.translationOutputMode),Gs(V.launchTemplate)},[]),$t=te.useCallback(()=>{ot.current!==null&&(window.clearInterval(ot.current),ot.current=null)},[]),ol=te.useCallback(()=>{$t(),bo(),ot.current=window.setInterval(()=>{bo()},Wg)},[$t]),Wr=te.useCallback(()=>{$t();let V=1;bo(),ot.current=window.setInterval(()=>{V+=1,bo(),V>=fk&&ot.current!==null&&(window.clearInterval(ot.current),ot.current=null)},Wg)},[$t]),Ws=te.useCallback((V,de=`manual-${Date.now()}`,Pe={})=>{Xn({id:de,text:V}),Pe.sound==="strong"?ol():Pe.sound==="weak"?Wr():$t()},[Wr,ol,$t]),Kr=te.useCallback(()=>{$t(),Xn(null)},[$t]);te.useEffect(()=>{ie!=null&&ie.taskSlug&&(_i.current[ie.taskSlug]=Date.now())},[ie==null?void 0:ie.taskSlug]);const Uo=te.useCallback(V=>{ie!=null&&ie.taskSlug&&z({taskSlug:ie.taskSlug,messages:V})},[ie==null?void 0:ie.taskSlug]),un=te.useCallback(V=>{ie!=null&&ie.taskSlug&&N({taskSlug:ie.taskSlug,orchestration:V})},[ie==null?void 0:ie.taskSlug]),Ks=te.useCallback(V=>{ie!=null&&ie.taskSlug&&I({taskSlug:ie.taskSlug,events:V})},[ie==null?void 0:ie.taskSlug]),cl=te.useCallback(V=>{var Zs,hl;if(!(ie!=null&&ie.taskSlug)||V.taskSlug!==ie.taskSlug)return;if(ve({taskSlug:V.taskSlug,roundState:V}),V.status==="running"&&V.activeRole==="gate-reviewer"&&ee("gate-reviewer"),((Zs=V.roleRecovery)==null?void 0:Zs.status)==="waiting"||((hl=V.roleRecovery)==null?void 0:hl.status)==="retrying"){si.current[V.taskSlug]={status:V.status};return}if(V.status!=="stopped"||!V.roundId){si.current[V.taskSlug]={status:V.status};return}const de=yk(V),Pe=gi.current[V.taskSlug],Et=si.current[V.taskSlug];if(si.current[V.taskSlug]={status:V.status},Pe===de||(gi.current[V.taskSlug]=de,!vk(V,Et,_i.current[V.taskSlug])))return;if(Gr){$t(),Xn(null);return}const Zn=V.activeRole??"role",jn=he?_k(V)>=hk?"strong":"weak":"none",Nn=V.roleRecovery,ns=(Nn==null?void 0:Nn.status)==="failed"?Ck(Nn,Zn):`No new turn started after ${Zn} stopped.`;Ws(ns,de,{sound:jn})},[ie==null?void 0:ie.taskSlug,Gr,he,Ws,$t]),Ys=te.useCallback(V=>{nl(de=>(de==null?void 0:de.taskSlug)===V.taskSlug&&de.statusLoaded===V.statusLoaded&&de.sessionCount===V.sessionCount&&de.hasAnySession===V.hasAnySession&&de.hasGateReviewerSession===V.hasGateReviewerSession&&de.allRolesHaveSession===V.allRolesHaveSession&&de.autoOrchestration===V.autoOrchestration&&JSON.stringify(de.roles)===JSON.stringify(V.roles)?de:V)},[]);async function bn(){const V=await ye.listTasks();return Y(V),W(de=>{var Pe;return de&&V.some(Et=>Et.taskSlug===de)?de:((Pe=V[0])==null?void 0:Pe.taskSlug)??null}),V}async function Yr(V=ie==null?void 0:ie.taskSlug){if(!V)return p(null),h(null),null;const de=await ye.getHarnessStatus(V);return p(de),h(V),de}async function Xr(V=ie==null?void 0:ie.taskSlug){if(!V)return o(null),u(null),null;const de=await ye.getHarnessBootstrapStatus(V);return o(de),u(V),de}async function Cn(){const V=await ye.getGatewayStatus();return v(V),V}async function Po(){const V=await ye.getRecentRepositoryPaths();return l(V),V}async function Xs(){if(!n)return Le(!1),!1;const V=await ye.getTranslationState();return Le(V.memoryInitialized),V.memoryInitialized}async function Qr(V){const[de,Pe]=await Promise.all([ye.listMessages(V),ye.getOrchestrationState(V)]);z({taskSlug:V,messages:de}),N({taskSlug:V,orchestration:Pe})}async function Jr(V){const de=await ye.getGateReviewState(V);return Q({taskSlug:V,state:de}),Do("Poll Gate Review state"),cn(Pe=>xo(Pe,["Refresh Gate Review state","Poll Gate Review state"])),de}function ul(V,de){const Pe=_v(V,de);Pe&&cn(Pe)}function Ii(V){V&&(Wn(V.permissionMode),V.model&&on(V.model),V.effort&&Xt(V.effort))}async function _r(V={}){const de=await ye.getTranslatorSession();return ln(de),V.syncLaunchOptions&&Ii(de),de}function Jt(V){V&&(Ft(V.permissionMode),V.model&&ze(V.model),V.effort&&Fr(V.effort))}async function Bn(V={}){const de=await ye.getHarnessEngineerSession();return Qt(de),V.syncLaunchOptions&&Jt(de),de}function Qs(V,de,Pe={}){var Et;ln(V.translatorSession),Le(!!((Et=V.translationState)!=null&&Et.memoryInitialized)),Qt(V.harnessEngineerSession),E(V.harnessFeedbackState),v(V.gatewayStatus),de&&V.harnessStatus?(p(V.harnessStatus),h(de)):(p(null),h(null)),de&&V.harnessBootstrapStatus?(o(V.harnessBootstrapStatus),u(de)):(o(null),u(null)),Pe.syncLaunchOptions&&(Ii(V.translatorSession),Jt(V.harnessEngineerSession))}async function Ui(V={}){if(!n)return ln(null),Le(!1),Qt(null),p(null),o(null),h(null),u(null),E(null),null;const de=(ie==null?void 0:ie.taskSlug)??null,Pe=await ye.getProjectRuntimeState(de);return Qs(Pe,de,V),Pe}function Pi(){const V=["Poll project runtime state","Load project runtime state","Refresh Harness feedback state","Poll Harness feedback state","Load Translator session","Poll Translator session","Poll translation memory status","Load Harness Engineer session","Poll Harness Engineer session","Load VCM Harness status","Poll VCM Harness status"];for(const de of V)Do(de);cn(de=>xo(de,V))}te.useEffect(()=>{Promise.all([ye.getCurrentProject(),ye.getRecentRepositoryPaths(),ye.getAppPreferences(),ye.getGatewayStatus()]).then(async([V,de,Pe,Et])=>{r(V),l(de),v(Et),ht(Pe),V&&await bn()}).catch(V=>cn(_t("Load initial app data",V)))},[ht]),te.useEffect(()=>{const V=window.matchMedia("(prefers-color-scheme: dark)"),de=()=>rl(V.matches);return de(),V.addEventListener("change",de),()=>V.removeEventListener("change",de)},[]),te.useEffect(()=>()=>$t(),[$t]),te.useEffect(()=>{Gr&&($t(),Xn(null))},[Gr,$t]),te.useEffect(()=>{const V=se==="system"?il?"dark":"light":se;document.documentElement.dataset.theme=V,document.documentElement.dataset.themeMode=se},[il,se]),te.useEffect(()=>{if(!(ie!=null&&ie.taskSlug)){Q(null);return}Jr(ie.taskSlug).catch(V=>cn(_t("Refresh Gate Review state",V)))},[ie==null?void 0:ie.taskSlug]),te.useEffect(()=>{$r.current="",ln(null),Wn("bypassPermissions"),on("default"),Xt("medium"),Le(!1),Qt(null),Ft("bypassPermissions"),ze("default"),Fr("medium"),p(null),o(null),h(null),u(null),E(null)},[n==null?void 0:n.repoRoot]),Ja(n?`project-runtime:${n.repoRoot}:${(ie==null?void 0:ie.taskSlug)??"no-task"}`:null,async()=>{try{const V=(n==null?void 0:n.repoRoot)??"",de=!!(n&&$r.current!==V);await Ui({syncLaunchOptions:de}),de&&($r.current=V),Pi()}catch(V){ul("Poll project runtime state",V)}},{intervalMs:3e3,runImmediately:!0});const hn=(ie==null?void 0:ie.taskSlug)??null,vr=hn&&(ge==null?void 0:ge.taskSlug)===hn?ge.state:null,Zr=hn&&(re==null?void 0:re.taskSlug)===hn?re.roundState:null,vi=hn&&(Yn==null?void 0:Yn.taskSlug)===hn?Yn:null,Jn=!!(hn&&(vr!=null&&vr.activeGate||(Zr==null?void 0:Zr.activeRole)==="gate-reviewer"||vi!=null&&vi.hasGateReviewerSession));Ja(Jn&&hn?`gate-review:${hn}`:null,async()=>{if(hn)try{await Jr(hn)}catch(V){ul("Poll Gate Review state",V)}},{intervalMs:3e3,runImmediately:!1});async function Re(V,de="Run UI action"){qr(!0),cn("");try{await V()}catch(Pe){cn(_t(de,Pe))}finally{qr(!1)}}async function yr(){if(!ie)throw new Error("Create or select a task before closing it.");const V=[`Close task "${ie.taskSlug}"?`,"","This is destructive:","- stops VCM-managed running role sessions for this task","- moves project-scoped Translator and Harness Engineer sessions to the base repository cwd",`- deletes the task worktree: ${ie.worktreePath}`,`- deletes the Git branch: ${ie.branch}`,"- deletes VCM task/session/message/orchestration state","","VCM will not check running sessions or uncommitted changes before closing."].join(`
|
|
96
|
+
`);window.confirm(V)&&(await ye.cleanupTask(ie.taskSlug,{force:!0,forceDeleteBranch:!0}),W(null),z(null),N(null),I(null),ve(null),Q(null),Tt(Pe=>Pe+1),await bn())}const li=Z&&Z.taskSlug===(ie==null?void 0:ie.taskSlug)?Z.messages:[],Js=O&&O.taskSlug===(ie==null?void 0:ie.taskSlug)?O.orchestration:null,es=$&&$.taskSlug===(ie==null?void 0:ie.taskSlug)?$.events:[],wn=re&&re.taskSlug===(ie==null?void 0:ie.taskSlug)?re.roundState:null,Fi=ie!=null&&ie.taskSlug&&(wn!=null&&wn.roleRecovery)?Sk(ie.taskSlug,wn.roleRecovery):null,Sr=wn!=null&&wn.roleRecovery&&wn.roleRecovery.status!=="failed"&&Fi!==Vs?bk(wn.roleRecovery):null,ts=ge&&ge.taskSlug===(ie==null?void 0:ie.taskSlug)?ge.state:null,Gt=!!(ts&&Object.values(ts.gates).some(V=>V.required));return x.jsxs(t1,{sidebar:x.jsx(B2,{project:n,recentRepositoryPaths:s,tasks:K,activeTaskSlug:(ie==null?void 0:ie.taskSlug)??null,messages:li,orchestration:Js,events:es,roundState:wn,gateReview:ts,translationEnabled:gr,translationAutoSendEnabled:yn,translationTargetLanguage:tt,translationOutputMode:ue,translationMemoryInitialized:Ae,translatorSession:Ht,harnessStatus:ai,harnessBootstrapStatus:sl,harnessApplyResult:b,autoTaskHarnessReviewEnabled:rt,gatewayStatus:S,gatewayQrLogin:_,gatewayQrCheck:A,gatewayLarkRegistration:k,gatewayLarkRegistrationCheck:j,busy:On,onConnect:V=>Re(async()=>{const de=await ye.connectProject({repoPath:V});r(de),C(null),await Promise.all([bn(),Po()])},"Connect repository"),onRefreshConnectedRepository:()=>Re(async()=>{const V=await ye.getCurrentProject();r(V)},"Refresh connected repository"),onPullConnectedRepository:()=>Re(async()=>{const V=await ye.pullCurrentProject();r(V)},"Pull connected repository"),onRefreshHarness:()=>Re(async()=>{if(!ie)throw new Error("Create or select a task before refreshing VCM Harness.");C(null),await Promise.all([Yr(ie.taskSlug),Xr(ie.taskSlug)])},"Refresh VCM Harness"),onApplyHarness:()=>Re(async()=>{if(!ie)throw new Error("Create or select a task before applying VCM Harness.");const V=await ye.applyHarness({taskSlug:ie.taskSlug});C(V),await Promise.all([Yr(ie.taskSlug),Xr(ie.taskSlug)])},"Apply VCM Harness"),onStartHarnessBootstrap:V=>Re(async()=>{if(!ie)throw new Error("Create or select a task before starting Harness Bootstrap.");const de=await ye.startHarnessBootstrap({taskSlug:ie.taskSlug,cols:120,rows:32,...V});o(de.status),u(ie.taskSlug),await Bn({syncLaunchOptions:!0})},"Start Harness Bootstrap"),onRestartHarnessBootstrap:V=>Re(async()=>{if(!ie)throw new Error("Create or select a task before restarting Harness Bootstrap.");const de=await ye.restartHarnessBootstrap({taskSlug:ie.taskSlug,cols:120,rows:32,...V});o(de.status),u(ie.taskSlug),await Bn({syncLaunchOptions:!0})},"Restart Harness Bootstrap"),onStopHarnessBootstrap:()=>Re(async()=>{const V=await ye.stopHarnessBootstrap();o(V),u((ie==null?void 0:ie.taskSlug)??null),await Bn()},"Stop Harness Bootstrap"),onRunHarnessBootstrap:()=>Re(async()=>{if(!ie)throw new Error("Create or select a task before running Harness Bootstrap.");const V=await ye.runHarnessBootstrap({taskSlug:ie.taskSlug});o(V.status),u(ie.taskSlug),await Bn()},"Run Harness Bootstrap"),onOpenHarnessStudio:()=>Nt(!0),onOpenRepositoryDiff:()=>rn(!0),onAutoTaskHarnessReviewChange:V=>{wt(V),Re(async()=>{const de=await ye.updateAppPreferences({autoTaskHarnessReviewEnabled:V});ht(de)},"Update auto task harness review setting")},onRefreshGateway:()=>Re(async()=>{await Cn()},"Refresh Gateway status"),onGatewayEnabledChange:V=>{Re(async()=>{const de=await ye.updateGatewaySettings({enabled:V,...V&&n?{currentProjectId:n.repoRoot,currentTaskSlug:(ie==null?void 0:ie.taskSlug)??null}:{}});v(de),V&&ht(await ye.getAppPreferences())},"Update Gateway enabled setting")},onGatewaySettingsChange:V=>Re(async()=>{const de=await ye.updateGatewaySettings(V);v(de)},"Update Gateway settings"),onGatewayTranslationChange:V=>{Re(async()=>{const de=await ye.updateGatewaySettings({translationEnabled:V});v(de)},"Update Gateway translation setting")},onStartGatewayQrLogin:()=>{Re(async()=>{const V=await ye.startGatewayQrLogin();y(V),L(null),R(!0),await Cn()},"Start Gateway QR login")},onStartGatewayLarkRegistration:()=>{Re(async()=>{const V=await ye.startGatewayLarkRegistration();M(V),H(null),F(!0),await Cn()},"Start Lark Gateway QR setup")},onResetGatewayBinding:()=>{Re(async()=>{const V=await ye.resetGatewayBinding();v(V),y(null),L(null),R(!1),M(null),H(null),F(!1)},"Reset Gateway binding")},onGateReviewGateEnabledChange:(V,de)=>{Re(async()=>{if(!ie)throw new Error("Create or select a task before changing Gate Review Gates.");const Pe=await ye.updateGateReviewSettings(ie.taskSlug,{gates:{[V]:de}});Q({taskSlug:ie.taskSlug,state:Pe})},`Update ${V} Gate Review setting`)},onTranslationEnabledChange:V=>{It(V),Re(async()=>{const de=await ye.updateAppPreferences({translationEnabled:V});ht(de)},"Update conversation translation setting")},onTranslationAutoSendChange:V=>{xt(V),Re(async()=>{const de=await ye.updateAppPreferences({translationAutoSendEnabled:V});ht(de)},"Update translation auto-send setting")},onTranslationTargetLanguageChange:V=>{jt(V),Re(async()=>{const de=await ye.updateAppPreferences({translationTargetLanguage:V});ht(de)},"Update translation target language")},onTranslationOutputModeChange:V=>{Se(V),Re(async()=>{const de=await ye.updateAppPreferences({translationOutputMode:V});ht(de)},"Update translation output mode")},onOpenFileTranslation:()=>mt(!0),onOpenTranslatorSession:()=>St(!0),onCreateTranslationBootstrap:()=>{Re(async()=>{if(!ie)throw new Error("Create or select a task before running Translation Bootstrap.");await ye.createTranslationBootstrap({taskSlug:ie.taskSlug,targetLanguage:tt}),await Xs(),await _r()},"Create Translation Bootstrap task")},onUpdateTranslationMemory:()=>{Re(async()=>{if(!ie)throw new Error("Create or select a task before updating translation memory.");await ye.createTranslationMemoryUpdate({taskSlug:ie.taskSlug,targetLanguage:tt}),await Xs(),await _r()},"Create translation memory update task")},onCreateTask:V=>Re(async()=>{const de=await ye.createTask(V);await bn(),W(de.taskSlug)},"Create task"),onCloseTask:()=>{Re(yr,"Close task")},onSelectTask:W,themeMode:se,onAutoOrchestrationChange:V=>{Re(async()=>{if(!ie)throw new Error("Create or select a task before changing auto orchestration.");const de=await ye.updateOrchestrationState(ie.taskSlug,{mode:V?"auto":"manual"});N({taskSlug:ie.taskSlug,orchestration:de})},"Update auto orchestration mode")},onThemeModeChange:V=>{we(V),Re(async()=>{const de=await ye.updateAppPreferences({themeMode:V});ht(de)},"Update theme setting")},pauseAlertSound:he,onPauseAlertSoundChange:V=>{pe(V),V&&kk(),Re(async()=>{const de=await ye.updateAppPreferences({flowPauseAlerts:V});ht(de)},"Update pause alert sound setting")},roleRetryEnabled:ke,onRoleRetryEnabledChange:V=>{Be(V),Re(async()=>{const de=await ye.updateAppPreferences({roleRetryEnabled:V});ht(de)},"Update CC retry setting")},permissionRequestMode:Ke,onPermissionRequestModeChange:V=>{xe(V),Re(async()=>{const de=await ye.updateAppPreferences({permissionRequestMode:V});ht(de)},"Update permission request setting")},launchTemplate:zi,canSaveLaunchTemplate:Vr,canOneClickStart:Qn,onSaveLaunchTemplate:()=>{Re(async()=>{if(!(Rt!=null&&Rt.statusLoaded))throw new Error("Open a task workspace before saving a launch template.");const V=await ye.updateAppPreferences({launchTemplate:{version:1,roles:Rt.roles,autoOrchestration:Rt.autoOrchestration}});ht(V)},"Save launch template")},onOneClickStart:()=>{Re(async()=>{if(!ie)throw new Error("Create or select a task before one-click start.");const V=await ye.getTaskStatus(ie.taskSlug);if(V.sessions.some(Et=>Lh.some(Zn=>Zn===Et.role)))throw new Error("One-click start is only available before any role session has started.");const de=await ye.updateOrchestrationState(ie.taskSlug,{mode:zi.autoOrchestration?"auto":"manual"});N({taskSlug:ie.taskSlug,orchestration:de});const Pe=C2(zi,{gateReviewerEnabled:Gt});for(const Et of Pe){const Zn={cols:100,rows:28,permissionMode:Et.permissionMode,model:Et.model,effort:Et.effort},jn=V.sessions.find(Nn=>Nn.role===Et.role);(jn==null?void 0:jn.status)!=="running"&&(jn!=null&&jn.claudeSessionId?await ye.resumeRoleSession(ie.taskSlug,Et.role,Zn):await ye.startRoleSession(ie.taskSlug,Et.role,Zn))}ee("project-manager"),await Qr(ie.taskSlug),await bn(),Tt(Et=>Et+1)},"One-click start role sessions")},onMarkAllMessagesDone:V=>{Re(async()=>{const de=await ye.markAllMessagesDone(V);z({taskSlug:V,messages:de.messages}),await Qr(V)},"Mark all role messages done")},onDeleteMessageHistory:V=>{Re(async()=>{const de=await ye.deleteMessageHistory(V);z({taskSlug:V,messages:de.messages}),await Qr(V)},"Delete role message history")}}),children:[x.jsx(g2,{}),qt?x.jsx("div",{className:"flow-pause-alert-backdrop",children:x.jsxs("section",{"aria-describedby":"flow-pause-alert-body flow-pause-alert-hint","aria-labelledby":"flow-pause-alert-title","aria-modal":"true",className:"flow-pause-alert",role:"alertdialog",children:[x.jsx("p",{className:"flow-pause-alert-kicker",children:"VCM needs attention"}),x.jsx("h2",{id:"flow-pause-alert-title",children:"Flow needs attention"}),x.jsx("p",{id:"flow-pause-alert-body",children:qt.text}),x.jsx("p",{id:"flow-pause-alert-hint",className:"flow-pause-alert-hint",children:"The task may be complete, waiting for your decision, or blocked by a workflow issue."}),x.jsx("button",{type:"button",autoFocus:!0,onClick:Kr,children:"Confirm"})]})}):null,Sr&&Fi?x.jsxs("div",{className:"role-recovery-toast",role:"status",children:[x.jsx("span",{children:Sr}),x.jsx("button",{type:"button",onClick:()=>Io(Fi),children:"Close"})]}):null,D&&_?x.jsx(mk,{busy:On,qrCheck:A,qrLogin:_,onCheck:()=>{Re(async()=>{const V=await ye.checkGatewayQrLogin();L(V),(V.status==="confirmed"||V.status==="binded_redirect")&&R(!1),await Cn()})},onClose:()=>R(!1)}):null,U&&k?x.jsx(gk,{busy:On,registration:k,registrationCheck:j,onCheck:()=>{Re(async()=>{const V=await ye.checkGatewayLarkRegistration();H(V),V.gatewayStatus&&v(V.gatewayStatus),V.status==="confirmed"&&(F(!1),await Cn())},"Check Lark Gateway QR setup")},onManualBind:(V,de)=>{Re(async()=>{const Pe=await ye.bindGatewayLarkApp({appId:V,appSecret:de,larkDomain:"lark"});H(Pe),Pe.gatewayStatus&&v(Pe.gatewayStatus),Pe.status==="confirmed"&&(F(!1),await Cn())},"Bind Lark Gateway app")},onClose:()=>F(!1)}):null,n&&ie?x.jsx(ck,{task:ie,activeRole:q,gateReviewerEnabled:Gt,translationEnabled:gr,translationAutoSendEnabled:yn,translationTargetLanguage:tt,launchTemplate:zi,refreshNonce:ri,onTaskChanged:async()=>{await bn()},onActiveRoleChange:ee,onMessagesChanged:Uo,onOrchestrationChanged:un,onRoundStateChanged:cl,onEventsChanged:Ks,onLaunchStateChanged:Ys}):x.jsxs("section",{className:"empty-workspace",children:[x.jsx("h1",{children:n?"Create a task to open the workspace":"Connect a repository to begin"}),x.jsx("p",{children:n?"Tasks create local role commands and handoff artifacts for the selected repository.":"VibeCodingMaster will create a local task workspace, role sessions, and handoff artifacts."})]}),x.jsx(i2,{open:je,taskSlug:(ie==null?void 0:ie.taskSlug)??null,targetLanguage:tt,onClose:()=>mt(!1)}),x.jsx(y1,{open:vt,busy:On,status:ai,bootstrapStatus:sl,engineerSession:$s,permissionMode:Sn,model:Hi,effort:mi,taskSlug:(ie==null?void 0:ie.taskSlug)??null,onClose:()=>Nt(!1),onRefresh:()=>{Re(async()=>{if(!ie)throw new Error("Create or select a task before refreshing Harness Studio.");await Promise.all([Yr(ie.taskSlug),Xr(ie.taskSlug),Bn()])},"Refresh Harness Studio")},onPermissionModeChange:Ft,onModelChange:ze,onEffortChange:Fr,onEngineerStart:()=>{Re(async()=>{if(!ie)throw new Error("Create or select a task before starting Harness Engineer.");const V=await ye.startHarnessEngineerSession({taskSlug:ie.taskSlug,cols:120,rows:32,permissionMode:Sn,model:Hi,effort:mi});Qt(V),Jt(V)},"Start Harness Engineer")},onEngineerResume:()=>{Re(async()=>{if(!ie)throw new Error("Create or select a task before resuming Harness Engineer.");const V=await ye.resumeHarnessEngineerSession({taskSlug:ie.taskSlug,cols:120,rows:32,permissionMode:Sn,model:Hi,effort:mi});Qt(V),Jt(V)},"Resume Harness Engineer")},onEngineerRestart:()=>{Re(async()=>{if(!ie)throw new Error("Create or select a task before restarting Harness Engineer.");const V=await ye.restartHarnessEngineerSession({taskSlug:ie.taskSlug,cols:120,rows:32,permissionMode:Sn,model:Hi,effort:mi});Qt(V),Jt(V)},"Restart Harness Engineer")},onEngineerStop:()=>{Re(async()=>{const V=await ye.stopHarnessEngineerSession();Qt(V)},"Stop Harness Engineer")},onEngineerNotifyHarnessUpdated:()=>{Re(async()=>{const V=await ye.notifyHarnessEngineerHarnessUpdated();Qt(V),Jt(V)},"Notify Harness Engineer to reload harness")},onOpenRepositoryDiff:()=>rn(!0),onReviewTaskHarness:()=>{Re(async()=>{if(!ie)throw new Error("Create or select a task before reviewing task harness.");const V=await ye.startTaskHarnessRetrospective({taskSlug:ie.taskSlug,trigger:"manual"});E(V),await Bn({syncLaunchOptions:!0})},"Review task harness")}}),x.jsx(b1,{open:Qe,taskSlug:(ie==null?void 0:ie.taskSlug)??null,onClose:()=>rn(!1)}),x.jsx(k1,{open:Fe,busy:On,session:Ht,permissionMode:Vn,model:Pt,effort:Kn,onClose:()=>St(!1),onPermissionModeChange:Wn,onModelChange:on,onEffortChange:Xt,onStart:()=>{Re(async()=>{if(!ie)throw new Error("Create or select a task before starting Translator.");const V=await ye.startTranslatorSession({taskSlug:ie.taskSlug,cols:100,rows:28,permissionMode:Vn,model:Pt,effort:Kn});ln(V),Ii(V)},"Start Translator session")},onResume:()=>{Re(async()=>{if(!ie)throw new Error("Create or select a task before resuming Translator.");const V=await ye.resumeTranslatorSession({taskSlug:ie.taskSlug,cols:100,rows:28,permissionMode:Vn,model:Pt,effort:Kn});ln(V),Ii(V)},"Resume Translator session")},onRestart:()=>{Re(async()=>{if(!ie)throw new Error("Create or select a task before restarting Translator.");const V=await ye.restartTranslatorSession({taskSlug:ie.taskSlug,cols:100,rows:28,permissionMode:Vn,model:Pt,effort:Kn});ln(V),Ii(V)},"Restart Translator session")},onStop:()=>{Re(async()=>{const V=await ye.stopTranslatorSession();ln(V)},"Stop Translator session")},onNotifyHarnessUpdated:()=>{Re(async()=>{const V=await ye.notifyTranslatorHarnessUpdated();ln(V),Ii(V)},"Notify Translator to reload harness")}}),x.jsx(n1,{busy:On,state:T,onCancel:V=>{Re(async()=>{const de=await ye.decideHarnessFeedback({action:"cancel",taskSlug:ie==null?void 0:ie.taskSlug,comment:V});E(de)},"Cancel Harness feedback")},onApprove:V=>{Re(async()=>{if(!ie)throw new Error("Create or select a task before approving Harness feedback.");const de=await ye.decideHarnessFeedback({action:"approve",taskSlug:ie.taskSlug,comment:V});E(de),await Bn()},"Approve Harness feedback")},onComment:V=>{Re(async()=>{if(!ie)throw new Error("Create or select a task before sending Harness feedback comments.");const de=await ye.decideHarnessFeedback({action:"comment",taskSlug:ie.taskSlug,comment:V});E(de),await Bn()},"Send Harness feedback comment")},onReject:V=>{Re(async()=>{const de=await ye.decideHarnessFeedback({action:"reject",taskSlug:ie==null?void 0:ie.taskSlug,comment:V});E(de)},"Reject Harness feedback")}})]})}function mk({busy:n,onCheck:r,onClose:s,qrCheck:l,qrLogin:d}){const[p,f]=te.useState(""),[o,c]=ji("");return te.useEffect(()=>{let h=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const m=Ur(0,"M");m.addData(d.qrcodeUrl),m.make(),h||f(m.createDataURL(8,2))}catch(m){h||c(_t("Render Gateway QR login code",m))}return()=>{h=!0}},[d.qrcodeUrl]),x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{"aria-labelledby":"gateway-qr-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{id:"gateway-qr-title",children:"Weixin Gateway Login"}),x.jsx("p",{className:"muted",children:"Scan with Weixin, confirm on the phone, then click Confirm."})]}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]}),x.jsxs("div",{className:"gateway-qr-modal-body",children:[x.jsx("div",{className:"gateway-qr-code-frame",children:p?x.jsx("img",{alt:"Weixin Gateway QR login",src:p}):x.jsx("div",{className:"gateway-qr-placeholder",children:o?"QR code could not be rendered.":"Rendering QR code..."})}),x.jsxs("dl",{className:"gateway-qr-meta",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Status"}),x.jsx("dd",{children:(l==null?void 0:l.status)??d.status})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Expires"}),x.jsx("dd",{children:wv(d.expiresAt)})]}),l!=null&&l.message?x.jsxs("div",{children:[x.jsx("dt",{children:"Message"}),x.jsx("dd",{children:l.message})]}):null]})]}),x.jsx("footer",{children:x.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})})]})})}function gk({busy:n,onCheck:r,onClose:s,onManualBind:l,registration:d,registrationCheck:p}){const[f,o]=te.useState(""),[c,h]=ji(""),[m,u]=te.useState(""),[b,C]=te.useState(""),[T,E]=ji("");return te.useEffect(()=>{let S=!1;h(""),o("");try{const v=Ur(0,"M");v.addData(d.qrUrl),v.make(),S||o(v.createDataURL(8,2))}catch(v){S||h(_t("Render Lark Gateway setup QR code",v))}return()=>{S=!0}},[d.qrUrl]),x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{"aria-labelledby":"gateway-lark-registration-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{id:"gateway-lark-registration-title",children:"Lark Gateway Setup"}),x.jsx("p",{className:"muted",children:"Scan with Lark, approve bot creation, then click Confirm."})]}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]}),x.jsxs("div",{className:"gateway-qr-modal-body",children:[x.jsx("div",{className:"gateway-qr-code-frame",children:f?x.jsx("img",{alt:"Lark Gateway setup QR code",src:f}):x.jsx("div",{className:"gateway-qr-placeholder",children:c?"QR code could not be rendered.":"Rendering QR code..."})}),x.jsx("div",{className:"gateway-qr-actions",children:x.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})}),x.jsxs("dl",{className:"gateway-qr-meta",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Status"}),x.jsx("dd",{children:(p==null?void 0:p.status)??d.status})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Expires"}),x.jsx("dd",{children:wv(d.expiresAt)})]}),d.userCode?x.jsxs("div",{children:[x.jsx("dt",{children:"User Code"}),x.jsx("dd",{children:d.userCode})]}):null,p!=null&&p.larkBotName?x.jsxs("div",{children:[x.jsx("dt",{children:"Bot"}),x.jsx("dd",{children:p.larkBotName})]}):null,p!=null&&p.message?x.jsxs("div",{children:[x.jsx("dt",{children:"Message"}),x.jsx("dd",{children:p.message})]}):null]}),x.jsxs("form",{className:"gateway-manual-bind",onSubmit:S=>{S.preventDefault();const v=m.trim(),_=b.trim();if(!v||!_){E("Enter both App ID and App Secret.");return}E(""),C(""),l(v,_)},children:[x.jsxs("div",{children:[x.jsx("label",{htmlFor:"gateway-lark-app-id",children:"App ID"}),x.jsx("input",{id:"gateway-lark-app-id",autoComplete:"off",disabled:n,value:m,onChange:S=>u(S.currentTarget.value),placeholder:"cli_xxx"})]}),x.jsxs("div",{children:[x.jsx("label",{htmlFor:"gateway-lark-app-secret",children:"App Secret"}),x.jsx("input",{id:"gateway-lark-app-secret",autoComplete:"off",disabled:n,type:"password",value:b,onChange:S=>C(S.currentTarget.value),placeholder:"Enter App Secret"})]}),T?x.jsx("p",{className:"form-error",children:T}):null,x.jsx("button",{type:"submit",disabled:n,children:"Bind manually"})]})]})]})})}function wv(n){const r=new Date(n);return Number.isNaN(r.getTime())?"-":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r)}let zr=null;function _k(n){const r=Date.parse(n.startedAt??""),s=Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return!Number.isFinite(r)||!Number.isFinite(s)?0:Math.max(0,s-r)}function vk(n,r,s){if((r==null?void 0:r.status)==="running")return!0;const l=Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return!!(s&&Number.isFinite(l)&&l>s)}function yk(n){const r=n.roundId??n.startedAt??n.taskSlug,s=n.stoppedAt??n.lastTurnEndedAt??"stopped";return`${r}:${s}`}function Sk(n,r){return`${n}:${r.role}:${r.lastFailureAt}`}function bk(n){const r=xk(n.role),s=xv(n);return n.status==="retrying"?`CC 出错,正在重试 ${r}${s} · 第 ${n.attempt}/${n.maxAttempts} 次`:`CC 出错,重试中 ${r}${s} · 第 ${n.attempt}/${n.maxAttempts} 次 · ${Ek(n.nextRetryAt)}`}function Ck(n,r){const s=xv(n);return n.retryable===!1?`CC stopped for ${r}: ${wk(n)} cannot be fixed by retrying.`:`CC retry failed after ${n.maxAttempts} attempts for ${r}${s}.`}function xv(n){return!n.error||n.error==="unknown"?"":` · ${n.error}`}function wk(n){return n.error&&n.error!=="unknown"?n.error:"this error"}function xk(n){return n.split("-").filter(Boolean).map(r=>`${r.slice(0,1).toUpperCase()}${r.slice(1)}`).join(" ")}function Ek(n){if(!n)return"即将重试";const r=Date.parse(n)-Date.now();return!Number.isFinite(r)||r<=0?"即将重试":`${Math.ceil(r/6e4)} 分钟后`}async function kk(){const n=Ev();return n?kv(n):!1}async function bo(){const n=Ev();if(!n||!await kv(n))return!1;try{const s=n.createGain(),l=n.currentTime+.025;return s.gain.setValueAtTime(.85,n.currentTime),s.connect(n.destination),Xg(n,s,{frequency:587.33,startAt:l,duration:.18,peakGain:.045}),Xg(n,s,{frequency:783.99,startAt:l+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function Ev(){const n=window.AudioContext??window.webkitAudioContext;if(!n)return null;try{return(!zr||zr.state==="closed")&&(zr=new n),zr}catch{return null}}function Kg(n){zr=null,n&&n.state!=="closed"&&n.close().catch(()=>{})}async function kv(n){if(Yg(n))return!0;try{await n.resume();const r=Yg(n);return!r&&n===zr&&Kg(n),r}catch{return n===zr&&Kg(n),!1}}function Yg(n){return n.state==="running"}function Xg(n,r,s){const l=n.createGain(),d=n.createOscillator(),p=n.createOscillator(),f=s.startAt+s.duration;l.gain.setValueAtTime(1e-4,s.startAt),l.gain.exponentialRampToValueAtTime(s.peakGain,s.startAt+.018),l.gain.exponentialRampToValueAtTime(1e-4,f),d.type="sine",d.frequency.setValueAtTime(s.frequency,s.startAt),p.type="triangle",p.frequency.setValueAtTime(s.frequency*2.01,s.startAt),d.connect(l),p.connect(l),l.connect(r),d.start(s.startAt),p.start(s.startAt),d.stop(f+.02),p.stop(f+.02)}const Av=document.getElementById("root");if(!Av)throw new Error("Missing #root element.");I0.createRoot(Av).render(x.jsx(te.StrictMode,{children:x.jsx(pk,{})}));
|