vibe-coding-master 0.4.16 → 0.4.17

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,95 @@
1
+ var s1=Object.defineProperty;var a1=(n,r,s)=>r in n?s1(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var cm=(n,r,s)=>a1(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"]'))o(d);new MutationObserver(d=>{for(const v of d)if(v.type==="childList")for(const f of v.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function s(d){const v={};return d.integrity&&(v.integrity=d.integrity),d.referrerPolicy&&(v.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?v.credentials="include":d.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function o(d){if(d.ep)return;d.ep=!0;const v=s(d);fetch(d.href,v)}})();function Bg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Cu={exports:{}},Sa={};/**
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 um;function l1(){if(um)return Sa;um=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(o,d,v){var f=null;if(v!==void 0&&(f=""+v),d.key!==void 0&&(f=""+d.key),"key"in d){v={};for(var l in d)l!=="key"&&(v[l]=d[l])}else v=d;return d=v.ref,{$$typeof:n,type:o,key:f,ref:d!==void 0?d:null,props:v}}return Sa.Fragment=r,Sa.jsx=s,Sa.jsxs=s,Sa}var hm;function o1(){return hm||(hm=1,Cu.exports=l1()),Cu.exports}var k=o1(),wu={exports:{}},Ie={};/**
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 fm;function c1(){if(fm)return Ie;fm=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),f=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),u=Symbol.for("react.activity"),b=Symbol.iterator;function C(H){return H===null||typeof H!="object"?null:(H=b&&H[b]||H["@@iterator"],typeof H=="function"?H:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,_={};function y(H,G,N){this.props=H,this.context=G,this.refs=_,this.updater=N||T}y.prototype.isReactComponent={},y.prototype.setState=function(H,G){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,G,"setState")},y.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function m(){}m.prototype=y.prototype;function S(H,G,N){this.props=H,this.context=G,this.refs=_,this.updater=N||T}var A=S.prototype=new m;A.constructor=S,x(A,y.prototype),A.isPureReactComponent=!0;var M=Array.isArray;function R(){}var D={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function L(H,G,N){var ie=N.ref;return{$$typeof:n,type:H,key:G,ref:ie!==void 0?ie:null,props:N}}function B(H,G){return L(H.type,G,H.props)}function I(H){return typeof H=="object"&&H!==null&&H.$$typeof===n}function F(H){var G={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(N){return G[N]})}var U=/\/+/g;function W(H,G){return typeof H=="object"&&H!==null&&H.key!=null?F(""+H.key):G.toString(36)}function X(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(R,R):(H.status="pending",H.then(function(G){H.status==="pending"&&(H.status="fulfilled",H.value=G)},function(G){H.status==="pending"&&(H.status="rejected",H.reason=G)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function V(H,G,N,ie,he){var ge=typeof H;(ge==="undefined"||ge==="boolean")&&(H=null);var K=!1;if(H===null)K=!0;else switch(ge){case"bigint":case"string":case"number":K=!0;break;case"object":switch(H.$$typeof){case n:case r:K=!0;break;case p:return K=H._init,V(K(H._payload),G,N,ie,he)}}if(K)return he=he(H),K=ie===""?"."+W(H,0):ie,M(he)?(N="",K!=null&&(N=K.replace(U,"$&/")+"/"),V(he,G,N,"",function(le){return le})):he!=null&&(I(he)&&(he=B(he,N+(he.key==null||H&&H.key===he.key?"":(""+he.key).replace(U,"$&/")+"/")+K)),G.push(he)),1;K=0;var q=ie===""?".":ie+":";if(M(H))for(var te=0;te<H.length;te++)ie=H[te],ge=q+W(ie,te),K+=V(ie,G,N,ge,he);else if(te=C(H),typeof te=="function")for(H=te.call(H),te=0;!(ie=H.next()).done;)ie=ie.value,ge=q+W(ie,te++),K+=V(ie,G,N,ge,he);else if(ge==="object"){if(typeof H.then=="function")return V(X(H),G,N,ie,he);throw G=String(H),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return K}function Y(H,G,N){if(H==null)return H;var ie=[],he=0;return V(H,ie,"","",function(ge){return G.call(N,ge,he++)}),ie}function J(H){if(H._status===-1){var G=H._result;G=G(),G.then(function(N){(H._status===0||H._status===-1)&&(H._status=1,H._result=N)},function(N){(H._status===0||H._status===-1)&&(H._status=2,H._result=N)}),H._status===-1&&(H._status=0,H._result=G)}if(H._status===1)return H._result.default;throw H._result}var z=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)},j={map:Y,forEach:function(H,G,N){Y(H,function(){G.apply(this,arguments)},N)},count:function(H){var G=0;return Y(H,function(){G++}),G},toArray:function(H){return Y(H,function(G){return G})||[]},only:function(H){if(!I(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return Ie.Activity=u,Ie.Children=j,Ie.Component=y,Ie.Fragment=s,Ie.Profiler=d,Ie.PureComponent=S,Ie.StrictMode=o,Ie.Suspense=c,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(H){return D.H.useMemoCache(H)}},Ie.cache=function(H){return function(){return H.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(H,G,N){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var ie=x({},H.props),he=H.key;if(G!=null)for(ge in G.key!==void 0&&(he=""+G.key),G)!E.call(G,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&G.ref===void 0||(ie[ge]=G[ge]);var ge=arguments.length-2;if(ge===1)ie.children=N;else if(1<ge){for(var K=Array(ge),q=0;q<ge;q++)K[q]=arguments[q+2];ie.children=K}return L(H.type,he,ie)},Ie.createContext=function(H){return H={$$typeof:f,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null},H.Provider=H,H.Consumer={$$typeof:v,_context:H},H},Ie.createElement=function(H,G,N){var ie,he={},ge=null;if(G!=null)for(ie in G.key!==void 0&&(ge=""+G.key),G)E.call(G,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(he[ie]=G[ie]);var K=arguments.length-2;if(K===1)he.children=N;else if(1<K){for(var q=Array(K),te=0;te<K;te++)q[te]=arguments[te+2];he.children=q}if(H&&H.defaultProps)for(ie in K=H.defaultProps,K)he[ie]===void 0&&(he[ie]=K[ie]);return L(H,ge,he)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(H){return{$$typeof:l,render:H}},Ie.isValidElement=I,Ie.lazy=function(H){return{$$typeof:p,_payload:{_status:-1,_result:H},_init:J}},Ie.memo=function(H,G){return{$$typeof:h,type:H,compare:G===void 0?null:G}},Ie.startTransition=function(H){var G=D.T,N={};D.T=N;try{var ie=H(),he=D.S;he!==null&&he(N,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(R,z)}catch(ge){z(ge)}finally{G!==null&&N.types!==null&&(G.types=N.types),D.T=G}},Ie.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ie.use=function(H){return D.H.use(H)},Ie.useActionState=function(H,G,N){return D.H.useActionState(H,G,N)},Ie.useCallback=function(H,G){return D.H.useCallback(H,G)},Ie.useContext=function(H){return D.H.useContext(H)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(H,G){return D.H.useDeferredValue(H,G)},Ie.useEffect=function(H,G){return D.H.useEffect(H,G)},Ie.useEffectEvent=function(H){return D.H.useEffectEvent(H)},Ie.useId=function(){return D.H.useId()},Ie.useImperativeHandle=function(H,G,N){return D.H.useImperativeHandle(H,G,N)},Ie.useInsertionEffect=function(H,G){return D.H.useInsertionEffect(H,G)},Ie.useLayoutEffect=function(H,G){return D.H.useLayoutEffect(H,G)},Ie.useMemo=function(H,G){return D.H.useMemo(H,G)},Ie.useOptimistic=function(H,G){return D.H.useOptimistic(H,G)},Ie.useReducer=function(H,G,N){return D.H.useReducer(H,G,N)},Ie.useRef=function(H){return D.H.useRef(H)},Ie.useState=function(H){return D.H.useState(H)},Ie.useSyncExternalStore=function(H,G,N){return D.H.useSyncExternalStore(H,G,N)},Ie.useTransition=function(){return D.H.useTransition()},Ie.version="19.2.6",Ie}var dm;function oh(){return dm||(dm=1,wu.exports=c1()),wu.exports}var ne=oh(),xu={exports:{}},ba={},Eu={exports:{}},ku={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var pm;function u1(){return pm||(pm=1,(function(n){function r(V,Y){var J=V.length;V.push(Y);e:for(;0<J;){var z=J-1>>>1,j=V[z];if(0<d(j,Y))V[z]=Y,V[J]=j,J=z;else break e}}function s(V){return V.length===0?null:V[0]}function o(V){if(V.length===0)return null;var Y=V[0],J=V.pop();if(J!==Y){V[0]=J;e:for(var z=0,j=V.length,H=j>>>1;z<H;){var G=2*(z+1)-1,N=V[G],ie=G+1,he=V[ie];if(0>d(N,J))ie<j&&0>d(he,N)?(V[z]=he,V[ie]=J,z=ie):(V[z]=N,V[G]=J,z=G);else if(ie<j&&0>d(he,J))V[z]=he,V[ie]=J,z=ie;else break e}}return Y}function d(V,Y){var J=V.sortIndex-Y.sortIndex;return J!==0?J:V.id-Y.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var v=performance;n.unstable_now=function(){return v.now()}}else{var f=Date,l=f.now();n.unstable_now=function(){return f.now()-l}}var c=[],h=[],p=1,u=null,b=3,C=!1,T=!1,x=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function A(V){for(var Y=s(h);Y!==null;){if(Y.callback===null)o(h);else if(Y.startTime<=V)o(h),Y.sortIndex=Y.expirationTime,r(c,Y);else break;Y=s(h)}}function M(V){if(x=!1,A(V),!T)if(s(c)!==null)T=!0,R||(R=!0,F());else{var Y=s(h);Y!==null&&X(M,Y.startTime-V)}}var R=!1,D=-1,E=5,L=-1;function B(){return _?!0:!(n.unstable_now()-L<E)}function I(){if(_=!1,R){var V=n.unstable_now();L=V;var Y=!0;try{e:{T=!1,x&&(x=!1,m(D),D=-1),C=!0;var J=b;try{t:{for(A(V),u=s(c);u!==null&&!(u.expirationTime>V&&B());){var z=u.callback;if(typeof z=="function"){u.callback=null,b=u.priorityLevel;var j=z(u.expirationTime<=V);if(V=n.unstable_now(),typeof j=="function"){u.callback=j,A(V),Y=!0;break t}u===s(c)&&o(c),A(V)}else o(c);u=s(c)}if(u!==null)Y=!0;else{var H=s(h);H!==null&&X(M,H.startTime-V),Y=!1}}break e}finally{u=null,b=J,C=!1}Y=void 0}}finally{Y?F():R=!1}}}var F;if(typeof S=="function")F=function(){S(I)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,W=U.port2;U.port1.onmessage=I,F=function(){W.postMessage(null)}}else F=function(){y(I,0)};function X(V,Y){D=y(function(){V(n.unstable_now())},Y)}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(V){V.callback=null},n.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<V?Math.floor(1e3/V):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(V){switch(b){case 1:case 2:case 3:var Y=3;break;default:Y=b}var J=b;b=Y;try{return V()}finally{b=J}},n.unstable_requestPaint=function(){_=!0},n.unstable_runWithPriority=function(V,Y){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var J=b;b=V;try{return Y()}finally{b=J}},n.unstable_scheduleCallback=function(V,Y,J){var z=n.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?z+J:z):J=z,V){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=J+j,V={id:p++,callback:Y,priorityLevel:V,startTime:J,expirationTime:j,sortIndex:-1},J>z?(V.sortIndex=J,r(h,V),s(c)===null&&V===s(h)&&(x?(m(D),D=-1):x=!0,X(M,J-z))):(V.sortIndex=j,r(c,V),T||C||(T=!0,R||(R=!0,F()))),V},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(V){var Y=b;return function(){var J=b;b=Y;try{return V.apply(this,arguments)}finally{b=J}}}})(ku)),ku}var mm;function h1(){return mm||(mm=1,Eu.exports=u1()),Eu.exports}var Au={exports:{}},Gt={};/**
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 gm;function f1(){if(gm)return Gt;gm=1;var n=oh();function r(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}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 o={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 v(c,h,p){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:p}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Gt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Gt.createPortal=function(c,h){var p=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 v(c,h,null,p)},Gt.flushSync=function(c){var h=f.T,p=o.p;try{if(f.T=null,o.p=2,c)return c()}finally{f.T=h,o.p=p,o.d.f()}},Gt.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(c,h))},Gt.prefetchDNS=function(c){typeof c=="string"&&o.d.D(c)},Gt.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var p=h.as,u=l(p,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,C=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?o.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:u,integrity:b,fetchPriority:C}):p==="script"&&o.d.X(c,{crossOrigin:u,integrity:b,fetchPriority:C,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Gt.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=l(h.as,h.crossOrigin);o.d.M(c,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(c)},Gt.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,u=l(p,h.crossOrigin);o.d.L(c,p,{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})}},Gt.preloadModule=function(c,h){if(typeof c=="string")if(h){var p=l(h.as,h.crossOrigin);o.d.m(c,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(c)},Gt.requestFormReset=function(c){o.d.r(c)},Gt.unstable_batchedUpdates=function(c,h){return c(h)},Gt.useFormState=function(c,h,p){return f.H.useFormState(c,h,p)},Gt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Gt.version="19.2.6",Gt}var _m;function d1(){if(_m)return Au.exports;_m=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(),Au.exports=f1(),Au.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 vm;function p1(){if(vm)return ba;vm=1;var n=h1(),r=oh(),s=d1();function o(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 v(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 l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(v(e)!==e)throw Error(o(188))}function h(e){var t=e.alternate;if(!t){if(t=v(e),t===null)throw Error(o(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(o(188))}if(i.return!==a.return)i=g,a=w;else{for(var O=!1,P=g.child;P;){if(P===i){O=!0,i=g,a=w;break}if(P===a){O=!0,a=g,i=w;break}P=P.sibling}if(!O){for(P=w.child;P;){if(P===i){O=!0,i=w,a=g;break}if(P===a){O=!0,a=w,i=g;break}P=P.sibling}if(!O)throw Error(o(189))}}if(i.alternate!==a)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(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"),x=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),S=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var U=Symbol.for("react.client.reference");function W(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===U?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case y:return"Profiler";case _:return"StrictMode";case M:return"Suspense";case R:return"SuspenseList";case L:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case S:return e.displayName||"Context";case m: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 D:return t=e.displayName||null,t!==null?t:W(e.type)||"Memo";case E:t=e._payload,e=e._init;try{return W(e(t))}catch{}}return null}var X=Array.isArray,V=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},z=[],j=-1;function H(e){return{current:e}}function G(e){0>j||(e.current=z[j],z[j]=null,j--)}function N(e,t){j++,z[j]=e.current,e.current=t}var ie=H(null),he=H(null),ge=H(null),K=H(null);function q(e,t){switch(N(ge,t),N(he,e),N(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Lp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Lp(t),e=Op(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}G(ie),N(ie,e)}function te(){G(ie),G(he),G(ge)}function le(e){e.memoizedState!==null&&N(K,e);var t=ie.current,i=Op(t,e.type);t!==i&&(N(he,e),N(ie,i))}function xe(e){he.current===e&&(G(ie),G(he)),K.current===e&&(G(K),ga._currentValue=J)}var Ee,Ce;function me(e){if(Ee===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Ee=t&&t[1]||"",Ce=-1<i.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Ee+e+Ce}var Te=!1;function He(e,t){if(!e||Te)return"";Te=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(ue){var oe=ue}Reflect.construct(e,[],ve)}else{try{ve.call()}catch(ue){oe=ue}e.call(ve.prototype)}}else{try{throw Error()}catch(ue){oe=ue}(ve=e())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(ue){if(ue&&oe&&typeof ue.stack=="string")return[ue.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(),O=w[0],P=w[1];if(O&&P){var Q=O.split(`
44
+ `),ae=P.split(`
45
+ `);for(g=a=0;a<Q.length&&!Q[a].includes("DetermineComponentFrameRoot");)a++;for(;g<ae.length&&!ae[g].includes("DetermineComponentFrameRoot");)g++;if(a===Q.length||g===ae.length)for(a=Q.length-1,g=ae.length-1;1<=a&&0<=g&&Q[a]!==ae[g];)g--;for(;1<=a&&0<=g;a--,g--)if(Q[a]!==ae[g]){if(a!==1||g!==1)do if(a--,g--,0>g||Q[a]!==ae[g]){var de=`
46
+ `+Q[a].replace(" at new "," at ");return e.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",e.displayName)),de}while(1<=a&&0<=g);break}}}finally{Te=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?me(i):""}function ke(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me("Lazy");case 13:return e.child!==t&&t!==null?me("Suspense Fallback"):me("Suspense");case 19:return me("SuspenseList");case 0:case 15:return He(e.type,!1);case 11:return He(e.type.render,!1);case 1:return He(e.type,!0);case 31:return me("Activity");default:return""}}function Jt(e){try{var t="",i=null;do t+=ke(e,i),i=e,e=e.return;while(e);return t}catch(a){return`
47
+ Error generating stack: `+a.message+`
48
+ `+a.stack}}var Nt=Object.prototype.hasOwnProperty,Kt=n.unstable_scheduleCallback,en=n.unstable_cancelCallback,xn=n.unstable_shouldYield,bt=n.unstable_requestPaint,dt=n.unstable_now,Bt=n.unstable_getCurrentPriorityLevel,fe=n.unstable_ImmediatePriority,Se=n.unstable_UserBlockingPriority,pe=n.unstable_NormalPriority,Me=n.unstable_LowPriority,Ne=n.unstable_IdlePriority,pt=n.log,Ue=n.unstable_setDisableYieldValue,Je=null,at=null;function xt(e){if(typeof pt=="function"&&Ue(e),at&&typeof at.setStrictMode=="function")try{at.setStrictMode(Je,e)}catch{}}var we=Math.clz32?Math.clz32:Yt,Et=Math.log,kt=Math.LN2;function Yt(e){return e>>>=0,e===0?32:31-(Et(e)/kt|0)|0}var Hn=256,ze=262144,zn=4194304;function In(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 ti(e,t,i){var a=e.pendingLanes;if(a===0)return 0;var g=0,w=e.suspendedLanes,O=e.pingedLanes;e=e.warmLanes;var P=a&134217727;return P!==0?(a=P&~w,a!==0?g=In(a):(O&=P,O!==0?g=In(O):i||(i=P&~e,i!==0&&(g=In(i))))):(P=a&~w,P!==0?g=In(P):O!==0?g=In(O):i||(i=a&~e,i!==0&&(g=In(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 ar(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Mr(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 Ha(){var e=zn;return zn<<=1,(zn&62914560)===0&&(zn=4194304),e}function ks(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function lr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function za(e,t,i,a,g,w){var O=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,Q=e.expirationTimes,ae=e.hiddenUpdates;for(i=O&~i;0<i;){var de=31-we(i),ve=1<<de;P[de]=0,Q[de]=-1;var oe=ae[de];if(oe!==null)for(ae[de]=null,de=0;de<oe.length;de++){var ue=oe[de];ue!==null&&(ue.lane&=-536870913)}i&=~ve}a!==0&&or(e,a,0),w!==0&&g===0&&e.tag!==0&&(e.suspendedLanes|=w&~(O&~t))}function or(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-we(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|i&261930}function As(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var a=31-we(i),g=1<<a;g&t|e[a]&t&&(e[a]|=t),i&=~g}}function Ia(e,t){var i=t&-t;return i=(i&42)!==0?1:ni(i),(i&(e.suspendedLanes|t))!==0?0:i}function ni(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 Lr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ts(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:nm(e.type))}function ct(e,t){var i=Y.p;try{return Y.p=e,t()}finally{Y.p=i}}var Pn=Math.random().toString(36).slice(2),ut="__reactFiber$"+Pn,At="__reactProps$"+Pn,En="__reactContainer$"+Pn,Ei="__reactEvents$"+Pn,Rs="__reactListeners$"+Pn,Z="__reactHandles$"+Pn,Xt="__reactResources$"+Pn,ii="__reactMarker$"+Pn;function Or(e){delete e[ut],delete e[At],delete e[Ei],delete e[Rs],delete e[Z]}function tn(e){var t=e[ut];if(t)return t;for(var i=e.parentNode;i;){if(t=i[En]||i[ut]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=Pp(e);e!==null;){if(i=e[ut])return i;e=Pp(e)}return t}e=i,i=e.parentNode}return null}function Wn(e){if(e=e[ut]||e[En]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ki(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Ai(e){var t=e[Xt];return t||(t=e[Xt]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Tt(e){e[ii]=!0}var Ft=new Set,dn={};function Kn(e,t){ri(e,t),ri(e+"Capture",t)}function ri(e,t){for(dn[e]=t,e=0;e<t.length;e++)Ft.add(t[e])}var Ds=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]*$"),Pa={},cr={};function yo(e){return Nt.call(cr,e)?!0:Nt.call(Pa,e)?!1:Ds.test(e)?cr[e]=!0:(Pa[e]=!0,!1)}function Br(e,t,i){if(yo(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 jr(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 Un(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 nn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ti(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ur(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(O){i=""+O,w.call(this,O)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return i},setValue:function(O){i=""+O},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function si(e){if(!e._valueTracker){var t=Ti(e)?"checked":"value";e._valueTracker=ur(e,t,""+e[t])}}function Nr(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),a="";return e&&(a=Ti(e)?e.checked?"true":"false":e.value),e=a,e!==i?(t.setValue(e),!0):!1}function Hr(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 zr=/[\n"\\]/g;function qt(e){return e.replace(zr,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function hr(e,t,i,a,g,w,O,P){e.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?e.type=O:e.removeAttribute("type"),t!=null?O==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+nn(t)):e.value!==""+nn(t)&&(e.value=""+nn(t)):O!=="submit"&&O!=="reset"||e.removeAttribute("value"),t!=null?Ri(e,O,nn(t)):i!=null?Ri(e,O,nn(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=""+nn(P):e.removeAttribute("name")}function Fn(e,t,i,a,g,w,O,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)){si(e);return}i=i!=null?""+nn(i):"",t=t!=null?""+nn(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,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(e.name=O),si(e)}function Ri(e,t,i){t==="number"&&Hr(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function rn(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=""+nn(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 kn(e,t,i){if(t!=null&&(t=""+nn(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+nn(i):""}function Ir(e,t,i,a){if(t==null){if(a!=null){if(i!=null)throw Error(o(92));if(X(a)){if(1<a.length)throw Error(o(93));a=a[0]}i=a}i==null&&(i=""),t=i}i=nn(t),e.defaultValue=i,a=e.textContent,a===i&&a!==""&&a!==null&&(e.value=a),si(e)}function Be(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var So=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 Ua(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||So.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Fa(e,t,i){if(t!=null&&typeof t!="object")throw Error(o(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&&Ua(e,g,a)}else for(var w in t)t.hasOwnProperty(w)&&Ua(e,w,t[w])}function Ms(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 Ls=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"]]),qa=/^[\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 $(e){return qa.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ce(){}var ht=null;function vt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var An=null,pn=null;function Ga(e){var t=Wn(e);if(t&&(e=t.stateNode)){var i=e[At]||null;e:switch(e=t.stateNode,t.type){case"input":if(hr(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="'+qt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var a=i[t];if(a!==e&&a.form===e.form){var g=a[At]||null;if(!g)throw Error(o(90));hr(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&&Nr(a)}break e;case"textarea":kn(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&rn(e,!!i.multiple,t,!1)}}}var bo=!1;function Mh(e,t,i){if(bo)return e(t,i);bo=!0;try{var a=e(t);return a}finally{if(bo=!1,(An!==null||pn!==null)&&(Ml(),An&&(t=An,e=pn,pn=An=null,Ga(t),e)))for(t=0;t<e.length;t++)Ga(e[t])}}function Os(e,t){var i=e.stateNode;if(i===null)return null;var a=i[At]||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(o(231,t,typeof i));return i}var ai=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Co=!1;if(ai)try{var Bs={};Object.defineProperty(Bs,"passive",{get:function(){Co=!0}}),window.addEventListener("test",Bs,Bs),window.removeEventListener("test",Bs,Bs)}catch{Co=!1}var Di=null,wo=null,Va=null;function Lh(){if(Va)return Va;var e,t=wo,i=t.length,a,g="value"in Di?Di.value:Di.textContent,w=g.length;for(e=0;e<i&&t[e]===g[e];e++);var O=i-e;for(a=1;a<=O&&t[i-a]===g[w-a];a++);return Va=g.slice(e,1<a?1-a:void 0)}function $a(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 Wa(){return!0}function Oh(){return!1}function sn(e){function t(i,a,g,w,O){this._reactName=i,this._targetInst=g,this.type=a,this.nativeEvent=w,this.target=O,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)?Wa:Oh,this.isPropagationStopped=Oh,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=Wa)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Wa)},persist:function(){},isPersistent:Wa}),t}var fr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ka=sn(fr),js=u({},fr,{view:0,detail:0}),iv=sn(js),xo,Eo,Ns,Ya=u({},js,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ao,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!==Ns&&(Ns&&e.type==="mousemove"?(xo=e.screenX-Ns.screenX,Eo=e.screenY-Ns.screenY):Eo=xo=0,Ns=e),xo)},movementY:function(e){return"movementY"in e?e.movementY:Eo}}),Bh=sn(Ya),rv=u({},Ya,{dataTransfer:0}),sv=sn(rv),av=u({},js,{relatedTarget:0}),ko=sn(av),lv=u({},fr,{animationName:0,elapsedTime:0,pseudoElement:0}),ov=sn(lv),cv=u({},fr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),uv=sn(cv),hv=u({},fr,{data:0}),jh=sn(hv),fv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dv={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"},pv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=pv[e])?!!t[e]:!1}function Ao(){return mv}var gv=u({},js,{key:function(e){if(e.key){var t=fv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$a(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ao,charCode:function(e){return e.type==="keypress"?$a(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$a(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_v=sn(gv),vv=u({},Ya,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nh=sn(vv),yv=u({},js,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ao}),Sv=sn(yv),bv=u({},fr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Cv=sn(bv),wv=u({},Ya,{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}),xv=sn(wv),Ev=u({},fr,{newState:0,oldState:0}),kv=sn(Ev),Av=[9,13,27,32],To=ai&&"CompositionEvent"in window,Hs=null;ai&&"documentMode"in document&&(Hs=document.documentMode);var Tv=ai&&"TextEvent"in window&&!Hs,Hh=ai&&(!To||Hs&&8<Hs&&11>=Hs),zh=" ",Ih=!1;function Ph(e,t){switch(e){case"keyup":return Av.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Uh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pr=!1;function Rv(e,t){switch(e){case"compositionend":return Uh(t);case"keypress":return t.which!==32?null:(Ih=!0,zh);case"textInput":return e=t.data,e===zh&&Ih?null:e;default:return null}}function Dv(e,t){if(Pr)return e==="compositionend"||!To&&Ph(e,t)?(e=Lh(),Va=wo=Di=null,Pr=!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 Hh&&t.locale!=="ko"?null:t.data;default:return null}}var Mv={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 Fh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mv[e.type]:t==="textarea"}function qh(e,t,i,a){An?pn?pn.push(a):pn=[a]:An=a,t=zl(t,"onChange"),0<t.length&&(i=new Ka("onChange","change",null,i,a),e.push({event:i,listeners:t}))}var zs=null,Is=null;function Lv(e){kp(e,0)}function Xa(e){var t=ki(e);if(Nr(t))return e}function Gh(e,t){if(e==="change")return t}var Vh=!1;if(ai){var Ro;if(ai){var Do="oninput"in document;if(!Do){var $h=document.createElement("div");$h.setAttribute("oninput","return;"),Do=typeof $h.oninput=="function"}Ro=Do}else Ro=!1;Vh=Ro&&(!document.documentMode||9<document.documentMode)}function Wh(){zs&&(zs.detachEvent("onpropertychange",Kh),Is=zs=null)}function Kh(e){if(e.propertyName==="value"&&Xa(Is)){var t=[];qh(t,Is,e,vt(e)),Mh(Lv,t)}}function Ov(e,t,i){e==="focusin"?(Wh(),zs=t,Is=i,zs.attachEvent("onpropertychange",Kh)):e==="focusout"&&Wh()}function Bv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xa(Is)}function jv(e,t){if(e==="click")return Xa(t)}function Nv(e,t){if(e==="input"||e==="change")return Xa(t)}function Hv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mn=typeof Object.is=="function"?Object.is:Hv;function Ps(e,t){if(mn(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(!Nt.call(t,g)||!mn(e[g],t[g]))return!1}return!0}function Yh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xh(e,t){var i=Yh(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=Yh(i)}}function Qh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Hr(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=Hr(e.document)}return t}function Mo(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 zv=ai&&"documentMode"in document&&11>=document.documentMode,Ur=null,Lo=null,Us=null,Oo=!1;function Jh(e,t,i){var a=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Oo||Ur==null||Ur!==Hr(a)||(a=Ur,"selectionStart"in a&&Mo(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}),Us&&Ps(Us,a)||(Us=a,a=zl(Lo,"onSelect"),0<a.length&&(t=new Ka("onSelect","select",null,t,i),e.push({event:t,listeners:a}),t.target=Ur)))}function dr(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Fr={animationend:dr("Animation","AnimationEnd"),animationiteration:dr("Animation","AnimationIteration"),animationstart:dr("Animation","AnimationStart"),transitionrun:dr("Transition","TransitionRun"),transitionstart:dr("Transition","TransitionStart"),transitioncancel:dr("Transition","TransitionCancel"),transitionend:dr("Transition","TransitionEnd")},Bo={},ef={};ai&&(ef=document.createElement("div").style,"AnimationEvent"in window||(delete Fr.animationend.animation,delete Fr.animationiteration.animation,delete Fr.animationstart.animation),"TransitionEvent"in window||delete Fr.transitionend.transition);function pr(e){if(Bo[e])return Bo[e];if(!Fr[e])return e;var t=Fr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in ef)return Bo[e]=t[i];return e}var tf=pr("animationend"),nf=pr("animationiteration"),rf=pr("animationstart"),Iv=pr("transitionrun"),Pv=pr("transitionstart"),Uv=pr("transitioncancel"),sf=pr("transitionend"),af=new Map,jo="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(" ");jo.push("scrollEnd");function qn(e,t){af.set(e,t),Kn(t,[e])}var Qa=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)},Tn=[],qr=0,No=0;function Za(){for(var e=qr,t=No=qr=0;t<e;){var i=Tn[t];Tn[t++]=null;var a=Tn[t];Tn[t++]=null;var g=Tn[t];Tn[t++]=null;var w=Tn[t];if(Tn[t++]=null,a!==null&&g!==null){var O=a.pending;O===null?g.next=g:(g.next=O.next,O.next=g),a.pending=g}w!==0&&lf(i,g,w)}}function Ja(e,t,i,a){Tn[qr++]=e,Tn[qr++]=t,Tn[qr++]=i,Tn[qr++]=a,No|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Ho(e,t,i,a){return Ja(e,t,i,a),el(e)}function mr(e,t){return Ja(e,null,null,t),el(e)}function lf(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-we(i),e=w.hiddenUpdates,a=e[g],a===null?e[g]=[t]:a.push(t),t.lane=i|536870912),w):null}function el(e){if(50<ca)throw ca=0,$c=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Gr={};function Fv(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 gn(e,t,i,a){return new Fv(e,t,i,a)}function zo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function li(e,t){var i=e.alternate;return i===null?(i=gn(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 of(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 tl(e,t,i,a,g,w){var O=0;if(a=e,typeof e=="function")zo(e)&&(O=1);else if(typeof e=="string")O=W0(e,i,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case L:return e=gn(31,i,t,g),e.elementType=L,e.lanes=w,e;case x:return gr(i.children,g,w,t);case _:O=8,g|=24;break;case y:return e=gn(12,i,t,g|2),e.elementType=y,e.lanes=w,e;case M:return e=gn(13,i,t,g),e.elementType=M,e.lanes=w,e;case R:return e=gn(19,i,t,g),e.elementType=R,e.lanes=w,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case S:O=10;break e;case m:O=9;break e;case A:O=11;break e;case D:O=14;break e;case E:O=16,a=null;break e}O=29,i=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=gn(O,i,t,g),t.elementType=e,t.type=a,t.lanes=w,t}function gr(e,t,i,a){return e=gn(7,e,a,t),e.lanes=i,e}function Io(e,t,i){return e=gn(6,e,null,t),e.lanes=i,e}function cf(e){var t=gn(18,null,null,0);return t.stateNode=e,t}function Po(e,t,i){return t=gn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var uf=new WeakMap;function Rn(e,t){if(typeof e=="object"&&e!==null){var i=uf.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Jt(t)},uf.set(e,t),t)}return{value:e,source:t,stack:Jt(t)}}var Vr=[],$r=0,nl=null,Fs=0,Dn=[],Mn=0,Mi=null,Yn=1,Xn="";function oi(e,t){Vr[$r++]=Fs,Vr[$r++]=nl,nl=e,Fs=t}function hf(e,t,i){Dn[Mn++]=Yn,Dn[Mn++]=Xn,Dn[Mn++]=Mi,Mi=e;var a=Yn;e=Xn;var g=32-we(a)-1;a&=~(1<<g),i+=1;var w=32-we(t)+g;if(30<w){var O=g-g%5;w=(a&(1<<O)-1).toString(32),a>>=O,g-=O,Yn=1<<32-we(t)+g|i<<g|a,Xn=w+e}else Yn=1<<w|i<<g|a,Xn=e}function Uo(e){e.return!==null&&(oi(e,1),hf(e,1,0))}function Fo(e){for(;e===nl;)nl=Vr[--$r],Vr[$r]=null,Fs=Vr[--$r],Vr[$r]=null;for(;e===Mi;)Mi=Dn[--Mn],Dn[Mn]=null,Xn=Dn[--Mn],Dn[Mn]=null,Yn=Dn[--Mn],Dn[Mn]=null}function ff(e,t){Dn[Mn++]=Yn,Dn[Mn++]=Xn,Dn[Mn++]=Mi,Yn=t.id,Xn=t.overflow,Mi=e}var zt=null,mt=null,Ye=!1,Li=null,Ln=!1,qo=Error(o(519));function Oi(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qs(Rn(t,e)),qo}function df(e){var t=e.stateNode,i=e.type,a=e.memoizedProps;switch(t[ut]=e,t[At]=a,i){case"dialog":Ve("cancel",t),Ve("close",t);break;case"iframe":case"object":case"embed":Ve("load",t);break;case"video":case"audio":for(i=0;i<ha.length;i++)Ve(ha[i],t);break;case"source":Ve("error",t);break;case"img":case"image":case"link":Ve("error",t),Ve("load",t);break;case"details":Ve("toggle",t);break;case"input":Ve("invalid",t),Fn(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Ve("invalid",t);break;case"textarea":Ve("invalid",t),Ir(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||Dp(t.textContent,i)?(a.popover!=null&&(Ve("beforetoggle",t),Ve("toggle",t)),a.onScroll!=null&&Ve("scroll",t),a.onScrollEnd!=null&&Ve("scrollend",t),a.onClick!=null&&(t.onclick=ce),t=!0):t=!1,t||Oi(e,!0)}function pf(e){for(zt=e.return;zt;)switch(zt.tag){case 5:case 31:case 13:Ln=!1;return;case 27:case 3:Ln=!0;return;default:zt=zt.return}}function Wr(e){if(e!==zt)return!1;if(!Ye)return pf(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")||lu(e.type,e.memoizedProps)),i=!i),i&&mt&&Oi(e),pf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));mt=Ip(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));mt=Ip(e)}else t===27?(t=mt,Wi(e.type)?(e=fu,fu=null,mt=e):mt=t):mt=zt?Bn(e.stateNode.nextSibling):null;return!0}function _r(){mt=zt=null,Ye=!1}function Go(){var e=Li;return e!==null&&(cn===null?cn=e:cn.push.apply(cn,e),Li=null),e}function qs(e){Li===null?Li=[e]:Li.push(e)}var Vo=H(null),vr=null,ci=null;function Bi(e,t,i){N(Vo,t._currentValue),t._currentValue=i}function ui(e){e._currentValue=Vo.current,G(Vo)}function $o(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 Wo(e,t,i,a){var g=e.child;for(g!==null&&(g.return=e);g!==null;){var w=g.dependencies;if(w!==null){var O=g.child;w=w.firstContext;e:for(;w!==null;){var P=w;w=g;for(var Q=0;Q<t.length;Q++)if(P.context===t[Q]){w.lanes|=i,P=w.alternate,P!==null&&(P.lanes|=i),$o(w.return,i,e),a||(O=null);break e}w=P.next}}else if(g.tag===18){if(O=g.return,O===null)throw Error(o(341));O.lanes|=i,w=O.alternate,w!==null&&(w.lanes|=i),$o(O,i,e),O=null}else O=g.child;if(O!==null)O.return=g;else for(O=g;O!==null;){if(O===e){O=null;break}if(g=O.sibling,g!==null){g.return=O.return,O=g;break}O=O.return}g=O}}function Kr(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 O=g.alternate;if(O===null)throw Error(o(387));if(O=O.memoizedProps,O!==null){var P=g.type;mn(g.pendingProps.value,O.value)||(e!==null?e.push(P):e=[P])}}else if(g===K.current){if(O=g.alternate,O===null)throw Error(o(387));O.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(e!==null?e.push(ga):e=[ga])}g=g.return}e!==null&&Wo(t,e,i,a),t.flags|=262144}function il(e){for(e=e.firstContext;e!==null;){if(!mn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function yr(e){vr=e,ci=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function It(e){return mf(vr,e)}function rl(e,t){return vr===null&&yr(e),mf(e,t)}function mf(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},ci===null){if(e===null)throw Error(o(308));ci=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ci=ci.next=t;return i}var qv=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()})}},Gv=n.unstable_scheduleCallback,Vv=n.unstable_NormalPriority,Rt={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ko(){return{controller:new qv,data:new Map,refCount:0}}function Gs(e){e.refCount--,e.refCount===0&&Gv(Vv,function(){e.controller.abort()})}var Vs=null,Yo=0,Yr=0,Xr=null;function $v(e,t){if(Vs===null){var i=Vs=[];Yo=0,Yr=Zc(),Xr={status:"pending",value:void 0,then:function(a){i.push(a)}}}return Yo++,t.then(gf,gf),t}function gf(){if(--Yo===0&&Vs!==null){Xr!==null&&(Xr.status="fulfilled");var e=Vs;Vs=null,Yr=0,Xr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wv(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 _f=V.S;V.S=function(e,t){ep=dt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&$v(e,t),_f!==null&&_f(e,t)};var Sr=H(null);function Xo(){var e=Sr.current;return e!==null?e:lt.pooledCache}function sl(e,t){t===null?N(Sr,Sr.current):N(Sr,t.pool)}function vf(){var e=Xo();return e===null?null:{parent:Rt._currentValue,pool:e}}var Qr=Error(o(460)),Qo=Error(o(474)),al=Error(o(542)),ll={then:function(){}};function yf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Sf(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(ce,ce),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Cf(e),e;default:if(typeof t.status=="string")t.then(ce,ce);else{if(e=lt,e!==null&&100<e.shellSuspendCounter)throw Error(o(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,Cf(e),e}throw Cr=t,Qr}}function br(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Cr=i,Qr):i}}var Cr=null;function bf(){if(Cr===null)throw Error(o(459));var e=Cr;return Cr=null,e}function Cf(e){if(e===Qr||e===al)throw Error(o(483))}var Zr=null,$s=0;function ol(e){var t=$s;return $s+=1,Zr===null&&(Zr=[]),Sf(Zr,e,t)}function Ws(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function cl(e,t){throw t.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function wf(e){function t(re,ee){if(e){var se=re.deletions;se===null?(re.deletions=[ee],re.flags|=16):se.push(ee)}}function i(re,ee){if(!e)return null;for(;ee!==null;)t(re,ee),ee=ee.sibling;return null}function a(re){for(var ee=new Map;re!==null;)re.key!==null?ee.set(re.key,re):ee.set(re.index,re),re=re.sibling;return ee}function g(re,ee){return re=li(re,ee),re.index=0,re.sibling=null,re}function w(re,ee,se){return re.index=se,e?(se=re.alternate,se!==null?(se=se.index,se<ee?(re.flags|=67108866,ee):se):(re.flags|=67108866,ee)):(re.flags|=1048576,ee)}function O(re){return e&&re.alternate===null&&(re.flags|=67108866),re}function P(re,ee,se,_e){return ee===null||ee.tag!==6?(ee=Io(se,re.mode,_e),ee.return=re,ee):(ee=g(ee,se),ee.return=re,ee)}function Q(re,ee,se,_e){var Le=se.type;return Le===x?de(re,ee,se.props.children,_e,se.key):ee!==null&&(ee.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===E&&br(Le)===ee.type)?(ee=g(ee,se.props),Ws(ee,se),ee.return=re,ee):(ee=tl(se.type,se.key,se.props,null,re.mode,_e),Ws(ee,se),ee.return=re,ee)}function ae(re,ee,se,_e){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==se.containerInfo||ee.stateNode.implementation!==se.implementation?(ee=Po(se,re.mode,_e),ee.return=re,ee):(ee=g(ee,se.children||[]),ee.return=re,ee)}function de(re,ee,se,_e,Le){return ee===null||ee.tag!==7?(ee=gr(se,re.mode,_e,Le),ee.return=re,ee):(ee=g(ee,se),ee.return=re,ee)}function ve(re,ee,se){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Io(""+ee,re.mode,se),ee.return=re,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case C:return se=tl(ee.type,ee.key,ee.props,null,re.mode,se),Ws(se,ee),se.return=re,se;case T:return ee=Po(ee,re.mode,se),ee.return=re,ee;case E:return ee=br(ee),ve(re,ee,se)}if(X(ee)||F(ee))return ee=gr(ee,re.mode,se,null),ee.return=re,ee;if(typeof ee.then=="function")return ve(re,ol(ee),se);if(ee.$$typeof===S)return ve(re,rl(re,ee),se);cl(re,ee)}return null}function oe(re,ee,se,_e){var Le=ee!==null?ee.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Le!==null?null:P(re,ee,""+se,_e);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case C:return se.key===Le?Q(re,ee,se,_e):null;case T:return se.key===Le?ae(re,ee,se,_e):null;case E:return se=br(se),oe(re,ee,se,_e)}if(X(se)||F(se))return Le!==null?null:de(re,ee,se,_e,null);if(typeof se.then=="function")return oe(re,ee,ol(se),_e);if(se.$$typeof===S)return oe(re,ee,rl(re,se),_e);cl(re,se)}return null}function ue(re,ee,se,_e,Le){if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return re=re.get(se)||null,P(ee,re,""+_e,Le);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case C:return re=re.get(_e.key===null?se:_e.key)||null,Q(ee,re,_e,Le);case T:return re=re.get(_e.key===null?se:_e.key)||null,ae(ee,re,_e,Le);case E:return _e=br(_e),ue(re,ee,se,_e,Le)}if(X(_e)||F(_e))return re=re.get(se)||null,de(ee,re,_e,Le,null);if(typeof _e.then=="function")return ue(re,ee,se,ol(_e),Le);if(_e.$$typeof===S)return ue(re,ee,se,rl(ee,_e),Le);cl(ee,_e)}return null}function Re(re,ee,se,_e){for(var Le=null,Qe=null,De=ee,Fe=ee=0,Ke=null;De!==null&&Fe<se.length;Fe++){De.index>Fe?(Ke=De,De=null):Ke=De.sibling;var Ze=oe(re,De,se[Fe],_e);if(Ze===null){De===null&&(De=Ke);break}e&&De&&Ze.alternate===null&&t(re,De),ee=w(Ze,ee,Fe),Qe===null?Le=Ze:Qe.sibling=Ze,Qe=Ze,De=Ke}if(Fe===se.length)return i(re,De),Ye&&oi(re,Fe),Le;if(De===null){for(;Fe<se.length;Fe++)De=ve(re,se[Fe],_e),De!==null&&(ee=w(De,ee,Fe),Qe===null?Le=De:Qe.sibling=De,Qe=De);return Ye&&oi(re,Fe),Le}for(De=a(De);Fe<se.length;Fe++)Ke=ue(De,re,Fe,se[Fe],_e),Ke!==null&&(e&&Ke.alternate!==null&&De.delete(Ke.key===null?Fe:Ke.key),ee=w(Ke,ee,Fe),Qe===null?Le=Ke:Qe.sibling=Ke,Qe=Ke);return e&&De.forEach(function(Zi){return t(re,Zi)}),Ye&&oi(re,Fe),Le}function je(re,ee,se,_e){if(se==null)throw Error(o(151));for(var Le=null,Qe=null,De=ee,Fe=ee=0,Ke=null,Ze=se.next();De!==null&&!Ze.done;Fe++,Ze=se.next()){De.index>Fe?(Ke=De,De=null):Ke=De.sibling;var Zi=oe(re,De,Ze.value,_e);if(Zi===null){De===null&&(De=Ke);break}e&&De&&Zi.alternate===null&&t(re,De),ee=w(Zi,ee,Fe),Qe===null?Le=Zi:Qe.sibling=Zi,Qe=Zi,De=Ke}if(Ze.done)return i(re,De),Ye&&oi(re,Fe),Le;if(De===null){for(;!Ze.done;Fe++,Ze=se.next())Ze=ve(re,Ze.value,_e),Ze!==null&&(ee=w(Ze,ee,Fe),Qe===null?Le=Ze:Qe.sibling=Ze,Qe=Ze);return Ye&&oi(re,Fe),Le}for(De=a(De);!Ze.done;Fe++,Ze=se.next())Ze=ue(De,re,Fe,Ze.value,_e),Ze!==null&&(e&&Ze.alternate!==null&&De.delete(Ze.key===null?Fe:Ze.key),ee=w(Ze,ee,Fe),Qe===null?Le=Ze:Qe.sibling=Ze,Qe=Ze);return e&&De.forEach(function(r1){return t(re,r1)}),Ye&&oi(re,Fe),Le}function st(re,ee,se,_e){if(typeof se=="object"&&se!==null&&se.type===x&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case C:e:{for(var Le=se.key;ee!==null;){if(ee.key===Le){if(Le=se.type,Le===x){if(ee.tag===7){i(re,ee.sibling),_e=g(ee,se.props.children),_e.return=re,re=_e;break e}}else if(ee.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===E&&br(Le)===ee.type){i(re,ee.sibling),_e=g(ee,se.props),Ws(_e,se),_e.return=re,re=_e;break e}i(re,ee);break}else t(re,ee);ee=ee.sibling}se.type===x?(_e=gr(se.props.children,re.mode,_e,se.key),_e.return=re,re=_e):(_e=tl(se.type,se.key,se.props,null,re.mode,_e),Ws(_e,se),_e.return=re,re=_e)}return O(re);case T:e:{for(Le=se.key;ee!==null;){if(ee.key===Le)if(ee.tag===4&&ee.stateNode.containerInfo===se.containerInfo&&ee.stateNode.implementation===se.implementation){i(re,ee.sibling),_e=g(ee,se.children||[]),_e.return=re,re=_e;break e}else{i(re,ee);break}else t(re,ee);ee=ee.sibling}_e=Po(se,re.mode,_e),_e.return=re,re=_e}return O(re);case E:return se=br(se),st(re,ee,se,_e)}if(X(se))return Re(re,ee,se,_e);if(F(se)){if(Le=F(se),typeof Le!="function")throw Error(o(150));return se=Le.call(se),je(re,ee,se,_e)}if(typeof se.then=="function")return st(re,ee,ol(se),_e);if(se.$$typeof===S)return st(re,ee,rl(re,se),_e);cl(re,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,ee!==null&&ee.tag===6?(i(re,ee.sibling),_e=g(ee,se),_e.return=re,re=_e):(i(re,ee),_e=Io(se,re.mode,_e),_e.return=re,re=_e),O(re)):i(re,ee)}return function(re,ee,se,_e){try{$s=0;var Le=st(re,ee,se,_e);return Zr=null,Le}catch(De){if(De===Qr||De===al)throw De;var Qe=gn(29,De,null,re.mode);return Qe.lanes=_e,Qe.return=re,Qe}finally{}}}var wr=wf(!0),xf=wf(!1),ji=!1;function Zo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jo(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 Ni(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Hi(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=el(e),lf(e,null,i),t}return Ja(e,a,t,i),el(e)}function Ks(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,As(e,i)}}function ec(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 O={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};w===null?g=w=O:w=w.next=O,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 tc=!1;function Ys(){if(tc){var e=Xr;if(e!==null)throw e}}function Xs(e,t,i,a){tc=!1;var g=e.updateQueue;ji=!1;var w=g.firstBaseUpdate,O=g.lastBaseUpdate,P=g.shared.pending;if(P!==null){g.shared.pending=null;var Q=P,ae=Q.next;Q.next=null,O===null?w=ae:O.next=ae,O=Q;var de=e.alternate;de!==null&&(de=de.updateQueue,P=de.lastBaseUpdate,P!==O&&(P===null?de.firstBaseUpdate=ae:P.next=ae,de.lastBaseUpdate=Q))}if(w!==null){var ve=g.baseState;O=0,de=ae=Q=null,P=w;do{var oe=P.lane&-536870913,ue=oe!==P.lane;if(ue?(We&oe)===oe:(a&oe)===oe){oe!==0&&oe===Yr&&(tc=!0),de!==null&&(de=de.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Re=e,je=P;oe=t;var st=i;switch(je.tag){case 1:if(Re=je.payload,typeof Re=="function"){ve=Re.call(st,ve,oe);break e}ve=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=je.payload,oe=typeof Re=="function"?Re.call(st,ve,oe):Re,oe==null)break e;ve=u({},ve,oe);break e;case 2:ji=!0}}oe=P.callback,oe!==null&&(e.flags|=64,ue&&(e.flags|=8192),ue=g.callbacks,ue===null?g.callbacks=[oe]:ue.push(oe))}else ue={lane:oe,tag:P.tag,payload:P.payload,callback:P.callback,next:null},de===null?(ae=de=ue,Q=ve):de=de.next=ue,O|=oe;if(P=P.next,P===null){if(P=g.shared.pending,P===null)break;ue=P,P=ue.next,ue.next=null,g.lastBaseUpdate=ue,g.shared.pending=null}}while(!0);de===null&&(Q=ve),g.baseState=Q,g.firstBaseUpdate=ae,g.lastBaseUpdate=de,w===null&&(g.shared.lanes=0),Fi|=O,e.lanes=O,e.memoizedState=ve}}function Ef(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function kf(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Ef(i[e],t)}var Jr=H(null),ul=H(0);function Af(e,t){e=yi,N(ul,e),N(Jr,t),yi=e|t.baseLanes}function nc(){N(ul,yi),N(Jr,Jr.current)}function ic(){yi=ul.current,G(Jr),G(ul)}var _n=H(null),On=null;function zi(e){var t=e.alternate;N(Ct,Ct.current&1),N(_n,e),On===null&&(t===null||Jr.current!==null||t.memoizedState!==null)&&(On=e)}function rc(e){N(Ct,Ct.current),N(_n,e),On===null&&(On=e)}function Tf(e){e.tag===22?(N(Ct,Ct.current),N(_n,e),On===null&&(On=e)):Ii()}function Ii(){N(Ct,Ct.current),N(_n,_n.current)}function vn(e){G(_n),On===e&&(On=null),G(Ct)}var Ct=H(0);function hl(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||uu(i)||hu(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 hi=0,Pe=null,it=null,Dt=null,fl=!1,es=!1,xr=!1,dl=0,Qs=0,ts=null,Kv=0;function yt(){throw Error(o(321))}function sc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!mn(e[i],t[i]))return!1;return!0}function ac(e,t,i,a,g,w){return hi=w,Pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?hd:bc,xr=!1,w=i(a,g),xr=!1,es&&(w=Df(t,i,a,g)),Rf(e),w}function Rf(e){V.H=ea;var t=it!==null&&it.next!==null;if(hi=0,Dt=it=Pe=null,fl=!1,Qs=0,ts=null,t)throw Error(o(300));e===null||Mt||(e=e.dependencies,e!==null&&il(e)&&(Mt=!0))}function Df(e,t,i,a){Pe=e;var g=0;do{if(es&&(ts=null),Qs=0,es=!1,25<=g)throw Error(o(301));if(g+=1,Dt=it=null,e.updateQueue!=null){var w=e.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}V.H=fd,w=t(i,a)}while(es);return w}function Yv(){var e=V.H,t=e.useState()[0];return t=typeof t.then=="function"?Zs(t):t,e=e.useState()[0],(it!==null?it.memoizedState:null)!==e&&(Pe.flags|=1024),t}function lc(){var e=dl!==0;return dl=0,e}function oc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function cc(e){if(fl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}fl=!1}hi=0,Dt=it=Pe=null,es=!1,Qs=dl=0,ts=null}function Qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?Pe.memoizedState=Dt=e:Dt=Dt.next=e,Dt}function wt(){if(it===null){var e=Pe.alternate;e=e!==null?e.memoizedState:null}else e=it.next;var t=Dt===null?Pe.memoizedState:Dt.next;if(t!==null)Dt=t,it=e;else{if(e===null)throw Pe.alternate===null?Error(o(467)):Error(o(310));it=e,e={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Dt===null?Pe.memoizedState=Dt=e:Dt=Dt.next=e}return Dt}function pl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zs(e){var t=Qs;return Qs+=1,ts===null&&(ts=[]),e=Sf(ts,e,t),t=Pe,(Dt===null?t.memoizedState:Dt.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?hd:bc),e}function ml(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Zs(e);if(e.$$typeof===S)return It(e)}throw Error(o(438,String(e)))}function uc(e){var t=null,i=Pe.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var a=Pe.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=pl(),Pe.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]=B;return t.index++,i}function fi(e,t){return typeof t=="function"?t(e):t}function gl(e){var t=wt();return hc(t,it,e)}function hc(e,t,i){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=i;var g=e.baseQueue,w=a.pending;if(w!==null){if(g!==null){var O=g.next;g.next=w.next,w.next=O}t.baseQueue=g=w,a.pending=null}if(w=e.baseState,g===null)e.memoizedState=w;else{t=g.next;var P=O=null,Q=null,ae=t,de=!1;do{var ve=ae.lane&-536870913;if(ve!==ae.lane?(We&ve)===ve:(hi&ve)===ve){var oe=ae.revertLane;if(oe===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),ve===Yr&&(de=!0);else if((hi&oe)===oe){ae=ae.next,oe===Yr&&(de=!0);continue}else ve={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Q===null?(P=Q=ve,O=w):Q=Q.next=ve,Pe.lanes|=oe,Fi|=oe;ve=ae.action,xr&&i(w,ve),w=ae.hasEagerState?ae.eagerState:i(w,ve)}else oe={lane:ve,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Q===null?(P=Q=oe,O=w):Q=Q.next=oe,Pe.lanes|=ve,Fi|=ve;ae=ae.next}while(ae!==null&&ae!==t);if(Q===null?O=w:Q.next=P,!mn(w,e.memoizedState)&&(Mt=!0,de&&(i=Xr,i!==null)))throw i;e.memoizedState=w,e.baseState=O,e.baseQueue=Q,a.lastRenderedState=w}return g===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function fc(e){var t=wt(),i=t.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var a=i.dispatch,g=i.pending,w=t.memoizedState;if(g!==null){i.pending=null;var O=g=g.next;do w=e(w,O.action),O=O.next;while(O!==g);mn(w,t.memoizedState)||(Mt=!0),t.memoizedState=w,t.baseQueue===null&&(t.baseState=w),i.lastRenderedState=w}return[w,a]}function Mf(e,t,i){var a=Pe,g=wt(),w=Ye;if(w){if(i===void 0)throw Error(o(407));i=i()}else i=t();var O=!mn((it||g).memoizedState,i);if(O&&(g.memoizedState=i,Mt=!0),g=g.queue,mc(Bf.bind(null,a,g,e),[e]),g.getSnapshot!==t||O||Dt!==null&&Dt.memoizedState.tag&1){if(a.flags|=2048,ns(9,{destroy:void 0},Of.bind(null,a,g,i,t),null),lt===null)throw Error(o(349));w||(hi&127)!==0||Lf(a,t,i)}return i}function Lf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Pe.updateQueue,t===null?(t=pl(),Pe.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Of(e,t,i,a){t.value=i,t.getSnapshot=a,jf(t)&&Nf(e)}function Bf(e,t,i){return i(function(){jf(t)&&Nf(e)})}function jf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!mn(e,i)}catch{return!0}}function Nf(e){var t=mr(e,2);t!==null&&un(t,e,2)}function dc(e){var t=Qt();if(typeof e=="function"){var i=e;if(e=i(),xr){xt(!0);try{i()}finally{xt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:e},t}function Hf(e,t,i,a){return e.baseState=i,hc(e,it,typeof a=="function"?a:fi)}function Xv(e,t,i,a,g){if(yl(e))throw Error(o(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(O){w.listeners.push(O)}};V.T!==null?i(!0):w.isTransition=!1,a(w),i=t.pending,i===null?(w.next=t.pending=w,zf(t,w)):(w.next=i.next,t.pending=i.next=w)}}function zf(e,t){var i=t.action,a=t.payload,g=e.state;if(t.isTransition){var w=V.T,O={};V.T=O;try{var P=i(g,a),Q=V.S;Q!==null&&Q(O,P),If(e,t,P)}catch(ae){pc(e,t,ae)}finally{w!==null&&O.types!==null&&(w.types=O.types),V.T=w}}else try{w=i(g,a),If(e,t,w)}catch(ae){pc(e,t,ae)}}function If(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(a){Pf(e,t,a)},function(a){return pc(e,t,a)}):Pf(e,t,i)}function Pf(e,t,i){t.status="fulfilled",t.value=i,Uf(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,zf(e,i)))}function pc(e,t,i){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=i,Uf(t),t=t.next;while(t!==a)}e.action=null}function Uf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ff(e,t){return t}function qf(e,t){if(Ye){var i=lt.formState;if(i!==null){e:{var a=Pe;if(Ye){if(mt){t:{for(var g=mt,w=Ln;g.nodeType!==8;){if(!w){g=null;break t}if(g=Bn(g.nextSibling),g===null){g=null;break t}}w=g.data,g=w==="F!"||w==="F"?g:null}if(g){mt=Bn(g.nextSibling),a=g.data==="F!";break e}}Oi(a)}a=!1}a&&(t=i[0])}}return i=Qt(),i.memoizedState=i.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ff,lastRenderedState:t},i.queue=a,i=od.bind(null,Pe,a),a.dispatch=i,a=dc(!1),w=Sc.bind(null,Pe,!1,a.queue),a=Qt(),g={state:t,dispatch:null,action:e,pending:null},a.queue=g,i=Xv.bind(null,Pe,g,w,i),g.dispatch=i,a.memoizedState=e,[t,i,!1]}function Gf(e){var t=wt();return Vf(t,it,e)}function Vf(e,t,i){if(t=hc(e,t,Ff)[0],e=gl(fi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Zs(t)}catch(O){throw O===Qr?al:O}else a=t;t=wt();var g=t.queue,w=g.dispatch;return i!==t.memoizedState&&(Pe.flags|=2048,ns(9,{destroy:void 0},Qv.bind(null,g,i),null)),[a,w,e]}function Qv(e,t){e.action=t}function $f(e){var t=wt(),i=it;if(i!==null)return Vf(t,i,e);wt(),t=t.memoizedState,i=wt();var a=i.queue.dispatch;return i.memoizedState=e,[t,a,!1]}function ns(e,t,i,a){return e={tag:e,create:i,deps:a,inst:t,next:null},t=Pe.updateQueue,t===null&&(t=pl(),Pe.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 Wf(){return wt().memoizedState}function _l(e,t,i,a){var g=Qt();Pe.flags|=e,g.memoizedState=ns(1|t,{destroy:void 0},i,a===void 0?null:a)}function vl(e,t,i,a){var g=wt();a=a===void 0?null:a;var w=g.memoizedState.inst;it!==null&&a!==null&&sc(a,it.memoizedState.deps)?g.memoizedState=ns(t,w,i,a):(Pe.flags|=e,g.memoizedState=ns(1|t,w,i,a))}function Kf(e,t){_l(8390656,8,e,t)}function mc(e,t){vl(2048,8,e,t)}function Zv(e){Pe.flags|=4;var t=Pe.updateQueue;if(t===null)t=pl(),Pe.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Yf(e){var t=wt().memoizedState;return Zv({ref:t,nextImpl:e}),function(){if((et&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Xf(e,t){return vl(4,2,e,t)}function Qf(e,t){return vl(4,4,e,t)}function Zf(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 Jf(e,t,i){i=i!=null?i.concat([e]):null,vl(4,4,Zf.bind(null,t,e),i)}function gc(){}function ed(e,t){var i=wt();t=t===void 0?null:t;var a=i.memoizedState;return t!==null&&sc(t,a[1])?a[0]:(i.memoizedState=[e,t],e)}function td(e,t){var i=wt();t=t===void 0?null:t;var a=i.memoizedState;if(t!==null&&sc(t,a[1]))return a[0];if(a=e(),xr){xt(!0);try{e()}finally{xt(!1)}}return i.memoizedState=[a,t],a}function _c(e,t,i){return i===void 0||(hi&1073741824)!==0&&(We&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=np(),Pe.lanes|=e,Fi|=e,i)}function nd(e,t,i,a){return mn(i,t)?i:Jr.current!==null?(e=_c(e,i,a),mn(e,t)||(Mt=!0),e):(hi&42)===0||(hi&1073741824)!==0&&(We&261930)===0?(Mt=!0,e.memoizedState=i):(e=np(),Pe.lanes|=e,Fi|=e,t)}function id(e,t,i,a,g){var w=Y.p;Y.p=w!==0&&8>w?w:8;var O=V.T,P={};V.T=P,Sc(e,!1,t,i);try{var Q=g(),ae=V.S;if(ae!==null&&ae(P,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var de=Wv(Q,a);Js(e,t,de,bn(e))}else Js(e,t,a,bn(e))}catch(ve){Js(e,t,{then:function(){},status:"rejected",reason:ve},bn())}finally{Y.p=w,O!==null&&P.types!==null&&(O.types=P.types),V.T=O}}function Jv(){}function vc(e,t,i,a){if(e.tag!==5)throw Error(o(476));var g=rd(e).queue;id(e,g,t,J,i===null?Jv:function(){return sd(e),i(a)})}function rd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:J},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function sd(e){var t=rd(e);t.next===null&&(t=e.alternate.memoizedState),Js(e,t.next.queue,{},bn())}function yc(){return It(ga)}function ad(){return wt().memoizedState}function ld(){return wt().memoizedState}function e0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=bn();e=Ni(i);var a=Hi(t,e,i);a!==null&&(un(a,t,i),Ks(a,t,i)),t={cache:Ko()},e.payload=t;return}t=t.return}}function t0(e,t,i){var a=bn();i={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},yl(e)?cd(t,i):(i=Ho(e,t,i,a),i!==null&&(un(i,e,a),ud(i,t,a)))}function od(e,t,i){var a=bn();Js(e,t,i,a)}function Js(e,t,i,a){var g={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(yl(e))cd(t,g);else{var w=e.alternate;if(e.lanes===0&&(w===null||w.lanes===0)&&(w=t.lastRenderedReducer,w!==null))try{var O=t.lastRenderedState,P=w(O,i);if(g.hasEagerState=!0,g.eagerState=P,mn(P,O))return Ja(e,t,g,0),lt===null&&Za(),!1}catch{}finally{}if(i=Ho(e,t,g,a),i!==null)return un(i,e,a),ud(i,t,a),!0}return!1}function Sc(e,t,i,a){if(a={lane:2,revertLane:Zc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},yl(e)){if(t)throw Error(o(479))}else t=Ho(e,i,a,2),t!==null&&un(t,e,2)}function yl(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function cd(e,t){es=fl=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function ud(e,t,i){if((i&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,i|=a,t.lanes=i,As(e,i)}}var ea={readContext:It,use:ml,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt};ea.useEffectEvent=yt;var hd={readContext:It,use:ml,useCallback:function(e,t){return Qt().memoizedState=[e,t===void 0?null:t],e},useContext:It,useEffect:Kf,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,_l(4194308,4,Zf.bind(null,t,e),i)},useLayoutEffect:function(e,t){return _l(4194308,4,e,t)},useInsertionEffect:function(e,t){_l(4,2,e,t)},useMemo:function(e,t){var i=Qt();t=t===void 0?null:t;var a=e();if(xr){xt(!0);try{e()}finally{xt(!1)}}return i.memoizedState=[a,t],a},useReducer:function(e,t,i){var a=Qt();if(i!==void 0){var g=i(t);if(xr){xt(!0);try{i(t)}finally{xt(!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=t0.bind(null,Pe,e),[a.memoizedState,e]},useRef:function(e){var t=Qt();return e={current:e},t.memoizedState=e},useState:function(e){e=dc(e);var t=e.queue,i=od.bind(null,Pe,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:gc,useDeferredValue:function(e,t){var i=Qt();return _c(i,e,t)},useTransition:function(){var e=dc(!1);return e=id.bind(null,Pe,e.queue,!0,!1),Qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var a=Pe,g=Qt();if(Ye){if(i===void 0)throw Error(o(407));i=i()}else{if(i=t(),lt===null)throw Error(o(349));(We&127)!==0||Lf(a,t,i)}g.memoizedState=i;var w={value:i,getSnapshot:t};return g.queue=w,Kf(Bf.bind(null,a,w,e),[e]),a.flags|=2048,ns(9,{destroy:void 0},Of.bind(null,a,w,i,t),null),i},useId:function(){var e=Qt(),t=lt.identifierPrefix;if(Ye){var i=Xn,a=Yn;i=(a&~(1<<32-we(a)-1)).toString(32)+i,t="_"+t+"R_"+i,i=dl++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=Kv++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:yc,useFormState:qf,useActionState:qf,useOptimistic:function(e){var t=Qt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Sc.bind(null,Pe,!0,i),i.dispatch=t,[e,t]},useMemoCache:uc,useCacheRefresh:function(){return Qt().memoizedState=e0.bind(null,Pe)},useEffectEvent:function(e){var t=Qt(),i={impl:e};return t.memoizedState=i,function(){if((et&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}},bc={readContext:It,use:ml,useCallback:ed,useContext:It,useEffect:mc,useImperativeHandle:Jf,useInsertionEffect:Xf,useLayoutEffect:Qf,useMemo:td,useReducer:gl,useRef:Wf,useState:function(){return gl(fi)},useDebugValue:gc,useDeferredValue:function(e,t){var i=wt();return nd(i,it.memoizedState,e,t)},useTransition:function(){var e=gl(fi)[0],t=wt().memoizedState;return[typeof e=="boolean"?e:Zs(e),t]},useSyncExternalStore:Mf,useId:ad,useHostTransitionStatus:yc,useFormState:Gf,useActionState:Gf,useOptimistic:function(e,t){var i=wt();return Hf(i,it,e,t)},useMemoCache:uc,useCacheRefresh:ld};bc.useEffectEvent=Yf;var fd={readContext:It,use:ml,useCallback:ed,useContext:It,useEffect:mc,useImperativeHandle:Jf,useInsertionEffect:Xf,useLayoutEffect:Qf,useMemo:td,useReducer:fc,useRef:Wf,useState:function(){return fc(fi)},useDebugValue:gc,useDeferredValue:function(e,t){var i=wt();return it===null?_c(i,e,t):nd(i,it.memoizedState,e,t)},useTransition:function(){var e=fc(fi)[0],t=wt().memoizedState;return[typeof e=="boolean"?e:Zs(e),t]},useSyncExternalStore:Mf,useId:ad,useHostTransitionStatus:yc,useFormState:$f,useActionState:$f,useOptimistic:function(e,t){var i=wt();return it!==null?Hf(i,it,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:uc,useCacheRefresh:ld};fd.useEffectEvent=Yf;function Cc(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 wc={enqueueSetState:function(e,t,i){e=e._reactInternals;var a=bn(),g=Ni(a);g.payload=t,i!=null&&(g.callback=i),t=Hi(e,g,a),t!==null&&(un(t,e,a),Ks(t,e,a))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var a=bn(),g=Ni(a);g.tag=1,g.payload=t,i!=null&&(g.callback=i),t=Hi(e,g,a),t!==null&&(un(t,e,a),Ks(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=bn(),a=Ni(i);a.tag=2,t!=null&&(a.callback=t),t=Hi(e,a,i),t!==null&&(un(t,e,i),Ks(t,e,i))}};function dd(e,t,i,a,g,w,O){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,w,O):t.prototype&&t.prototype.isPureReactComponent?!Ps(i,a)||!Ps(g,w):!0}function pd(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&&wc.enqueueReplaceState(t,t.state,null)}function Er(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 md(e){Qa(e)}function gd(e){console.error(e)}function _d(e){Qa(e)}function Sl(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function vd(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 xc(e,t,i){return i=Ni(i),i.tag=3,i.payload={element:null},i.callback=function(){Sl(e,t)},i}function yd(e){return e=Ni(e),e.tag=3,e}function Sd(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(){vd(t,i,a)}}var O=i.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(e.callback=function(){vd(t,i,a),typeof g!="function"&&(qi===null?qi=new Set([this]):qi.add(this));var P=a.stack;this.componentDidCatch(a.value,{componentStack:P!==null?P:""})})}function n0(e,t,i,a,g){if(i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=i.alternate,t!==null&&Kr(t,i,g,!0),i=_n.current,i!==null){switch(i.tag){case 31:case 13:return On===null?Ll():i.alternate===null&&St===0&&(St=3),i.flags&=-257,i.flags|=65536,i.lanes=g,a===ll?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([a]):t.add(a),Yc(e,a,g)),!1;case 22:return i.flags|=65536,a===ll?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)),Yc(e,a,g)),!1}throw Error(o(435,i.tag))}return Yc(e,a,g),Ll(),!1}if(Ye)return t=_n.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=g,a!==qo&&(e=Error(o(422),{cause:a}),qs(Rn(e,i)))):(a!==qo&&(t=Error(o(423),{cause:a}),qs(Rn(t,i))),e=e.current.alternate,e.flags|=65536,g&=-g,e.lanes|=g,a=Rn(a,i),g=xc(e.stateNode,a,g),ec(e,g),St!==4&&(St=2)),!1;var w=Error(o(520),{cause:a});if(w=Rn(w,i),oa===null?oa=[w]:oa.push(w),St!==4&&(St=2),t===null)return!0;a=Rn(a,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=g&-g,i.lanes|=e,e=xc(i.stateNode,a,e),ec(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"&&(qi===null||!qi.has(w))))return i.flags|=65536,g&=-g,i.lanes|=g,g=yd(g),Sd(g,e,i,a),ec(i,g),!1}i=i.return}while(i!==null);return!1}var Ec=Error(o(461)),Mt=!1;function Pt(e,t,i,a){t.child=e===null?xf(t,null,i,a):wr(t,e.child,i,a)}function bd(e,t,i,a,g){i=i.render;var w=t.ref;if("ref"in a){var O={};for(var P in a)P!=="ref"&&(O[P]=a[P])}else O=a;return yr(t),a=ac(e,t,i,O,w,g),P=lc(),e!==null&&!Mt?(oc(e,t,g),di(e,t,g)):(Ye&&P&&Uo(t),t.flags|=1,Pt(e,t,a,g),t.child)}function Cd(e,t,i,a,g){if(e===null){var w=i.type;return typeof w=="function"&&!zo(w)&&w.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=w,wd(e,t,w,a,g)):(e=tl(i.type,null,a,t,t.mode,g),e.ref=t.ref,e.return=t,t.child=e)}if(w=e.child,!Oc(e,g)){var O=w.memoizedProps;if(i=i.compare,i=i!==null?i:Ps,i(O,a)&&e.ref===t.ref)return di(e,t,g)}return t.flags|=1,e=li(w,a),e.ref=t.ref,e.return=t,t.child=e}function wd(e,t,i,a,g){if(e!==null){var w=e.memoizedProps;if(Ps(w,a)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=a=w,Oc(e,g))(e.flags&131072)!==0&&(Mt=!0);else return t.lanes=e.lanes,di(e,t,g)}return kc(e,t,i,a,g)}function xd(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 Ed(e,t,w,i,a)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&sl(t,w!==null?w.cachePool:null),w!==null?Af(t,w):nc(),Tf(t);else return a=t.lanes=536870912,Ed(e,t,w!==null?w.baseLanes|i:i,i,a)}else w!==null?(sl(t,w.cachePool),Af(t,w),Ii(),t.memoizedState=null):(e!==null&&sl(t,null),nc(),Ii());return Pt(e,t,g,i),t.child}function ta(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ed(e,t,i,a,g){var w=Xo();return w=w===null?null:{parent:Rt._currentValue,pool:w},t.memoizedState={baseLanes:i,cachePool:w},e!==null&&sl(t,null),nc(),Tf(t),e!==null&&Kr(e,t,a,!0),t.childLanes=g,null}function bl(e,t){return t=wl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function kd(e,t,i){return wr(t,e.child,null,i),e=bl(t,t.pendingProps),e.flags|=2,vn(t),t.memoizedState=null,e}function i0(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=bl(t,a),t.lanes=536870912,ta(null,e);if(rc(t),(e=mt)?(e=zp(e,Ln),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mi!==null?{id:Yn,overflow:Xn}:null,retryLane:536870912,hydrationErrors:null},i=cf(e),i.return=t,t.child=i,zt=t,mt=null)):e=null,e===null)throw Oi(t);return t.lanes=536870912,null}return bl(t,a)}var w=e.memoizedState;if(w!==null){var O=w.dehydrated;if(rc(t),g)if(t.flags&256)t.flags&=-257,t=kd(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Mt||Kr(e,t,i,!1),g=(i&e.childLanes)!==0,Mt||g){if(a=lt,a!==null&&(O=Ia(a,i),O!==0&&O!==w.retryLane))throw w.retryLane=O,mr(e,O),un(a,e,O),Ec;Ll(),t=kd(e,t,i)}else e=w.treeContext,mt=Bn(O.nextSibling),zt=t,Ye=!0,Li=null,Ln=!1,e!==null&&ff(t,e),t=bl(t,a),t.flags|=4096;return t}return e=li(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Cl(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(o(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function kc(e,t,i,a,g){return yr(t),i=ac(e,t,i,a,void 0,g),a=lc(),e!==null&&!Mt?(oc(e,t,g),di(e,t,g)):(Ye&&a&&Uo(t),t.flags|=1,Pt(e,t,i,g),t.child)}function Ad(e,t,i,a,g,w){return yr(t),t.updateQueue=null,i=Df(t,a,i,g),Rf(e),a=lc(),e!==null&&!Mt?(oc(e,t,w),di(e,t,w)):(Ye&&a&&Uo(t),t.flags|=1,Pt(e,t,i,w),t.child)}function Td(e,t,i,a,g){if(yr(t),t.stateNode===null){var w=Gr,O=i.contextType;typeof O=="object"&&O!==null&&(w=It(O)),w=new i(a,w),t.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=wc,t.stateNode=w,w._reactInternals=t,w=t.stateNode,w.props=a,w.state=t.memoizedState,w.refs={},Zo(t),O=i.contextType,w.context=typeof O=="object"&&O!==null?It(O):Gr,w.state=t.memoizedState,O=i.getDerivedStateFromProps,typeof O=="function"&&(Cc(t,i,O,a),w.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(O=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),O!==w.state&&wc.enqueueReplaceState(w,w.state,null),Xs(t,a,w,g),Ys(),w.state=t.memoizedState),typeof w.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){w=t.stateNode;var P=t.memoizedProps,Q=Er(i,P);w.props=Q;var ae=w.context,de=i.contextType;O=Gr,typeof de=="object"&&de!==null&&(O=It(de));var ve=i.getDerivedStateFromProps;de=typeof ve=="function"||typeof w.getSnapshotBeforeUpdate=="function",P=t.pendingProps!==P,de||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(P||ae!==O)&&pd(t,w,a,O),ji=!1;var oe=t.memoizedState;w.state=oe,Xs(t,a,w,g),Ys(),ae=t.memoizedState,P||oe!==ae||ji?(typeof ve=="function"&&(Cc(t,i,ve,a),ae=t.memoizedState),(Q=ji||dd(t,i,Q,a,oe,ae,O))?(de||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=ae),w.props=a,w.state=ae,w.context=O,a=Q):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{w=t.stateNode,Jo(e,t),O=t.memoizedProps,de=Er(i,O),w.props=de,ve=t.pendingProps,oe=w.context,ae=i.contextType,Q=Gr,typeof ae=="object"&&ae!==null&&(Q=It(ae)),P=i.getDerivedStateFromProps,(ae=typeof P=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(O!==ve||oe!==Q)&&pd(t,w,a,Q),ji=!1,oe=t.memoizedState,w.state=oe,Xs(t,a,w,g),Ys();var ue=t.memoizedState;O!==ve||oe!==ue||ji||e!==null&&e.dependencies!==null&&il(e.dependencies)?(typeof P=="function"&&(Cc(t,i,P,a),ue=t.memoizedState),(de=ji||dd(t,i,de,a,oe,ue,Q)||e!==null&&e.dependencies!==null&&il(e.dependencies))?(ae||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(a,ue,Q),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(a,ue,Q)),typeof w.componentDidUpdate=="function"&&(t.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof w.componentDidUpdate!="function"||O===e.memoizedProps&&oe===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&oe===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=ue),w.props=a,w.state=ue,w.context=Q,a=de):(typeof w.componentDidUpdate!="function"||O===e.memoizedProps&&oe===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&oe===e.memoizedState||(t.flags|=1024),a=!1)}return w=a,Cl(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=wr(t,e.child,null,g),t.child=wr(t,null,i,g)):Pt(e,t,i,g),t.memoizedState=w.state,e=t.child):e=di(e,t,g),e}function Rd(e,t,i,a){return _r(),t.flags|=256,Pt(e,t,i,a),t.child}var Ac={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Tc(e){return{baseLanes:e,cachePool:vf()}}function Rc(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Sn),e}function Dd(e,t,i){var a=t.pendingProps,g=!1,w=(t.flags&128)!==0,O;if((O=w)||(O=e!==null&&e.memoizedState===null?!1:(Ct.current&2)!==0),O&&(g=!0,t.flags&=-129),O=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ye){if(g?zi(t):Ii(),(e=mt)?(e=zp(e,Ln),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Mi!==null?{id:Yn,overflow:Xn}:null,retryLane:536870912,hydrationErrors:null},i=cf(e),i.return=t,t.child=i,zt=t,mt=null)):e=null,e===null)throw Oi(t);return hu(e)?t.lanes=32:t.lanes=536870912,null}var P=a.children;return a=a.fallback,g?(Ii(),g=t.mode,P=wl({mode:"hidden",children:P},g),a=gr(a,g,i,null),P.return=t,a.return=t,P.sibling=a,t.child=P,a=t.child,a.memoizedState=Tc(i),a.childLanes=Rc(e,O,i),t.memoizedState=Ac,ta(null,a)):(zi(t),Dc(t,P))}var Q=e.memoizedState;if(Q!==null&&(P=Q.dehydrated,P!==null)){if(w)t.flags&256?(zi(t),t.flags&=-257,t=Mc(e,t,i)):t.memoizedState!==null?(Ii(),t.child=e.child,t.flags|=128,t=null):(Ii(),P=a.fallback,g=t.mode,a=wl({mode:"visible",children:a.children},g),P=gr(P,g,i,null),P.flags|=2,a.return=t,P.return=t,a.sibling=P,t.child=a,wr(t,e.child,null,i),a=t.child,a.memoizedState=Tc(i),a.childLanes=Rc(e,O,i),t.memoizedState=Ac,t=ta(null,a));else if(zi(t),hu(P)){if(O=P.nextSibling&&P.nextSibling.dataset,O)var ae=O.dgst;O=ae,a=Error(o(419)),a.stack="",a.digest=O,qs({value:a,source:null,stack:null}),t=Mc(e,t,i)}else if(Mt||Kr(e,t,i,!1),O=(i&e.childLanes)!==0,Mt||O){if(O=lt,O!==null&&(a=Ia(O,i),a!==0&&a!==Q.retryLane))throw Q.retryLane=a,mr(e,a),un(O,e,a),Ec;uu(P)||Ll(),t=Mc(e,t,i)}else uu(P)?(t.flags|=192,t.child=e.child,t=null):(e=Q.treeContext,mt=Bn(P.nextSibling),zt=t,Ye=!0,Li=null,Ln=!1,e!==null&&ff(t,e),t=Dc(t,a.children),t.flags|=4096);return t}return g?(Ii(),P=a.fallback,g=t.mode,Q=e.child,ae=Q.sibling,a=li(Q,{mode:"hidden",children:a.children}),a.subtreeFlags=Q.subtreeFlags&65011712,ae!==null?P=li(ae,P):(P=gr(P,g,i,null),P.flags|=2),P.return=t,a.return=t,a.sibling=P,t.child=a,ta(null,a),a=t.child,P=e.child.memoizedState,P===null?P=Tc(i):(g=P.cachePool,g!==null?(Q=Rt._currentValue,g=g.parent!==Q?{parent:Q,pool:Q}:g):g=vf(),P={baseLanes:P.baseLanes|i,cachePool:g}),a.memoizedState=P,a.childLanes=Rc(e,O,i),t.memoizedState=Ac,ta(e.child,a)):(zi(t),i=e.child,e=i.sibling,i=li(i,{mode:"visible",children:a.children}),i.return=t,i.sibling=null,e!==null&&(O=t.deletions,O===null?(t.deletions=[e],t.flags|=16):O.push(e)),t.child=i,t.memoizedState=null,i)}function Dc(e,t){return t=wl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function wl(e,t){return e=gn(22,e,null,t),e.lanes=0,e}function Mc(e,t,i){return wr(t,e.child,null,i),e=Dc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Md(e,t,i){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),$o(e.return,t,i)}function Lc(e,t,i,a,g,w){var O=e.memoizedState;O===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:i,tailMode:g,treeForkCount:w}:(O.isBackwards=t,O.rendering=null,O.renderingStartTime=0,O.last=a,O.tail=i,O.tailMode=g,O.treeForkCount=w)}function Ld(e,t,i){var a=t.pendingProps,g=a.revealOrder,w=a.tail;a=a.children;var O=Ct.current,P=(O&2)!==0;if(P?(O=O&1|2,t.flags|=128):O&=1,N(Ct,O),Pt(e,t,a,i),a=Ye?Fs:0,!P&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Md(e,i,t);else if(e.tag===19)Md(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&&hl(e)===null&&(g=i),i=i.sibling;i=g,i===null?(g=t.child,t.child=null):(g=i.sibling,i.sibling=null),Lc(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&&hl(e)===null){t.child=g;break}e=g.sibling,g.sibling=i,i=g,g=e}Lc(t,!0,i,null,w,a);break;case"together":Lc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function di(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Fi|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Kr(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,i=li(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=li(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&il(e)))}function r0(e,t,i){switch(t.tag){case 3:q(t,t.stateNode.containerInfo),Bi(t,Rt,e.memoizedState.cache),_r();break;case 27:case 5:le(t);break;case 4:q(t,t.stateNode.containerInfo);break;case 10:Bi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,rc(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(zi(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Dd(e,t,i):(zi(t),e=di(e,t,i),e!==null?e.sibling:null);zi(t);break;case 19:var g=(e.flags&128)!==0;if(a=(i&t.childLanes)!==0,a||(Kr(e,t,i,!1),a=(i&t.childLanes)!==0),g){if(a)return Ld(e,t,i);t.flags|=128}if(g=t.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),N(Ct,Ct.current),a)break;return null;case 22:return t.lanes=0,xd(e,t,i,t.pendingProps);case 24:Bi(t,Rt,e.memoizedState.cache)}return di(e,t,i)}function Od(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Mt=!0;else{if(!Oc(e,i)&&(t.flags&128)===0)return Mt=!1,r0(e,t,i);Mt=(e.flags&131072)!==0}else Mt=!1,Ye&&(t.flags&1048576)!==0&&hf(t,Fs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=br(t.elementType),t.type=e,typeof e=="function")zo(e)?(a=Er(e,a),t.tag=1,t=Td(null,t,e,a,i)):(t.tag=0,t=kc(null,t,e,a,i));else{if(e!=null){var g=e.$$typeof;if(g===A){t.tag=11,t=bd(null,t,e,a,i);break e}else if(g===D){t.tag=14,t=Cd(null,t,e,a,i);break e}}throw t=W(e)||e,Error(o(306,t,""))}}return t;case 0:return kc(e,t,t.type,t.pendingProps,i);case 1:return a=t.type,g=Er(a,t.pendingProps),Td(e,t,a,g,i);case 3:e:{if(q(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var w=t.memoizedState;g=w.element,Jo(e,t),Xs(t,a,null,i);var O=t.memoizedState;if(a=O.cache,Bi(t,Rt,a),a!==w.cache&&Wo(t,[Rt],i,!0),Ys(),a=O.element,w.isDehydrated)if(w={element:a,isDehydrated:!1,cache:O.cache},t.updateQueue.baseState=w,t.memoizedState=w,t.flags&256){t=Rd(e,t,a,i);break e}else if(a!==g){g=Rn(Error(o(424)),t),qs(g),t=Rd(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(mt=Bn(e.firstChild),zt=t,Ye=!0,Li=null,Ln=!0,i=xf(t,null,a,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(_r(),a===g){t=di(e,t,i);break e}Pt(e,t,a,i)}t=t.child}return t;case 26:return Cl(e,t),e===null?(i=Gp(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ye||(i=t.type,e=t.pendingProps,a=Il(ge.current).createElement(i),a[ut]=t,a[At]=e,Ut(a,i,e),Tt(a),t.stateNode=a):t.memoizedState=Gp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return le(t),e===null&&Ye&&(a=t.stateNode=Up(t.type,t.pendingProps,ge.current),zt=t,Ln=!0,g=mt,Wi(t.type)?(fu=g,mt=Bn(a.firstChild)):mt=g),Pt(e,t,t.pendingProps.children,i),Cl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ye&&((g=a=mt)&&(a=B0(a,t.type,t.pendingProps,Ln),a!==null?(t.stateNode=a,zt=t,mt=Bn(a.firstChild),Ln=!1,g=!0):g=!1),g||Oi(t)),le(t),g=t.type,w=t.pendingProps,O=e!==null?e.memoizedProps:null,a=w.children,lu(g,w)?a=null:O!==null&&lu(g,O)&&(t.flags|=32),t.memoizedState!==null&&(g=ac(e,t,Yv,null,null,i),ga._currentValue=g),Cl(e,t),Pt(e,t,a,i),t.child;case 6:return e===null&&Ye&&((e=i=mt)&&(i=j0(i,t.pendingProps,Ln),i!==null?(t.stateNode=i,zt=t,mt=null,e=!0):e=!1),e||Oi(t)),null;case 13:return Dd(e,t,i);case 4:return q(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=wr(t,null,a,i):Pt(e,t,a,i),t.child;case 11:return bd(e,t,t.type,t.pendingProps,i);case 7:return Pt(e,t,t.pendingProps,i),t.child;case 8:return Pt(e,t,t.pendingProps.children,i),t.child;case 12:return Pt(e,t,t.pendingProps.children,i),t.child;case 10:return a=t.pendingProps,Bi(t,t.type,a.value),Pt(e,t,a.children,i),t.child;case 9:return g=t.type._context,a=t.pendingProps.children,yr(t),g=It(g),a=a(g),t.flags|=1,Pt(e,t,a,i),t.child;case 14:return Cd(e,t,t.type,t.pendingProps,i);case 15:return wd(e,t,t.type,t.pendingProps,i);case 19:return Ld(e,t,i);case 31:return i0(e,t,i);case 22:return xd(e,t,i,t.pendingProps);case 24:return yr(t),a=It(Rt),e===null?(g=Xo(),g===null&&(g=lt,w=Ko(),g.pooledCache=w,w.refCount++,w!==null&&(g.pooledCacheLanes|=i),g=w),t.memoizedState={parent:a,cache:g},Zo(t),Bi(t,Rt,g)):((e.lanes&i)!==0&&(Jo(e,t),Xs(t,null,null,i),Ys()),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),Bi(t,Rt,a)):(a=w.cache,Bi(t,Rt,a),a!==g.cache&&Wo(t,[Rt],i,!0))),Pt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function pi(e){e.flags|=4}function Bc(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(ap())e.flags|=8192;else throw Cr=ll,Qo}else e.flags&=-16777217}function Bd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Yp(t))if(ap())e.flags|=8192;else throw Cr=ll,Qo}function xl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ha():536870912,e.lanes|=t,as|=t)}function na(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 gt(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 s0(e,t,i){var a=t.pendingProps;switch(Fo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(t),null;case 1:return gt(t),null;case 3:return i=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ui(Rt),te(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Wr(t)?pi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Go())),gt(t),null;case 26:var g=t.type,w=t.memoizedState;return e===null?(pi(t),w!==null?(gt(t),Bd(t,w)):(gt(t),Bc(t,g,null,a,i))):w?w!==e.memoizedState?(pi(t),gt(t),Bd(t,w)):(gt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&pi(t),gt(t),Bc(t,g,e,a,i)),null;case 27:if(xe(t),i=ge.current,g=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&pi(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return gt(t),null}e=ie.current,Wr(t)?df(t):(e=Up(g,a,i),t.stateNode=e,pi(t))}return gt(t),null;case 5:if(xe(t),g=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&pi(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return gt(t),null}if(w=ie.current,Wr(t))df(t);else{var O=Il(ge.current);switch(w){case 1:w=O.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:w=O.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":w=O.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":w=O.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":w=O.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof a.is=="string"?O.createElement("select",{is:a.is}):O.createElement("select"),a.multiple?w.multiple=!0:a.size&&(w.size=a.size);break;default:w=typeof a.is=="string"?O.createElement(g,{is:a.is}):O.createElement(g)}}w[ut]=t,w[At]=a;e:for(O=t.child;O!==null;){if(O.tag===5||O.tag===6)w.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===t)break e;for(;O.sibling===null;){if(O.return===null||O.return===t)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}t.stateNode=w;e:switch(Ut(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&&pi(t)}}return gt(t),Bc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&pi(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=ge.current,Wr(t)){if(e=t.stateNode,i=t.memoizedProps,a=null,g=zt,g!==null)switch(g.tag){case 27:case 5:a=g.memoizedProps}e[ut]=t,e=!!(e.nodeValue===i||a!==null&&a.suppressHydrationWarning===!0||Dp(e.nodeValue,i)),e||Oi(t,!0)}else e=Il(e).createTextNode(a),e[ut]=t,t.stateNode=e}return gt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(a=Wr(t),i!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[ut]=t}else _r(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),e=!1}else i=Go(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(vn(t),t):(vn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return gt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(g=Wr(t),a!==null&&a.dehydrated!==null){if(e===null){if(!g)throw Error(o(318));if(g=t.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(o(317));g[ut]=t}else _r(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),g=!1}else g=Go(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=g),g=!0;if(!g)return t.flags&256?(vn(t),t):(vn(t),null)}return vn(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),xl(t,t.updateQueue),gt(t),null);case 4:return te(),e===null&&nu(t.stateNode.containerInfo),gt(t),null;case 10:return ui(t.type),gt(t),null;case 19:if(G(Ct),a=t.memoizedState,a===null)return gt(t),null;if(g=(t.flags&128)!==0,w=a.rendering,w===null)if(g)na(a,!1);else{if(St!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(w=hl(e),w!==null){for(t.flags|=128,na(a,!1),e=w.updateQueue,t.updateQueue=e,xl(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)of(i,e),i=i.sibling;return N(Ct,Ct.current&1|2),Ye&&oi(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&dt()>Rl&&(t.flags|=128,g=!0,na(a,!1),t.lanes=4194304)}else{if(!g)if(e=hl(w),e!==null){if(t.flags|=128,g=!0,e=e.updateQueue,t.updateQueue=e,xl(t,e),na(a,!0),a.tail===null&&a.tailMode==="hidden"&&!w.alternate&&!Ye)return gt(t),null}else 2*dt()-a.renderingStartTime>Rl&&i!==536870912&&(t.flags|=128,g=!0,na(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=dt(),e.sibling=null,i=Ct.current,N(Ct,g?i&1|2:i&1),Ye&&oi(t,a.treeForkCount),e):(gt(t),null);case 22:case 23:return vn(t),ic(),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&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),i=t.updateQueue,i!==null&&xl(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&&G(Sr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ui(Rt),gt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function a0(e,t){switch(Fo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ui(Rt),te(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if(vn(t),t.alternate===null)throw Error(o(340));_r()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(vn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));_r()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(Ct),null;case 4:return te(),null;case 10:return ui(t.type),null;case 22:case 23:return vn(t),ic(),e!==null&&G(Sr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ui(Rt),null;case 25:return null;default:return null}}function jd(e,t){switch(Fo(t),t.tag){case 3:ui(Rt),te();break;case 26:case 27:case 5:xe(t);break;case 4:te();break;case 31:t.memoizedState!==null&&vn(t);break;case 13:vn(t);break;case 19:G(Ct);break;case 10:ui(t.type);break;case 22:case 23:vn(t),ic(),e!==null&&G(Sr);break;case 24:ui(Rt)}}function ia(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,O=i.inst;a=w(),O.destroy=a}i=i.next}while(i!==g)}}catch(P){nt(t,t.return,P)}}function Pi(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 O=a.inst,P=O.destroy;if(P!==void 0){O.destroy=void 0,g=t;var Q=i,ae=P;try{ae()}catch(de){nt(g,Q,de)}}}a=a.next}while(a!==w)}}catch(de){nt(t,t.return,de)}}function Nd(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{kf(t,i)}catch(a){nt(e,e.return,a)}}}function Hd(e,t,i){i.props=Er(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(a){nt(e,t,a)}}function ra(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){nt(e,t,g)}}function Qn(e,t){var i=e.ref,a=e.refCleanup;if(i!==null)if(typeof a=="function")try{a()}catch(g){nt(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){nt(e,t,g)}else i.current=null}function zd(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){nt(e,e.return,g)}}function jc(e,t,i){try{var a=e.stateNode;T0(a,e.type,i,t),a[At]=t}catch(g){nt(e,e.return,g)}}function Id(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Wi(e.type)||e.tag===4}function Nc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Id(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&&Wi(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 Hc(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=ce));else if(a!==4&&(a===27&&Wi(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Hc(e,t,i),e=e.sibling;e!==null;)Hc(e,t,i),e=e.sibling}function El(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&&Wi(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(El(e,t,i),e=e.sibling;e!==null;)El(e,t,i),e=e.sibling}function Pd(e){var t=e.stateNode,i=e.memoizedProps;try{for(var a=e.type,g=t.attributes;g.length;)t.removeAttributeNode(g[0]);Ut(t,a,i),t[ut]=e,t[At]=i}catch(w){nt(e,e.return,w)}}var mi=!1,Lt=!1,zc=!1,Ud=typeof WeakSet=="function"?WeakSet:Set,Ht=null;function l0(e,t){if(e=e.containerInfo,su=$l,e=Zh(e),Mo(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 O=0,P=-1,Q=-1,ae=0,de=0,ve=e,oe=null;t:for(;;){for(var ue;ve!==i||g!==0&&ve.nodeType!==3||(P=O+g),ve!==w||a!==0&&ve.nodeType!==3||(Q=O+a),ve.nodeType===3&&(O+=ve.nodeValue.length),(ue=ve.firstChild)!==null;)oe=ve,ve=ue;for(;;){if(ve===e)break t;if(oe===i&&++ae===g&&(P=O),oe===w&&++de===a&&(Q=O),(ue=ve.nextSibling)!==null)break;ve=oe,oe=ve.parentNode}ve=ue}i=P===-1||Q===-1?null:{start:P,end:Q}}else i=null}i=i||{start:0,end:0}}else i=null;for(au={focusedElem:e,selectionRange:i},$l=!1,Ht=t;Ht!==null;)if(t=Ht,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ht=e;else for(;Ht!==null;){switch(t=Ht,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 Re=Er(i.type,g);e=a.getSnapshotBeforeUpdate(Re,w),a.__reactInternalSnapshotBeforeUpdate=e}catch(je){nt(i,i.return,je)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)cu(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":cu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Ht=e;break}Ht=t.return}}function Fd(e,t,i){var a=i.flags;switch(i.tag){case 0:case 11:case 15:_i(e,i),a&4&&ia(5,i);break;case 1:if(_i(e,i),a&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(O){nt(i,i.return,O)}else{var g=Er(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(g,t,e.__reactInternalSnapshotBeforeUpdate)}catch(O){nt(i,i.return,O)}}a&64&&Nd(i),a&512&&ra(i,i.return);break;case 3:if(_i(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{kf(e,t)}catch(O){nt(i,i.return,O)}}break;case 27:t===null&&a&4&&Pd(i);case 26:case 5:_i(e,i),t===null&&a&4&&zd(i),a&512&&ra(i,i.return);break;case 12:_i(e,i);break;case 31:_i(e,i),a&4&&Vd(e,i);break;case 13:_i(e,i),a&4&&$d(e,i),a&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=g0.bind(null,i),N0(e,i))));break;case 22:if(a=i.memoizedState!==null||mi,!a){t=t!==null&&t.memoizedState!==null||Lt,g=mi;var w=Lt;mi=a,(Lt=t)&&!w?vi(e,i,(i.subtreeFlags&8772)!==0):_i(e,i),mi=g,Lt=w}break;case 30:break;default:_i(e,i)}}function qd(e){var t=e.alternate;t!==null&&(e.alternate=null,qd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Or(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 _t=null,an=!1;function gi(e,t,i){for(i=i.child;i!==null;)Gd(e,t,i),i=i.sibling}function Gd(e,t,i){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(Je,i)}catch{}switch(i.tag){case 26:Lt||Qn(i,t),gi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Lt||Qn(i,t);var a=_t,g=an;Wi(i.type)&&(_t=i.stateNode,an=!1),gi(e,t,i),da(i.stateNode),_t=a,an=g;break;case 5:Lt||Qn(i,t);case 6:if(a=_t,g=an,_t=null,gi(e,t,i),_t=a,an=g,_t!==null)if(an)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(i.stateNode)}catch(w){nt(i,t,w)}else try{_t.removeChild(i.stateNode)}catch(w){nt(i,t,w)}break;case 18:_t!==null&&(an?(e=_t,Np(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),ps(e)):Np(_t,i.stateNode));break;case 4:a=_t,g=an,_t=i.stateNode.containerInfo,an=!0,gi(e,t,i),_t=a,an=g;break;case 0:case 11:case 14:case 15:Pi(2,i,t),Lt||Pi(4,i,t),gi(e,t,i);break;case 1:Lt||(Qn(i,t),a=i.stateNode,typeof a.componentWillUnmount=="function"&&Hd(i,t,a)),gi(e,t,i);break;case 21:gi(e,t,i);break;case 22:Lt=(a=Lt)||i.memoizedState!==null,gi(e,t,i),Lt=a;break;default:gi(e,t,i)}}function Vd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ps(e)}catch(i){nt(t,t.return,i)}}}function $d(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ps(e)}catch(i){nt(t,t.return,i)}}function o0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ud),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ud),t;default:throw Error(o(435,e.tag))}}function kl(e,t){var i=o0(e);t.forEach(function(a){if(!i.has(a)){i.add(a);var g=_0.bind(null,e,a);a.then(g,g)}})}function ln(e,t){var i=t.deletions;if(i!==null)for(var a=0;a<i.length;a++){var g=i[a],w=e,O=t,P=O;e:for(;P!==null;){switch(P.tag){case 27:if(Wi(P.type)){_t=P.stateNode,an=!1;break e}break;case 5:_t=P.stateNode,an=!1;break e;case 3:case 4:_t=P.stateNode.containerInfo,an=!0;break e}P=P.return}if(_t===null)throw Error(o(160));Gd(w,O,g),_t=null,an=!1,w=g.alternate,w!==null&&(w.return=null),g.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Wd(t,e),t=t.sibling}var Gn=null;function Wd(e,t){var i=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ln(t,e),on(e),a&4&&(Pi(3,e,e.return),ia(3,e),Pi(5,e,e.return));break;case 1:ln(t,e),on(e),a&512&&(Lt||i===null||Qn(i,i.return)),a&64&&mi&&(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=Gn;if(ln(t,e),on(e),a&512&&(Lt||i===null||Qn(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[ii]||w[ut]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=g.createElement(a),g.head.insertBefore(w,g.querySelector("head > title"))),Ut(w,a,i),w[ut]=e,Tt(w),a=w;break e;case"link":var O=Wp("link","href",g).get(a+(i.href||""));if(O){for(var P=0;P<O.length;P++)if(w=O[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)){O.splice(P,1);break t}}w=g.createElement(a),Ut(w,a,i),g.head.appendChild(w);break;case"meta":if(O=Wp("meta","content",g).get(a+(i.content||""))){for(P=0;P<O.length;P++)if(w=O[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)){O.splice(P,1);break t}}w=g.createElement(a),Ut(w,a,i),g.head.appendChild(w);break;default:throw Error(o(468,a))}w[ut]=e,Tt(w),a=w}e.stateNode=a}else Kp(g,e.type,e.stateNode);else e.stateNode=$p(g,a,e.memoizedProps);else w!==a?(w===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):w.count--,a===null?Kp(g,e.type,e.stateNode):$p(g,a,e.memoizedProps)):a===null&&e.stateNode!==null&&jc(e,e.memoizedProps,i.memoizedProps)}break;case 27:ln(t,e),on(e),a&512&&(Lt||i===null||Qn(i,i.return)),i!==null&&a&4&&jc(e,e.memoizedProps,i.memoizedProps);break;case 5:if(ln(t,e),on(e),a&512&&(Lt||i===null||Qn(i,i.return)),e.flags&32){g=e.stateNode;try{Be(g,"")}catch(Re){nt(e,e.return,Re)}}a&4&&e.stateNode!=null&&(g=e.memoizedProps,jc(e,g,i!==null?i.memoizedProps:g)),a&1024&&(zc=!0);break;case 6:if(ln(t,e),on(e),a&4){if(e.stateNode===null)throw Error(o(162));a=e.memoizedProps,i=e.stateNode;try{i.nodeValue=a}catch(Re){nt(e,e.return,Re)}}break;case 3:if(Fl=null,g=Gn,Gn=Pl(t.containerInfo),ln(t,e),Gn=g,on(e),a&4&&i!==null&&i.memoizedState.isDehydrated)try{ps(t.containerInfo)}catch(Re){nt(e,e.return,Re)}zc&&(zc=!1,Kd(e));break;case 4:a=Gn,Gn=Pl(e.stateNode.containerInfo),ln(t,e),on(e),Gn=a;break;case 12:ln(t,e),on(e);break;case 31:ln(t,e),on(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,kl(e,a)));break;case 13:ln(t,e),on(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Tl=dt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,kl(e,a)));break;case 22:g=e.memoizedState!==null;var Q=i!==null&&i.memoizedState!==null,ae=mi,de=Lt;if(mi=ae||g,Lt=de||Q,ln(t,e),Lt=de,mi=ae,on(e),a&8192)e:for(t=e.stateNode,t._visibility=g?t._visibility&-2:t._visibility|1,g&&(i===null||Q||mi||Lt||kr(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){Q=i=t;try{if(w=Q.stateNode,g)O=w.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{P=Q.stateNode;var ve=Q.memoizedProps.style,oe=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;P.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Re){nt(Q,Q.return,Re)}}}else if(t.tag===6){if(i===null){Q=t;try{Q.stateNode.nodeValue=g?"":Q.memoizedProps}catch(Re){nt(Q,Q.return,Re)}}}else if(t.tag===18){if(i===null){Q=t;try{var ue=Q.stateNode;g?Hp(ue,!0):Hp(Q.stateNode,!1)}catch(Re){nt(Q,Q.return,Re)}}}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,kl(e,i))));break;case 19:ln(t,e),on(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,kl(e,a)));break;case 30:break;case 21:break;default:ln(t,e),on(e)}}function on(e){var t=e.flags;if(t&2){try{for(var i,a=e.return;a!==null;){if(Id(a)){i=a;break}a=a.return}if(i==null)throw Error(o(160));switch(i.tag){case 27:var g=i.stateNode,w=Nc(e);El(e,w,g);break;case 5:var O=i.stateNode;i.flags&32&&(Be(O,""),i.flags&=-33);var P=Nc(e);El(e,P,O);break;case 3:case 4:var Q=i.stateNode.containerInfo,ae=Nc(e);Hc(e,ae,Q);break;default:throw Error(o(161))}}catch(de){nt(e,e.return,de)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Kd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Kd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function _i(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Fd(e,t.alternate,t),t=t.sibling}function kr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Pi(4,t,t.return),kr(t);break;case 1:Qn(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&Hd(t,t.return,i),kr(t);break;case 27:da(t.stateNode);case 26:case 5:Qn(t,t.return),kr(t);break;case 22:t.memoizedState===null&&kr(t);break;case 30:kr(t);break;default:kr(t)}e=e.sibling}}function vi(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,g=e,w=t,O=w.flags;switch(w.tag){case 0:case 11:case 15:vi(g,w,i),ia(4,w);break;case 1:if(vi(g,w,i),a=w,g=a.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(ae){nt(a,a.return,ae)}if(a=w,g=a.updateQueue,g!==null){var P=a.stateNode;try{var Q=g.shared.hiddenCallbacks;if(Q!==null)for(g.shared.hiddenCallbacks=null,g=0;g<Q.length;g++)Ef(Q[g],P)}catch(ae){nt(a,a.return,ae)}}i&&O&64&&Nd(w),ra(w,w.return);break;case 27:Pd(w);case 26:case 5:vi(g,w,i),i&&a===null&&O&4&&zd(w),ra(w,w.return);break;case 12:vi(g,w,i);break;case 31:vi(g,w,i),i&&O&4&&Vd(g,w);break;case 13:vi(g,w,i),i&&O&4&&$d(g,w);break;case 22:w.memoizedState===null&&vi(g,w,i),ra(w,w.return);break;case 30:break;default:vi(g,w,i)}t=t.sibling}}function Ic(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&&Gs(i))}function Pc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Gs(e))}function Vn(e,t,i,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Yd(e,t,i,a),t=t.sibling}function Yd(e,t,i,a){var g=t.flags;switch(t.tag){case 0:case 11:case 15:Vn(e,t,i,a),g&2048&&ia(9,t);break;case 1:Vn(e,t,i,a);break;case 3:Vn(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&&Gs(e)));break;case 12:if(g&2048){Vn(e,t,i,a),e=t.stateNode;try{var w=t.memoizedProps,O=w.id,P=w.onPostCommit;typeof P=="function"&&P(O,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Q){nt(t,t.return,Q)}}else Vn(e,t,i,a);break;case 31:Vn(e,t,i,a);break;case 13:Vn(e,t,i,a);break;case 23:break;case 22:w=t.stateNode,O=t.alternate,t.memoizedState!==null?w._visibility&2?Vn(e,t,i,a):sa(e,t):w._visibility&2?Vn(e,t,i,a):(w._visibility|=2,is(e,t,i,a,(t.subtreeFlags&10256)!==0||!1)),g&2048&&Ic(O,t);break;case 24:Vn(e,t,i,a),g&2048&&Pc(t.alternate,t);break;default:Vn(e,t,i,a)}}function is(e,t,i,a,g){for(g=g&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var w=e,O=t,P=i,Q=a,ae=O.flags;switch(O.tag){case 0:case 11:case 15:is(w,O,P,Q,g),ia(8,O);break;case 23:break;case 22:var de=O.stateNode;O.memoizedState!==null?de._visibility&2?is(w,O,P,Q,g):sa(w,O):(de._visibility|=2,is(w,O,P,Q,g)),g&&ae&2048&&Ic(O.alternate,O);break;case 24:is(w,O,P,Q,g),g&&ae&2048&&Pc(O.alternate,O);break;default:is(w,O,P,Q,g)}t=t.sibling}}function sa(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:sa(i,a),g&2048&&Ic(a.alternate,a);break;case 24:sa(i,a),g&2048&&Pc(a.alternate,a);break;default:sa(i,a)}t=t.sibling}}var aa=8192;function rs(e,t,i){if(e.subtreeFlags&aa)for(e=e.child;e!==null;)Xd(e,t,i),e=e.sibling}function Xd(e,t,i){switch(e.tag){case 26:rs(e,t,i),e.flags&aa&&e.memoizedState!==null&&K0(i,Gn,e.memoizedState,e.memoizedProps);break;case 5:rs(e,t,i);break;case 3:case 4:var a=Gn;Gn=Pl(e.stateNode.containerInfo),rs(e,t,i),Gn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=aa,aa=16777216,rs(e,t,i),aa=a):rs(e,t,i));break;default:rs(e,t,i)}}function Qd(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function la(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];Ht=a,Jd(a,e)}Qd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zd(e),e=e.sibling}function Zd(e){switch(e.tag){case 0:case 11:case 15:la(e),e.flags&2048&&Pi(9,e,e.return);break;case 3:la(e);break;case 12:la(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Al(e)):la(e);break;default:la(e)}}function Al(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];Ht=a,Jd(a,e)}Qd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Pi(8,t,t.return),Al(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Al(t));break;default:Al(t)}e=e.sibling}}function Jd(e,t){for(;Ht!==null;){var i=Ht;switch(i.tag){case 0:case 11:case 15:Pi(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:Gs(i.memoizedState.cache)}if(a=i.child,a!==null)a.return=i,Ht=a;else e:for(i=e;Ht!==null;){a=Ht;var g=a.sibling,w=a.return;if(qd(a),a===i){Ht=null;break e}if(g!==null){g.return=w,Ht=g;break e}Ht=w}}}var c0={getCacheForType:function(e){var t=It(Rt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return It(Rt).controller.signal}},u0=typeof WeakMap=="function"?WeakMap:Map,et=0,lt=null,Ge=null,We=0,tt=0,yn=null,Ui=!1,ss=!1,Uc=!1,yi=0,St=0,Fi=0,Ar=0,Fc=0,Sn=0,as=0,oa=null,cn=null,qc=!1,Tl=0,ep=0,Rl=1/0,Dl=null,qi=null,jt=0,Gi=null,ls=null,Si=0,Gc=0,Vc=null,tp=null,ca=0,$c=null;function bn(){return(et&2)!==0&&We!==0?We&-We:V.T!==null?Zc():Ts()}function np(){if(Sn===0)if((We&536870912)===0||Ye){var e=ze;ze<<=1,(ze&3932160)===0&&(ze=262144),Sn=e}else Sn=536870912;return e=_n.current,e!==null&&(e.flags|=32),Sn}function un(e,t,i){(e===lt&&(tt===2||tt===9)||e.cancelPendingCommit!==null)&&(os(e,0),Vi(e,We,Sn,!1)),lr(e,i),((et&2)===0||e!==lt)&&(e===lt&&((et&2)===0&&(Ar|=i),St===4&&Vi(e,We,Sn,!1)),Zn(e))}function ip(e,t,i){if((et&6)!==0)throw Error(o(327));var a=!i&&(t&127)===0&&(t&e.expiredLanes)===0||ar(e,t),g=a?d0(e,t):Kc(e,t,!0),w=a;do{if(g===0){ss&&!a&&Vi(e,t,0,!1);break}else{if(i=e.current.alternate,w&&!h0(i)){g=Kc(e,t,!1),w=!1;continue}if(g===2){if(w=t,e.errorRecoveryDisabledLanes&w)var O=0;else O=e.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){t=O;e:{var P=e;g=oa;var Q=P.current.memoizedState.isDehydrated;if(Q&&(os(P,O).flags|=256),O=Kc(P,O,!1),O!==2){if(Uc&&!Q){P.errorRecoveryDisabledLanes|=w,Ar|=w,g=4;break e}w=cn,cn=g,w!==null&&(cn===null?cn=w:cn.push.apply(cn,w))}g=O}if(w=!1,g!==2)continue}}if(g===1){os(e,0),Vi(e,t,0,!0);break}e:{switch(a=e,w=g,w){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Vi(a,t,Sn,!Ui);break e;case 2:cn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(g=Tl+300-dt(),10<g)){if(Vi(a,t,Sn,!Ui),ti(a,0,!0)!==0)break e;Si=t,a.timeoutHandle=Bp(rp.bind(null,a,i,cn,Dl,qc,t,Sn,Ar,as,Ui,w,"Throttled",-0,0),g);break e}rp(a,i,cn,Dl,qc,t,Sn,Ar,as,Ui,w,null,-0,0)}}break}while(!0);Zn(e)}function rp(e,t,i,a,g,w,O,P,Q,ae,de,ve,oe,ue){if(e.timeoutHandle=-1,ve=t.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ce},Xd(t,w,ve);var Re=(w&62914560)===w?Tl-dt():(w&4194048)===w?ep-dt():0;if(Re=Y0(ve,Re),Re!==null){Si=w,e.cancelPendingCommit=Re(fp.bind(null,e,t,w,i,a,g,O,P,Q,de,ve,null,oe,ue)),Vi(e,w,O,!ae);return}}fp(e,t,w,i,a,g,O,P,Q)}function h0(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(!mn(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 Vi(e,t,i,a){t&=~Fc,t&=~Ar,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var g=t;0<g;){var w=31-we(g),O=1<<w;a[w]=-1,g&=~O}i!==0&&or(e,i,t)}function Ml(){return(et&6)===0?(ua(0),!1):!0}function Wc(){if(Ge!==null){if(tt===0)var e=Ge.return;else e=Ge,ci=vr=null,cc(e),Zr=null,$s=0,e=Ge;for(;e!==null;)jd(e.alternate,e),e=e.return;Ge=null}}function os(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,M0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Si=0,Wc(),lt=e,Ge=i=li(e.current,null),We=t,tt=0,yn=null,Ui=!1,ss=ar(e,t),Uc=!1,as=Sn=Fc=Ar=Fi=St=0,cn=oa=null,qc=!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-we(a),w=1<<g;t|=e[g],a&=~w}return yi=t,Za(),i}function sp(e,t){Pe=null,V.H=ea,t===Qr||t===al?(t=bf(),tt=3):t===Qo?(t=bf(),tt=4):tt=t===Ec?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,yn=t,Ge===null&&(St=1,Sl(e,Rn(t,e.current)))}function ap(){var e=_n.current;return e===null?!0:(We&4194048)===We?On===null:(We&62914560)===We||(We&536870912)!==0?e===On:!1}function lp(){var e=V.H;return V.H=ea,e===null?ea:e}function op(){var e=V.A;return V.A=c0,e}function Ll(){St=4,Ui||(We&4194048)!==We&&_n.current!==null||(ss=!0),(Fi&134217727)===0&&(Ar&134217727)===0||lt===null||Vi(lt,We,Sn,!1)}function Kc(e,t,i){var a=et;et|=2;var g=lp(),w=op();(lt!==e||We!==t)&&(Dl=null,os(e,t)),t=!1;var O=St;e:do try{if(tt!==0&&Ge!==null){var P=Ge,Q=yn;switch(tt){case 8:Wc(),O=6;break e;case 3:case 2:case 9:case 6:_n.current===null&&(t=!0);var ae=tt;if(tt=0,yn=null,cs(e,P,Q,ae),i&&ss){O=0;break e}break;default:ae=tt,tt=0,yn=null,cs(e,P,Q,ae)}}f0(),O=St;break}catch(de){sp(e,de)}while(!0);return t&&e.shellSuspendCounter++,ci=vr=null,et=a,V.H=g,V.A=w,Ge===null&&(lt=null,We=0,Za()),O}function f0(){for(;Ge!==null;)cp(Ge)}function d0(e,t){var i=et;et|=2;var a=lp(),g=op();lt!==e||We!==t?(Dl=null,Rl=dt()+500,os(e,t)):ss=ar(e,t);e:do try{if(tt!==0&&Ge!==null){t=Ge;var w=yn;t:switch(tt){case 1:tt=0,yn=null,cs(e,t,w,1);break;case 2:case 9:if(yf(w)){tt=0,yn=null,up(t);break}t=function(){tt!==2&&tt!==9||lt!==e||(tt=7),Zn(e)},w.then(t,t);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:yf(w)?(tt=0,yn=null,up(t)):(tt=0,yn=null,cs(e,t,w,7));break;case 5:var O=null;switch(Ge.tag){case 26:O=Ge.memoizedState;case 5:case 27:var P=Ge;if(O?Yp(O):P.stateNode.complete){tt=0,yn=null;var Q=P.sibling;if(Q!==null)Ge=Q;else{var ae=P.return;ae!==null?(Ge=ae,Ol(ae)):Ge=null}break t}}tt=0,yn=null,cs(e,t,w,5);break;case 6:tt=0,yn=null,cs(e,t,w,6);break;case 8:Wc(),St=6;break e;default:throw Error(o(462))}}p0();break}catch(de){sp(e,de)}while(!0);return ci=vr=null,V.H=a,V.A=g,et=i,Ge!==null?0:(lt=null,We=0,Za(),St)}function p0(){for(;Ge!==null&&!xn();)cp(Ge)}function cp(e){var t=Od(e.alternate,e,yi);e.memoizedProps=e.pendingProps,t===null?Ol(e):Ge=t}function up(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Ad(i,t,t.pendingProps,t.type,void 0,We);break;case 11:t=Ad(i,t,t.pendingProps,t.type.render,t.ref,We);break;case 5:cc(t);default:jd(i,t),t=Ge=of(t,yi),t=Od(i,t,yi)}e.memoizedProps=e.pendingProps,t===null?Ol(e):Ge=t}function cs(e,t,i,a){ci=vr=null,cc(t),Zr=null,$s=0;var g=t.return;try{if(n0(e,g,t,i,We)){St=1,Sl(e,Rn(i,e.current)),Ge=null;return}}catch(w){if(g!==null)throw Ge=g,w;St=1,Sl(e,Rn(i,e.current)),Ge=null;return}t.flags&32768?(Ye||a===1?e=!0:ss||(We&536870912)!==0?e=!1:(Ui=e=!0,(a===2||a===9||a===3||a===6)&&(a=_n.current,a!==null&&a.tag===13&&(a.flags|=16384))),hp(t,e)):Ol(t)}function Ol(e){var t=e;do{if((t.flags&32768)!==0){hp(t,Ui);return}e=t.return;var i=s0(t.alternate,t,yi);if(i!==null){Ge=i;return}if(t=t.sibling,t!==null){Ge=t;return}Ge=t=e}while(t!==null);St===0&&(St=5)}function hp(e,t){do{var i=a0(e.alternate,e);if(i!==null){i.flags&=32767,Ge=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Ge=e;return}Ge=e=i}while(e!==null);St=6,Ge=null}function fp(e,t,i,a,g,w,O,P,Q){e.cancelPendingCommit=null;do Bl();while(jt!==0);if((et&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(w=t.lanes|t.childLanes,w|=No,za(e,i,w,O,P,Q),e===lt&&(Ge=lt=null,We=0),ls=t,Gi=e,Si=i,Gc=w,Vc=g,tp=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,v0(pe,function(){return _p(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=V.T,V.T=null,g=Y.p,Y.p=2,O=et,et|=4;try{l0(e,t,i)}finally{et=O,Y.p=g,V.T=a}}jt=1,dp(),pp(),mp()}}function dp(){if(jt===1){jt=0;var e=Gi,t=ls,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=V.T,V.T=null;var a=Y.p;Y.p=2;var g=et;et|=4;try{Wd(t,e);var w=au,O=Zh(e.containerInfo),P=w.focusedElem,Q=w.selectionRange;if(O!==P&&P&&P.ownerDocument&&Qh(P.ownerDocument.documentElement,P)){if(Q!==null&&Mo(P)){var ae=Q.start,de=Q.end;if(de===void 0&&(de=ae),"selectionStart"in P)P.selectionStart=ae,P.selectionEnd=Math.min(de,P.value.length);else{var ve=P.ownerDocument||document,oe=ve&&ve.defaultView||window;if(oe.getSelection){var ue=oe.getSelection(),Re=P.textContent.length,je=Math.min(Q.start,Re),st=Q.end===void 0?je:Math.min(Q.end,Re);!ue.extend&&je>st&&(O=st,st=je,je=O);var re=Xh(P,je),ee=Xh(P,st);if(re&&ee&&(ue.rangeCount!==1||ue.anchorNode!==re.node||ue.anchorOffset!==re.offset||ue.focusNode!==ee.node||ue.focusOffset!==ee.offset)){var se=ve.createRange();se.setStart(re.node,re.offset),ue.removeAllRanges(),je>st?(ue.addRange(se),ue.extend(ee.node,ee.offset)):(se.setEnd(ee.node,ee.offset),ue.addRange(se))}}}}for(ve=[],ue=P;ue=ue.parentNode;)ue.nodeType===1&&ve.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<ve.length;P++){var _e=ve[P];_e.element.scrollLeft=_e.left,_e.element.scrollTop=_e.top}}$l=!!su,au=su=null}finally{et=g,Y.p=a,V.T=i}}e.current=t,jt=2}}function pp(){if(jt===2){jt=0;var e=Gi,t=ls,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=V.T,V.T=null;var a=Y.p;Y.p=2;var g=et;et|=4;try{Fd(e,t.alternate,t)}finally{et=g,Y.p=a,V.T=i}}jt=3}}function mp(){if(jt===4||jt===3){jt=0,bt();var e=Gi,t=ls,i=Si,a=tp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?jt=5:(jt=0,ls=Gi=null,gp(e,e.pendingLanes));var g=e.pendingLanes;if(g===0&&(qi=null),Lr(i),t=t.stateNode,at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(Je,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=V.T,g=Y.p,Y.p=2,V.T=null;try{for(var w=e.onRecoverableError,O=0;O<a.length;O++){var P=a[O];w(P.value,{componentStack:P.stack})}}finally{V.T=t,Y.p=g}}(Si&3)!==0&&Bl(),Zn(e),g=e.pendingLanes,(i&261930)!==0&&(g&42)!==0?e===$c?ca++:(ca=0,$c=e):ca=0,ua(0)}}function gp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Gs(t)))}function Bl(){return dp(),pp(),mp(),_p()}function _p(){if(jt!==5)return!1;var e=Gi,t=Gc;Gc=0;var i=Lr(Si),a=V.T,g=Y.p;try{Y.p=32>i?32:i,V.T=null,i=Vc,Vc=null;var w=Gi,O=Si;if(jt=0,ls=Gi=null,Si=0,(et&6)!==0)throw Error(o(331));var P=et;if(et|=4,Zd(w.current),Yd(w,w.current,O,i),et=P,ua(0,!1),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(Je,w)}catch{}return!0}finally{Y.p=g,V.T=a,gp(e,t)}}function vp(e,t,i){t=Rn(i,t),t=xc(e.stateNode,t,2),e=Hi(e,t,2),e!==null&&(lr(e,2),Zn(e))}function nt(e,t,i){if(e.tag===3)vp(e,e,i);else for(;t!==null;){if(t.tag===3){vp(t,e,i);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(qi===null||!qi.has(a))){e=Rn(i,e),i=yd(2),a=Hi(t,i,2),a!==null&&(Sd(i,a,t,e),lr(a,2),Zn(a));break}}t=t.return}}function Yc(e,t,i){var a=e.pingCache;if(a===null){a=e.pingCache=new u0;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)||(Uc=!0,g.add(i),e=m0.bind(null,e,t,i),t.then(e,e))}function m0(e,t,i){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,lt===e&&(We&i)===i&&(St===4||St===3&&(We&62914560)===We&&300>dt()-Tl?(et&2)===0&&os(e,0):Fc|=i,as===We&&(as=0)),Zn(e)}function yp(e,t){t===0&&(t=Ha()),e=mr(e,t),e!==null&&(lr(e,t),Zn(e))}function g0(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),yp(e,i)}function _0(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(o(314))}a!==null&&a.delete(t),yp(e,i)}function v0(e,t){return Kt(e,t)}var jl=null,us=null,Xc=!1,Nl=!1,Qc=!1,$i=0;function Zn(e){e!==us&&e.next===null&&(us===null?jl=us=e:us=us.next=e),Nl=!0,Xc||(Xc=!0,S0())}function ua(e,t){if(!Qc&&Nl){Qc=!0;do for(var i=!1,a=jl;a!==null;){if(e!==0){var g=a.pendingLanes;if(g===0)var w=0;else{var O=a.suspendedLanes,P=a.pingedLanes;w=(1<<31-we(42|e)+1)-1,w&=g&~(O&~P),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(i=!0,wp(a,w))}else w=We,w=ti(a,a===lt?w:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(w&3)===0||ar(a,w)||(i=!0,wp(a,w));a=a.next}while(i);Qc=!1}}function y0(){Sp()}function Sp(){Nl=Xc=!1;var e=0;$i!==0&&D0()&&(e=$i);for(var t=dt(),i=null,a=jl;a!==null;){var g=a.next,w=bp(a,t);w===0?(a.next=null,i===null?jl=g:i.next=g,g===null&&(us=i)):(i=a,(e!==0||(w&3)!==0)&&(Nl=!0)),a=g}jt!==0&&jt!==5||ua(e),$i!==0&&($i=0)}function bp(e,t){for(var i=e.suspendedLanes,a=e.pingedLanes,g=e.expirationTimes,w=e.pendingLanes&-62914561;0<w;){var O=31-we(w),P=1<<O,Q=g[O];Q===-1?((P&i)===0||(P&a)!==0)&&(g[O]=Mr(P,t)):Q<=t&&(e.expiredLanes|=P),w&=~P}if(t=lt,i=We,i=ti(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,i===0||e===t&&(tt===2||tt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&en(a),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||ar(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(a!==null&&en(a),Lr(i)){case 2:case 8:i=Se;break;case 32:i=pe;break;case 268435456:i=Ne;break;default:i=pe}return a=Cp.bind(null,e),i=Kt(i,a),e.callbackPriority=t,e.callbackNode=i,t}return a!==null&&a!==null&&en(a),e.callbackPriority=2,e.callbackNode=null,2}function Cp(e,t){if(jt!==0&&jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Bl()&&e.callbackNode!==i)return null;var a=We;return a=ti(e,e===lt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(ip(e,a,t),bp(e,dt()),e.callbackNode!=null&&e.callbackNode===i?Cp.bind(null,e):null)}function wp(e,t){if(Bl())return null;ip(e,t,!0)}function S0(){L0(function(){(et&6)!==0?Kt(fe,y0):Sp()})}function Zc(){if($i===0){var e=Yr;e===0&&(e=Hn,Hn<<=1,(Hn&261888)===0&&(Hn=256)),$i=e}return $i}function xp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:$(""+e)}function Ep(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 b0(e,t,i,a,g){if(t==="submit"&&i&&i.stateNode===g){var w=xp((g[At]||null).action),O=a.submitter;O&&(t=(t=O[At]||null)?xp(t.formAction):O.getAttribute("formAction"),t!==null&&(w=t,O=null));var P=new Ka("action","action",null,a,g);e.push({event:P,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if($i!==0){var Q=O?Ep(g,O):new FormData(g);vc(i,{pending:!0,data:Q,method:g.method,action:w},null,Q)}}else typeof w=="function"&&(P.preventDefault(),Q=O?Ep(g,O):new FormData(g),vc(i,{pending:!0,data:Q,method:g.method,action:w},w,Q))},currentTarget:g}]})}}for(var Jc=0;Jc<jo.length;Jc++){var eu=jo[Jc],C0=eu.toLowerCase(),w0=eu[0].toUpperCase()+eu.slice(1);qn(C0,"on"+w0)}qn(tf,"onAnimationEnd"),qn(nf,"onAnimationIteration"),qn(rf,"onAnimationStart"),qn("dblclick","onDoubleClick"),qn("focusin","onFocus"),qn("focusout","onBlur"),qn(Iv,"onTransitionRun"),qn(Pv,"onTransitionStart"),qn(Uv,"onTransitionCancel"),qn(sf,"onTransitionEnd"),ri("onMouseEnter",["mouseout","mouseover"]),ri("onMouseLeave",["mouseout","mouseover"]),ri("onPointerEnter",["pointerout","pointerover"]),ri("onPointerLeave",["pointerout","pointerover"]),Kn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Kn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Kn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Kn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Kn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Kn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ha="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(" "),x0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ha));function kp(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 O=a.length-1;0<=O;O--){var P=a[O],Q=P.instance,ae=P.currentTarget;if(P=P.listener,Q!==w&&g.isPropagationStopped())break e;w=P,g.currentTarget=ae;try{w(g)}catch(de){Qa(de)}g.currentTarget=null,w=Q}else for(O=0;O<a.length;O++){if(P=a[O],Q=P.instance,ae=P.currentTarget,P=P.listener,Q!==w&&g.isPropagationStopped())break e;w=P,g.currentTarget=ae;try{w(g)}catch(de){Qa(de)}g.currentTarget=null,w=Q}}}}function Ve(e,t){var i=t[Ei];i===void 0&&(i=t[Ei]=new Set);var a=e+"__bubble";i.has(a)||(Ap(t,e,2,!1),i.add(a))}function tu(e,t,i){var a=0;t&&(a|=4),Ap(i,e,a,t)}var Hl="_reactListening"+Math.random().toString(36).slice(2);function nu(e){if(!e[Hl]){e[Hl]=!0,Ft.forEach(function(i){i!=="selectionchange"&&(x0.has(i)||tu(i,!1,e),tu(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hl]||(t[Hl]=!0,tu("selectionchange",!1,t))}}function Ap(e,t,i,a){switch(nm(t)){case 2:var g=Z0;break;case 8:g=J0;break;default:g=_u}i=g.bind(null,t,i,e),g=void 0,!Co||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 iu(e,t,i,a,g){var w=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var O=a.tag;if(O===3||O===4){var P=a.stateNode.containerInfo;if(P===g)break;if(O===4)for(O=a.return;O!==null;){var Q=O.tag;if((Q===3||Q===4)&&O.stateNode.containerInfo===g)return;O=O.return}for(;P!==null;){if(O=tn(P),O===null)return;if(Q=O.tag,Q===5||Q===6||Q===26||Q===27){a=w=O;continue e}P=P.parentNode}}a=a.return}Mh(function(){var ae=w,de=vt(i),ve=[];e:{var oe=af.get(e);if(oe!==void 0){var ue=Ka,Re=e;switch(e){case"keypress":if($a(i)===0)break e;case"keydown":case"keyup":ue=_v;break;case"focusin":Re="focus",ue=ko;break;case"focusout":Re="blur",ue=ko;break;case"beforeblur":case"afterblur":ue=ko;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":ue=Bh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=sv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=Sv;break;case tf:case nf:case rf:ue=ov;break;case sf:ue=Cv;break;case"scroll":case"scrollend":ue=iv;break;case"wheel":ue=xv;break;case"copy":case"cut":case"paste":ue=uv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Nh;break;case"toggle":case"beforetoggle":ue=kv}var je=(t&4)!==0,st=!je&&(e==="scroll"||e==="scrollend"),re=je?oe!==null?oe+"Capture":null:oe;je=[];for(var ee=ae,se;ee!==null;){var _e=ee;if(se=_e.stateNode,_e=_e.tag,_e!==5&&_e!==26&&_e!==27||se===null||re===null||(_e=Os(ee,re),_e!=null&&je.push(fa(ee,_e,se))),st)break;ee=ee.return}0<je.length&&(oe=new ue(oe,Re,null,i,de),ve.push({event:oe,listeners:je}))}}if((t&7)===0){e:{if(oe=e==="mouseover"||e==="pointerover",ue=e==="mouseout"||e==="pointerout",oe&&i!==ht&&(Re=i.relatedTarget||i.fromElement)&&(tn(Re)||Re[En]))break e;if((ue||oe)&&(oe=de.window===de?de:(oe=de.ownerDocument)?oe.defaultView||oe.parentWindow:window,ue?(Re=i.relatedTarget||i.toElement,ue=ae,Re=Re?tn(Re):null,Re!==null&&(st=v(Re),je=Re.tag,Re!==st||je!==5&&je!==27&&je!==6)&&(Re=null)):(ue=null,Re=ae),ue!==Re)){if(je=Bh,_e="onMouseLeave",re="onMouseEnter",ee="mouse",(e==="pointerout"||e==="pointerover")&&(je=Nh,_e="onPointerLeave",re="onPointerEnter",ee="pointer"),st=ue==null?oe:ki(ue),se=Re==null?oe:ki(Re),oe=new je(_e,ee+"leave",ue,i,de),oe.target=st,oe.relatedTarget=se,_e=null,tn(de)===ae&&(je=new je(re,ee+"enter",Re,i,de),je.target=se,je.relatedTarget=st,_e=je),st=_e,ue&&Re)t:{for(je=E0,re=ue,ee=Re,se=0,_e=re;_e;_e=je(_e))se++;_e=0;for(var Le=ee;Le;Le=je(Le))_e++;for(;0<se-_e;)re=je(re),se--;for(;0<_e-se;)ee=je(ee),_e--;for(;se--;){if(re===ee||ee!==null&&re===ee.alternate){je=re;break t}re=je(re),ee=je(ee)}je=null}else je=null;ue!==null&&Tp(ve,oe,ue,je,!1),Re!==null&&st!==null&&Tp(ve,st,Re,je,!0)}}e:{if(oe=ae?ki(ae):window,ue=oe.nodeName&&oe.nodeName.toLowerCase(),ue==="select"||ue==="input"&&oe.type==="file")var Qe=Gh;else if(Fh(oe))if(Vh)Qe=Nv;else{Qe=Bv;var De=Ov}else ue=oe.nodeName,!ue||ue.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ae&&Ms(ae.elementType)&&(Qe=Gh):Qe=jv;if(Qe&&(Qe=Qe(e,ae))){qh(ve,Qe,i,de);break e}De&&De(e,oe,ae),e==="focusout"&&ae&&oe.type==="number"&&ae.memoizedProps.value!=null&&Ri(oe,"number",oe.value)}switch(De=ae?ki(ae):window,e){case"focusin":(Fh(De)||De.contentEditable==="true")&&(Ur=De,Lo=ae,Us=null);break;case"focusout":Us=Lo=Ur=null;break;case"mousedown":Oo=!0;break;case"contextmenu":case"mouseup":case"dragend":Oo=!1,Jh(ve,i,de);break;case"selectionchange":if(zv)break;case"keydown":case"keyup":Jh(ve,i,de)}var Fe;if(To)e:{switch(e){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else Pr?Ph(e,i)&&(Ke="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ke="onCompositionStart");Ke&&(Hh&&i.locale!=="ko"&&(Pr||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&Pr&&(Fe=Lh()):(Di=de,wo="value"in Di?Di.value:Di.textContent,Pr=!0)),De=zl(ae,Ke),0<De.length&&(Ke=new jh(Ke,e,null,i,de),ve.push({event:Ke,listeners:De}),Fe?Ke.data=Fe:(Fe=Uh(i),Fe!==null&&(Ke.data=Fe)))),(Fe=Tv?Rv(e,i):Dv(e,i))&&(Ke=zl(ae,"onBeforeInput"),0<Ke.length&&(De=new jh("onBeforeInput","beforeinput",null,i,de),ve.push({event:De,listeners:Ke}),De.data=Fe)),b0(ve,e,ae,i,de)}kp(ve,t)})}function fa(e,t,i){return{instance:e,listener:t,currentTarget:i}}function zl(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=Os(e,i),g!=null&&a.unshift(fa(e,g,w)),g=Os(e,t),g!=null&&a.push(fa(e,g,w))),e.tag===3)return a;e=e.return}return[]}function E0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Tp(e,t,i,a,g){for(var w=t._reactName,O=[];i!==null&&i!==a;){var P=i,Q=P.alternate,ae=P.stateNode;if(P=P.tag,Q!==null&&Q===a)break;P!==5&&P!==26&&P!==27||ae===null||(Q=ae,g?(ae=Os(i,w),ae!=null&&O.unshift(fa(i,ae,Q))):g||(ae=Os(i,w),ae!=null&&O.push(fa(i,ae,Q)))),i=i.return}O.length!==0&&e.push({event:t,listeners:O})}var k0=/\r\n?/g,A0=/\u0000|\uFFFD/g;function Rp(e){return(typeof e=="string"?e:""+e).replace(k0,`
49
+ `).replace(A0,"")}function Dp(e,t){return t=Rp(t),Rp(e)===t}function rt(e,t,i,a,g,w){switch(i){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Be(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Be(e,""+a);break;case"className":jr(e,"class",a);break;case"tabIndex":jr(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":jr(e,i,a);break;case"style":Fa(e,a,w);break;case"data":if(t!=="object"){jr(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=$(""+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"&&rt(e,t,"name",g.name,g,null),rt(e,t,"formEncType",g.formEncType,g,null),rt(e,t,"formMethod",g.formMethod,g,null),rt(e,t,"formTarget",g.formTarget,g,null)):(rt(e,t,"encType",g.encType,g,null),rt(e,t,"method",g.method,g,null),rt(e,t,"target",g.target,g,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=$(""+a),e.setAttribute(i,a);break;case"onClick":a!=null&&(e.onclick=ce);break;case"onScroll":a!=null&&Ve("scroll",e);break;case"onScrollEnd":a!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(i=a.__html,i!=null){if(g.children!=null)throw Error(o(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=$(""+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":Ve("beforetoggle",e),Ve("toggle",e),Br(e,"popover",a);break;case"xlinkActuate":Un(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Un(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Un(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Un(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Un(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Un(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Un(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Un(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Un(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Br(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=Ls.get(i)||i,Br(e,i,a))}}function ru(e,t,i,a,g,w){switch(i){case"style":Fa(e,a,w);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(i=a.__html,i!=null){if(g.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"children":typeof a=="string"?Be(e,a):(typeof a=="number"||typeof a=="bigint")&&Be(e,""+a);break;case"onScroll":a!=null&&Ve("scroll",e);break;case"onScrollEnd":a!=null&&Ve("scrollend",e);break;case"onClick":a!=null&&(e.onclick=ce);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!dn.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[At]||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,""):Br(e,i,a)}}}function Ut(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",e),Ve("load",e);var a=!1,g=!1,w;for(w in i)if(i.hasOwnProperty(w)){var O=i[w];if(O!=null)switch(w){case"src":a=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:rt(e,t,w,O,i,null)}}g&&rt(e,t,"srcSet",i.srcSet,i,null),a&&rt(e,t,"src",i.src,i,null);return;case"input":Ve("invalid",e);var P=w=O=g=null,Q=null,ae=null;for(a in i)if(i.hasOwnProperty(a)){var de=i[a];if(de!=null)switch(a){case"name":g=de;break;case"type":O=de;break;case"checked":Q=de;break;case"defaultChecked":ae=de;break;case"value":w=de;break;case"defaultValue":P=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(o(137,t));break;default:rt(e,t,a,de,i,null)}}Fn(e,w,P,Q,ae,O,g,!1);return;case"select":Ve("invalid",e),a=O=w=null;for(g in i)if(i.hasOwnProperty(g)&&(P=i[g],P!=null))switch(g){case"value":w=P;break;case"defaultValue":O=P;break;case"multiple":a=P;default:rt(e,t,g,P,i,null)}t=w,i=O,e.multiple=!!a,t!=null?rn(e,!!a,t,!1):i!=null&&rn(e,!!a,i,!0);return;case"textarea":Ve("invalid",e),w=g=a=null;for(O in i)if(i.hasOwnProperty(O)&&(P=i[O],P!=null))switch(O){case"value":a=P;break;case"defaultValue":g=P;break;case"children":w=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(o(91));break;default:rt(e,t,O,P,i,null)}Ir(e,a,g,w);return;case"option":for(Q in i)if(i.hasOwnProperty(Q)&&(a=i[Q],a!=null))switch(Q){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:rt(e,t,Q,a,i,null)}return;case"dialog":Ve("beforetoggle",e),Ve("toggle",e),Ve("cancel",e),Ve("close",e);break;case"iframe":case"object":Ve("load",e);break;case"video":case"audio":for(a=0;a<ha.length;a++)Ve(ha[a],e);break;case"image":Ve("error",e),Ve("load",e);break;case"details":Ve("toggle",e);break;case"embed":case"source":case"link":Ve("error",e),Ve("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(ae in i)if(i.hasOwnProperty(ae)&&(a=i[ae],a!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:rt(e,t,ae,a,i,null)}return;default:if(Ms(t)){for(de in i)i.hasOwnProperty(de)&&(a=i[de],a!==void 0&&ru(e,t,de,a,i,void 0));return}}for(P in i)i.hasOwnProperty(P)&&(a=i[P],a!=null&&rt(e,t,P,a,i,null))}function T0(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,O=null,P=null,Q=null,ae=null,de=null;for(ue in i){var ve=i[ue];if(i.hasOwnProperty(ue)&&ve!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":Q=ve;default:a.hasOwnProperty(ue)||rt(e,t,ue,null,a,ve)}}for(var oe in a){var ue=a[oe];if(ve=i[oe],a.hasOwnProperty(oe)&&(ue!=null||ve!=null))switch(oe){case"type":w=ue;break;case"name":g=ue;break;case"checked":ae=ue;break;case"defaultChecked":de=ue;break;case"value":O=ue;break;case"defaultValue":P=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(o(137,t));break;default:ue!==ve&&rt(e,t,oe,ue,a,ve)}}hr(e,O,P,Q,ae,de,w,g);return;case"select":ue=O=P=oe=null;for(w in i)if(Q=i[w],i.hasOwnProperty(w)&&Q!=null)switch(w){case"value":break;case"multiple":ue=Q;default:a.hasOwnProperty(w)||rt(e,t,w,null,a,Q)}for(g in a)if(w=a[g],Q=i[g],a.hasOwnProperty(g)&&(w!=null||Q!=null))switch(g){case"value":oe=w;break;case"defaultValue":P=w;break;case"multiple":O=w;default:w!==Q&&rt(e,t,g,w,a,Q)}t=P,i=O,a=ue,oe!=null?rn(e,!!i,oe,!1):!!a!=!!i&&(t!=null?rn(e,!!i,t,!0):rn(e,!!i,i?[]:"",!1));return;case"textarea":ue=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:rt(e,t,P,null,a,g)}for(O in a)if(g=a[O],w=i[O],a.hasOwnProperty(O)&&(g!=null||w!=null))switch(O){case"value":oe=g;break;case"defaultValue":ue=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(o(91));break;default:g!==w&&rt(e,t,O,g,a,w)}kn(e,oe,ue);return;case"option":for(var Re in i)if(oe=i[Re],i.hasOwnProperty(Re)&&oe!=null&&!a.hasOwnProperty(Re))switch(Re){case"selected":e.selected=!1;break;default:rt(e,t,Re,null,a,oe)}for(Q in a)if(oe=a[Q],ue=i[Q],a.hasOwnProperty(Q)&&oe!==ue&&(oe!=null||ue!=null))switch(Q){case"selected":e.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:rt(e,t,Q,oe,a,ue)}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 je in i)oe=i[je],i.hasOwnProperty(je)&&oe!=null&&!a.hasOwnProperty(je)&&rt(e,t,je,null,a,oe);for(ae in a)if(oe=a[ae],ue=i[ae],a.hasOwnProperty(ae)&&oe!==ue&&(oe!=null||ue!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(o(137,t));break;default:rt(e,t,ae,oe,a,ue)}return;default:if(Ms(t)){for(var st in i)oe=i[st],i.hasOwnProperty(st)&&oe!==void 0&&!a.hasOwnProperty(st)&&ru(e,t,st,void 0,a,oe);for(de in a)oe=a[de],ue=i[de],!a.hasOwnProperty(de)||oe===ue||oe===void 0&&ue===void 0||ru(e,t,de,oe,a,ue);return}}for(var re in i)oe=i[re],i.hasOwnProperty(re)&&oe!=null&&!a.hasOwnProperty(re)&&rt(e,t,re,null,a,oe);for(ve in a)oe=a[ve],ue=i[ve],!a.hasOwnProperty(ve)||oe===ue||oe==null&&ue==null||rt(e,t,ve,oe,a,ue)}function Mp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function R0(){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,O=g.initiatorType,P=g.duration;if(w&&P&&Mp(O)){for(O=0,P=g.responseEnd,a+=1;a<i.length;a++){var Q=i[a],ae=Q.startTime;if(ae>P)break;var de=Q.transferSize,ve=Q.initiatorType;de&&Mp(ve)&&(Q=Q.responseEnd,O+=de*(Q<P?1:(P-ae)/(Q-ae)))}if(--a,t+=8*(w+O)/(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 su=null,au=null;function Il(e){return e.nodeType===9?e:e.ownerDocument}function Lp(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 Op(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 lu(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 ou=null;function D0(){var e=window.event;return e&&e.type==="popstate"?e===ou?!1:(ou=e,!0):(ou=null,!1)}var Bp=typeof setTimeout=="function"?setTimeout:void 0,M0=typeof clearTimeout=="function"?clearTimeout:void 0,jp=typeof Promise=="function"?Promise:void 0,L0=typeof queueMicrotask=="function"?queueMicrotask:typeof jp<"u"?function(e){return jp.resolve(null).then(e).catch(O0)}:Bp;function O0(e){setTimeout(function(){throw e})}function Wi(e){return e==="head"}function Np(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),ps(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 O=w.nextSibling,P=w.nodeName;w[ii]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&w.rel.toLowerCase()==="stylesheet"||i.removeChild(w),w=O}}else i==="body"&&da(e.ownerDocument.body);i=g}while(i);ps(t)}function Hp(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 cu(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":cu(i),Or(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function B0(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[ii])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=Bn(e.nextSibling),e===null)break}return null}function j0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Bn(e.nextSibling),e===null))return null;return e}function zp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Bn(e.nextSibling),e===null))return null;return e}function uu(e){return e.data==="$?"||e.data==="$~"}function hu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function N0(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 Bn(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 fu=null;function Ip(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Bn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function Pp(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 Up(e,t,i){switch(t=Il(i),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function da(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Or(e)}var jn=new Map,Fp=new Set;function Pl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var bi=Y.d;Y.d={f:H0,r:z0,D:I0,C:P0,L:U0,m:F0,X:G0,S:q0,M:V0};function H0(){var e=bi.f(),t=Ml();return e||t}function z0(e){var t=Wn(e);t!==null&&t.tag===5&&t.type==="form"?sd(t):bi.r(e)}var hs=typeof document>"u"?null:document;function qp(e,t,i){var a=hs;if(a&&typeof t=="string"&&t){var g=qt(t);g='link[rel="'+e+'"][href="'+g+'"]',typeof i=="string"&&(g+='[crossorigin="'+i+'"]'),Fp.has(g)||(Fp.add(g),e={rel:e,crossOrigin:i,href:t},a.querySelector(g)===null&&(t=a.createElement("link"),Ut(t,"link",e),Tt(t),a.head.appendChild(t)))}}function I0(e){bi.D(e),qp("dns-prefetch",e,null)}function P0(e,t){bi.C(e,t),qp("preconnect",e,t)}function U0(e,t,i){bi.L(e,t,i);var a=hs;if(a&&e&&t){var g='link[rel="preload"][as="'+qt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(g+='[imagesrcset="'+qt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(g+='[imagesizes="'+qt(i.imageSizes)+'"]')):g+='[href="'+qt(e)+'"]';var w=g;switch(t){case"style":w=fs(e);break;case"script":w=ds(e)}jn.has(w)||(e=u({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),jn.set(w,e),a.querySelector(g)!==null||t==="style"&&a.querySelector(pa(w))||t==="script"&&a.querySelector(ma(w))||(t=a.createElement("link"),Ut(t,"link",e),Tt(t),a.head.appendChild(t)))}}function F0(e,t){bi.m(e,t);var i=hs;if(i&&e){var a=t&&typeof t.as=="string"?t.as:"script",g='link[rel="modulepreload"][as="'+qt(a)+'"][href="'+qt(e)+'"]',w=g;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=ds(e)}if(!jn.has(w)&&(e=u({rel:"modulepreload",href:e},t),jn.set(w,e),i.querySelector(g)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ma(w)))return}a=i.createElement("link"),Ut(a,"link",e),Tt(a),i.head.appendChild(a)}}}function q0(e,t,i){bi.S(e,t,i);var a=hs;if(a&&e){var g=Ai(a).hoistableStyles,w=fs(e);t=t||"default";var O=g.get(w);if(!O){var P={loading:0,preload:null};if(O=a.querySelector(pa(w)))P.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},i),(i=jn.get(w))&&du(e,i);var Q=O=a.createElement("link");Tt(Q),Ut(Q,"link",e),Q._p=new Promise(function(ae,de){Q.onload=ae,Q.onerror=de}),Q.addEventListener("load",function(){P.loading|=1}),Q.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Ul(O,t,a)}O={type:"stylesheet",instance:O,count:1,state:P},g.set(w,O)}}}function G0(e,t){bi.X(e,t);var i=hs;if(i&&e){var a=Ai(i).hoistableScripts,g=ds(e),w=a.get(g);w||(w=i.querySelector(ma(g)),w||(e=u({src:e,async:!0},t),(t=jn.get(g))&&pu(e,t),w=i.createElement("script"),Tt(w),Ut(w,"link",e),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},a.set(g,w))}}function V0(e,t){bi.M(e,t);var i=hs;if(i&&e){var a=Ai(i).hoistableScripts,g=ds(e),w=a.get(g);w||(w=i.querySelector(ma(g)),w||(e=u({src:e,async:!0,type:"module"},t),(t=jn.get(g))&&pu(e,t),w=i.createElement("script"),Tt(w),Ut(w,"link",e),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},a.set(g,w))}}function Gp(e,t,i,a){var g=(g=ge.current)?Pl(g):null;if(!g)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=fs(i.href),i=Ai(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=fs(i.href);var w=Ai(g).hoistableStyles,O=w.get(e);if(O||(g=g.ownerDocument||g,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(e,O),(w=g.querySelector(pa(e)))&&!w._p&&(O.instance=w,O.state.loading=5),jn.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},jn.set(e,i),w||$0(g,e,i,O.state))),t&&a===null)throw Error(o(528,""));return O}if(t&&a!==null)throw Error(o(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=Ai(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(o(444,e))}}function fs(e){return'href="'+qt(e)+'"'}function pa(e){return'link[rel="stylesheet"]['+e+"]"}function Vp(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function $0(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}),Ut(t,"link",i),Tt(t),e.head.appendChild(t))}function ds(e){return'[src="'+qt(e)+'"]'}function ma(e){return"script[async]"+e}function $p(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+qt(i.href)+'"]');if(a)return t.instance=a,Tt(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"),Tt(a),Ut(a,"style",g),Ul(a,i.precedence,e),t.instance=a;case"stylesheet":g=fs(i.href);var w=e.querySelector(pa(g));if(w)return t.state.loading|=4,t.instance=w,Tt(w),w;a=Vp(i),(g=jn.get(g))&&du(a,g),w=(e.ownerDocument||e).createElement("link"),Tt(w);var O=w;return O._p=new Promise(function(P,Q){O.onload=P,O.onerror=Q}),Ut(w,"link",a),t.state.loading|=4,Ul(w,i.precedence,e),t.instance=w;case"script":return w=ds(i.src),(g=e.querySelector(ma(w)))?(t.instance=g,Tt(g),g):(a=i,(g=jn.get(w))&&(a=u({},i),pu(a,g)),e=e.ownerDocument||e,g=e.createElement("script"),Tt(g),Ut(g,"link",a),e.head.appendChild(g),t.instance=g);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Ul(a,i.precedence,e));return t.instance}function Ul(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,O=0;O<a.length;O++){var P=a[O];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 du(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function pu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Fl=null;function Wp(e,t,i){if(Fl===null){var a=new Map,g=Fl=new Map;g.set(i,a)}else g=Fl,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[ii]||w[ut]||e==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var O=w.getAttribute(t)||"";O=e+O;var P=a.get(O);P?P.push(w):a.set(O,[w])}}return a}function Kp(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function W0(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 Yp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function K0(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=fs(a.href),w=t.querySelector(pa(g));if(w){t=w._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ql.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=w,Tt(w);return}w=t.ownerDocument||t,a=Vp(a),(g=jn.get(g))&&du(a,g),w=w.createElement("link"),Tt(w);var O=w;O._p=new Promise(function(P,Q){O.onload=P,O.onerror=Q}),Ut(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=ql.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var mu=0;function Y0(e,t){return e.stylesheets&&e.count===0&&Vl(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var a=setTimeout(function(){if(e.stylesheets&&Vl(e,e.stylesheets),e.unsuspend){var w=e.unsuspend;e.unsuspend=null,w()}},6e4+t);0<e.imgBytes&&mu===0&&(mu=62500*R0());var g=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Vl(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 ql(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Gl=null;function Vl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Gl=new Map,t.forEach(X0,e),Gl=null,ql.call(e))}function X0(e,t){if(!(t.state.loading&4)){var i=Gl.get(e);if(i)var a=i.get(null);else{i=new Map,Gl.set(e,i);for(var g=e.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<g.length;w++){var O=g[w];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(i.set(O.dataset.precedence,O),a=O)}a&&i.set(null,a)}g=t.instance,O=g.getAttribute("data-precedence"),w=i.get(O)||a,w===a&&i.set(null,g),i.set(O,g),this.count++,a=ql.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 ga={$$typeof:S,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function Q0(e,t,i,a,g,w,O,P,Q){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=ks(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ks(0),this.hiddenUpdates=ks(null),this.identifierPrefix=a,this.onUncaughtError=g,this.onCaughtError=w,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function Xp(e,t,i,a,g,w,O,P,Q,ae,de,ve){return e=new Q0(e,t,i,O,Q,ae,de,ve,P),t=1,w===!0&&(t|=24),w=gn(3,null,null,t),e.current=w,w.stateNode=e,t=Ko(),t.refCount++,e.pooledCache=t,t.refCount++,w.memoizedState={element:a,isDehydrated:i,cache:t},Zo(w),e}function Qp(e){return e?(e=Gr,e):Gr}function Zp(e,t,i,a,g,w){g=Qp(g),a.context===null?a.context=g:a.pendingContext=g,a=Ni(t),a.payload={element:i},w=w===void 0?null:w,w!==null&&(a.callback=w),i=Hi(e,a,t),i!==null&&(un(i,e,t),Ks(i,e,t))}function Jp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function gu(e,t){Jp(e,t),(e=e.alternate)&&Jp(e,t)}function em(e){if(e.tag===13||e.tag===31){var t=mr(e,67108864);t!==null&&un(t,e,67108864),gu(e,67108864)}}function tm(e){if(e.tag===13||e.tag===31){var t=bn();t=ni(t);var i=mr(e,t);i!==null&&un(i,e,t),gu(e,t)}}var $l=!0;function Z0(e,t,i,a){var g=V.T;V.T=null;var w=Y.p;try{Y.p=2,_u(e,t,i,a)}finally{Y.p=w,V.T=g}}function J0(e,t,i,a){var g=V.T;V.T=null;var w=Y.p;try{Y.p=8,_u(e,t,i,a)}finally{Y.p=w,V.T=g}}function _u(e,t,i,a){if($l){var g=vu(a);if(g===null)iu(e,t,a,Wl,i),im(e,a);else if(t1(g,e,t,i,a))a.stopPropagation();else if(im(e,a),t&4&&-1<e1.indexOf(e)){for(;g!==null;){var w=Wn(g);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var O=In(w.pendingLanes);if(O!==0){var P=w;for(P.pendingLanes|=2,P.entangledLanes|=2;O;){var Q=1<<31-we(O);P.entanglements[1]|=Q,O&=~Q}Zn(w),(et&6)===0&&(Rl=dt()+500,ua(0))}}break;case 31:case 13:P=mr(w,2),P!==null&&un(P,w,2),Ml(),gu(w,2)}if(w=vu(a),w===null&&iu(e,t,a,Wl,i),w===g)break;g=w}g!==null&&a.stopPropagation()}else iu(e,t,a,null,i)}}function vu(e){return e=vt(e),yu(e)}var Wl=null;function yu(e){if(Wl=null,e=tn(e),e!==null){var t=v(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=l(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 Wl=e,null}function nm(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(Bt()){case fe:return 2;case Se:return 8;case pe:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var Su=!1,Ki=null,Yi=null,Xi=null,_a=new Map,va=new Map,Qi=[],e1="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 im(e,t){switch(e){case"focusin":case"focusout":Ki=null;break;case"dragenter":case"dragleave":Yi=null;break;case"mouseover":case"mouseout":Xi=null;break;case"pointerover":case"pointerout":_a.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":va.delete(t.pointerId)}}function ya(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=Wn(t),t!==null&&em(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,g!==null&&t.indexOf(g)===-1&&t.push(g),e)}function t1(e,t,i,a,g){switch(t){case"focusin":return Ki=ya(Ki,e,t,i,a,g),!0;case"dragenter":return Yi=ya(Yi,e,t,i,a,g),!0;case"mouseover":return Xi=ya(Xi,e,t,i,a,g),!0;case"pointerover":var w=g.pointerId;return _a.set(w,ya(_a.get(w)||null,e,t,i,a,g)),!0;case"gotpointercapture":return w=g.pointerId,va.set(w,ya(va.get(w)||null,e,t,i,a,g)),!0}return!1}function rm(e){var t=tn(e.target);if(t!==null){var i=v(t);if(i!==null){if(t=i.tag,t===13){if(t=f(i),t!==null){e.blockedOn=t,ct(e.priority,function(){tm(i)});return}}else if(t===31){if(t=l(i),t!==null){e.blockedOn=t,ct(e.priority,function(){tm(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 Kl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=vu(e.nativeEvent);if(i===null){i=e.nativeEvent;var a=new i.constructor(i.type,i);ht=a,i.target.dispatchEvent(a),ht=null}else return t=Wn(i),t!==null&&em(t),e.blockedOn=i,!1;t.shift()}return!0}function sm(e,t,i){Kl(e)&&i.delete(t)}function n1(){Su=!1,Ki!==null&&Kl(Ki)&&(Ki=null),Yi!==null&&Kl(Yi)&&(Yi=null),Xi!==null&&Kl(Xi)&&(Xi=null),_a.forEach(sm),va.forEach(sm)}function Yl(e,t){e.blockedOn===t&&(e.blockedOn=null,Su||(Su=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,n1)))}var Xl=null;function am(e){Xl!==e&&(Xl=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Xl===e&&(Xl=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(yu(a||i)===null)continue;break}var w=Wn(i);w!==null&&(e.splice(t,3),t-=3,vc(w,{pending:!0,data:g,method:i.method,action:a},a,g))}}))}function ps(e){function t(Q){return Yl(Q,e)}Ki!==null&&Yl(Ki,e),Yi!==null&&Yl(Yi,e),Xi!==null&&Yl(Xi,e),_a.forEach(t),va.forEach(t);for(var i=0;i<Qi.length;i++){var a=Qi[i];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Qi.length&&(i=Qi[0],i.blockedOn===null);)rm(i),i.blockedOn===null&&Qi.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],O=g[At]||null;if(typeof w=="function")O||am(i);else if(O){var P=null;if(w&&w.hasAttribute("formAction")){if(g=w,O=w[At]||null)P=O.formAction;else if(yu(g)!==null)continue}else P=O.action;typeof P=="function"?i[a+1]=P:(i.splice(a,3),a-=3),am(i)}}}function lm(){function e(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(O){return g=O})},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 bu(e){this._internalRoot=e}Ql.prototype.render=bu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var i=t.current,a=bn();Zp(i,a,e,t,null,null)},Ql.prototype.unmount=bu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Zp(e.current,2,null,e,null,null),Ml(),t[En]=null}};function Ql(e){this._internalRoot=e}Ql.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ts();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Qi.length&&t!==0&&t<Qi[i].priority;i++);Qi.splice(i,0,e),i===0&&rm(e)}};var om=r.version;if(om!=="19.2.6")throw Error(o(527,om,"19.2.6"));Y.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(t),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var i1={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zl.isDisabled&&Zl.supportsFiber)try{Je=Zl.inject(i1),at=Zl}catch{}}return ba.createRoot=function(e,t){if(!d(e))throw Error(o(299));var i=!1,a="",g=md,w=gd,O=_d;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&&(O=t.onRecoverableError)),t=Xp(e,1,!1,null,null,i,a,null,g,w,O,lm),e[En]=t.current,nu(e),new bu(t)},ba.hydrateRoot=function(e,t,i){if(!d(e))throw Error(o(299));var a=!1,g="",w=md,O=gd,P=_d,Q=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&&(O=i.onCaughtError),i.onRecoverableError!==void 0&&(P=i.onRecoverableError),i.formState!==void 0&&(Q=i.formState)),t=Xp(e,1,!0,t,i??null,a,g,Q,w,O,P,lm),t.context=Qp(null),i=t.current,a=bn(),a=ni(a),g=Ni(a),g.callback=null,Hi(i,g,a),i=a,t.current.lanes=i,lr(t,i),Zn(t),e[En]=t.current,nu(e),new Ql(t)},ba.version="19.2.6",ba}var ym;function m1(){if(ym)return xu.exports;ym=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(),xu.exports=p1(),xu.exports}var g1=m1();const Cs=function(n,r){let d=n;const v=Aa[r];let f=null,l=0,c=null;const h=[],p={},u=function(D,E){l=d*4+17,f=(function(L){const B=new Array(L);for(let I=0;I<L;I+=1){B[I]=new Array(L);for(let F=0;F<L;F+=1)B[I][F]=null}return B})(l),b(0,0),b(l-7,0),b(0,l-7),x(),T(),y(D,E),d>=7&&_(D),c==null&&(c=A(d,v,h)),m(c,E)},b=function(D,E){for(let L=-1;L<=7;L+=1)if(!(D+L<=-1||l<=D+L))for(let B=-1;B<=7;B+=1)E+B<=-1||l<=E+B||(0<=L&&L<=6&&(B==0||B==6)||0<=B&&B<=6&&(L==0||L==6)||2<=L&&L<=4&&2<=B&&B<=4?f[D+L][E+B]=!0:f[D+L][E+B]=!1)},C=function(){let D=0,E=0;for(let L=0;L<8;L+=1){u(!0,L);const B=er.getLostPoint(p);(L==0||D>B)&&(D=B,E=L)}return E},T=function(){for(let D=8;D<l-8;D+=1)f[D][6]==null&&(f[D][6]=D%2==0);for(let D=8;D<l-8;D+=1)f[6][D]==null&&(f[6][D]=D%2==0)},x=function(){const D=er.getPatternPosition(d);for(let E=0;E<D.length;E+=1)for(let L=0;L<D.length;L+=1){const B=D[E],I=D[L];if(f[B][I]==null)for(let F=-2;F<=2;F+=1)for(let U=-2;U<=2;U+=1)F==-2||F==2||U==-2||U==2||F==0&&U==0?f[B+F][I+U]=!0:f[B+F][I+U]=!1}},_=function(D){const E=er.getBCHTypeNumber(d);for(let L=0;L<18;L+=1){const B=!D&&(E>>L&1)==1;f[Math.floor(L/3)][L%3+l-8-3]=B}for(let L=0;L<18;L+=1){const B=!D&&(E>>L&1)==1;f[L%3+l-8-3][Math.floor(L/3)]=B}},y=function(D,E){const L=v<<3|E,B=er.getBCHTypeInfo(L);for(let I=0;I<15;I+=1){const F=!D&&(B>>I&1)==1;I<6?f[I][8]=F:I<8?f[I+1][8]=F:f[l-15+I][8]=F}for(let I=0;I<15;I+=1){const F=!D&&(B>>I&1)==1;I<8?f[8][l-I-1]=F:I<9?f[8][15-I-1+1]=F:f[8][15-I-1]=F}f[l-8][8]=!D},m=function(D,E){let L=-1,B=l-1,I=7,F=0;const U=er.getMaskFunction(E);for(let W=l-1;W>0;W-=2)for(W==6&&(W-=1);;){for(let X=0;X<2;X+=1)if(f[B][W-X]==null){let V=!1;F<D.length&&(V=(D[F]>>>I&1)==1),U(B,W-X)&&(V=!V),f[B][W-X]=V,I-=1,I==-1&&(F+=1,I=7)}if(B+=L,B<0||l<=B){B-=L,L=-L;break}}},S=function(D,E){let L=0,B=0,I=0;const F=new Array(E.length),U=new Array(E.length);for(let Y=0;Y<E.length;Y+=1){const J=E[Y].dataCount,z=E[Y].totalCount-J;B=Math.max(B,J),I=Math.max(I,z),F[Y]=new Array(J);for(let N=0;N<F[Y].length;N+=1)F[Y][N]=255&D.getBuffer()[N+L];L+=J;const j=er.getErrorCorrectPolynomial(z),G=Ma(F[Y],j.getLength()-1).mod(j);U[Y]=new Array(j.getLength()-1);for(let N=0;N<U[Y].length;N+=1){const ie=N+G.getLength()-U[Y].length;U[Y][N]=ie>=0?G.getAt(ie):0}}let W=0;for(let Y=0;Y<E.length;Y+=1)W+=E[Y].totalCount;const X=new Array(W);let V=0;for(let Y=0;Y<B;Y+=1)for(let J=0;J<E.length;J+=1)Y<F[J].length&&(X[V]=F[J][Y],V+=1);for(let Y=0;Y<I;Y+=1)for(let J=0;J<E.length;J+=1)Y<U[J].length&&(X[V]=U[J][Y],V+=1);return X},A=function(D,E,L){const B=Sm.getRSBlocks(D,E),I=bm();for(let U=0;U<L.length;U+=1){const W=L[U];I.put(W.getMode(),4),I.put(W.getLength(),er.getLengthInBits(W.getMode(),D)),W.write(I)}let F=0;for(let U=0;U<B.length;U+=1)F+=B[U].dataCount;if(I.getLengthInBits()>F*8)throw"code length overflow. ("+I.getLengthInBits()+">"+F*8+")";for(I.getLengthInBits()+4<=F*8&&I.put(0,4);I.getLengthInBits()%8!=0;)I.putBit(!1);for(;!(I.getLengthInBits()>=F*8||(I.put(236,8),I.getLengthInBits()>=F*8));)I.put(17,8);return S(I,B)};p.addData=function(D,E){E=E||"Byte";let L=null;switch(E){case"Numeric":L=_1(D);break;case"Alphanumeric":L=v1(D);break;case"Byte":L=y1(D);break;case"Kanji":L=S1(D);break;default:throw"mode:"+E}h.push(L),c=null},p.isDark=function(D,E){if(D<0||l<=D||E<0||l<=E)throw D+","+E;return f[D][E]},p.getModuleCount=function(){return l},p.make=function(){if(d<1){let D=1;for(;D<40;D++){const E=Sm.getRSBlocks(D,v),L=bm();for(let I=0;I<h.length;I++){const F=h[I];L.put(F.getMode(),4),L.put(F.getLength(),er.getLengthInBits(F.getMode(),D)),F.write(L)}let B=0;for(let I=0;I<E.length;I++)B+=E[I].dataCount;if(L.getLengthInBits()<=B*8)break}d=D}u(!1,C())},p.createTableTag=function(D,E){D=D||2,E=typeof E>"u"?D*4:E;let L="";L+='<table style="',L+=" border-width: 0px; border-style: none;",L+=" border-collapse: collapse;",L+=" padding: 0px; margin: "+E+"px;",L+='">',L+="<tbody>";for(let B=0;B<p.getModuleCount();B+=1){L+="<tr>";for(let I=0;I<p.getModuleCount();I+=1)L+='<td style="',L+=" border-width: 0px; border-style: none;",L+=" border-collapse: collapse;",L+=" padding: 0px; margin: 0px;",L+=" width: "+D+"px;",L+=" height: "+D+"px;",L+=" background-color: ",L+=p.isDark(B,I)?"#000000":"#ffffff",L+=";",L+='"/>';L+="</tr>"}return L+="</tbody>",L+="</table>",L},p.createSvgTag=function(D,E,L,B){let I={};typeof arguments[0]=="object"&&(I=arguments[0],D=I.cellSize,E=I.margin,L=I.alt,B=I.title),D=D||2,E=typeof E>"u"?D*4:E,L=typeof L=="string"?{text:L}:L||{},L.text=L.text||null,L.id=L.text?L.id||"qrcode-description":null,B=typeof B=="string"?{text:B}:B||{},B.text=B.text||null,B.id=B.text?B.id||"qrcode-title":null;const F=p.getModuleCount()*D+E*2;let U,W,X,V,Y="",J;for(J="l"+D+",0 0,"+D+" -"+D+",0 0,-"+D+"z ",Y+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',Y+=I.scalable?"":' width="'+F+'px" height="'+F+'px"',Y+=' viewBox="0 0 '+F+" "+F+'" ',Y+=' preserveAspectRatio="xMinYMin meet"',Y+=B.text||L.text?' role="img" aria-labelledby="'+M([B.id,L.id].join(" ").trim())+'"':"",Y+=">",Y+=B.text?'<title id="'+M(B.id)+'">'+M(B.text)+"</title>":"",Y+=L.text?'<description id="'+M(L.id)+'">'+M(L.text)+"</description>":"",Y+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',Y+='<path d="',X=0;X<p.getModuleCount();X+=1)for(V=X*D+E,U=0;U<p.getModuleCount();U+=1)p.isDark(X,U)&&(W=U*D+E,Y+="M"+W+","+V+J);return Y+='" stroke="transparent" fill="black"/>',Y+="</svg>",Y},p.createDataURL=function(D,E){D=D||2,E=typeof E>"u"?D*4:E;const L=p.getModuleCount()*D+E*2,B=E,I=L-E;return x1(L,L,function(F,U){if(B<=F&&F<I&&B<=U&&U<I){const W=Math.floor((F-B)/D),X=Math.floor((U-B)/D);return p.isDark(X,W)?0:1}else return 1})},p.createImgTag=function(D,E,L){D=D||2,E=typeof E>"u"?D*4:E;const B=p.getModuleCount()*D+E*2;let I="";return I+="<img",I+=' src="',I+=p.createDataURL(D,E),I+='"',I+=' width="',I+=B,I+='"',I+=' height="',I+=B,I+='"',L&&(I+=' alt="',I+=M(L),I+='"'),I+="/>",I};const M=function(D){let E="";for(let L=0;L<D.length;L+=1){const B=D.charAt(L);switch(B){case"<":E+="&lt;";break;case">":E+="&gt;";break;case"&":E+="&amp;";break;case'"':E+="&quot;";break;default:E+=B;break}}return E},R=function(D){D=typeof D>"u"?2:D;const L=p.getModuleCount()*1+D*2,B=D,I=L-D;let F,U,W,X,V;const Y={"██":"█","█ ":"▀"," █":"▄"," ":" "},J={"██":"▀","█ ":"▀"," █":" "," ":" "};let z="";for(F=0;F<L;F+=2){for(W=Math.floor((F-B)/1),X=Math.floor((F+1-B)/1),U=0;U<L;U+=1)V="█",B<=U&&U<I&&B<=F&&F<I&&p.isDark(W,Math.floor((U-B)/1))&&(V=" "),B<=U&&U<I&&B<=F+1&&F+1<I&&p.isDark(X,Math.floor((U-B)/1))?V+=" ":V+="█",z+=D<1&&F+1>=I?J[V]:Y[V];z+=`
50
+ `}return L%2&&D>0?z.substring(0,z.length-L-1)+Array(L+1).join("▀"):z.substring(0,z.length-1)};return p.createASCII=function(D,E){if(D=D||1,D<2)return R(E);D-=1,E=typeof E>"u"?D*2:E;const L=p.getModuleCount()*D+E*2,B=E,I=L-E;let F,U,W,X;const V=Array(D+1).join("██"),Y=Array(D+1).join(" ");let J="",z="";for(F=0;F<L;F+=1){for(W=Math.floor((F-B)/D),z="",U=0;U<L;U+=1)X=1,B<=U&&U<I&&B<=F&&F<I&&p.isDark(W,Math.floor((U-B)/D))&&(X=0),z+=X?V:Y;for(W=0;W<D;W+=1)J+=z+`
51
+ `}return J.substring(0,J.length-1)},p.renderTo2dContext=function(D,E){E=E||2;const L=p.getModuleCount();for(let B=0;B<L;B++)for(let I=0;I<L;I++)D.fillStyle=p.isDark(B,I)?"black":"white",D.fillRect(I*E,B*E,E,E)},p};Cs.stringToBytes=function(n){const r=[];for(let s=0;s<n.length;s+=1){const o=n.charCodeAt(s);r.push(o&255)}return r};Cs.createStringToBytes=function(n,r){const s=(function(){const d=C1(n),v=function(){const c=d.read();if(c==-1)throw"eof";return c};let f=0;const l={};for(;;){const c=d.read();if(c==-1)break;const h=v(),p=v(),u=v(),b=String.fromCharCode(c<<8|h),C=p<<8|u;l[b]=C,f+=1}if(f!=r)throw f+" != "+r;return l})(),o=63;return function(d){const v=[];for(let f=0;f<d.length;f+=1){const l=d.charCodeAt(f);if(l<128)v.push(l);else{const c=s[d.charAt(f)];typeof c=="number"?(c&255)==c?v.push(c):(v.push(c>>>8),v.push(c&255)):v.push(o)}}return v}};const Vt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Aa={L:1,M:0,Q:3,H:2},Ji={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},er=(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,o=21522,d={},v=function(f){let l=0;for(;f!=0;)l+=1,f>>>=1;return l};return d.getBCHTypeInfo=function(f){let l=f<<10;for(;v(l)-v(r)>=0;)l^=r<<v(l)-v(r);return(f<<10|l)^o},d.getBCHTypeNumber=function(f){let l=f<<12;for(;v(l)-v(s)>=0;)l^=s<<v(l)-v(s);return f<<12|l},d.getPatternPosition=function(f){return n[f-1]},d.getMaskFunction=function(f){switch(f){case Ji.PATTERN000:return function(l,c){return(l+c)%2==0};case Ji.PATTERN001:return function(l,c){return l%2==0};case Ji.PATTERN010:return function(l,c){return c%3==0};case Ji.PATTERN011:return function(l,c){return(l+c)%3==0};case Ji.PATTERN100:return function(l,c){return(Math.floor(l/2)+Math.floor(c/3))%2==0};case Ji.PATTERN101:return function(l,c){return l*c%2+l*c%3==0};case Ji.PATTERN110:return function(l,c){return(l*c%2+l*c%3)%2==0};case Ji.PATTERN111:return function(l,c){return(l*c%3+(l+c)%2)%2==0};default:throw"bad maskPattern:"+f}},d.getErrorCorrectPolynomial=function(f){let l=Ma([1],0);for(let c=0;c<f;c+=1)l=l.multiply(Ma([1,nr.gexp(c)],0));return l},d.getLengthInBits=function(f,l){if(1<=l&&l<10)switch(f){case Vt.MODE_NUMBER:return 10;case Vt.MODE_ALPHA_NUM:return 9;case Vt.MODE_8BIT_BYTE:return 8;case Vt.MODE_KANJI:return 8;default:throw"mode:"+f}else if(l<27)switch(f){case Vt.MODE_NUMBER:return 12;case Vt.MODE_ALPHA_NUM:return 11;case Vt.MODE_8BIT_BYTE:return 16;case Vt.MODE_KANJI:return 10;default:throw"mode:"+f}else if(l<41)switch(f){case Vt.MODE_NUMBER:return 14;case Vt.MODE_ALPHA_NUM:return 13;case Vt.MODE_8BIT_BYTE:return 16;case Vt.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+l},d.getLostPoint=function(f){const l=f.getModuleCount();let c=0;for(let u=0;u<l;u+=1)for(let b=0;b<l;b+=1){let C=0;const T=f.isDark(u,b);for(let x=-1;x<=1;x+=1)if(!(u+x<0||l<=u+x))for(let _=-1;_<=1;_+=1)b+_<0||l<=b+_||x==0&&_==0||T==f.isDark(u+x,b+_)&&(C+=1);C>5&&(c+=3+C-5)}for(let u=0;u<l-1;u+=1)for(let b=0;b<l-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<l;u+=1)for(let b=0;b<l-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<l;u+=1)for(let b=0;b<l-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<l;u+=1)for(let b=0;b<l;b+=1)f.isDark(b,u)&&(h+=1);const p=Math.abs(100*h/l/l-50)/5;return c+=p*10,c},d})(),nr=(function(){const n=new Array(256),r=new Array(256);for(let o=0;o<8;o+=1)n[o]=1<<o;for(let o=8;o<256;o+=1)n[o]=n[o-4]^n[o-5]^n[o-6]^n[o-8];for(let o=0;o<255;o+=1)r[n[o]]=o;const s={};return s.glog=function(o){if(o<1)throw"glog("+o+")";return r[o]},s.gexp=function(o){for(;o<0;)o+=255;for(;o>=256;)o-=255;return n[o]},s})(),Ma=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 v=new Array(n.length-d+r);for(let f=0;f<n.length-d;f+=1)v[f]=n[f+d];return v})(),o={};return o.getAt=function(d){return s[d]},o.getLength=function(){return s.length},o.multiply=function(d){const v=new Array(o.getLength()+d.getLength()-1);for(let f=0;f<o.getLength();f+=1)for(let l=0;l<d.getLength();l+=1)v[f+l]^=nr.gexp(nr.glog(o.getAt(f))+nr.glog(d.getAt(l)));return Ma(v,0)},o.mod=function(d){if(o.getLength()-d.getLength()<0)return o;const v=nr.glog(o.getAt(0))-nr.glog(d.getAt(0)),f=new Array(o.getLength());for(let l=0;l<o.getLength();l+=1)f[l]=o.getAt(l);for(let l=0;l<d.getLength();l+=1)f[l]^=nr.gexp(nr.glog(d.getAt(l))+v);return Ma(f,0).mod(d)},o},Sm=(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,v){const f={};return f.totalCount=d,f.dataCount=v,f},s={},o=function(d,v){switch(v){case Aa.L:return n[(d-1)*4+0];case Aa.M:return n[(d-1)*4+1];case Aa.Q:return n[(d-1)*4+2];case Aa.H:return n[(d-1)*4+3];default:return}};return s.getRSBlocks=function(d,v){const f=o(d,v);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+v;const l=f.length/3,c=[];for(let h=0;h<l;h+=1){const p=f[h*3+0],u=f[h*3+1],b=f[h*3+2];for(let C=0;C<p;C+=1)c.push(r(u,b))}return c},s})(),bm=function(){const n=[];let r=0;const s={};return s.getBuffer=function(){return n},s.getAt=function(o){const d=Math.floor(o/8);return(n[d]>>>7-o%8&1)==1},s.put=function(o,d){for(let v=0;v<d;v+=1)s.putBit((o>>>d-v-1&1)==1)},s.getLengthInBits=function(){return r},s.putBit=function(o){const d=Math.floor(r/8);n.length<=d&&n.push(0),o&&(n[d]|=128>>>r%8),r+=1},s},_1=function(n){const r=Vt.MODE_NUMBER,s=n,o={};o.getMode=function(){return r},o.getLength=function(f){return s.length},o.write=function(f){const l=s;let c=0;for(;c+2<l.length;)f.put(d(l.substring(c,c+3)),10),c+=3;c<l.length&&(l.length-c==1?f.put(d(l.substring(c,c+1)),4):l.length-c==2&&f.put(d(l.substring(c,c+2)),7))};const d=function(f){let l=0;for(let c=0;c<f.length;c+=1)l=l*10+v(f.charAt(c));return l},v=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return o},v1=function(n){const r=Vt.MODE_ALPHA_NUM,s=n,o={};o.getMode=function(){return r},o.getLength=function(v){return s.length},o.write=function(v){const f=s;let l=0;for(;l+1<f.length;)v.put(d(f.charAt(l))*45+d(f.charAt(l+1)),11),l+=2;l<f.length&&v.put(d(f.charAt(l)),6)};const d=function(v){if("0"<=v&&v<="9")return v.charCodeAt(0)-48;if("A"<=v&&v<="Z")return v.charCodeAt(0)-65+10;switch(v){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 :"+v}};return o},y1=function(n){const r=Vt.MODE_8BIT_BYTE,s=Cs.stringToBytes(n),o={};return o.getMode=function(){return r},o.getLength=function(d){return s.length},o.write=function(d){for(let v=0;v<s.length;v+=1)d.put(s[v],8)},o},S1=function(n){const r=Vt.MODE_KANJI,s=Cs.stringToBytes;(function(v,f){const l=s(v);if(l.length!=2||(l[0]<<8|l[1])!=f)throw"sjis not supported."})("友",38726);const o=s(n),d={};return d.getMode=function(){return r},d.getLength=function(v){return~~(o.length/2)},d.write=function(v){const f=o;let l=0;for(;l+1<f.length;){let c=(255&f[l])<<8|255&f[l+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(l+1)+"/"+c;c=(c>>>8&255)*192+(c&255),v.put(c,13),l+=2}if(l<f.length)throw"illegal char at "+(l+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,o,d){o=o||0,d=d||s.length;for(let v=0;v<d;v+=1)r.writeByte(s[v+o])},r.writeString=function(s){for(let o=0;o<s.length;o+=1)r.writeByte(s.charCodeAt(o))},r.toByteArray=function(){return n},r.toString=function(){let s="";s+="[";for(let o=0;o<n.length;o+=1)o>0&&(s+=","),s+=n[o];return s+="]",s},r},b1=function(){let n=0,r=0,s=0,o="";const d={},v=function(l){o+=String.fromCharCode(f(l&63))},f=function(l){if(l<0)throw"n:"+l;if(l<26)return 65+l;if(l<52)return 97+(l-26);if(l<62)return 48+(l-52);if(l==62)return 43;if(l==63)return 47;throw"n:"+l};return d.writeByte=function(l){for(n=n<<8|l&255,r+=8,s+=1;r>=6;)v(n>>>r-6),r-=6},d.flush=function(){if(r>0&&(v(n<<6-r),n=0,r=0),s%3!=0){const l=3-s%3;for(let c=0;c<l;c+=1)o+="="}},d.toString=function(){return o},d},C1=function(n){const r=n;let s=0,o=0,d=0;const v={};v.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;o=o<<6|f(c.charCodeAt(0)),d+=6}const l=o>>>d-8&255;return d-=8,l};const f=function(l){if(65<=l&&l<=90)return l-65;if(97<=l&&l<=122)return l-97+26;if(48<=l&&l<=57)return l-48+52;if(l==43)return 62;if(l==47)return 63;throw"c:"+l};return v},w1=function(n,r){const s=n,o=r,d=new Array(n*r),v={};v.setPixel=function(h,p,u){d[p*s+h]=u},v.write=function(h){h.writeString("GIF87a"),h.writeShort(s),h.writeShort(o),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(o),h.writeByte(0);const p=2,u=l(p);h.writeByte(p);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 p=h;let u=0,b=0;const C={};return C.write=function(T,x){if(T>>>x)throw"length over";for(;u+x>=8;)p.writeByte(255&(T<<u|b)),x-=8-u,T>>>=8-u,b=0,u=0;b=T<<u|b,u=u+x},C.flush=function(){u>0&&p.writeByte(b)},C},l=function(h){const p=1<<h,u=(1<<h)+1;let b=h+1;const C=c();for(let m=0;m<p;m+=1)C.add(String.fromCharCode(m));C.add(String.fromCharCode(p)),C.add(String.fromCharCode(u));const T=jg(),x=f(T);x.write(p,b);let _=0,y=String.fromCharCode(d[_]);for(_+=1;_<d.length;){const m=String.fromCharCode(d[_]);_+=1,C.contains(y+m)?y=y+m:(x.write(C.indexOf(y),b),C.size()<4095&&(C.size()==1<<b&&(b+=1),C.add(y+m)),y=m)}return x.write(C.indexOf(y),b),x.write(u,b),x.flush(),T.toByteArray()},c=function(){const h={};let p=0;const u={};return u.add=function(b){if(u.contains(b))throw"dup key:"+b;h[b]=p,p+=1},u.size=function(){return p},u.indexOf=function(b){return h[b]},u.contains=function(b){return typeof h[b]<"u"},u};return v},x1=function(n,r,s){const o=w1(n,r);for(let l=0;l<r;l+=1)for(let c=0;c<n;c+=1)o.setPixel(c,l,s(c,l));const d=jg();o.write(d);const v=b1(),f=d.toByteArray();for(let l=0;l<f.length;l+=1)v.writeByte(f[l]);return v.flush(),"data:image/gif;base64,"+v};Cs.stringToBytes;const Ss=[{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}],Ng={name:"gate-reviewer",label:"Gate Reviewer",commandAgent:"gate-reviewer",dispatchable:!1},ws=[...Ss,Ng],E1={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},k1={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},Hg=[E1,k1],ch=[...ws,...Hg],A1=Ss.map(n=>n.name),zg=ws.map(n=>n.name);Hg.map(n=>n.name);ch.map(n=>n.name);ch.filter(n=>n.dispatchable).map(n=>n.name);function T1(n){return zg.includes(n)}const R1="zh-CN",D1="pm-final-only",Ig=[{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"}],M1=[{value:"pm-final-only",label:"PM final reply"},{value:"final-only",label:"Each role final reply"},{value:"all",label:"All replies"}];function L1(){const n={};for(const r of zg)n[r]={permissionMode:"bypassPermissions",model:"default",effort:"default"};return{version:1,roles:n,autoOrchestration:!0}}function O1({sidebar:n,children:r}){const[s,o]=ne.useState(!1);return k.jsxs("div",{className:s?"app-shell is-sidebar-collapsed":"app-shell",children:[k.jsxs("aside",{className:"app-sidebar",children:[k.jsx("button",{className:"sidebar-toggle",type:"button","aria-label":s?"Expand sidebar":"Collapse sidebar",title:s?"Expand sidebar":"Collapse sidebar",onClick:()=>o(d=>!d)}),k.jsx("div",{className:"sidebar-content",children:n})]}),k.jsx("main",{className:"app-main",children:r})]})}function B1({busy:n,state:r,onApprove:s,onComment:o,onReject:d,onRefresh:v}){var C;const[f,l]=ne.useState(!1),[c,h]=ne.useState("");if(!r||r.status==="idle")return null;const p=r.active,u=r.status==="awaiting_user_approval",b=(p==null?void 0:p.title)??((C=r.pending[0])==null?void 0:C.title)??"Harness feedback";return k.jsxs(k.Fragment,{children:[k.jsxs("section",{className:u?"harness-feedback-float needs-review":"harness-feedback-float",children:[k.jsxs("div",{children:[k.jsx("strong",{children:u?"Harness review needed":"Harness feedback"}),k.jsx("span",{children:j1(r)})]}),k.jsx("p",{title:b,children:b}),k.jsxs("div",{className:"harness-feedback-float-actions",children:[k.jsx("button",{type:"button",disabled:n,onClick:v,children:"Refresh"}),k.jsx("button",{type:"button",disabled:n||!p,onClick:()=>l(!0),children:u?"Review":"Open"})]})]}),f&&p?k.jsx("div",{className:"modal-backdrop harness-feedback-backdrop",children:k.jsxs("section",{className:"harness-feedback-modal",role:"dialog","aria-modal":"true","aria-label":"Harness feedback review",children:[k.jsxs("header",{children:[k.jsxs("div",{children:[k.jsx("h2",{children:"Harness Feedback"}),k.jsxs("p",{className:"muted",children:[r.status.replaceAll("_"," ")," · queued ",r.queuedCount]})]}),k.jsx("button",{type:"button",onClick:()=>l(!1),children:"Close"})]}),k.jsxs("div",{className:"harness-feedback-modal-body",children:[k.jsxs("section",{children:[k.jsx("h3",{children:"Feedback"}),k.jsx("pre",{children:p.feedbackContent||"No feedback content found."})]}),k.jsxs("section",{children:[k.jsx("h3",{children:"Harness Engineer Analysis"}),k.jsx("pre",{children:p.analysisContent||"Analysis is not available yet."})]})]}),u?k.jsxs("footer",{className:"harness-feedback-review-actions",children:[k.jsx("textarea",{value:c,placeholder:"Optional note for Harness Engineer...",onChange:T=>h(T.target.value)}),k.jsxs("div",{children:[k.jsx("button",{type:"button",disabled:n,onClick:()=>o(c),children:"Send Feedback"}),k.jsx("button",{type:"button",disabled:n,onClick:()=>d(c),children:"Reject"}),k.jsx("button",{type:"button",disabled:n,onClick:()=>s(c),children:"Approve"})]})]}):null]})}):null]})}function j1(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}const ye={getAppPreferences(){return Ae("/api/settings/preferences")},updateAppPreferences(n){return Ae("/api/settings/preferences",{method:"PUT",body:JSON.stringify(n)})},getRuntimeDiagnostics(){return Ae("/api/diagnostics/runtime")},getCurrentProject(){return Ae("/api/projects/current")},pullCurrentProject(){return Ae("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return Ae("/api/projects/recent")},connectProject(n){return Ae("/api/projects/connect",{method:"POST",body:JSON.stringify(n)})},listTasks(){return Ae("/api/tasks")},createTask(n){return Ae("/api/tasks",{method:"POST",body:JSON.stringify(n)})},cleanupTask(n,r={}){return Ae(`/api/tasks/${encodeURIComponent(n)}/cleanup`,{method:"POST",body:JSON.stringify(r)})},getHarnessStatus(n){const r=new URLSearchParams({taskSlug:n});return Ae(`/api/projects/harness?${r.toString()}`)},applyHarness(n){return Ae("/api/projects/harness/apply",{method:"POST",body:JSON.stringify(n)})},getHarnessFileContent(n,r){const s=new URLSearchParams({path:r,taskSlug:n});return Ae(`/api/projects/harness/file?${s.toString()}`)},updateHarnessFileContent(n,r,s){const o=new URLSearchParams({path:r,taskSlug:n});return Ae(`/api/projects/harness/file?${o.toString()}`,{method:"PUT",body:JSON.stringify(s)})},getRepositoryDiff(n,r){const s=new URLSearchParams({taskSlug:n});return r&&s.set("commit",r),Ae(`/api/projects/harness/repository-diff?${s.toString()}`)},getHarnessBootstrapStatus(n){const r=new URLSearchParams({taskSlug:n});return Ae(`/api/projects/harness/bootstrap?${r.toString()}`)},startHarnessBootstrap(n={}){return Ae("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(n)})},restartHarnessBootstrap(n={}){return Ae("/api/projects/harness/bootstrap/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessBootstrap(){return Ae("/api/projects/harness/bootstrap/stop",{method:"POST"})},runHarnessBootstrap(n){return Ae("/api/projects/harness/bootstrap/run",{method:"POST",body:JSON.stringify(n)})},getHarnessEngineerSession(){return Ae("/api/projects/harness/engineer/session")},ensureHarnessEngineerSession(n={}){return Ae("/api/projects/harness/engineer/session/ensure",{method:"POST",body:JSON.stringify(n)})},startHarnessEngineerSession(n={}){return Ae("/api/projects/harness/engineer/session/start",{method:"POST",body:JSON.stringify(n)})},resumeHarnessEngineerSession(n={}){return Ae("/api/projects/harness/engineer/session/resume",{method:"POST",body:JSON.stringify(n)})},restartHarnessEngineerSession(n={}){return Ae("/api/projects/harness/engineer/session/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessEngineerSession(){return Ae("/api/projects/harness/engineer/session/stop",{method:"POST"})},notifyHarnessEngineerHarnessUpdated(){return Ae("/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 Ae(`/api/projects/harness/feedback${s?`?${s}`:""}`)},decideHarnessFeedback(n){return Ae("/api/projects/harness/feedback/decision",{method:"POST",body:JSON.stringify(n)})},getTaskStatus(n){return Ae(`/api/tasks/${encodeURIComponent(n)}/status`)},listSessions(n){return Ae(`/api/tasks/${encodeURIComponent(n)}/sessions`)},startRoleSession(n,r,s={}){return Ae(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(n,r){return Ae(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(n,r,s={}){return Ae(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(n,r,s={}){return Ae(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},notifyRoleHarnessUpdated(n,r){return Ae(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/notify-harness`,{method:"POST"})},dispatchRoleCommand(n,r){return Ae(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(n){return Ae(`/api/tasks/${encodeURIComponent(n)}/messages`)},markAllMessagesDone(n){return Ae(`/api/tasks/${encodeURIComponent(n)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(n){return Ae(`/api/tasks/${encodeURIComponent(n)}/messages/history`,{method:"DELETE"})},getOrchestrationState(n){return Ae(`/api/tasks/${encodeURIComponent(n)}/orchestration`)},updateOrchestrationState(n,r){return Ae(`/api/tasks/${encodeURIComponent(n)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(n){return Ae(`/api/tasks/${encodeURIComponent(n)}/round`)},getGateReviewState(n){return Ae(`/api/tasks/${encodeURIComponent(n)}/gate-review`)},updateGateReviewSettings(n,r){return Ae(`/api/tasks/${encodeURIComponent(n)}/gate-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestGateReviewGate(n,r){return Ae(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/request`,{method:"POST"})},retryGateReviewGate(n,r){return Ae(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/retry`,{method:"POST"})},skipGateReviewGate(n,r,s){return Ae(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideGateReviewGate(n,r,s){return Ae(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getGateReviewReport(n,r){return Ae(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/report`)},startTranslationSession(n,r){return Ae(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/start`,{method:"POST"})},pollTranslationSession(n,r,s){const o=new URLSearchParams({after:String(r)});return s!==void 0&&o.set("limit",String(s)),Ae(`/api/translation/sessions/${encodeURIComponent(n)}/events?${o.toString()}`)},translateUserInput(n,r,s){return Ae(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},sendTranslatedInput(n,r,s){return Ae(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(n){return Ae(`/api/translation/sessions/${encodeURIComponent(n)}/clear`,{method:"POST"})},stopTranslationSession(n){return Ae(`/api/translation/sessions/${encodeURIComponent(n)}/stop`,{method:"POST"})},notifyTranslatorHarnessUpdated(){return Ae("/api/projects/translation/session/notify-harness",{method:"POST"})},retryTranslation(n,r){return Ae(`/api/translation/sessions/${encodeURIComponent(n)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(n){return Ae(`/api/translation/sessions/${encodeURIComponent(n)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(n){return Ae(`/api/translation/sessions/${encodeURIComponent(n)}/failures/retry`,{method:"POST"})},getTranslationState(){return Ae("/api/translation/state")},getTranslatorSession(){return Ae("/api/translation/session")},ensureTranslatorSession(n={}){return Ae("/api/translation/session/ensure",{method:"POST",body:JSON.stringify(n)})},startTranslatorSession(n={}){return Ae("/api/translation/session/start",{method:"POST",body:JSON.stringify(n)})},resumeTranslatorSession(n={}){return Ae("/api/translation/session/resume",{method:"POST",body:JSON.stringify(n)})},restartTranslatorSession(n={}){return Ae("/api/translation/session/restart",{method:"POST",body:JSON.stringify(n)})},stopTranslatorSession(){return Ae("/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 Ae(`/api/translation/source-files${s}`)},createFileTranslation(n){return Ae("/api/translation/files",{method:"POST",body:JSON.stringify(n)})},readFileTranslation(n){return Ae(`/api/translation/files/${encodeURIComponent(n)}`)},createTranslationBootstrap(n){return Ae("/api/translation/bootstrap",{method:"POST",body:JSON.stringify(n)})},createTranslationMemoryUpdate(n){return Ae("/api/translation/memory-update",{method:"POST",body:JSON.stringify(n)})},promoteTranslation(n,r){return Ae(`/api/translation/files/${encodeURIComponent(n)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return Ae("/api/gateway/status")},updateGatewaySettings(n){return Ae("/api/gateway/settings",{method:"PUT",body:JSON.stringify(n)})},startGatewayQrLogin(){return Ae("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(n={}){return Ae("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(n)})},resetGatewayBinding(){return Ae("/api/gateway/binding/reset",{method:"POST"})}};async function Ae(n,r={}){var d,v,f;const s=new Headers(r.headers);r.body!==void 0&&r.body!==null&&!s.has("content-type")&&s.set("content-type","application/json");const o=await fetch(n,{...r,headers:s});if(!o.ok){const l=await o.json().catch(()=>null),c=(d=l==null?void 0:l.error)!=null&&d.hint?`${l.error.message} ${l.error.hint}`:((v=l==null?void 0:l.error)==null?void 0:v.message)??`Request failed: ${o.status}`,h=(f=l==null?void 0:l.error)==null?void 0:f.runtime,p=h?` [backend ${h.version??"unknown"} pid=${h.pid??"unknown"} cwd=${h.cwd??"unknown"}]`:"";throw new Error(`${c}${p}`)}return o.json()}var Tu={exports:{}},Cm;function N1(){return Cm||(Cm=1,(function(n,r){(function(s,o){n.exports=o()})(self,(()=>(()=>{var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.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 v=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(v._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,v=d._renderService.dimensions;if(v.css.cell.width===0||v.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),h=Math.max(0,parseInt(l.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),u=c-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),b=h-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(b/v.css.cell.width)),rows:Math.max(1,Math.floor(u/v.css.cell.height))}}}})(),s})()))})(Tu)),Tu.exports}var H1=N1(),Ru={exports:{}},wm;function z1(){return wm||(wm=1,(function(n,r){(function(s,o){n.exports=o()})(self,(()=>(()=>{var s={6:(f,l)=>{function c(p){try{const u=new URL(p),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 p.toLocaleLowerCase().startsWith(b.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(p,u,b,C={}){this._terminal=p,this._regex=u,this._handler=b,this._options=C}provideLinks(p,u){const b=h.computeLink(p,this._regex,this._terminal,this._handler);u(this._addCallbacks(b))}_addCallbacks(p){return p.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 x=new RegExp(b.source,(b.flags||"")+"g"),[_,y]=h._getWindowedLineStrings(u-1,C),m=_.join("");let S;const A=[];for(;S=x.exec(m);){const M=S[0];if(!c(M))continue;const[R,D]=h._mapStrIdx(C,y,0,S.index),[E,L]=h._mapStrIdx(C,R,D,M.length);if(R===-1||D===-1||E===-1||L===-1)continue;const B={start:{x:D+1,y:R+1},end:{x:L,y:E+1}};A.push({range:B,text:M,activate:T})}return A}static _getWindowedLineStrings(u,b){let C,T=u,x=u,_=0,y="";const m=[];if(C=b.buffer.active.getLine(u)){const S=C.translateToString(!0);if(C.isWrapped&&S[0]!==" "){for(_=0;(C=b.buffer.active.getLine(--T))&&_<2048&&(y=C.translateToString(!0),_+=y.length,m.push(y),C.isWrapped&&y.indexOf(" ")===-1););m.reverse()}for(m.push(S),_=0;(C=b.buffer.active.getLine(++x))&&C.isWrapped&&_<2048&&(y=C.translateToString(!0),_+=y.length,m.push(y),y.indexOf(" ")===-1););}return[m,T]}static _mapStrIdx(u,b,C,T){const x=u.buffer.active,_=x.getNullCell();let y=C;for(;T;){const m=x.getLine(b);if(!m)return[-1,-1];for(let S=y;S<m.length;++S){m.getCell(S,_);const A=_.getChars();if(_.getWidth()&&(T-=A.length||1,S===m.length-1&&A==="")){const M=x.getLine(b+1);M&&M.isWrapped&&(M.getCell(0,_),_.getWidth()===2&&(T+=1))}if(T<0)return[b,S]}b++,y=0}return[b,y]}}l.LinkComputer=h}},o={};function d(f){var l=o[f];if(l!==void 0)return l.exports;var c=o[f]={exports:{}};return s[f](c,c.exports,d),c.exports}var v={};return(()=>{var f=v;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const l=d(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(p,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(p=h,u={}){this._handler=p,this._options=u}activate(p){this._terminal=p;const u=this._options,b=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,b,this._handler,u))}dispose(){var p;(p=this._linkProvider)==null||p.dispose()}}})(),v})()))})(Ru)),Ru.exports}var I1=z1(),Du={exports:{}},xm;function P1(){return xm||(xm=1,(function(n,r){(function(s,o){n.exports=o()})(globalThis,(()=>(()=>{var s={4567:function(f,l,c){var h=this&&this.__decorate||function(m,S,A,M){var R,D=arguments.length,E=D<3?S:M===null?M=Object.getOwnPropertyDescriptor(S,A):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,S,A,M);else for(var L=m.length-1;L>=0;L--)(R=m[L])&&(E=(D<3?R(E):D>3?R(S,A,E):R(S,A))||E);return D>3&&E&&Object.defineProperty(S,A,E),E},p=this&&this.__param||function(m,S){return function(A,M){S(A,M,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const u=c(9042),b=c(9924),C=c(844),T=c(4725),x=c(2585),_=c(3656);let y=l.AccessibilityManager=class extends C.Disposable{constructor(m,S,A,M){super(),this._terminal=m,this._coreBrowserService=A,this._renderService=M,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new 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((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
52
+ `)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,_.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(m){for(let S=0;S<m;S++)this._handleChar(" ")}_handleChar(m){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==m&&(this._charsToAnnounce+=m):this._charsToAnnounce+=m,m===`
53
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(m){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(m)||this._charsToConsume.push(m)}_refreshRows(m,S){this._liveRegionDebouncer.refresh(m,S,this._terminal.rows)}_renderRows(m,S){const A=this._terminal.buffer,M=A.lines.length.toString();for(let R=m;R<=S;R++){const D=A.lines.get(A.ydisp+R),E=[],L=(D==null?void 0:D.translateToString(!0,void 0,void 0,E))||"",B=(A.ydisp+R+1).toString(),I=this._rowElements[R];I&&(L.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=L,this._rowColumns.set(I,E)),I.setAttribute("aria-posinset",B),I.setAttribute("aria-setsize",M))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(m,S){const A=m.target,M=this._rowElements[S===0?1:this._rowElements.length-2];if(A.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||m.relatedTarget!==M)return;let R,D;if(S===0?(R=A,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(R=this._rowElements.shift(),D=A,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),S===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(S===0?-1:1),this._rowElements[S===0?1:this._rowElements.length-2].focus(),m.preventDefault(),m.stopImmediatePropagation()}_handleSelectionChange(){var L;if(this._rowElements.length===0)return;const m=document.getSelection();if(!m)return;if(m.isCollapsed)return void(this._rowContainer.contains(m.anchorNode)&&this._terminal.clearSelection());if(!m.anchorNode||!m.focusNode)return void console.error("anchorNode and/or focusNode are null");let S={node:m.anchorNode,offset:m.anchorOffset},A={node:m.focusNode,offset:m.focusOffset};if((S.node.compareDocumentPosition(A.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===A.node&&S.offset>A.offset)&&([S,A]=[A,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.node))return;const M=this._rowElements.slice(-1)[0];if(A.node.compareDocumentPosition(M)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(A={node:M,offset:((L=M.textContent)==null?void 0:L.length)??0}),!this._rowContainer.contains(A.node))return;const R=({node:B,offset:I})=>{const F=B instanceof Text?B.parentNode:B;let U=parseInt(F==null?void 0:F.getAttribute("aria-posinset"),10)-1;if(isNaN(U))return console.warn("row is invalid. Race condition?"),null;const W=this._rowColumns.get(F);if(!W)return console.warn("columns is null. Race condition?"),null;let X=I<W.length?W[I]:W.slice(-1)[0]+1;return X>=this._terminal.cols&&(++U,X=0),{row:U,column:X}},D=R(S),E=R(A);if(D&&E){if(D.row>E.row||D.row===E.row&&D.column>=E.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(E.row-D.row)*this._terminal.cols-D.column+E.column)}}_handleResize(m){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let S=this._rowContainer.children.length;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);for(;this._rowElements.length>m;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const m=this._coreBrowserService.mainDocument.createElement("div");return m.setAttribute("role","listitem"),m.tabIndex=-1,this._refreshRowDimensions(m),m}_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 m=0;m<this._terminal.rows;m++)this._refreshRowDimensions(this._rowElements[m])}}_refreshRowDimensions(m){m.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=y=h([p(1,x.IInstantiationService),p(2,T.ICoreBrowserService),p(3,T.IRenderService)],y)},3614:(f,l)=>{function c(b){return b.replace(/\r?\n/g,"\r")}function h(b,C){return C?"\x1B[200~"+b+"\x1B[201~":b}function p(b,C,T,x){b=h(b=c(b),T.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),T.triggerDataEvent(b,!0),C.value=""}function u(b,C,T){const x=T.getBoundingClientRect(),_=b.clientX-x.left-10,y=b.clientY-x.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${_}px`,C.style.top=`${y}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=c,l.bracketTextForPaste=h,l.copyHandler=function(b,C){b.clipboardData&&b.clipboardData.setData("text/plain",C.selectionText),b.preventDefault()},l.handlePasteEvent=function(b,C,T,x){b.stopPropagation(),b.clipboardData&&p(b.clipboardData.getData("text/plain"),C,T,x)},l.paste=p,l.moveTextAreaUnderMouseCursor=u,l.rightClickHandler=function(b,C,T,x,_){u(b,C,T),_&&x.rightClickSelect(b),C.value=x.selectionText,C.select()}},7239:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const h=c(1505);l.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(p,u,b){this._css.set(p,u,b)}getCss(p,u){return this._css.get(p,u)}setColor(p,u,b){this._color.set(p,u,b)}getColor(p,u){return this._color.get(p,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(c,h,p,u){c.addEventListener(h,p,u);let b=!1;return{dispose:()=>{b||(b=!0,c.removeEventListener(h,p,u))}}}},3551:function(f,l,c){var h=this&&this.__decorate||function(y,m,S,A){var M,R=arguments.length,D=R<3?m:A===null?A=Object.getOwnPropertyDescriptor(m,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,m,S,A);else for(var E=y.length-1;E>=0;E--)(M=y[E])&&(D=(R<3?M(D):R>3?M(m,S,D):M(m,S))||D);return R>3&&D&&Object.defineProperty(m,S,D),D},p=this&&this.__param||function(y,m){return function(S,A){m(S,A,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const u=c(3656),b=c(8460),C=c(844),T=c(2585),x=c(4725);let _=l.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(y,m,S,A,M){super(),this._element=y,this._mouseService=m,this._renderService=S,this._bufferService=A,this._linkProviderService=M,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 R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.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(y){this._lastMouseEvent=y;const m=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!m)return;this._isMouseOut=!1;const S=y.composedPath();for(let A=0;A<S.length;A++){const M=S[A];if(M.classList.contains("xterm"))break;if(M.classList.contains("xterm-hover"))return}this._lastBufferCell&&m.x===this._lastBufferCell.x&&m.y===this._lastBufferCell.y||(this._handleHover(m),this._lastBufferCell=m)}_handleHover(y){if(this._activeLine!==y.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(y,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,y)||(this._clearCurrentLink(),this._askForLink(y,!0))}_askForLink(y,m){var A,M;this._activeProviderReplies&&m||((A=this._activeProviderReplies)==null||A.forEach((R=>{R==null||R.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let S=!1;for(const[R,D]of this._linkProviderService.linkProviders.entries())m?(M=this._activeProviderReplies)!=null&&M.get(R)&&(S=this._checkLinkProviderResult(R,y,S)):D.provideLinks(y.y,(E=>{var B,I;if(this._isMouseOut)return;const L=E==null?void 0:E.map((F=>({link:F})));(B=this._activeProviderReplies)==null||B.set(R,L),S=this._checkLinkProviderResult(R,y,S),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,m){const S=new Set;for(let A=0;A<m.size;A++){const M=m.get(A);if(M)for(let R=0;R<M.length;R++){const D=M[R],E=D.link.range.start.y<y?0:D.link.range.start.x,L=D.link.range.end.y>y?this._bufferService.cols:D.link.range.end.x;for(let B=E;B<=L;B++){if(S.has(B)){M.splice(R--,1);break}S.add(B)}}}}_checkLinkProviderResult(y,m,S){var R;if(!this._activeProviderReplies)return S;const A=this._activeProviderReplies.get(y);let M=!1;for(let D=0;D<y;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(M=!0);if(!M&&A){const D=A.find((E=>this._linkAtPosition(E.link,m)));D&&(S=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!S)for(let D=0;D<this._activeProviderReplies.size;D++){const E=(R=this._activeProviderReplies.get(D))==null?void 0:R.find((L=>this._linkAtPosition(L.link,m)));if(E){S=!0,this._handleNewLink(E);break}}return S}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const m=this._positionFromMouseEvent(y,this._element,this._mouseService);m&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,m)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,m){this._currentLink&&this._lastMouseEvent&&(!y||!m||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=m)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const m=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);m&&this._linkAtPosition(y.link,m)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.link.decorations,{pointerCursor:{get:()=>{var S,A;return(A=(S=this._currentLink)==null?void 0:S.state)==null?void 0:A.decorations.pointerCursor},set:S=>{var A;(A=this._currentLink)!=null&&A.state&&this._currentLink.state.decorations.pointerCursor!==S&&(this._currentLink.state.decorations.pointerCursor=S,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",S))}},underline:{get:()=>{var S,A;return(A=(S=this._currentLink)==null?void 0:S.state)==null?void 0:A.decorations.underline},set:S=>{var A,M,R;(A=this._currentLink)!=null&&A.state&&((R=(M=this._currentLink)==null?void 0:M.state)==null?void 0:R.decorations.underline)!==S&&(this._currentLink.state.decorations.underline=S,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,S))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((S=>{if(!this._currentLink)return;const A=S.start===0?0:S.start+1+this._bufferService.buffer.ydisp,M=this._bufferService.buffer.ydisp+1+S.end;if(this._currentLink.link.range.start.y>=A&&this._currentLink.link.range.end.y<=M&&(this._clearCurrentLink(A,M),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(y,m,S){var A;(A=this._currentLink)!=null&&A.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!0),this._currentLink.state.decorations.pointerCursor&&y.classList.add("xterm-cursor-pointer")),m.hover&&m.hover(S,m.text)}_fireUnderlineEvent(y,m){const S=y.range,A=this._bufferService.buffer.ydisp,M=this._createLinkUnderlineEvent(S.start.x-1,S.start.y-A-1,S.end.x,S.end.y-A-1,void 0);(m?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(M)}_linkLeave(y,m,S){var A;(A=this._currentLink)!=null&&A.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!1),this._currentLink.state.decorations.pointerCursor&&y.classList.remove("xterm-cursor-pointer")),m.leave&&m.leave(S,m.text)}_linkAtPosition(y,m){const S=y.range.start.y*this._bufferService.cols+y.range.start.x,A=y.range.end.y*this._bufferService.cols+y.range.end.x,M=m.y*this._bufferService.cols+m.x;return S<=M&&M<=A}_positionFromMouseEvent(y,m,S){const A=S.getCoords(y,m,this._bufferService.cols,this._bufferService.rows);if(A)return{x:A[0],y:A[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,m,S,A,M){return{x1:y,y1:m,x2:S,y2:A,cols:this._bufferService.cols,fg:M}}};l.Linkifier=_=h([p(1,x.IMouseService),p(2,x.IRenderService),p(3,T.IBufferService),p(4,x.ILinkProviderService)],_)},9042:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,l,c){var h=this&&this.__decorate||function(x,_,y,m){var S,A=arguments.length,M=A<3?_:m===null?m=Object.getOwnPropertyDescriptor(_,y):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,_,y,m);else for(var R=x.length-1;R>=0;R--)(S=x[R])&&(M=(A<3?S(M):A>3?S(_,y,M):S(_,y))||M);return A>3&&M&&Object.defineProperty(_,y,M),M},p=this&&this.__param||function(x,_){return function(y,m){_(y,m,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const u=c(511),b=c(2585);let C=l.OscLinkProvider=class{constructor(x,_,y){this._bufferService=x,this._optionsService=_,this._oscLinkService=y}provideLinks(x,_){var L;const y=this._bufferService.buffer.lines.get(x-1);if(!y)return void _(void 0);const m=[],S=this._optionsService.rawOptions.linkHandler,A=new u.CellData,M=y.getTrimmedLength();let R=-1,D=-1,E=!1;for(let B=0;B<M;B++)if(D!==-1||y.hasContent(B)){if(y.loadCell(B,A),A.hasExtendedAttrs()&&A.extended.urlId){if(D===-1){D=B,R=A.extended.urlId;continue}E=A.extended.urlId!==R}else D!==-1&&(E=!0);if(E||D!==-1&&B===M-1){const I=(L=this._oscLinkService.getLinkData(R))==null?void 0:L.uri;if(I){const F={start:{x:D+1,y:x},end:{x:B+(E||B!==M-1?0:1),y:x}};let U=!1;if(!(S!=null&&S.allowNonHttpProtocols))try{const W=new URL(I);["http:","https:"].includes(W.protocol)||(U=!0)}catch{U=!0}U||m.push({text:I,range:F,activate:(W,X)=>S?S.activate(W,X,F):T(0,X),hover:(W,X)=>{var V;return(V=S==null?void 0:S.hover)==null?void 0:V.call(S,W,X,F)},leave:(W,X)=>{var V;return(V=S==null?void 0:S.leave)==null?void 0:V.call(S,W,X,F)}})}E=!1,A.hasExtendedAttrs()&&A.extended.urlId?(D=B,R=A.extended.urlId):(D=-1,R=-1)}}_(m)}};function T(x,_){if(confirm(`Do you want to navigate to ${_}?
54
+
55
+ WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=_}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=C=h([p(0,b.IBufferService),p(1,b.IOptionsService),p(2,b.IOscLinkService)],C)},6193:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.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,p){this._rowCount=p,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,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const h=c(3614),p=c(3656),u=c(3551),b=c(9042),C=c(3730),T=c(1680),x=c(3107),_=c(5744),y=c(2950),m=c(1296),S=c(428),A=c(4269),M=c(5114),R=c(8934),D=c(3230),E=c(9312),L=c(4725),B=c(6731),I=c(8055),F=c(8969),U=c(8460),W=c(844),X=c(6114),V=c(8437),Y=c(2584),J=c(7399),z=c(5941),j=c(9074),H=c(2585),G=c(5435),N=c(4567),ie=c(779);class he extends F.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(K={}){super(K),this.browser=X,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new W.MutableDisposable),this._onCursorMove=this.register(new U.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new U.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new U.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new U.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new U.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new U.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new U.EventEmitter),this._onBlur=this.register(new U.EventEmitter),this._onA11yCharEmitter=this.register(new U.EventEmitter),this._onA11yTabEmitter=this.register(new U.EventEmitter),this._onWillOpen=this.register(new U.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(j.DecorationService),this._instantiationService.setService(H.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ie.LinkProviderService),this._instantiationService.setService(L.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,te)=>this.refresh(q,te)))),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,U.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,U.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((q=>this._afterResize(q.cols,q.rows)))),this.register((0,W.toDisposable)((()=>{var q,te;this._customKeyEventHandler=void 0,(te=(q=this.element)==null?void 0:q.parentNode)==null||te.removeChild(this.element)})))}_handleColorEvent(K){if(this._themeService)for(const q of K){let te,le="";switch(q.index){case 256:te="foreground",le="10";break;case 257:te="background",le="11";break;case 258:te="cursor",le="12";break;default:te="ansi",le="4;"+q.index}switch(q.type){case 0:const xe=I.color.toColorRGB(te==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[te]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${le};${(0,z.toRgbString)(xe)}${Y.C1_ESCAPED.ST}`);break;case 1:if(te==="ansi")this._themeService.modifyColors((Ee=>Ee.ansi[q.index]=I.channels.toColor(...q.color)));else{const Ee=te;this._themeService.modifyColors((Ce=>Ce[Ee]=I.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(K){K?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(K){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var K;return(K=this.textarea)==null?void 0:K.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const K=this.buffer.ybase+this.buffer.y,q=this.buffer.lines.get(K);if(!q)return;const te=Math.min(this.buffer.x,this.cols-1),le=this._renderService.dimensions.css.cell.height,xe=q.getWidth(te),Ee=this._renderService.dimensions.css.cell.width*xe,Ce=this.buffer.y*this._renderService.dimensions.css.cell.height,me=te*this._renderService.dimensions.css.cell.width;this.textarea.style.left=me+"px",this.textarea.style.top=Ce+"px",this.textarea.style.width=Ee+"px",this.textarea.style.height=le+"px",this.textarea.style.lineHeight=le+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(q=>{this.hasSelection()&&(0,h.copyHandler)(q,this._selectionService)})));const K=q=>(0,h.handlePasteEvent)(q,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",K)),this.register((0,p.addDisposableDomListener)(this.element,"paste",K)),X.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(q=>{q.button===2&&(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(q=>{(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),X.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(q=>{q.button===1&&(0,h.moveTextAreaUnderMouseCursor)(q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(K=>this._keyUp(K)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(K=>this._keyDown(K)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(K=>this._keyPress(K)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(K=>this._compositionHelper.compositionupdate(K)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(K=>this._inputEvent(K)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(K){var te;if(!K)throw new Error("Terminal requires a parent element.");if(K.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((te=this.element)==null?void 0:te.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=K.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),K.appendChild(this.element);const 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,p.addDisposableDomListener)(this.screenElement,"mousemove",(le=>this.updateCursorStyle(le)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",b.promptLabel),X.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(M.CoreBrowserService,this.textarea,K.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(L.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(le=>this._handleTextAreaFocus(le)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(S.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(L.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(L.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(A.CharacterJoinerService),this._instantiationService.setService(L.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(L.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((le=>this._onRender.fire(le)))),this.onResize((le=>this._renderService.resize(le.cols,le.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(y.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(L.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((le=>this.scrollLines(le.amount,le.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(E.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(L.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((le=>this._renderService.handleSelectionChanged(le.start,le.end,le.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((le=>{this.textarea.value=le,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((le=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(le=>this._selectionService.handleMouseDown(le)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(le=>this._handleScreenReaderModeOptionChange(le)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(_.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(le=>{!this._overviewRulerRenderer&&le&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(_.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(m.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const K=this,q=this.element;function te(Ee){const Ce=K._mouseService.getMouseReportCoords(Ee,K.screenElement);if(!Ce)return!1;let me,Te;switch(Ee.overrideType||Ee.type){case"mousemove":Te=32,Ee.buttons===void 0?(me=3,Ee.button!==void 0&&(me=Ee.button<3?Ee.button:3)):me=1&Ee.buttons?0:4&Ee.buttons?1:2&Ee.buttons?2:3;break;case"mouseup":Te=0,me=Ee.button<3?Ee.button:3;break;case"mousedown":Te=1,me=Ee.button<3?Ee.button:3;break;case"wheel":if(K._customWheelEventHandler&&K._customWheelEventHandler(Ee)===!1||K.viewport.getLinesScrolled(Ee)===0)return!1;Te=Ee.deltaY<0?0:1,me=4;break;default:return!1}return!(Te===void 0||me===void 0||me>4)&&K.coreMouseService.triggerMouseEvent({col:Ce.col,row:Ce.row,x:Ce.x,y:Ce.y,button:me,action:Te,ctrl:Ee.ctrlKey,alt:Ee.altKey,shift:Ee.shiftKey})}const le={mouseup:null,wheel:null,mousedrag:null,mousemove:null},xe={mouseup:Ee=>(te(Ee),Ee.buttons||(this._document.removeEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.removeEventListener("mousemove",le.mousedrag)),this.cancel(Ee)),wheel:Ee=>(te(Ee),this.cancel(Ee,!0)),mousedrag:Ee=>{Ee.buttons&&te(Ee)},mousemove:Ee=>{Ee.buttons||te(Ee)}};this.register(this.coreMouseService.onProtocolChange((Ee=>{Ee?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Ee)),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&Ee?le.mousemove||(q.addEventListener("mousemove",xe.mousemove),le.mousemove=xe.mousemove):(q.removeEventListener("mousemove",le.mousemove),le.mousemove=null),16&Ee?le.wheel||(q.addEventListener("wheel",xe.wheel,{passive:!1}),le.wheel=xe.wheel):(q.removeEventListener("wheel",le.wheel),le.wheel=null),2&Ee?le.mouseup||(le.mouseup=xe.mouseup):(this._document.removeEventListener("mouseup",le.mouseup),le.mouseup=null),4&Ee?le.mousedrag||(le.mousedrag=xe.mousedrag):(this._document.removeEventListener("mousemove",le.mousedrag),le.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(q,"mousedown",(Ee=>{if(Ee.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Ee))return te(Ee),le.mouseup&&this._document.addEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.addEventListener("mousemove",le.mousedrag),this.cancel(Ee)}))),this.register((0,p.addDisposableDomListener)(q,"wheel",(Ee=>{if(!le.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Ee)===!1)return!1;if(!this.buffer.hasScrollback){const Ce=this.viewport.getLinesScrolled(Ee);if(Ce===0)return;const me=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Ee.deltaY<0?"A":"B");let Te="";for(let He=0;He<Math.abs(Ce);He++)Te+=me;return this.coreService.triggerDataEvent(Te,!0),this.cancel(Ee,!0)}return this.viewport.handleWheel(Ee)?this.cancel(Ee):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(q,"touchstart",(Ee=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Ee),this.cancel(Ee)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(q,"touchmove",(Ee=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Ee)?void 0:this.cancel(Ee)}),{passive:!1}))}refresh(K,q){var te;(te=this._renderService)==null||te.refreshRows(K,q)}updateCursorStyle(K){var q;(q=this._selectionService)!=null&&q.shouldColumnSelect(K)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(K,q,te=0){var le;te===1?(super.scrollLines(K,q,te),this.refresh(0,this.rows-1)):(le=this.viewport)==null||le.scrollLines(K)}paste(K){(0,h.paste)(K,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(K){this._customKeyEventHandler=K}attachCustomWheelEventHandler(K){this._customWheelEventHandler=K}registerLinkProvider(K){return this._linkProviderService.registerLinkProvider(K)}registerCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const q=this._characterJoinerService.register(K);return this.refresh(0,this.rows-1),q}deregisterCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(K)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(K){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+K)}registerDecoration(K){return this._decorationService.registerDecoration(K)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(K,q,te){this._selectionService.setSelection(K,q,te)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var K;(K=this._selectionService)==null||K.clearSelection()}selectAll(){var K;(K=this._selectionService)==null||K.selectAll()}selectLines(K,q){var te;(te=this._selectionService)==null||te.selectLines(K,q)}_keyDown(K){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;const q=this.browser.isMac&&this.options.macOptionIsMeta&&K.altKey;if(!q&&!this._compositionHelper.keydown(K))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;q||K.key!=="Dead"&&K.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const te=(0,J.evaluateKeyboardEvent)(K,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(K),te.type===3||te.type===2){const le=this.rows-1;return this.scrollLines(te.type===2?-le:le),this.cancel(K,!0)}return te.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,K)||(te.cancel&&this.cancel(K,!0),!te.key||!!(K.key&&!K.ctrlKey&&!K.altKey&&!K.metaKey&&K.key.length===1&&K.key.charCodeAt(0)>=65&&K.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(te.key!==Y.C0.ETX&&te.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:te.key,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(te.key,!0),!this.optionsService.rawOptions.screenReaderMode||K.altKey||K.ctrlKey?this.cancel(K,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(K,q){const te=K.isMac&&!this.options.macOptionIsMeta&&q.altKey&&!q.ctrlKey&&!q.metaKey||K.isWindows&&q.altKey&&q.ctrlKey&&!q.metaKey||K.isWindows&&q.getModifierState("AltGraph");return q.type==="keypress"?te:te&&(!q.keyCode||q.keyCode>47)}_keyUp(K){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1||((function(q){return q.keyCode===16||q.keyCode===17||q.keyCode===18})(K)||this.focus(),this.updateCursorStyle(K),this._keyPressHandled=!1)}_keyPress(K){let q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(this.cancel(K),K.charCode)q=K.charCode;else if(K.which===null||K.which===void 0)q=K.keyCode;else{if(K.which===0||K.charCode===0)return!1;q=K.which}return!(!q||(K.altKey||K.ctrlKey||K.metaKey)&&!this._isThirdLevelShift(this.browser,K)||(q=String.fromCharCode(q),this._onKey.fire({key:q,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(K){if(K.data&&K.inputType==="insertText"&&(!K.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const q=K.data;return this.coreService.triggerDataEvent(q,!0),this.cancel(K),!0}return!1}resize(K,q){K!==this.cols||q!==this.rows?super.resize(K,q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(K,q){var te,le;(te=this._charSizeService)==null||te.measure(),(le=this.viewport)==null||le.syncScrollArea(!0)}clear(){var K;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let q=1;q<this.rows;q++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(K=this.viewport)==null||K.reset(),this.refresh(0,this.rows-1)}}reset(){var q,te;this.options.rows=this.rows,this.options.cols=this.cols;const K=this._customKeyEventHandler;this._setup(),super.reset(),(q=this._selectionService)==null||q.reset(),this._decorationService.reset(),(te=this.viewport)==null||te.reset(),this._customKeyEventHandler=K,this.refresh(0,this.rows-1)}clearTextureAtlas(){var K;(K=this._renderService)==null||K.clearTextureAtlas()}_reportFocus(){var K;(K=this.element)!=null&&K.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(K){if(this._renderService)switch(K){case G.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),te=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${te};${q}t`);break;case G.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const le=this._renderService.dimensions.css.cell.width.toFixed(0),xe=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${xe};${le}t`)}}cancel(K,q){if(this.options.cancelEvents||q)return K.preventDefault(),K.stopPropagation(),!1}}l.Terminal=he},9924:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.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,p){this._rowCount=p,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,l,c){var h=this&&this.__decorate||function(y,m,S,A){var M,R=arguments.length,D=R<3?m:A===null?A=Object.getOwnPropertyDescriptor(m,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,m,S,A);else for(var E=y.length-1;E>=0;E--)(M=y[E])&&(D=(R<3?M(D):R>3?M(m,S,D):M(m,S))||D);return R>3&&D&&Object.defineProperty(m,S,D),D},p=this&&this.__param||function(y,m){return function(S,A){m(S,A,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const u=c(3656),b=c(4725),C=c(8460),T=c(844),x=c(2585);let _=l.Viewport=class extends T.Disposable{constructor(y,m,S,A,M,R,D,E){super(),this._viewportElement=y,this._scrollArea=m,this._bufferService=S,this._optionsService=A,this._charSizeService=M,this._renderService=R,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new 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((L=>this._activeBuffer=L.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((L=>this._renderDimensions=L))),this._handleThemeChange(E.colors),this.register(E.onChangeColors((L=>this._handleThemeChange(L)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(y){this._viewportElement.style.backgroundColor=y.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(y){if(y)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 m=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==m&&(this._lastRecordedBufferHeight=m,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const y=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==y&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=y),this._refreshAnimationFrame=null}syncScrollArea(y=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(y);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(y)}_handleScroll(y){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 m=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:m,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const y=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(y*(this._smoothScrollState.target-this._smoothScrollState.origin)),y<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(y,m){const S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(m<0&&this._viewportElement.scrollTop!==0||m>0&&S<this._lastRecordedBufferHeight)||(y.cancelable&&y.preventDefault(),!1)}handleWheel(y){const m=this._getPixelsScrolled(y);return m!==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+m:this._smoothScrollState.target+=m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=m,this._bubbleScroll(y,m))}scrollLines(y){if(y!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const m=y*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:y,suppressScrollEvent:!1})}_getPixelsScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let m=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_LINE?m*=this._currentRowHeight:y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._currentRowHeight*this._bufferService.rows),m}getBufferElements(y,m){var E;let S,A="";const M=[],R=m??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let L=y;L<R;L++){const B=D.get(L);if(!B)continue;const I=(E=D.get(L+1))==null?void 0:E.isWrapped;if(A+=B.translateToString(!I),!I||L===D.length-1){const F=document.createElement("div");F.textContent=A,M.push(F),A.length>0&&(S=F),A=""}}return{bufferElements:M,cursorElement:S}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let m=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(m/=this._currentRowHeight+0,this._wheelPartialScroll+=m,m=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._bufferService.rows),m}_applyScrollModifier(y,m){const S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&m.altKey||S==="ctrl"&&m.ctrlKey||S==="shift"&&m.shiftKey?y*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:y*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(y){this._lastTouchY=y.touches[0].pageY}handleTouchMove(y){const m=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,m!==0&&(this._viewportElement.scrollTop+=m,this._bubbleScroll(y,m))}};l.Viewport=_=h([p(2,x.IBufferService),p(3,x.IOptionsService),p(4,b.ICharSizeService),p(5,b.IRenderService),p(6,b.ICoreBrowserService),p(7,b.IThemeService)],_)},3107:function(f,l,c){var h=this&&this.__decorate||function(x,_,y,m){var S,A=arguments.length,M=A<3?_:m===null?m=Object.getOwnPropertyDescriptor(_,y):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,_,y,m);else for(var R=x.length-1;R>=0;R--)(S=x[R])&&(M=(A<3?S(M):A>3?S(_,y,M):S(_,y))||M);return A>3&&M&&Object.defineProperty(_,y,M),M},p=this&&this.__param||function(x,_){return function(y,m){_(y,m,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const u=c(4725),b=c(844),C=c(2585);let T=l.BufferDecorationRenderer=class extends b.Disposable{constructor(x,_,y,m,S){super(),this._screenElement=x,this._bufferService=_,this._coreBrowserService=y,this._decorationService=m,this._renderService=S,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 x of this._decorationService.decorations)this._renderDecoration(x);this._dimensionsChanged=!1}_renderDecoration(x){this._refreshStyle(x),this._dimensionsChanged&&this._refreshXPosition(x)}_createElement(x){var m;const _=this._coreBrowserService.mainDocument.createElement("div");_.classList.add("xterm-decoration"),_.classList.toggle("xterm-decoration-top-layer",((m=x==null?void 0:x.options)==null?void 0:m.layer)==="top"),_.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,_.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",_.style.top=(x.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",_.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=x.options.x??0;return y&&y>this._bufferService.cols&&(_.style.display="none"),this._refreshXPosition(x,_),_}_refreshStyle(x){const _=x.marker.line-this._bufferService.buffers.active.ydisp;if(_<0||_>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let y=this._decorationElements.get(x);y||(y=this._createElement(x),x.element=y,this._decorationElements.set(x,y),this._container.appendChild(y),x.onDispose((()=>{this._decorationElements.delete(x),y.remove()}))),y.style.top=_*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(y)}}_refreshXPosition(x,_=x.element){if(!_)return;const y=x.options.x??0;(x.options.anchor||"left")==="right"?_.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":_.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){var _;(_=this._decorationElements.get(x))==null||_.remove(),this._decorationElements.delete(x),x.dispose()}};l.BufferDecorationRenderer=T=h([p(1,C.IBufferService),p(2,u.ICoreBrowserService),p(3,C.IDecorationService),p(4,u.IRenderService)],T)},5871:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(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,p){return h>=c.startBufferLine-this._linePadding[p||"full"]&&h<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(f,l,c){var h=this&&this.__decorate||function(S,A,M,R){var D,E=arguments.length,L=E<3?A:R===null?R=Object.getOwnPropertyDescriptor(A,M):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,A,M,R);else for(var B=S.length-1;B>=0;B--)(D=S[B])&&(L=(E<3?D(L):E>3?D(A,M,L):D(A,M))||L);return E>3&&L&&Object.defineProperty(A,M,L),L},p=this&&this.__param||function(S,A){return function(M,R){A(M,R,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const u=c(5871),b=c(4725),C=c(844),T=c(2585),x={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0};let m=l.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,A,M,R,D,E,L){var I;super(),this._viewportElement=S,this._screenElement=A,this._bufferService=M,this._decorationService=R,this._renderService=D,this._optionsService=E,this._coreBrowserService=L,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(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,C.toDisposable)((()=>{var F;(F=this._canvas)==null||F.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 S=Math.floor(this._canvas.width/3),A=Math.ceil(this._canvas.width/3);_.full=this._canvas.width,_.left=S,_.center=A,_.right=S,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=_.left,y.right=_.left+_.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);const S=this._canvas.height/this._bufferService.buffer.lines.length,A=Math.round(Math.max(Math.min(S,12),6)*this._coreBrowserService.dpr);x.left=A,x.center=A,x.right=A}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const A of this._decorationService.decorations)this._colorZoneStore.addDecoration(A);this._ctx.lineWidth=1;const S=this._colorZoneStore.zones;for(const A of S)A.position!=="full"&&this._renderColorZone(A);for(const A of S)A.position==="full"&&this._renderColorZone(A);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(y[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-x[S.position||"full"]/2),_[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[S.position||"full"]))}_queueRefresh(S,A){this._shouldUpdateDimensions=S||this._shouldUpdateDimensions,this._shouldUpdateAnchor=A||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=m=h([p(2,T.IBufferService),p(3,T.IDecorationService),p(4,b.IRenderService),p(5,T.IOptionsService),p(6,b.ICoreBrowserService)],m)},2950:function(f,l,c){var h=this&&this.__decorate||function(x,_,y,m){var S,A=arguments.length,M=A<3?_:m===null?m=Object.getOwnPropertyDescriptor(_,y):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,_,y,m);else for(var R=x.length-1;R>=0;R--)(S=x[R])&&(M=(A<3?S(M):A>3?S(_,y,M):S(_,y))||M);return A>3&&M&&Object.defineProperty(_,y,M),M},p=this&&this.__param||function(x,_){return function(y,m){_(y,m,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const u=c(4725),b=c(2585),C=c(2584);let T=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,_,y,m,S,A){this._textarea=x,this._compositionView=_,this._bufferService=y,this._optionsService=m,this._coreService=S,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(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const _={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,_.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(_.start,_.end):this._textarea.value.substring(_.start),y.length>0&&this._coreService.triggerDataEvent(y,!0)}}),0)}else{this._isSendingComposition=!1;const _=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(_,!0)}}_handleAnyTextareaChanges(){const x=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const _=this._textarea.value,y=_.replace(x,"");this._dataAlreadySent=y,_.length>x.length?this._coreService.triggerDataEvent(y,!0):_.length<x.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):_.length===x.length&&_!==x&&this._coreService.triggerDataEvent(_,!0)}}),0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const _=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),y=this._renderService.dimensions.css.cell.height,m=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,S=_*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=S+"px",this._compositionView.style.top=m+"px",this._compositionView.style.height=y+"px",this._compositionView.style.lineHeight=y+"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=S+"px",this._textarea.style.top=m+"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"}x||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=T=h([p(2,b.IBufferService),p(3,b.IOptionsService),p(4,b.ICoreService),p(5,u.IRenderService)],T)},9806:(f,l)=>{function c(h,p,u){const b=u.getBoundingClientRect(),C=h.getComputedStyle(u),T=parseInt(C.getPropertyValue("padding-left")),x=parseInt(C.getPropertyValue("padding-top"));return[p.clientX-b.left-T,p.clientY-b.top-x]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=c,l.getCoords=function(h,p,u,b,C,T,x,_,y){if(!T)return;const m=c(h,p,u);return m?(m[0]=Math.ceil((m[0]+(y?x/2:0))/x),m[1]=Math.ceil(m[1]/_),m[0]=Math.min(Math.max(m[0],1),b+(y?1:0)),m[1]=Math.min(Math.max(m[1],1),C),m):void 0}},9504:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const h=c(2584);function p(_,y,m,S){const A=_-u(_,m),M=y-u(y,m),R=Math.abs(A-M)-(function(D,E,L){let B=0;const I=D-u(D,L),F=E-u(E,L);for(let U=0;U<Math.abs(I-F);U++){const W=b(D,E)==="A"?-1:1,X=L.buffer.lines.get(I+W*U);X!=null&&X.isWrapped&&B++}return B})(_,y,m);return x(R,T(b(_,y),S))}function u(_,y){let m=0,S=y.buffer.lines.get(_),A=S==null?void 0:S.isWrapped;for(;A&&_>=0&&_<y.rows;)m++,S=y.buffer.lines.get(--_),A=S==null?void 0:S.isWrapped;return m}function b(_,y){return _>y?"A":"B"}function C(_,y,m,S,A,M){let R=_,D=y,E="";for(;R!==m||D!==S;)R+=A?1:-1,A&&R>M.cols-1?(E+=M.buffer.translateBufferLineToString(D,!1,_,R),R=0,_=0,D++):!A&&R<0&&(E+=M.buffer.translateBufferLineToString(D,!1,0,_+1),R=M.cols-1,_=R,D--);return E+M.buffer.translateBufferLineToString(D,!1,_,R)}function T(_,y){const m=y?"O":"[";return h.C0.ESC+m+_}function x(_,y){_=Math.floor(_);let m="";for(let S=0;S<_;S++)m+=y;return m}l.moveToCellSequence=function(_,y,m,S){const A=m.buffer.x,M=m.buffer.y;if(!m.buffer.hasScrollback)return(function(E,L,B,I,F,U){return p(L,I,F,U).length===0?"":x(C(E,L,E,L-u(L,F),!1,F).length,T("D",U))})(A,M,0,y,m,S)+p(M,y,m,S)+(function(E,L,B,I,F,U){let W;W=p(L,I,F,U).length>0?I-u(I,F):L;const X=I,V=(function(Y,J,z,j,H,G){let N;return N=p(z,j,H,G).length>0?j-u(j,H):J,Y<z&&N<=j||Y>=z&&N<j?"C":"D"})(E,L,B,I,F,U);return x(C(E,W,B,X,V==="C",F).length,T(V,U))})(A,M,_,y,m,S);let R;if(M===y)return R=A>_?"D":"C",x(Math.abs(A-_),T(R,S));R=M>y?"D":"C";const D=Math.abs(M-y);return x((function(E,L){return L.cols-E})(M>y?_:A,m)+(D-1)*m.cols+1+((M>y?A:_)-1),T(R,S))}},1296:function(f,l,c){var h=this&&this.__decorate||function(U,W,X,V){var Y,J=arguments.length,z=J<3?W:V===null?V=Object.getOwnPropertyDescriptor(W,X):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(U,W,X,V);else for(var j=U.length-1;j>=0;j--)(Y=U[j])&&(z=(J<3?Y(z):J>3?Y(W,X,z):Y(W,X))||z);return J>3&&z&&Object.defineProperty(W,X,z),z},p=this&&this.__param||function(U,W){return function(X,V){W(X,V,U)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const u=c(3787),b=c(2550),C=c(2223),T=c(6171),x=c(6052),_=c(4725),y=c(8055),m=c(8460),S=c(844),A=c(2585),M="xterm-dom-renderer-owner-",R="xterm-rows",D="xterm-fg-",E="xterm-bg-",L="xterm-focus",B="xterm-selection";let I=1,F=l.DomRenderer=class extends S.Disposable{constructor(U,W,X,V,Y,J,z,j,H,G,N,ie,he){super(),this._terminal=U,this._document=W,this._element=X,this._screenElement=V,this._viewportElement=Y,this._helperContainer=J,this._linkifier2=z,this._charSizeService=H,this._optionsService=G,this._bufferService=N,this._coreBrowserService=ie,this._themeService=he,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,x.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new m.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(B),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=j.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(M+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,S.toDisposable)((()=>{this._element.classList.remove(M+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 U=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*U,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*U),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/U),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/U),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 X of this._rowElements)X.style.width=`${this.dimensions.css.canvas.width}px`,X.style.height=`${this.dimensions.css.cell.height}px`,X.style.lineHeight=`${this.dimensions.css.cell.height}px`,X.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const W=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=W,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(U){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let W=`${this._terminalSelector} .${R} { color: ${U.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;W+=`${this._terminalSelector} .${R} .xterm-dim { color: ${y.color.multiplyOpacity(U.foreground,.5).css};}`,W+=`${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 X=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;W+=`@keyframes ${X} { 50% { border-bottom-style: hidden; }}`,W+=`@keyframes ${V} { 50% { box-shadow: none; }}`,W+=`@keyframes ${Y} { 0% { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css}; } 50% { background-color: inherit; color: ${U.cursor.css}; }}`,W+=`${this._terminalSelector} .${R}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${R}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${R}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${U.cursor.css} !important; color: ${U.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${U.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${U.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${U.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,W+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${U.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${U.selectionInactiveBackgroundOpaque.css};}`;for(const[J,z]of U.ansi.entries())W+=`${this._terminalSelector} .${D}${J} { color: ${z.css}; }${this._terminalSelector} .${D}${J}.xterm-dim { color: ${y.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${E}${J} { background-color: ${z.css}; }`;W+=`${this._terminalSelector} .${D}${C.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(U.background).css}; }${this._terminalSelector} .${D}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(U.background),.5).css}; }${this._terminalSelector} .${E}${C.INVERTED_DEFAULT_COLOR} { background-color: ${U.foreground.css}; }`,this._themeStyleElement.textContent=W}_setDefaultSpacing(){const U=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${U}px`,this._rowFactory.defaultSpacing=U}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(U,W){for(let X=this._rowElements.length;X<=W;X++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>W;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(U,W){this._refreshRowElements(U,W),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(L),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(L),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(U,W,X){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(U,W,X),this.renderRows(0,this._bufferService.rows-1),!U||!W)return;this._selectionRenderModel.update(this._terminal,U,W,X);const V=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,J=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(J>=this._bufferService.rows||z<0)return;const j=this._document.createDocumentFragment();if(X){const H=U[0]>W[0];j.appendChild(this._createSelectionElement(J,H?W[0]:U[0],H?U[0]:W[0],z-J+1))}else{const H=V===J?U[0]:0,G=J===Y?W[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(J,H,G));const N=z-J-1;if(j.appendChild(this._createSelectionElement(J+1,0,this._bufferService.cols,N)),J!==z){const ie=Y===z?W[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(z,0,ie))}}this._selectionContainer.appendChild(j)}_createSelectionElement(U,W,X,V=1){const Y=this._document.createElement("div"),J=W*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(X-W);return J+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-J),Y.style.height=V*this.dimensions.css.cell.height+"px",Y.style.top=U*this.dimensions.css.cell.height+"px",Y.style.left=`${J}px`,Y.style.width=`${z}px`,Y}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const U of this._rowElements)U.replaceChildren()}renderRows(U,W){const X=this._bufferService.buffer,V=X.ybase+X.y,Y=Math.min(X.x,this._bufferService.cols-1),J=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let H=U;H<=W;H++){const G=H+X.ydisp,N=this._rowElements[H],ie=X.lines.get(G);if(!N||!ie)break;N.replaceChildren(...this._rowFactory.createRow(ie,G,G===V,z,j,Y,J,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${M}${this._terminalClass}`}_handleLinkHover(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!0)}_handleLinkLeave(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!1)}_setCellUnderline(U,W,X,V,Y,J){X<0&&(U=0),V<0&&(W=0);const z=this._bufferService.rows-1;X=Math.max(Math.min(X,z),0),V=Math.max(Math.min(V,z),0),Y=Math.min(Y,this._bufferService.cols);const j=this._bufferService.buffer,H=j.ybase+j.y,G=Math.min(j.x,Y-1),N=this._optionsService.rawOptions.cursorBlink,ie=this._optionsService.rawOptions.cursorStyle,he=this._optionsService.rawOptions.cursorInactiveStyle;for(let ge=X;ge<=V;++ge){const K=ge+j.ydisp,q=this._rowElements[ge],te=j.lines.get(K);if(!q||!te)break;q.replaceChildren(...this._rowFactory.createRow(te,K,K===H,ie,he,G,N,this.dimensions.css.cell.width,this._widthCache,J?ge===X?U:0:-1,J?(ge===V?W:Y)-1:-1))}}};l.DomRenderer=F=h([p(7,A.IInstantiationService),p(8,_.ICharSizeService),p(9,A.IOptionsService),p(10,A.IBufferService),p(11,_.ICoreBrowserService),p(12,_.IThemeService)],F)},3787:function(f,l,c){var h=this&&this.__decorate||function(R,D,E,L){var B,I=arguments.length,F=I<3?D:L===null?L=Object.getOwnPropertyDescriptor(D,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(R,D,E,L);else for(var U=R.length-1;U>=0;U--)(B=R[U])&&(F=(I<3?B(F):I>3?B(D,E,F):B(D,E))||F);return I>3&&F&&Object.defineProperty(D,E,F),F},p=this&&this.__param||function(R,D){return function(E,L){D(E,L,R)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const u=c(2223),b=c(643),C=c(511),T=c(2585),x=c(8055),_=c(4725),y=c(4269),m=c(6171),S=c(3734);let A=l.DomRendererRowFactory=class{constructor(R,D,E,L,B,I,F){this._document=R,this._characterJoinerService=D,this._optionsService=E,this._coreBrowserService=L,this._coreService=B,this._decorationService=I,this._themeService=F,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,D,E){this._selectionStart=R,this._selectionEnd=D,this._columnSelectMode=E}createRow(R,D,E,L,B,I,F,U,W,X,V){const Y=[],J=this._characterJoinerService.getJoinedCharacters(D),z=this._themeService.colors;let j,H=R.getNoBgTrimmedLength();E&&H<I+1&&(H=I+1);let G=0,N="",ie=0,he=0,ge=0,K=!1,q=0,te=!1,le=0;const xe=[],Ee=X!==-1&&V!==-1;for(let Ce=0;Ce<H;Ce++){R.loadCell(Ce,this._workCell);let me=this._workCell.getWidth();if(me===0)continue;let Te=!1,He=Ce,ke=this._workCell;if(J.length>0&&Ce===J[0][0]){Te=!0;const Ue=J.shift();ke=new y.JoinedCellData(this._workCell,R.translateToString(!0,Ue[0],Ue[1]),Ue[1]-Ue[0]),He=Ue[1]-1,me=ke.getWidth()}const Jt=this._isCellInSelection(Ce,D),Nt=E&&Ce===I,Kt=Ee&&Ce>=X&&Ce<=V;let en=!1;this._decorationService.forEachDecorationAtCell(Ce,D,void 0,(Ue=>{en=!0}));let xn=ke.getChars()||b.WHITESPACE_CELL_CHAR;if(xn===" "&&(ke.isUnderline()||ke.isOverline())&&(xn=" "),le=me*U-W.get(xn,ke.isBold(),ke.isItalic()),j){if(G&&(Jt&&te||!Jt&&!te&&ke.bg===ie)&&(Jt&&te&&z.selectionForeground||ke.fg===he)&&ke.extended.ext===ge&&Kt===K&&le===q&&!Nt&&!Te&&!en){ke.isInvisible()?N+=b.WHITESPACE_CELL_CHAR:N+=xn,G++;continue}G&&(j.textContent=N),j=this._document.createElement("span"),G=0,N=""}else j=this._document.createElement("span");if(ie=ke.bg,he=ke.fg,ge=ke.extended.ext,K=Kt,q=le,te=Jt,Te&&I>=Ce&&I<=He&&(I=Ce),!this._coreService.isCursorHidden&&Nt&&this._coreService.isCursorInitialized){if(xe.push("xterm-cursor"),this._coreBrowserService.isFocused)F&&xe.push("xterm-cursor-blink"),xe.push(L==="bar"?"xterm-cursor-bar":L==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":xe.push("xterm-cursor-outline");break;case"block":xe.push("xterm-cursor-block");break;case"bar":xe.push("xterm-cursor-bar");break;case"underline":xe.push("xterm-cursor-underline")}}if(ke.isBold()&&xe.push("xterm-bold"),ke.isItalic()&&xe.push("xterm-italic"),ke.isDim()&&xe.push("xterm-dim"),N=ke.isInvisible()?b.WHITESPACE_CELL_CHAR:ke.getChars()||b.WHITESPACE_CELL_CHAR,ke.isUnderline()&&(xe.push(`xterm-underline-${ke.extended.underlineStyle}`),N===" "&&(N=" "),!ke.isUnderlineColorDefault()))if(ke.isUnderlineColorRGB())j.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(ke.getUnderlineColor()).join(",")})`;else{let Ue=ke.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ke.isBold()&&Ue<8&&(Ue+=8),j.style.textDecorationColor=z.ansi[Ue].css}ke.isOverline()&&(xe.push("xterm-overline"),N===" "&&(N=" ")),ke.isStrikethrough()&&xe.push("xterm-strikethrough"),Kt&&(j.style.textDecoration="underline");let bt=ke.getFgColor(),dt=ke.getFgColorMode(),Bt=ke.getBgColor(),fe=ke.getBgColorMode();const Se=!!ke.isInverse();if(Se){const Ue=bt;bt=Bt,Bt=Ue;const Je=dt;dt=fe,fe=Je}let pe,Me,Ne,pt=!1;switch(this._decorationService.forEachDecorationAtCell(Ce,D,void 0,(Ue=>{Ue.options.layer!=="top"&&pt||(Ue.backgroundColorRGB&&(fe=50331648,Bt=Ue.backgroundColorRGB.rgba>>8&16777215,pe=Ue.backgroundColorRGB),Ue.foregroundColorRGB&&(dt=50331648,bt=Ue.foregroundColorRGB.rgba>>8&16777215,Me=Ue.foregroundColorRGB),pt=Ue.options.layer==="top")})),!pt&&Jt&&(pe=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,Bt=pe.rgba>>8&16777215,fe=50331648,pt=!0,z.selectionForeground&&(dt=50331648,bt=z.selectionForeground.rgba>>8&16777215,Me=z.selectionForeground)),pt&&xe.push("xterm-decoration-top"),fe){case 16777216:case 33554432:Ne=z.ansi[Bt],xe.push(`xterm-bg-${Bt}`);break;case 50331648:Ne=x.channels.toColor(Bt>>16,Bt>>8&255,255&Bt),this._addStyle(j,`background-color:#${M((Bt>>>0).toString(16),"0",6)}`);break;default:Se?(Ne=z.foreground,xe.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Ne=z.background}switch(pe||ke.isDim()&&(pe=x.color.multiplyOpacity(Ne,.5)),dt){case 16777216:case 33554432:ke.isBold()&&bt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(bt+=8),this._applyMinimumContrast(j,Ne,z.ansi[bt],ke,pe,void 0)||xe.push(`xterm-fg-${bt}`);break;case 50331648:const Ue=x.channels.toColor(bt>>16&255,bt>>8&255,255&bt);this._applyMinimumContrast(j,Ne,Ue,ke,pe,Me)||this._addStyle(j,`color:#${M(bt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(j,Ne,z.foreground,ke,pe,Me)||Se&&xe.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}xe.length&&(j.className=xe.join(" "),xe.length=0),Nt||Te||en?j.textContent=N:G++,le!==this.defaultSpacing&&(j.style.letterSpacing=`${le}px`),Y.push(j),Ce=He}return j&&G&&(j.textContent=N),Y}_applyMinimumContrast(R,D,E,L,B,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,m.treatGlyphAsBackgroundColor)(L.getCode()))return!1;const F=this._getContrastCache(L);let U;if(B||I||(U=F.getColor(D.rgba,E.rgba)),U===void 0){const W=this._optionsService.rawOptions.minimumContrastRatio/(L.isDim()?2:1);U=x.color.ensureContrastRatio(B||D,I||E,W),F.setColor((B||D).rgba,(I||E).rgba,U??null)}return!!U&&(this._addStyle(R,`color:${U.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,D){R.setAttribute("style",`${R.getAttribute("style")||""}${D};`)}_isCellInSelection(R,D){const E=this._selectionStart,L=this._selectionEnd;return!(!E||!L)&&(this._columnSelectMode?E[0]<=L[0]?R>=E[0]&&D>=E[1]&&R<L[0]&&D<=L[1]:R<E[0]&&D>=E[1]&&R>=L[0]&&D<=L[1]:D>E[1]&&D<L[1]||E[1]===L[1]&&D===E[1]&&R>=E[0]&&R<L[0]||E[1]<L[1]&&D===L[1]&&R<L[0]||E[1]<L[1]&&D===E[1]&&R>=E[0])}};function M(R,D,E){for(;R.length<E;)R=D+R;return R}l.DomRendererRowFactory=A=h([p(1,_.ICharacterJoinerService),p(2,T.IOptionsService),p(3,_.ICoreBrowserService),p(4,T.ICoreService),p(5,T.IDecorationService),p(6,_.IThemeService)],A)},2550:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.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 p=c.createElement("span");p.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=[p,u,b,C],this._container.appendChild(p),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,p,u){c===this._font&&h===this._fontSize&&p===this._weight&&u===this._weightBold||(this._font=c,this._fontSize=h,this._weight=p,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(c,h,p){let u=0;if(!h&&!p&&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"),p&&(b+="I");let C=this._holey.get(b);if(C===void 0){let T=0;h&&(T|=1),p&&(T|=2),C=this._measure(c,T),C>0&&this._holey.set(b,C)}return C}_measure(c,h){const p=this._measureElements[h];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,l)=>{function c(p){return 57508<=p&&p<=57558}function h(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},l.isPowerlineGlyph=c,l.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},l.isEmoji=h,l.allowRescaling=function(p,u,b,C){return u===1&&b>Math.ceil(1.5*C)&&p!==void 0&&p>255&&!h(p)&&!c(p)&&!(function(T){return 57344<=T&&T<=63743})(p)},l.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(u){return 9472<=u&&u<=9631})(p)},l.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},l.computeNextVariantOffset=function(p,u,b=0){return(p-(2*Math.round(u)-b))%(2*Math.round(u))}},6052:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.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(p,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=p.buffers.active.ydisp,x=u[1]-T,_=b[1]-T,y=Math.max(x,0),m=Math.min(_,p.rows-1);y>=p.rows||m<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=x,this.viewportEndRow=_,this.viewportCappedStartRow=y,this.viewportCappedEndRow=m,this.startCol=u[0],this.endCol=b[0])}isCellSelected(p,u,b){return!!this.hasSelection&&(b-=p.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)}}l.createSelectionRenderModel=function(){return new c}},456:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.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,l,c){var h=this&&this.__decorate||function(m,S,A,M){var R,D=arguments.length,E=D<3?S:M===null?M=Object.getOwnPropertyDescriptor(S,A):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,S,A,M);else for(var L=m.length-1;L>=0;L--)(R=m[L])&&(E=(D<3?R(E):D>3?R(S,A,E):R(S,A))||E);return D>3&&E&&Object.defineProperty(S,A,E),E},p=this&&this.__param||function(m,S){return function(A,M){S(A,M,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const u=c(2585),b=c(8460),C=c(844);let T=l.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(m,S,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 y(this._optionsService))}catch{this._measureStrategy=this.register(new _(m,S,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const m=this._measureStrategy.measure();m.width===this.width&&m.height===this.height||(this.width=m.width,this.height=m.height,this._onCharSizeChange.fire())}};l.CharSizeService=T=h([p(2,u.IOptionsService)],T);class x extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(S,A){S!==void 0&&S>0&&A!==void 0&&A>0&&(this._result.width=S,this._result.height=A)}}class _ extends x{constructor(S,A,M){super(),this._document=S,this._parentElement=A,this._optionsService=M,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 y extends x{constructor(S){super(),this._optionsService=S,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 S=this._ctx.measureText("W");return this._validateAndSet(S.width,S.fontBoundingBoxAscent+S.fontBoundingBoxDescent),this._result}}},4269:function(f,l,c){var h=this&&this.__decorate||function(y,m,S,A){var M,R=arguments.length,D=R<3?m:A===null?A=Object.getOwnPropertyDescriptor(m,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,m,S,A);else for(var E=y.length-1;E>=0;E--)(M=y[E])&&(D=(R<3?M(D):R>3?M(m,S,D):M(m,S))||D);return R>3&&D&&Object.defineProperty(m,S,D),D},p=this&&this.__param||function(y,m){return function(S,A){m(S,A,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const u=c(3734),b=c(643),C=c(511),T=c(2585);class x extends u.AttributeData{constructor(m,S,A){super(),this.content=0,this.combinedData="",this.fg=m.fg,this.bg=m.bg,this.combinedData=S,this._width=A}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(m){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=x;let _=l.CharacterJoinerService=class Pg{constructor(m){this._bufferService=m,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(m){const S={id:this._nextCharacterJoinerId++,handler:m};return this._characterJoiners.push(S),S.id}deregister(m){for(let S=0;S<this._characterJoiners.length;S++)if(this._characterJoiners[S].id===m)return this._characterJoiners.splice(S,1),!0;return!1}getJoinedCharacters(m){if(this._characterJoiners.length===0)return[];const S=this._bufferService.buffer.lines.get(m);if(!S||S.length===0)return[];const A=[],M=S.translateToString(!0);let R=0,D=0,E=0,L=S.getFg(0),B=S.getBg(0);for(let I=0;I<S.getTrimmedLength();I++)if(S.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==L||this._workCell.bg!==B){if(I-R>1){const F=this._getJoinedRanges(M,E,D,S,R);for(let U=0;U<F.length;U++)A.push(F[U])}R=I,E=D,L=this._workCell.fg,B=this._workCell.bg}D+=this._workCell.getChars().length||b.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const I=this._getJoinedRanges(M,E,D,S,R);for(let F=0;F<I.length;F++)A.push(I[F])}return A}_getJoinedRanges(m,S,A,M,R){const D=m.substring(S,A);let E=[];try{E=this._characterJoiners[0].handler(D)}catch(L){console.error(L)}for(let L=1;L<this._characterJoiners.length;L++)try{const B=this._characterJoiners[L].handler(D);for(let I=0;I<B.length;I++)Pg._mergeRanges(E,B[I])}catch(B){console.error(B)}return this._stringRangesToCellRanges(E,M,R),E}_stringRangesToCellRanges(m,S,A){let M=0,R=!1,D=0,E=m[M];if(E){for(let L=A;L<this._bufferService.cols;L++){const B=S.getWidth(L),I=S.getString(L).length||b.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!R&&E[0]<=D&&(E[0]=L,R=!0),E[1]<=D){if(E[1]=L,E=m[++M],!E)break;E[0]<=D?(E[0]=L,R=!0):R=!1}D+=I}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(m,S){let A=!1;for(let M=0;M<m.length;M++){const R=m[M];if(A){if(S[1]<=R[0])return m[M-1][1]=S[1],m;if(S[1]<=R[1])return m[M-1][1]=Math.max(S[1],R[1]),m.splice(M,1),m;m.splice(M,1),M--}else{if(S[1]<=R[0])return m.splice(M,0,S),m;if(S[1]<=R[1])return R[0]=Math.min(S[0],R[0]),m;S[0]<R[1]&&(R[0]=Math.min(S[0],R[0]),A=!0)}}return A?m[m.length-1][1]=S[1]:m.push(S),m}};l.CharacterJoinerService=_=h([p(0,T.IBufferService)],_)},5114:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const h=c(844),p=c(8460),u=c(3656);class b extends h.Disposable{constructor(x,_,y){super(),this._textarea=x,this._window=_,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new C(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((m=>this._screenDprMonitor.setWindow(m)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(x){this._window!==x&&(this._window=x,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}l.CoreBrowserService=b;class C extends h.Disposable{constructor(x){super(),this._parentWindow=x,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new p.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(x){this._parentWindow=x,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 x;this._outerListener&&((x=this._resolutionMediaMatchList)==null||x.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const h=c(844);class p 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)}}}}l.LinkProviderService=p},8934:function(f,l,c){var h=this&&this.__decorate||function(T,x,_,y){var m,S=arguments.length,A=S<3?x:y===null?y=Object.getOwnPropertyDescriptor(x,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(T,x,_,y);else for(var M=T.length-1;M>=0;M--)(m=T[M])&&(A=(S<3?m(A):S>3?m(x,_,A):m(x,_))||A);return S>3&&A&&Object.defineProperty(x,_,A),A},p=this&&this.__param||function(T,x){return function(_,y){x(_,y,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const u=c(4725),b=c(9806);let C=l.MouseService=class{constructor(T,x){this._renderService=T,this._charSizeService=x}getCoords(T,x,_,y,m){return(0,b.getCoords)(window,T,x,_,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,m)}getMouseReportCoords(T,x){const _=(0,b.getCoordsRelativeToElement)(window,T,x);if(this._charSizeService.hasValidSize)return _[0]=Math.min(Math.max(_[0],0),this._renderService.dimensions.css.canvas.width-1),_[1]=Math.min(Math.max(_[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(_[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(_[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(_[0]),y:Math.floor(_[1])}}};l.MouseService=C=h([p(0,u.IRenderService),p(1,u.ICharSizeService)],C)},3230:function(f,l,c){var h=this&&this.__decorate||function(m,S,A,M){var R,D=arguments.length,E=D<3?S:M===null?M=Object.getOwnPropertyDescriptor(S,A):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,S,A,M);else for(var L=m.length-1;L>=0;L--)(R=m[L])&&(E=(D<3?R(E):D>3?R(S,A,E):R(S,A))||E);return D>3&&E&&Object.defineProperty(S,A,E),E},p=this&&this.__param||function(m,S){return function(A,M){S(A,M,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const u=c(6193),b=c(4725),C=c(8460),T=c(844),x=c(7226),_=c(2585);let y=l.RenderService=class extends T.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(m,S,A,M,R,D,E,L){super(),this._rowCount=m,this._charSizeService=M,this._renderer=this.register(new T.MutableDisposable),this._pausedResizeTask=new x.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(((B,I)=>this._renderRows(B,I)),E),this.register(this._renderDebouncer),this.register(E.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.clear()}))),this.register(A.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(A.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(A.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(L.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(E.window,S),this.register(E.onWindowChange((B=>this._registerIntersectionObserver(B,S))))}_registerIntersectionObserver(m,S){if("IntersectionObserver"in m){const A=new m.IntersectionObserver((M=>this._handleIntersectionChange(M[M.length-1])),{threshold:0});A.observe(S),this._observerDisposable.value=(0,T.toDisposable)((()=>A.disconnect()))}}_handleIntersectionChange(m){this._isPaused=m.isIntersecting===void 0?m.intersectionRatio===0:!m.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(m,S,A=!1){this._isPaused?this._needsFullRefresh=!0:(A||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(m,S,this._rowCount))}_renderRows(m,S){this._renderer.value&&(m=Math.min(m,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(m,S),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:m,end:S}),this._onRender.fire({start:m,end:S}),this._isNextRenderRedrawOnly=!0)}resize(m,S){this._rowCount=S,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(m){this._renderer.value=m,this._renderer.value&&(this._renderer.value.onRequestRedraw((S=>this.refreshRows(S.start,S.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(m){return this._renderDebouncer.addRefreshCallback(m)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var m,S;this._renderer.value&&((S=(m=this._renderer.value).clearTextureAtlas)==null||S.call(m),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(m,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var A;return(A=this._renderer.value)==null?void 0:A.handleResize(m,S)})):this._renderer.value.handleResize(m,S),this._fullRefresh())}handleCharSizeChanged(){var m;(m=this._renderer.value)==null||m.handleCharSizeChanged()}handleBlur(){var m;(m=this._renderer.value)==null||m.handleBlur()}handleFocus(){var m;(m=this._renderer.value)==null||m.handleFocus()}handleSelectionChanged(m,S,A){var M;this._selectionState.start=m,this._selectionState.end=S,this._selectionState.columnSelectMode=A,(M=this._renderer.value)==null||M.handleSelectionChanged(m,S,A)}handleCursorMove(){var m;(m=this._renderer.value)==null||m.handleCursorMove()}clear(){var m;(m=this._renderer.value)==null||m.clear()}};l.RenderService=y=h([p(2,_.IOptionsService),p(3,b.ICharSizeService),p(4,_.IDecorationService),p(5,_.IBufferService),p(6,b.ICoreBrowserService),p(7,b.IThemeService)],y)},9312:function(f,l,c){var h=this&&this.__decorate||function(E,L,B,I){var F,U=arguments.length,W=U<3?L:I===null?I=Object.getOwnPropertyDescriptor(L,B):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(E,L,B,I);else for(var X=E.length-1;X>=0;X--)(F=E[X])&&(W=(U<3?F(W):U>3?F(L,B,W):F(L,B))||W);return U>3&&W&&Object.defineProperty(L,B,W),W},p=this&&this.__param||function(E,L){return function(B,I){L(B,I,E)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const u=c(9806),b=c(9504),C=c(456),T=c(4725),x=c(8460),_=c(844),y=c(6114),m=c(4841),S=c(511),A=c(2585),M=" ",R=new RegExp(M,"g");let D=l.SelectionService=class extends _.Disposable{constructor(E,L,B,I,F,U,W,X,V){super(),this._element=E,this._screenElement=L,this._linkifier=B,this._bufferService=I,this._coreService=F,this._mouseService=U,this._optionsService=W,this._renderService=X,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new S.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Y=>this._handleMouseMove(Y),this._mouseUpListener=Y=>this._handleMouseUp(Y),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Y=>this._handleTrim(Y))),this.register(this._bufferService.buffers.onBufferActivate((Y=>this._handleBufferActivate(Y)))),this.enable(),this._model=new C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,_.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const E=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!E||!L||E[0]===L[0]&&E[1]===L[1])}get selectionText(){const E=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;if(!E||!L)return"";const B=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(E[0]===L[0])return"";const F=E[0]<L[0]?E[0]:L[0],U=E[0]<L[0]?L[0]:E[0];for(let W=E[1];W<=L[1];W++){const X=B.translateBufferLineToString(W,!0,F,U);I.push(X)}}else{const F=E[1]===L[1]?L[0]:void 0;I.push(B.translateBufferLineToString(E[1],!0,E[0],F));for(let U=E[1]+1;U<=L[1]-1;U++){const W=B.lines.get(U),X=B.translateBufferLineToString(U,!0);W!=null&&W.isWrapped?I[I.length-1]+=X:I.push(X)}if(E[1]!==L[1]){const U=B.lines.get(L[1]),W=B.translateBufferLineToString(L[1],!0,0,L[0]);U&&U.isWrapped?I[I.length-1]+=W:I.push(W)}}return I.map((F=>F.replace(R," "))).join(y.isWindows?`\r
56
+ `:`
57
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),y.isLinux&&E&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(E){const L=this._getMouseBufferCoords(E),B=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(B&&I&&L)&&this._areCoordsInSelection(L,B,I)}isCellInSelection(E,L){const B=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!B||!I)&&this._areCoordsInSelection([E,L],B,I)}_areCoordsInSelection(E,L,B){return E[1]>L[1]&&E[1]<B[1]||L[1]===B[1]&&E[1]===L[1]&&E[0]>=L[0]&&E[0]<B[0]||L[1]<B[1]&&E[1]===B[1]&&E[0]<B[0]||L[1]<B[1]&&E[1]===L[1]&&E[0]>=L[0]}_selectWordAtCursor(E,L){var F,U;const B=(U=(F=this._linkifier.currentLink)==null?void 0:F.link)==null?void 0:U.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,m.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(E);return!!I&&(this._selectWordAt(I,L),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,L){this._model.clearSelection(),E=Math.max(E,0),L=Math.min(L,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,L],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const L=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(L)return L[0]--,L[1]--,L[1]+=this._bufferService.buffer.ydisp,L}_getMouseEventScrollAmount(E){let L=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return L>=0&&L<=B?0:(L>B&&(L-=B),L=Math.min(Math.max(L,-50),50),L/=50,L/Math.abs(L)+Math.round(14*L))}shouldForceSelection(E){return y.isMac?E.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:E.shiftKey}handleMouseDown(E){if(this._mouseDownTimeStamp=E.timeStamp,(E.button!==2||!this.hasSelection)&&E.button===0){if(!this._enabled){if(!this.shouldForceSelection(E))return;E.stopPropagation()}E.preventDefault(),this._dragScrollAmount=0,this._enabled&&E.shiftKey?this._handleIncrementalClick(E):E.detail===1?this._handleSingleClick(E):E.detail===2?this._handleDoubleClick(E):E.detail===3&&this._handleTripleClick(E),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(E){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(E))}_handleSingleClick(E){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(E)?3:0,this._model.selectionStart=this._getMouseBufferCoords(E),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const L=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);L&&L.length!==this._model.selectionStart[0]&&L.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const L=this._getMouseBufferCoords(E);L&&(this._activeSelectionMode=2,this._selectLineAt(L[1]))}shouldColumnSelect(E){return E.altKey&&!(y.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.stopImmediatePropagation(),!this._model.selectionStart)return;const L=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(E),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(E),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const B=this._bufferService.buffer;if(this._model.selectionEnd[1]<B.lines.length){const I=B.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}L&&L[0]===this._model.selectionEnd[0]&&L[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const E=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(E.ydisp+this._bufferService.rows,E.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=E.ydisp),this.refresh()}}_handleMouseUp(E){const L=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&L<500&&E.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const I=(0,b.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,L=this._model.finalSelectionEnd,B=!(!E||!L||E[0]===L[0]&&E[1]===L[1]);B?E&&L&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&L[0]===this._oldSelectionEnd[0]&&L[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,L,B)):this._oldHasSelection&&this._fireOnSelectionChange(E,L,B)}_fireOnSelectionChange(E,L,B){this._oldSelectionStart=E,this._oldSelectionEnd=L,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim((L=>this._handleTrim(L)))}_convertViewportColToCharacterIndex(E,L){let B=L;for(let I=0;L>=I;I++){const F=E.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:F>1&&L!==I&&(B+=F-1)}return B}setSelection(E,L,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,L],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,L,B=!0,I=!0){if(E[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,U=F.lines.get(E[1]);if(!U)return;const W=F.translateBufferLineToString(E[1],!1);let X=this._convertViewportColToCharacterIndex(U,E[0]),V=X;const Y=E[0]-X;let J=0,z=0,j=0,H=0;if(W.charAt(X)===" "){for(;X>0&&W.charAt(X-1)===" ";)X--;for(;V<W.length&&W.charAt(V+1)===" ";)V++}else{let ie=E[0],he=E[0];U.getWidth(ie)===0&&(J++,ie--),U.getWidth(he)===2&&(z++,he++);const ge=U.getString(he).length;for(ge>1&&(H+=ge-1,V+=ge-1);ie>0&&X>0&&!this._isCharWordSeparator(U.loadCell(ie-1,this._workCell));){U.loadCell(ie-1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===0?(J++,ie--):K>1&&(j+=K-1,X-=K-1),X--,ie--}for(;he<U.length&&V+1<W.length&&!this._isCharWordSeparator(U.loadCell(he+1,this._workCell));){U.loadCell(he+1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,he++):K>1&&(H+=K-1,V+=K-1),V++,he++}}V++;let G=X+Y-J+j,N=Math.min(this._bufferService.cols,V-X+J+z-j-H);if(L||W.slice(X,V).trim()!==""){if(B&&G===0&&U.getCodePoint(0)!==32){const ie=F.lines.get(E[1]-1);if(ie&&U.isWrapped&&ie.getCodePoint(this._bufferService.cols-1)!==32){const he=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(he){const ge=this._bufferService.cols-he.start;G-=ge,N+=ge}}}if(I&&G+N===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const ie=F.lines.get(E[1]+1);if(ie!=null&&ie.isWrapped&&ie.getCodePoint(0)!==32){const he=this._getWordAt([0,E[1]+1],!1,!1,!0);he&&(N+=he.length)}}return{start:G,length:N}}}_selectWordAt(E,L){const B=this._getWordAt(E,L);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,E[1]--;this._model.selectionStart=[B.start,E[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(E){const L=this._getWordAt(E,!0);if(L){let B=E[1];for(;L.start<0;)L.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;L.start+L.length>this._bufferService.cols;)L.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?L.start:L.start+L.length,B]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const L=this._bufferService.buffer.getWrappedRangeForLine(E),B={start:{x:0,y:L.first},end:{x:this._bufferService.cols-1,y:L.last}};this._model.selectionStart=[0,L.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,m.getRangeLength)(B,this._bufferService.cols)}};l.SelectionService=D=h([p(3,A.IBufferService),p(4,A.ICoreService),p(5,T.IMouseService),p(6,A.IOptionsService),p(7,T.IRenderService),p(8,T.ICoreBrowserService)],D)},4725:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const h=c(8343);l.ICharSizeService=(0,h.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),l.IMouseService=(0,h.createDecorator)("MouseService"),l.IRenderService=(0,h.createDecorator)("RenderService"),l.ISelectionService=(0,h.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,h.createDecorator)("ThemeService"),l.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,l,c){var h=this&&this.__decorate||function(D,E,L,B){var I,F=arguments.length,U=F<3?E:B===null?B=Object.getOwnPropertyDescriptor(E,L):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(D,E,L,B);else for(var W=D.length-1;W>=0;W--)(I=D[W])&&(U=(F<3?I(U):F>3?I(E,L,U):I(E,L))||U);return F>3&&U&&Object.defineProperty(E,L,U),U},p=this&&this.__param||function(D,E){return function(L,B){E(L,B,D)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),b=c(8055),C=c(8460),T=c(844),x=c(2585),_=b.css.toColor("#ffffff"),y=b.css.toColor("#000000"),m=b.css.toColor("#ffffff"),S=b.css.toColor("#000000"),A={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[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")],E=[0,95,135,175,215,255];for(let L=0;L<216;L++){const B=E[L/36%6|0],I=E[L/6%6|0],F=E[L%6];D.push({css:b.channels.toCss(B,I,F),rgba:b.channels.toRgba(B,I,F)})}for(let L=0;L<24;L++){const B=8+10*L;D.push({css:b.channels.toCss(B,B,B),rgba:b.channels.toRgba(B,B,B)})}return D})());let M=l.ThemeService=class extends T.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,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:_,background:y,cursor:m,cursorAccent:S,selectionForeground:void 0,selectionBackgroundTransparent:A,selectionBackgroundOpaque:b.color.blend(y,A),selectionInactiveBackgroundTransparent:A,selectionInactiveBackgroundOpaque:b.color.blend(y,A),ansi:l.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const E=this._colors;if(E.foreground=R(D.foreground,_),E.background=R(D.background,y),E.cursor=R(D.cursor,m),E.cursorAccent=R(D.cursorAccent,S),E.selectionBackgroundTransparent=R(D.selectionBackground,A),E.selectionBackgroundOpaque=b.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=R(D.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=b.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=D.selectionForeground?R(D.selectionForeground,b.NULL_COLOR):void 0,E.selectionForeground===b.NULL_COLOR&&(E.selectionForeground=void 0),b.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=b.color.opacity(E.selectionBackgroundTransparent,.3)),b.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=b.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=l.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=R(D.black,l.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=R(D.red,l.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=R(D.green,l.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=R(D.yellow,l.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=R(D.blue,l.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=R(D.magenta,l.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=R(D.cyan,l.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=R(D.white,l.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=R(D.brightBlack,l.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=R(D.brightRed,l.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=R(D.brightGreen,l.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=R(D.brightYellow,l.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=R(D.brightBlue,l.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=R(D.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=R(D.brightCyan,l.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=R(D.brightWhite,l.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const L=Math.min(E.ansi.length-16,D.extendedAnsi.length);for(let B=0;B<L;B++)E.ansi[B+16]=R(D.extendedAnsi[B],l.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[D]=this._restoreColors.ansi[D]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(D,E){if(D!==void 0)try{return b.css.toColor(D)}catch{}return E}l.ThemeService=M=h([p(0,x.IOptionsService)],M)},6349:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const h=c(8460),p=c(844);class u extends p.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 x=0;x<Math.min(C,this.length);x++)T[x]=this._array[this._getCyclicIndex(x)];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,...x){if(T){for(let _=C;_<this._length-T;_++)this._array[this._getCyclicIndex(_)]=this._array[this._getCyclicIndex(_+T)];this._length-=T,this.onDeleteEmitter.fire({index:C,amount:T})}for(let _=this._length-1;_>=C;_--)this._array[this._getCyclicIndex(_+x.length)]=this._array[this._getCyclicIndex(_)];for(let _=0;_<x.length;_++)this._array[this._getCyclicIndex(C+_)]=x[_];if(x.length&&this.onInsertEmitter.fire({index:C,amount:x.length}),this._length+x.length>this._maxLength){const _=this._length+x.length-this._maxLength;this._startIndex+=_,this._length=this._maxLength,this.onTrimEmitter.fire(_)}else this._length+=x.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,T,x){if(!(T<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let y=T-1;y>=0;y--)this.set(C+y+x,this.get(C+y));const _=C+T+x-this._length;if(_>0)for(this._length+=_;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let _=0;_<T;_++)this.set(C+_+x,this.get(C+_))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}l.CircularList=u},1439:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function c(h,p=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const b in h)u[b]=p<=1?h[b]:h[b]&&c(h[b],p-1);return u}},8055:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let c=0,h=0,p=0,u=0;var b,C,T,x,_;function y(S){const A=S.toString(16);return A.length<2?"0"+A:A}function m(S,A){return S<A?(A+.05)/(S+.05):(S+.05)/(A+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(S){S.toCss=function(A,M,R,D){return D!==void 0?`#${y(A)}${y(M)}${y(R)}${y(D)}`:`#${y(A)}${y(M)}${y(R)}`},S.toRgba=function(A,M,R,D=255){return(A<<24|M<<16|R<<8|D)>>>0},S.toColor=function(A,M,R,D){return{css:S.toCss(A,M,R,D),rgba:S.toRgba(A,M,R,D)}}})(b||(l.channels=b={})),(function(S){function A(M,R){return u=Math.round(255*R),[c,h,p]=_.toChannels(M.rgba),{css:b.toCss(c,h,p,u),rgba:b.toRgba(c,h,p,u)}}S.blend=function(M,R){if(u=(255&R.rgba)/255,u===1)return{css:R.css,rgba:R.rgba};const D=R.rgba>>24&255,E=R.rgba>>16&255,L=R.rgba>>8&255,B=M.rgba>>24&255,I=M.rgba>>16&255,F=M.rgba>>8&255;return c=B+Math.round((D-B)*u),h=I+Math.round((E-I)*u),p=F+Math.round((L-F)*u),{css:b.toCss(c,h,p),rgba:b.toRgba(c,h,p)}},S.isOpaque=function(M){return(255&M.rgba)==255},S.ensureContrastRatio=function(M,R,D){const E=_.ensureContrastRatio(M.rgba,R.rgba,D);if(E)return b.toColor(E>>24&255,E>>16&255,E>>8&255)},S.opaque=function(M){const R=(255|M.rgba)>>>0;return[c,h,p]=_.toChannels(R),{css:b.toCss(c,h,p),rgba:R}},S.opacity=A,S.multiplyOpacity=function(M,R){return u=255&M.rgba,A(M,u*R/255)},S.toColorRGB=function(M){return[M.rgba>>24&255,M.rgba>>16&255,M.rgba>>8&255]}})(C||(l.color=C={})),(function(S){let A,M;try{const R=document.createElement("canvas");R.width=1,R.height=1;const D=R.getContext("2d",{willReadFrequently:!0});D&&(A=D,A.globalCompositeOperation="copy",M=A.createLinearGradient(0,0,1,1))}catch{}S.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return c=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),p=parseInt(R.slice(3,4).repeat(2),16),b.toColor(c,h,p);case 5:return c=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),p=parseInt(R.slice(3,4).repeat(2),16),u=parseInt(R.slice(4,5).repeat(2),16),b.toColor(c,h,p,u);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const D=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return c=parseInt(D[1]),h=parseInt(D[2]),p=parseInt(D[3]),u=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),b.toColor(c,h,p,u);if(!A||!M)throw new Error("css.toColor: Unsupported css format");if(A.fillStyle=M,A.fillStyle=R,typeof A.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(A.fillRect(0,0,1,1),[c,h,p,u]=A.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(c,h,p,u),css:R}}})(T||(l.css=T={})),(function(S){function A(M,R,D){const E=M/255,L=R/255,B=D/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}S.relativeLuminance=function(M){return A(M>>16&255,M>>8&255,255&M)},S.relativeLuminance2=A})(x||(l.rgb=x={})),(function(S){function A(R,D,E){const L=R>>24&255,B=R>>16&255,I=R>>8&255;let F=D>>24&255,U=D>>16&255,W=D>>8&255,X=m(x.relativeLuminance2(F,U,W),x.relativeLuminance2(L,B,I));for(;X<E&&(F>0||U>0||W>0);)F-=Math.max(0,Math.ceil(.1*F)),U-=Math.max(0,Math.ceil(.1*U)),W-=Math.max(0,Math.ceil(.1*W)),X=m(x.relativeLuminance2(F,U,W),x.relativeLuminance2(L,B,I));return(F<<24|U<<16|W<<8|255)>>>0}function M(R,D,E){const L=R>>24&255,B=R>>16&255,I=R>>8&255;let F=D>>24&255,U=D>>16&255,W=D>>8&255,X=m(x.relativeLuminance2(F,U,W),x.relativeLuminance2(L,B,I));for(;X<E&&(F<255||U<255||W<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),U=Math.min(255,U+Math.ceil(.1*(255-U))),W=Math.min(255,W+Math.ceil(.1*(255-W))),X=m(x.relativeLuminance2(F,U,W),x.relativeLuminance2(L,B,I));return(F<<24|U<<16|W<<8|255)>>>0}S.blend=function(R,D){if(u=(255&D)/255,u===1)return D;const E=D>>24&255,L=D>>16&255,B=D>>8&255,I=R>>24&255,F=R>>16&255,U=R>>8&255;return c=I+Math.round((E-I)*u),h=F+Math.round((L-F)*u),p=U+Math.round((B-U)*u),b.toRgba(c,h,p)},S.ensureContrastRatio=function(R,D,E){const L=x.relativeLuminance(R>>8),B=x.relativeLuminance(D>>8);if(m(L,B)<E){if(B<L){const U=A(R,D,E),W=m(L,x.relativeLuminance(U>>8));if(W<E){const X=M(R,D,E);return W>m(L,x.relativeLuminance(X>>8))?U:X}return U}const I=M(R,D,E),F=m(L,x.relativeLuminance(I>>8));if(F<E){const U=A(R,D,E);return F>m(L,x.relativeLuminance(U>>8))?I:U}return I}},S.reduceLuminance=A,S.increaseLuminance=M,S.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(_||(l.rgba=_={})),l.toPaddedHex=y,l.contrastRatio=m},8969:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const h=c(844),p=c(2585),u=c(4348),b=c(7866),C=c(744),T=c(7302),x=c(6975),_=c(8460),y=c(1753),m=c(1480),S=c(7994),A=c(9282),M=c(5435),R=c(5981),D=c(2660);let E=!1;class L extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new _.EventEmitter),this._onScroll.event((I=>{var F;(F=this._onScrollApi)==null||F.fire(I.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(I){for(const F in I)this.optionsService.options[F]=I[F]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new _.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new _.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new _.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new T.OptionsService(I)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(b.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(y.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(m.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(S.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new M.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,_.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,_.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,_.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,_.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((F=>{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((F=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((F,U)=>this._inputHandler.parse(F,U)))),this.register((0,_.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,F){this._writeBuffer.write(I,F)}writeSync(I,F){this._logService.logLevel<=p.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(I,F)}input(I,F=!0){this.coreService.triggerDataEvent(I,F)}resize(I,F){isNaN(I)||isNaN(F)||(I=Math.max(I,C.MINIMUM_COLS),F=Math.max(F,C.MINIMUM_ROWS),this._bufferService.resize(I,F))}scroll(I,F=!1){this._bufferService.scroll(I,F)}scrollLines(I,F,U){this._bufferService.scrollLines(I,F,U)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const F=I-this._bufferService.buffer.ydisp;F!==0&&this.scrollLines(F)}registerEscHandler(I,F){return this._inputHandler.registerEscHandler(I,F)}registerDcsHandler(I,F){return this._inputHandler.registerDcsHandler(I,F)}registerCsiHandler(I,F){return this._inputHandler.registerCsiHandler(I,F)}registerOscHandler(I,F){return this._inputHandler.registerOscHandler(I,F)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const F=this.optionsService.rawOptions.windowsPty;F&&F.buildNumber!==void 0&&F.buildNumber!==void 0?I=F.backend==="conpty"&&F.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(A.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,A.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const F of I)F.dispose()}))}}}l.CoreTerminal=L},8460:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=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 p=[];for(let u=0;u<this._listeners.length;u++)p.push(this._listeners[u]);for(let u=0;u<p.length;u++)p[u].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(c,h){return c((p=>h.fire(p)))},l.runAndSubscribe=function(c,h){return h(void 0),c((p=>h(p)))}},5435:function(f,l,c){var h=this&&this.__decorate||function(J,z,j,H){var G,N=arguments.length,ie=N<3?z:H===null?H=Object.getOwnPropertyDescriptor(z,j):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ie=Reflect.decorate(J,z,j,H);else for(var he=J.length-1;he>=0;he--)(G=J[he])&&(ie=(N<3?G(ie):N>3?G(z,j,ie):G(z,j))||ie);return N>3&&ie&&Object.defineProperty(z,j,ie),ie},p=this&&this.__param||function(J,z){return function(j,H){z(j,H,J)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const u=c(2584),b=c(7116),C=c(2015),T=c(844),x=c(482),_=c(8437),y=c(8460),m=c(643),S=c(511),A=c(3734),M=c(2585),R=c(1480),D=c(6242),E=c(6351),L=c(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function F(J,z){if(J>24)return z.setWinLines||!1;switch(J){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 U;(function(J){J[J.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",J[J.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(U||(l.WindowsOptionsReportType=U={}));let W=0;class X extends T.Disposable{getAttrData(){return this._curAttrData}constructor(z,j,H,G,N,ie,he,ge,K=new C.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=j,this._coreService=H,this._logService=G,this._optionsService=N,this._oscLinkService=ie,this._coreMouseService=he,this._unicodeService=ge,this._parser=K,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new S.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((q=>this._activeBuffer=q.activeBuffer))),this._parser.setCsiHandlerFallback(((q,te)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:te.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,te,le)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:te,data:le})})),this._parser.setDcsHandlerFallback(((q,te,le)=>{te==="HOOK"&&(le=le.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:te,payload:le})})),this._parser.setPrintHandler(((q,te,le)=>this.print(q,te,le))),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 D.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new D.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new D.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new D.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new D.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new D.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new D.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new D.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new D.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new D.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new D.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 E.DcsHandler(((q,te)=>this.requestStatusString(q,te))))}_preserveStack(z,j,H,G){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=j,this._parseStack.decodedLength=H,this._parseStack.position=G}_logSlowResolvingAsync(z){this._logService.logLevel<=M.LogLevelEnum.WARN&&Promise.race([z,new Promise(((j,H)=>setTimeout((()=>H("#SLOW_TIMEOUT")),5e3)))]).catch((j=>{if(j!=="#SLOW_TIMEOUT")throw j;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(z,j){let H,G=this._activeBuffer.x,N=this._activeBuffer.y,ie=0;const he=this._parseStack.paused;if(he){if(H=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,j))return this._logSlowResolvingAsync(H),H;G=this._parseStack.cursorStartX,N=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>I&&(ie=this._parseStack.position+I)}if(this._logService.logLevel<=M.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<I&&(this._parseBuffer=new Uint32Array(Math.min(z.length,I))),he||this._dirtyRowTracker.clearRange(),z.length>I)for(let q=ie;q<z.length;q+=I){const te=q+I<z.length?q+I:z.length,le=typeof z=="string"?this._stringDecoder.decode(z.substring(q,te),this._parseBuffer):this._utf8Decoder.decode(z.subarray(q,te),this._parseBuffer);if(H=this._parser.parse(this._parseBuffer,le))return this._preserveStack(G,N,le,q),this._logSlowResolvingAsync(H),H}else if(!he){const q=typeof z=="string"?this._stringDecoder.decode(z,this._parseBuffer):this._utf8Decoder.decode(z,this._parseBuffer);if(H=this._parser.parse(this._parseBuffer,q))return this._preserveStack(G,N,q,0),this._logSlowResolvingAsync(H),H}this._activeBuffer.x===G&&this._activeBuffer.y===N||this._onCursorMove.fire();const ge=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),K=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);K<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(K,this._bufferService.rows-1),Math.min(ge,this._bufferService.rows-1))}print(z,j,H){let G,N;const ie=this._charsetService.charset,he=this._optionsService.rawOptions.screenReaderMode,ge=this._bufferService.cols,K=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,te=this._curAttrData;let le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&H-j>0&&le.getWidth(this._activeBuffer.x-1)===2&&le.setCellFromCodepoint(this._activeBuffer.x-1,0,1,te);let xe=this._parser.precedingJoinState;for(let Ee=j;Ee<H;++Ee){if(G=z[Ee],G<127&&ie){const He=ie[String.fromCharCode(G)];He&&(G=He.charCodeAt(0))}const Ce=this._unicodeService.charProperties(G,xe);N=R.UnicodeService.extractWidth(Ce);const me=R.UnicodeService.extractShouldJoin(Ce),Te=me?R.UnicodeService.extractWidth(xe):0;if(xe=Ce,he&&this._onA11yChar.fire((0,x.stringFromCodePoint)(G)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+N-Te>ge){if(K){const He=le;let ke=this._activeBuffer.x-Te;for(this._activeBuffer.x=Te,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Te>0&&le instanceof _.BufferLine&&le.copyCellsFrom(He,ke,0,Te,!1);ke<ge;)He.setCellFromCodepoint(ke++,0,1,te)}else if(this._activeBuffer.x=ge-1,N===2)continue}if(me&&this._activeBuffer.x){const He=le.getWidth(this._activeBuffer.x-1)?1:2;le.addCodepointToCell(this._activeBuffer.x-He,G,N);for(let ke=N-Te;--ke>=0;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,te)}else if(q&&(le.insertCells(this._activeBuffer.x,N-Te,this._activeBuffer.getNullCell(te)),le.getWidth(ge-1)===2&&le.setCellFromCodepoint(ge-1,m.NULL_CELL_CODE,m.NULL_CELL_WIDTH,te)),le.setCellFromCodepoint(this._activeBuffer.x++,G,N,te),N>0)for(;--N;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,te)}this._parser.precedingJoinState=xe,this._activeBuffer.x<ge&&H-j>0&&le.getWidth(this._activeBuffer.x)===0&&!le.hasContent(this._activeBuffer.x)&&le.setCellFromCodepoint(this._activeBuffer.x,0,1,te),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(z,j){return z.final!=="t"||z.prefix||z.intermediates?this._parser.registerCsiHandler(z,j):this._parser.registerCsiHandler(z,(H=>!F(H.params[0],this._optionsService.rawOptions.windowOptions)||j(H)))}registerDcsHandler(z,j){return this._parser.registerDcsHandler(z,new E.DcsHandler(j))}registerEscHandler(z,j){return this._parser.registerEscHandler(z,j)}registerOscHandler(z,j){return this._parser.registerOscHandler(z,new D.OscHandler(j))}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 j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);j.hasWidth(this._activeBuffer.x)&&!j.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,j){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=z,this._activeBuffer.y=this._activeBuffer.scrollTop+j):(this._activeBuffer.x=z,this._activeBuffer.y=j),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(z,j){this._restrictCursor(),this._setCursor(this._activeBuffer.x+z,this._activeBuffer.y+j)}cursorUp(z){const j=this._activeBuffer.y-this._activeBuffer.scrollTop;return j>=0?this._moveCursor(0,-Math.min(j,z.params[0]||1)):this._moveCursor(0,-(z.params[0]||1)),!0}cursorDown(z){const j=this._activeBuffer.scrollBottom-this._activeBuffer.y;return j>=0?this._moveCursor(0,Math.min(j,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 j=z.params[0];return j===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:j===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=z.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=z.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(z){const j=z.params[0];return j===1&&(this._curAttrData.bg|=536870912),j!==2&&j!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(z,j,H,G=!1,N=!1){const ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);ie.replaceCells(j,H,this._activeBuffer.getNullCell(this._eraseAttrData()),N),G&&(ie.isWrapped=!1)}_resetBufferLine(z,j=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);H&&(H.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),j),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),H.isWrapped=!1)}eraseInDisplay(z,j=!1){let H;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,j);H<this._bufferService.rows;H++)this._resetBufferLine(H,j);this._dirtyRowTracker.markDirty(H);break;case 1:for(H=this._activeBuffer.y,this._dirtyRowTracker.markDirty(H),this._eraseInBufferLine(H,0,this._activeBuffer.x+1,!0,j),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(H+1).isWrapped=!1);H--;)this._resetBufferLine(H,j);this._dirtyRowTracker.markDirty(0);break;case 2:for(H=this._bufferService.rows,this._dirtyRowTracker.markDirty(H-1);H--;)this._resetBufferLine(H,j);this._dirtyRowTracker.markDirty(0);break;case 3:const G=this._activeBuffer.lines.length-this._bufferService.rows;G>0&&(this._activeBuffer.lines.trimStart(G),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-G,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-G,0),this._onScroll.fire(0))}return!0}eraseInLine(z,j=!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,j);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,j);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,j)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(z){this._restrictCursor();let j=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=this._activeBuffer.ybase+this._activeBuffer.y,G=this._bufferService.rows-1-this._activeBuffer.scrollBottom,N=this._bufferService.rows-1+this._activeBuffer.ybase-G+1;for(;j--;)this._activeBuffer.lines.splice(N-1,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(z){this._restrictCursor();let j=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=this._activeBuffer.ybase+this._activeBuffer.y;let G;for(G=this._bufferService.rows-1-this._activeBuffer.scrollBottom,G=this._bufferService.rows-1+this._activeBuffer.ybase-G;j--;)this._activeBuffer.lines.splice(H,1),this._activeBuffer.lines.splice(G,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 j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.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 j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.deleteCells(this._activeBuffer.x,z.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(z){let j=z.params[0]||1;for(;j--;)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 j=z.params[0]||1;for(;j--;)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(_.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 j=z.params[0]||1;for(let H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);G.deleteCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),G.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 j=z.params[0]||1;for(let H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);G.insertCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),G.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 j=z.params[0]||1;for(let H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);G.insertCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),G.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 j=z.params[0]||1;for(let H=this._activeBuffer.scrollTop;H<=this._activeBuffer.scrollBottom;++H){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);G.deleteCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(z){this._restrictCursor();const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.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 j=this._parser.precedingJoinState;if(!j)return!0;const H=z.params[0]||1,G=R.UnicodeService.extractWidth(j),N=this._activeBuffer.x-G,ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(N),he=new Uint32Array(ie.length*H);let ge=0;for(let q=0;q<ie.length;){const te=ie.codePointAt(q)||0;he[ge++]=te,q+=te>65535?2:1}let K=ge;for(let q=1;q<H;++q)he.copyWithin(K,0,ge),K+=ge;return this.print(he,0,K),!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 j=0;j<z.length;j++)switch(z.params[j]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(z){for(let j=0;j<z.length;j++)switch(z.params[j]){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 j=0;j<z.length;j++)switch(z.params[j]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(z){for(let j=0;j<z.length;j++)switch(z.params[j]){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[j]===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,j){const H=this._coreService.decPrivateModes,{activeProtocol:G,activeEncoding:N}=this._coreMouseService,ie=this._coreService,{buffers:he,cols:ge}=this._bufferService,{active:K,alt:q}=he,te=this._optionsService.rawOptions,le=me=>me?1:2,xe=z.params[0];return Ee=xe,Ce=j?xe===2?4:xe===4?le(ie.modes.insertMode):xe===12?3:xe===20?le(te.convertEol):0:xe===1?le(H.applicationCursorKeys):xe===3?te.windowOptions.setWinLines?ge===80?2:ge===132?1:0:0:xe===6?le(H.origin):xe===7?le(H.wraparound):xe===8?3:xe===9?le(G==="X10"):xe===12?le(te.cursorBlink):xe===25?le(!ie.isCursorHidden):xe===45?le(H.reverseWraparound):xe===66?le(H.applicationKeypad):xe===67?4:xe===1e3?le(G==="VT200"):xe===1002?le(G==="DRAG"):xe===1003?le(G==="ANY"):xe===1004?le(H.sendFocus):xe===1005?4:xe===1006?le(N==="SGR"):xe===1015?4:xe===1016?le(N==="SGR_PIXELS"):xe===1048?1:xe===47||xe===1047||xe===1049?le(K===q):xe===2004?le(H.bracketedPasteMode):0,ie.triggerDataEvent(`${u.C0.ESC}[${j?"":"?"}${Ee};${Ce}$y`),!0;var Ee,Ce}_updateAttrColor(z,j,H,G,N){return j===2?(z|=50331648,z&=-16777216,z|=A.AttributeData.fromColorRGB([H,G,N])):j===5&&(z&=-50331904,z|=33554432|255&H),z}_extractColor(z,j,H){const G=[0,0,-1,0,0,0];let N=0,ie=0;do{if(G[ie+N]=z.params[j+ie],z.hasSubParams(j+ie)){const he=z.getSubParams(j+ie);let ge=0;do G[1]===5&&(N=1),G[ie+ge+1+N]=he[ge];while(++ge<he.length&&ge+ie+1+N<G.length);break}if(G[1]===5&&ie+N>=2||G[1]===2&&ie+N>=5)break;G[1]&&(N=1)}while(++ie+j<z.length&&ie+N<G.length);for(let he=2;he<G.length;++he)G[he]===-1&&(G[he]=0);switch(G[0]){case 38:H.fg=this._updateAttrColor(H.fg,G[1],G[3],G[4],G[5]);break;case 48:H.bg=this._updateAttrColor(H.bg,G[1],G[3],G[4],G[5]);break;case 58:H.extended=H.extended.clone(),H.extended.underlineColor=this._updateAttrColor(H.extended.underlineColor,G[1],G[3],G[4],G[5])}return ie}_processUnderline(z,j){j.extended=j.extended.clone(),(!~z||z>5)&&(z=1),j.extended.underlineStyle=z,j.fg|=268435456,z===0&&(j.fg&=-268435457),j.updateExtended()}_processSGR0(z){z.fg=_.DEFAULT_ATTR_DATA.fg,z.bg=_.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 j=z.length;let H;const G=this._curAttrData;for(let N=0;N<j;N++)H=z.params[N],H>=30&&H<=37?(G.fg&=-50331904,G.fg|=16777216|H-30):H>=40&&H<=47?(G.bg&=-50331904,G.bg|=16777216|H-40):H>=90&&H<=97?(G.fg&=-50331904,G.fg|=16777224|H-90):H>=100&&H<=107?(G.bg&=-50331904,G.bg|=16777224|H-100):H===0?this._processSGR0(G):H===1?G.fg|=134217728:H===3?G.bg|=67108864:H===4?(G.fg|=268435456,this._processUnderline(z.hasSubParams(N)?z.getSubParams(N)[0]:1,G)):H===5?G.fg|=536870912:H===7?G.fg|=67108864:H===8?G.fg|=1073741824:H===9?G.fg|=2147483648:H===2?G.bg|=134217728:H===21?this._processUnderline(2,G):H===22?(G.fg&=-134217729,G.bg&=-134217729):H===23?G.bg&=-67108865:H===24?(G.fg&=-268435457,this._processUnderline(0,G)):H===25?G.fg&=-536870913:H===27?G.fg&=-67108865:H===28?G.fg&=-1073741825:H===29?G.fg&=2147483647:H===39?(G.fg&=-67108864,G.fg|=16777215&_.DEFAULT_ATTR_DATA.fg):H===49?(G.bg&=-67108864,G.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):H===38||H===48||H===58?N+=this._extractColor(z,N,G):H===53?G.bg|=1073741824:H===55?G.bg&=-1073741825:H===59?(G.extended=G.extended.clone(),G.extended.underlineColor=-1,G.updateExtended()):H===100?(G.fg&=-67108864,G.fg|=16777215&_.DEFAULT_ATTR_DATA.fg,G.bg&=-67108864,G.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",H);return!0}deviceStatus(z){switch(z.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const j=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${j};${H}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const j=this._activeBuffer.y+1,H=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${j};${H}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=_.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 j=z.params[0]||1;switch(j){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 H=j%2==1;return this._optionsService.options.cursorBlink=H,!0}setScrollRegion(z){const j=z.params[0]||1;let H;return(z.length<2||(H=z.params[1])>this._bufferService.rows||H===0)&&(H=this._bufferService.rows),H>j&&(this._activeBuffer.scrollTop=j-1,this._activeBuffer.scrollBottom=H-1,this._setCursor(0,0)),!0}windowOptions(z){if(!F(z.params[0],this._optionsService.rawOptions.windowOptions))return!0;const j=z.length>1?z.params[1]:0;switch(z.params[0]){case 14:j!==2&&this._onRequestWindowsOptionsReport.fire(U.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(U.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:j!==0&&j!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),j!==0&&j!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:j!==0&&j!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),j!==0&&j!==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 j=[],H=z.split(";");for(;H.length>1;){const G=H.shift(),N=H.shift();if(/^\d+$/.exec(G)){const ie=parseInt(G);if(Y(ie))if(N==="?")j.push({type:0,index:ie});else{const he=(0,L.parseColor)(N);he&&j.push({type:1,index:ie,color:he})}}}return j.length&&this._onColor.fire(j),!0}setHyperlink(z){const j=z.split(";");return!(j.length<2)&&(j[1]?this._createHyperlink(j[0],j[1]):!j[0]&&this._finishHyperlink())}_createHyperlink(z,j){this._getCurrentLinkId()&&this._finishHyperlink();const H=z.split(":");let G;const N=H.findIndex((ie=>ie.startsWith("id=")));return N!==-1&&(G=H[N].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:G,uri:j}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(z,j){const H=z.split(";");for(let G=0;G<H.length&&!(j>=this._specialColors.length);++G,++j)if(H[G]==="?")this._onColor.fire([{type:0,index:this._specialColors[j]}]);else{const N=(0,L.parseColor)(H[G]);N&&this._onColor.fire([{type:1,index:this._specialColors[j],color:N}])}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 j=[],H=z.split(";");for(let G=0;G<H.length;++G)if(/^\d+$/.exec(H[G])){const N=parseInt(H[G]);Y(N)&&j.push({type:2,index:N})}return j.length&&this._onColor.fire(j),!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(B[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=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.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 S.CellData;z.content=4194373,z.fg=this._curAttrData.fg,z.bg=this._curAttrData.bg,this._setCursor(0,0);for(let j=0;j<this._bufferService.rows;++j){const H=this._activeBuffer.ybase+this._activeBuffer.y+j,G=this._activeBuffer.lines.get(H);G&&(G.fill(z),G.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(z,j){const H=this._bufferService.buffer,G=this._optionsService.rawOptions;return(N=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${N}${u.C0.ESC}\\`),!0))(z==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:z==='"p'?'P1$r61;1"p':z==="r"?`P1$r${H.scrollTop+1};${H.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[G.cursorStyle]-(G.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,j){this._dirtyRowTracker.markRangeDirty(z,j)}}l.InputHandler=X;let V=class{constructor(J){this._bufferService=J,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(J){J<this.start?this.start=J:J>this.end&&(this.end=J)}markRangeDirty(J,z){J>z&&(W=J,J=z,z=W),J<this.start&&(this.start=J),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(J){return 0<=J&&J<256}V=h([p(0,M.IBufferService)],V)},844:(f,l)=>{function c(h){for(const p of h)p.dispose();h.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const p=this._disposables.indexOf(h);p!==-1&&this._disposables.splice(p,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var p;this._isDisposed||h===this._value||((p=this._value)==null||p.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}},l.toDisposable=function(h){return{dispose:h}},l.disposeArray=c,l.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,u,b){this._data[p]||(this._data[p]={}),this._data[p][u]=b}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}l.TwoKeyMap=c,l.FourKeyMap=class{constructor(){this._data=new c}set(h,p,u,b,C){this._data.get(h,p)||this._data.set(h,p,new c),this._data.get(h,p).set(u,b,C)}get(h,p,u,b){var C;return(C=this._data.get(h,p))==null?void 0:C.get(u,b)}clear(){this._data.clear()}}},6114:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const c=l.isNode?"node":navigator.userAgent,h=l.isNode?"node":navigator.platform;l.isFirefox=c.includes("Firefox"),l.isLegacyEdge=c.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(c),l.getSafariVersion=function(){if(!l.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),l.isIpad=h==="iPad",l.isIphone=h==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),l.isLinux=h.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let c=0;l.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 p=this._getKey(h);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)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])===p);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,p){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do p(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let p=0,u=this._array.length-1;for(;u>=p;){let b=p+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}p=b+1}}return p}}},7226:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const h=c(6114);class p{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,x=0,_=C.timeRemaining(),y=0;for(;this._i<this._tasks.length;){if(T=Date.now(),this._tasks[this._i]()||this._i++,T=Math.max(1,Date.now()-T),x=Math.max(T,x),y=C.timeRemaining(),1.5*x>y)return _-T<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(_-T))}ms`),void this._start();_=y}this.clear()}}class u extends p{_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())}}}l.PriorityTaskQueue=u,l.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:u,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}flush(){this._queue.flush()}}},9282:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const h=c(643);l.updateWindowsModeWrappedState=function(p){const u=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),b=u==null?void 0:u.get(p.cols-1),C=p.buffer.lines.get(p.buffer.ybase+p.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,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.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}}l.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}}l.ExtendedAttrs=h},9092:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const h=c(6349),p=c(7226),u=c(3734),b=c(8437),C=c(4634),T=c(511),x=c(643),_=c(4863),y=c(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(m,S,A){this._hasScrollback=m,this._optionsService=S,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=y.DEFAULT_CHARSET,this.markers=[],this._nullCell=T.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=T.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.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(m){return m?(this._nullCell.fg=m.fg,this._nullCell.bg=m.bg,this._nullCell.extended=m.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(m){return m?(this._whitespaceCell.fg=m.fg,this._whitespaceCell.bg=m.bg,this._whitespaceCell.extended=m.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(m,S){return new b.BufferLine(this._bufferService.cols,this.getNullCell(m),S)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const m=this.ybase+this.y-this.ydisp;return m>=0&&m<this._rows}_getCorrectBufferLength(m){if(!this._hasScrollback)return m;const S=m+this._optionsService.rawOptions.scrollback;return S>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:S}fillViewportRows(m){if(this.lines.length===0){m===void 0&&(m=b.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)this.lines.push(this.getBlankLine(m))}}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(m,S){const A=this.getNullCell(b.DEFAULT_ATTR_DATA);let M=0;const R=this._getCorrectBufferLength(S);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<m)for(let E=0;E<this.lines.length;E++)M+=+this.lines.get(E).resize(m,A);let D=0;if(this._rows<S)for(let E=this._rows;E<S;E++)this.lines.length<S+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(m,A)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new b.BufferLine(m,A)));else for(let E=this._rows;E>S;E--)this.lines.length>S+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const E=this.lines.length-R;E>0&&(this.lines.trimStart(E),this.ybase=Math.max(this.ybase-E,0),this.ydisp=Math.max(this.ydisp-E,0),this.savedY=Math.max(this.savedY-E,0)),this.lines.maxLength=R}this.x=Math.min(this.x,m-1),this.y=Math.min(this.y,S-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,m-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(m,S),this._cols>m))for(let D=0;D<this.lines.length;D++)M+=+this.lines.get(D).resize(m,A);this._cols=m,this._rows=S,this._memoryCleanupQueue.clear(),M>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let m=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,m=!1);let S=0;for(;this._memoryCleanupPosition<this.lines.length;)if(S+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),S>100)return!0;return m}get _isReflowEnabled(){const m=this._optionsService.rawOptions.windowsPty;return m&&m.buildNumber?this._hasScrollback&&m.backend==="conpty"&&m.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(m,S){this._cols!==m&&(m>this._cols?this._reflowLarger(m,S):this._reflowSmaller(m,S))}_reflowLarger(m,S){const A=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,m,this.ybase+this.y,this.getNullCell(b.DEFAULT_ATTR_DATA));if(A.length>0){const M=(0,C.reflowLargerCreateNewLayout)(this.lines,A);(0,C.reflowLargerApplyNewLayout)(this.lines,M.layout),this._reflowLargerAdjustViewport(m,S,M.countRemoved)}}_reflowLargerAdjustViewport(m,S,A){const M=this.getNullCell(b.DEFAULT_ATTR_DATA);let R=A;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<S&&this.lines.push(new b.BufferLine(m,M))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-A,0)}_reflowSmaller(m,S){const A=this.getNullCell(b.DEFAULT_ATTR_DATA),M=[];let R=0;for(let D=this.lines.length-1;D>=0;D--){let E=this.lines.get(D);if(!E||!E.isWrapped&&E.getTrimmedLength()<=m)continue;const L=[E];for(;E.isWrapped&&D>0;)E=this.lines.get(--D),L.unshift(E);const B=this.ybase+this.y;if(B>=D&&B<D+L.length)continue;const I=L[L.length-1].getTrimmedLength(),F=(0,C.reflowSmallerGetNewLineLengths)(L,this._cols,m),U=F.length-L.length;let W;W=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+U):Math.max(0,this.lines.length-this.lines.maxLength+U);const X=[];for(let H=0;H<U;H++){const G=this.getBlankLine(b.DEFAULT_ATTR_DATA,!0);X.push(G)}X.length>0&&(M.push({start:D+L.length+R,newLines:X}),R+=X.length),L.push(...X);let V=F.length-1,Y=F[V];Y===0&&(V--,Y=F[V]);let J=L.length-U-1,z=I;for(;J>=0;){const H=Math.min(z,Y);if(L[V]===void 0)break;if(L[V].copyCellsFrom(L[J],z-H,Y-H,H,!0),Y-=H,Y===0&&(V--,Y=F[V]),z-=H,z===0){J--;const G=Math.max(J,0);z=(0,C.getWrappedLineTrimmedLength)(L,G,this._cols)}}for(let H=0;H<L.length;H++)F[H]<m&&L[H].setCell(F[H],A);let j=U-W;for(;j-- >0;)this.ybase===0?this.y<S-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-S&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+U,this.ybase+S-1)}if(M.length>0){const D=[],E=[];for(let V=0;V<this.lines.length;V++)E.push(this.lines.get(V));const L=this.lines.length;let B=L-1,I=0,F=M[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let U=0;for(let V=Math.min(this.lines.maxLength-1,L+R-1);V>=0;V--)if(F&&F.start>B+U){for(let Y=F.newLines.length-1;Y>=0;Y--)this.lines.set(V--,F.newLines[Y]);V++,D.push({index:B+1,amount:F.newLines.length}),U+=F.newLines.length,F=M[++I]}else this.lines.set(V,E[B--]);let W=0;for(let V=D.length-1;V>=0;V--)D[V].index+=W,this.lines.onInsertEmitter.fire(D[V]),W+=D[V].amount;const X=Math.max(0,L+R-this.lines.maxLength);X>0&&this.lines.onTrimEmitter.fire(X)}}translateBufferLineToString(m,S,A=0,M){const R=this.lines.get(m);return R?R.translateToString(S,A,M):""}getWrappedRangeForLine(m){let S=m,A=m;for(;S>0&&this.lines.get(S).isWrapped;)S--;for(;A+1<this.lines.length&&this.lines.get(A+1).isWrapped;)A++;return{first:S,last:A}}setupTabStops(m){for(m!=null?this.tabs[m]||(m=this.prevStop(m)):(this.tabs={},m=0);m<this._cols;m+=this._optionsService.rawOptions.tabStopWidth)this.tabs[m]=!0}prevStop(m){for(m==null&&(m=this.x);!this.tabs[--m]&&m>0;);return m>=this._cols?this._cols-1:m<0?0:m}nextStop(m){for(m==null&&(m=this.x);!this.tabs[++m]&&m<this._cols;);return m>=this._cols?this._cols-1:m<0?0:m}clearMarkers(m){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].line===m&&(this.markers[S].dispose(),this.markers.splice(S--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].dispose(),this.markers.splice(m--,1);this._isClearing=!1}addMarker(m){const S=new _.Marker(m);return this.markers.push(S),S.register(this.lines.onTrim((A=>{S.line-=A,S.line<0&&S.dispose()}))),S.register(this.lines.onInsert((A=>{S.line>=A.index&&(S.line+=A.amount)}))),S.register(this.lines.onDelete((A=>{S.line>=A.index&&S.line<A.index+A.amount&&S.dispose(),S.line>A.index&&(S.line-=A.amount)}))),S.register(S.onDispose((()=>this._removeMarker(S)))),S}_removeMarker(m){this._isClearing||this.markers.splice(this.markers.indexOf(m),1)}}},8437:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const h=c(3734),p=c(511),u=c(643),b=c(482);l.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let C=0;class T{constructor(_,y,m=!1){this.isWrapped=m,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*_);const S=y||p.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let A=0;A<_;++A)this.setCell(A,S);this.length=_}get(_){const y=this._data[3*_+0],m=2097151&y;return[this._data[3*_+1],2097152&y?this._combined[_]:m?(0,b.stringFromCodePoint)(m):"",y>>22,2097152&y?this._combined[_].charCodeAt(this._combined[_].length-1):m]}set(_,y){this._data[3*_+1]=y[u.CHAR_DATA_ATTR_INDEX],y[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[_]=y[1],this._data[3*_+0]=2097152|_|y[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*_+0]=y[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(_){return this._data[3*_+0]>>22}hasWidth(_){return 12582912&this._data[3*_+0]}getFg(_){return this._data[3*_+1]}getBg(_){return this._data[3*_+2]}hasContent(_){return 4194303&this._data[3*_+0]}getCodePoint(_){const y=this._data[3*_+0];return 2097152&y?this._combined[_].charCodeAt(this._combined[_].length-1):2097151&y}isCombined(_){return 2097152&this._data[3*_+0]}getString(_){const y=this._data[3*_+0];return 2097152&y?this._combined[_]:2097151&y?(0,b.stringFromCodePoint)(2097151&y):""}isProtected(_){return 536870912&this._data[3*_+2]}loadCell(_,y){return C=3*_,y.content=this._data[C+0],y.fg=this._data[C+1],y.bg=this._data[C+2],2097152&y.content&&(y.combinedData=this._combined[_]),268435456&y.bg&&(y.extended=this._extendedAttrs[_]),y}setCell(_,y){2097152&y.content&&(this._combined[_]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[_]=y.extended),this._data[3*_+0]=y.content,this._data[3*_+1]=y.fg,this._data[3*_+2]=y.bg}setCellFromCodepoint(_,y,m,S){268435456&S.bg&&(this._extendedAttrs[_]=S.extended),this._data[3*_+0]=y|m<<22,this._data[3*_+1]=S.fg,this._data[3*_+2]=S.bg}addCodepointToCell(_,y,m){let S=this._data[3*_+0];2097152&S?this._combined[_]+=(0,b.stringFromCodePoint)(y):2097151&S?(this._combined[_]=(0,b.stringFromCodePoint)(2097151&S)+(0,b.stringFromCodePoint)(y),S&=-2097152,S|=2097152):S=y|4194304,m&&(S&=-12582913,S|=m<<22),this._data[3*_+0]=S}insertCells(_,y,m){if((_%=this.length)&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,m),y<this.length-_){const S=new p.CellData;for(let A=this.length-_-y-1;A>=0;--A)this.setCell(_+y+A,this.loadCell(_+A,S));for(let A=0;A<y;++A)this.setCell(_+A,m)}else for(let S=_;S<this.length;++S)this.setCell(S,m);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,m)}deleteCells(_,y,m){if(_%=this.length,y<this.length-_){const S=new p.CellData;for(let A=0;A<this.length-_-y;++A)this.setCell(_+A,this.loadCell(_+y+A,S));for(let A=this.length-y;A<this.length;++A)this.setCell(A,m)}else for(let S=_;S<this.length;++S)this.setCell(S,m);_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,m),this.getWidth(_)!==0||this.hasContent(_)||this.setCellFromCodepoint(_,0,1,m)}replaceCells(_,y,m,S=!1){if(S)for(_&&this.getWidth(_-1)===2&&!this.isProtected(_-1)&&this.setCellFromCodepoint(_-1,0,1,m),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodepoint(y,0,1,m);_<y&&_<this.length;)this.isProtected(_)||this.setCell(_,m),_++;else for(_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,m),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y,0,1,m);_<y&&_<this.length;)this.setCell(_++,m)}resize(_,y){if(_===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const m=3*_;if(_>this.length){if(this._data.buffer.byteLength>=4*m)this._data=new Uint32Array(this._data.buffer,0,m);else{const S=new Uint32Array(m);S.set(this._data),this._data=S}for(let S=this.length;S<_;++S)this.setCell(S,y)}else{this._data=this._data.subarray(0,m);const S=Object.keys(this._combined);for(let M=0;M<S.length;M++){const R=parseInt(S[M],10);R>=_&&delete this._combined[R]}const A=Object.keys(this._extendedAttrs);for(let M=0;M<A.length;M++){const R=parseInt(A[M],10);R>=_&&delete this._extendedAttrs[R]}}return this.length=_,4*m*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const _=new Uint32Array(this._data.length);return _.set(this._data),this._data=_,1}return 0}fill(_,y=!1){if(y)for(let m=0;m<this.length;++m)this.isProtected(m)||this.setCell(m,_);else{this._combined={},this._extendedAttrs={};for(let m=0;m<this.length;++m)this.setCell(m,_)}}copyFrom(_){this.length!==_.length?this._data=new Uint32Array(_._data):this._data.set(_._data),this.length=_.length,this._combined={};for(const y in _._combined)this._combined[y]=_._combined[y];this._extendedAttrs={};for(const y in _._extendedAttrs)this._extendedAttrs[y]=_._extendedAttrs[y];this.isWrapped=_.isWrapped}clone(){const _=new T(0);_._data=new Uint32Array(this._data),_.length=this.length;for(const y in this._combined)_._combined[y]=this._combined[y];for(const y in this._extendedAttrs)_._extendedAttrs[y]=this._extendedAttrs[y];return _.isWrapped=this.isWrapped,_}getTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0])return _+(this._data[3*_+0]>>22);return 0}getNoBgTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0]||50331648&this._data[3*_+2])return _+(this._data[3*_+0]>>22);return 0}copyCellsFrom(_,y,m,S,A){const M=_._data;if(A)for(let D=S-1;D>=0;D--){for(let E=0;E<3;E++)this._data[3*(m+D)+E]=M[3*(y+D)+E];268435456&M[3*(y+D)+2]&&(this._extendedAttrs[m+D]=_._extendedAttrs[y+D])}else for(let D=0;D<S;D++){for(let E=0;E<3;E++)this._data[3*(m+D)+E]=M[3*(y+D)+E];268435456&M[3*(y+D)+2]&&(this._extendedAttrs[m+D]=_._extendedAttrs[y+D])}const R=Object.keys(_._combined);for(let D=0;D<R.length;D++){const E=parseInt(R[D],10);E>=y&&(this._combined[E-y+m]=_._combined[E])}}translateToString(_,y,m,S){y=y??0,m=m??this.length,_&&(m=Math.min(m,this.getTrimmedLength())),S&&(S.length=0);let A="";for(;y<m;){const M=this._data[3*y+0],R=2097151&M,D=2097152&M?this._combined[y]:R?(0,b.stringFromCodePoint)(R):u.WHITESPACE_CELL_CHAR;if(A+=D,S)for(let E=0;E<D.length;++E)S.push(y);y+=M>>22||1}return S&&S.push(y),A}}l.BufferLine=T},4841:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.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,l)=>{function c(h,p,u){if(p===h.length-1)return h[p].getTrimmedLength();const b=!h[p].hasContent(u-1)&&h[p].getWidth(u-1)===1,C=h[p+1].getWidth(0)===2;return b&&C?u-1:u}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(h,p,u,b,C){const T=[];for(let x=0;x<h.length-1;x++){let _=x,y=h.get(++_);if(!y.isWrapped)continue;const m=[h.get(x)];for(;_<h.length&&y.isWrapped;)m.push(y),y=h.get(++_);if(b>=x&&b<_){x+=m.length-1;continue}let S=0,A=c(m,S,p),M=1,R=0;for(;M<m.length;){const E=c(m,M,p),L=E-R,B=u-A,I=Math.min(L,B);m[S].copyCellsFrom(m[M],R,A,I,!1),A+=I,A===u&&(S++,A=0),R+=I,R===E&&(M++,R=0),A===0&&S!==0&&m[S-1].getWidth(u-1)===2&&(m[S].copyCellsFrom(m[S-1],u-1,A++,1,!1),m[S-1].setCell(u-1,C))}m[S].replaceCells(A,u,C);let D=0;for(let E=m.length-1;E>0&&(E>S||m[E].getTrimmedLength()===0);E--)D++;D>0&&(T.push(x+m.length-D),T.push(D)),x+=m.length-1}return T},l.reflowLargerCreateNewLayout=function(h,p){const u=[];let b=0,C=p[b],T=0;for(let x=0;x<h.length;x++)if(C===x){const _=p[++b];h.onDeleteEmitter.fire({index:x-T,amount:_}),x+=_-1,T+=_,C=p[++b]}else u.push(x);return{layout:u,countRemoved:T}},l.reflowLargerApplyNewLayout=function(h,p){const u=[];for(let b=0;b<p.length;b++)u.push(h.get(p[b]));for(let b=0;b<u.length;b++)h.set(b,u[b]);h.length=p.length},l.reflowSmallerGetNewLineLengths=function(h,p,u){const b=[],C=h.map(((y,m)=>c(h,m,p))).reduce(((y,m)=>y+m));let T=0,x=0,_=0;for(;_<C;){if(C-_<u){b.push(C-_);break}T+=u;const y=c(h,x,p);T>y&&(T-=y,x++);const m=h[x].getWidth(T-1)===2;m&&T--;const S=m?u-1:u;b.push(S),_+=S}return b},l.getWrappedLineTrimmedLength=c},5295:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const h=c(8460),p=c(844),u=c(9092);class b extends p.Disposable{constructor(T,x){super(),this._optionsService=T,this._bufferService=x,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,x){this._normal.resize(T,x),this._alt.resize(T,x),this.setupTabStops(T)}setupTabStops(T){this._normal.setupTabStops(T),this._alt.setupTabStops(T)}}l.BufferSet=b},511:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const h=c(482),p=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 x=new b;return x.setFromCharData(T),x}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[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(T[p.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(T[p.CHAR_DATA_CHAR_INDEX].length===2){const _=T[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=_&&_<=56319){const y=T[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(_-55296)+y-56320+65536|T[p.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=T[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|T[p.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=T[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|T[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=b},643:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const h=c(8460),p=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,p.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}l.Marker=u,u._nextId=1},7116:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,l)=>{var c,h,p;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.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||(l.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||(l.C1=h={})),(function(u){u.ST=`${c.ESC}\\`})(p||(l.C1_ESCAPED=p={}))},7399:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const h=c(2584),p={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};l.evaluateKeyboardEvent=function(u,b,C,T){const x={type:0,cancel:!1,key:void 0},_=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?x.key=b?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?x.key=b?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?x.key=b?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(x.key=b?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:x.key=u.ctrlKey?"\b":h.C0.DEL,u.altKey&&(x.key=h.C0.ESC+x.key);break;case 9:if(u.shiftKey){x.key=h.C0.ESC+"[Z";break}x.key=h.C0.HT,x.cancel=!0;break;case 13:x.key=u.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,x.cancel=!0;break;case 27:x.key=h.C0.ESC,u.altKey&&(x.key=h.C0.ESC+h.C0.ESC),x.cancel=!0;break;case 37:if(u.metaKey)break;_?(x.key=h.C0.ESC+"[1;"+(_+1)+"D",x.key===h.C0.ESC+"[1;3D"&&(x.key=h.C0.ESC+(C?"b":"[1;5D"))):x.key=b?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;_?(x.key=h.C0.ESC+"[1;"+(_+1)+"C",x.key===h.C0.ESC+"[1;3C"&&(x.key=h.C0.ESC+(C?"f":"[1;5C"))):x.key=b?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;_?(x.key=h.C0.ESC+"[1;"+(_+1)+"A",C||x.key!==h.C0.ESC+"[1;3A"||(x.key=h.C0.ESC+"[1;5A")):x.key=b?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;_?(x.key=h.C0.ESC+"[1;"+(_+1)+"B",C||x.key!==h.C0.ESC+"[1;3B"||(x.key=h.C0.ESC+"[1;5B")):x.key=b?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(x.key=h.C0.ESC+"[2~");break;case 46:x.key=_?h.C0.ESC+"[3;"+(_+1)+"~":h.C0.ESC+"[3~";break;case 36:x.key=_?h.C0.ESC+"[1;"+(_+1)+"H":b?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:x.key=_?h.C0.ESC+"[1;"+(_+1)+"F":b?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?x.type=2:u.ctrlKey?x.key=h.C0.ESC+"[5;"+(_+1)+"~":x.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?x.type=3:u.ctrlKey?x.key=h.C0.ESC+"[6;"+(_+1)+"~":x.key=h.C0.ESC+"[6~";break;case 112:x.key=_?h.C0.ESC+"[1;"+(_+1)+"P":h.C0.ESC+"OP";break;case 113:x.key=_?h.C0.ESC+"[1;"+(_+1)+"Q":h.C0.ESC+"OQ";break;case 114:x.key=_?h.C0.ESC+"[1;"+(_+1)+"R":h.C0.ESC+"OR";break;case 115:x.key=_?h.C0.ESC+"[1;"+(_+1)+"S":h.C0.ESC+"OS";break;case 116:x.key=_?h.C0.ESC+"[15;"+(_+1)+"~":h.C0.ESC+"[15~";break;case 117:x.key=_?h.C0.ESC+"[17;"+(_+1)+"~":h.C0.ESC+"[17~";break;case 118:x.key=_?h.C0.ESC+"[18;"+(_+1)+"~":h.C0.ESC+"[18~";break;case 119:x.key=_?h.C0.ESC+"[19;"+(_+1)+"~":h.C0.ESC+"[19~";break;case 120:x.key=_?h.C0.ESC+"[20;"+(_+1)+"~":h.C0.ESC+"[20~";break;case 121:x.key=_?h.C0.ESC+"[21;"+(_+1)+"~":h.C0.ESC+"[21~";break;case 122:x.key=_?h.C0.ESC+"[23;"+(_+1)+"~":h.C0.ESC+"[23~";break;case 123:x.key=_?h.C0.ESC+"[24;"+(_+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?x.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(x.key=h.C0.US),u.key==="@"&&(x.key=h.C0.NUL)):u.keyCode===65&&(x.type=1);else{const y=p[u.keyCode],m=y==null?void 0:y[u.shiftKey?1:0];if(m)x.key=h.C0.ESC+m;else if(u.keyCode>=65&&u.keyCode<=90){const S=u.ctrlKey?u.keyCode-64:u.keyCode+32;let A=String.fromCharCode(S);u.shiftKey&&(A=A.toUpperCase()),x.key=h.C0.ESC+A}else if(u.keyCode===32)x.key=h.C0.ESC+(u.ctrlKey?h.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let S=u.code.slice(3,4);u.shiftKey||(S=S.toLowerCase()),x.key=h.C0.ESC+S,x.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?x.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?x.key=h.C0.NUL:u.keyCode>=51&&u.keyCode<=55?x.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?x.key=h.C0.DEL:u.keyCode===219?x.key=h.C0.ESC:u.keyCode===220?x.key=h.C0.FS:u.keyCode===221&&(x.key=h.C0.GS)}return x}},482:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},l.utf32ToString=function(c,h=0,p=c.length){let u="";for(let b=h;b<p;++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},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const p=c.length;if(!p)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<p;++C){const T=c.charCodeAt(C);if(55296<=T&&T<=56319){if(++C>=p)return this._interim=T,u;const x=c.charCodeAt(C);56320<=x&&x<=57343?h[u++]=1024*(T-55296)+x-56320+65536:(h[u++]=T,h[u++]=x)}else T!==65279&&(h[u++]=T)}return u}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const p=c.length;if(!p)return 0;let u,b,C,T,x=0,_=0,y=0;if(this.interim[0]){let A=!1,M=this.interim[0];M&=(224&M)==192?31:(240&M)==224?15:7;let R,D=0;for(;(R=63&this.interim[++D])&&D<4;)M<<=6,M|=R;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=E-D;for(;y<L;){if(y>=p)return 0;if(R=c[y++],(192&R)!=128){y--,A=!0;break}this.interim[D++]=R,M<<=6,M|=63&R}A||(E===2?M<128?y--:h[x++]=M:E===3?M<2048||M>=55296&&M<=57343||M===65279||(h[x++]=M):M<65536||M>1114111||(h[x++]=M)),this.interim.fill(0)}const m=p-4;let S=y;for(;S<p;){for(;!(!(S<m)||128&(u=c[S])||128&(b=c[S+1])||128&(C=c[S+2])||128&(T=c[S+3]));)h[x++]=u,h[x++]=b,h[x++]=C,h[x++]=T,S+=4;if(u=c[S++],u<128)h[x++]=u;else if((224&u)==192){if(S>=p)return this.interim[0]=u,x;if(b=c[S++],(192&b)!=128){S--;continue}if(_=(31&u)<<6|63&b,_<128){S--;continue}h[x++]=_}else if((240&u)==224){if(S>=p)return this.interim[0]=u,x;if(b=c[S++],(192&b)!=128){S--;continue}if(S>=p)return this.interim[0]=u,this.interim[1]=b,x;if(C=c[S++],(192&C)!=128){S--;continue}if(_=(15&u)<<12|(63&b)<<6|63&C,_<2048||_>=55296&&_<=57343||_===65279)continue;h[x++]=_}else if((248&u)==240){if(S>=p)return this.interim[0]=u,x;if(b=c[S++],(192&b)!=128){S--;continue}if(S>=p)return this.interim[0]=u,this.interim[1]=b,x;if(C=c[S++],(192&C)!=128){S--;continue}if(S>=p)return this.interim[0]=u,this.interim[1]=b,this.interim[2]=C,x;if(T=c[S++],(192&T)!=128){S--;continue}if(_=(7&u)<<18|(63&b)<<12|(63&C)<<6|63&T,_<65536||_>1114111)continue;h[x++]=_}}return x}}},225:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const h=c(1480),p=[[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;l.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let C=0;C<p.length;++C)b.fill(0,p[C][0],p[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?b[C]:(function(T,x){let _,y=0,m=x.length-1;if(T<x[0][0]||T>x[m][1])return!1;for(;m>=y;)if(_=y+m>>1,T>x[_][1])y=_+1;else{if(!(T<x[_][0]))return!0;m=_-1}return!1})(C,u)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,T){let x=this.wcwidth(C),_=x===0&&T!==0;if(_){const y=h.UnicodeService.extractWidth(T);y===0?_=!1:y>x&&(x=y)}return h.UnicodeService.createPropertyValue(0,x,_)}}},5981:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const h=c(8460),p=c(844);class u extends p.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 x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const _=this._callbacks.shift();_&&_()}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 x=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const _=this._writeBuffer[this._bufferOffset],y=this._action(_,T);if(y){const S=A=>Date.now()-x>=12?setTimeout((()=>this._innerWrite(0,A))):this._innerWrite(x,A);return void y.catch((A=>(queueMicrotask((()=>{throw A})),Promise.resolve(!1)))).then(S)}const m=this._callbacks[this._bufferOffset];if(m&&m(),this._bufferOffset++,this._pendingData-=_.length,Date.now()-x>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}l.WriteBuffer=u},5941:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.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 p(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}}l.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 x=0;x<3;++x){const _=parseInt(b.slice(C*x,C*x+C),16);T[x]=C===1?_<<4:C===2?_:C===3?_>>4:_>>8}return T}},l.toRgbString=function(u,b=16){const[C,T,x]=u;return`rgb:${p(C,b)}/${p(T,b)}/${p(x,b)}`}},5770:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const h=c(482),p=c(8742),u=c(5770),b=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=b,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=b}registerHandler(T,x){this._handlers[T]===void 0&&(this._handlers[T]=[]);const _=this._handlers[T];return _.push(x),{dispose:()=>{const y=_.indexOf(x);y!==-1&&_.splice(y,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,x){if(this.reset(),this._ident=T,this._active=this._handlers[T]||b,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(T,x,_){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(T,x,_);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(T,x,_))}unhook(T,x=!0){if(this._active.length){let _=!1,y=this._active.length-1,m=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,_=x,m=this._stack.fallThrough,this._stack.paused=!1),!m&&_===!1){for(;y>=0&&(_=this._active[y].unhook(T),_!==!0);y--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,_;y--}for(;y>=0;y--)if(_=this._active[y].unhook(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,_}else this._handlerFb(this._ident,"UNHOOK",T);this._active=b,this._ident=0}};const C=new p.Params;C.addParam(0),l.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,x,_){this._hitLimit||(this._data+=(0,h.utf32ToString)(T,x,_),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(T){let x=!1;if(this._hitLimit)x=!1;else if(T&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then((_=>(this._params=C,this._data="",this._hitLimit=!1,_)));return this._params=C,this._data="",this._hitLimit=!1,x}}},2015:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const h=c(844),p=c(8742),u=c(6242),b=c(6351);class C{constructor(y){this.table=new Uint8Array(y)}setDefault(y,m){this.table.fill(y<<4|m)}add(y,m,S,A){this.table[m<<8|y]=S<<4|A}addMany(y,m,S,A){for(let M=0;M<y.length;M++)this.table[m<<8|y[M]]=S<<4|A}}l.TransitionTable=C;const T=160;l.VT500_TRANSITION_TABLE=(function(){const _=new C(4095),y=Array.apply(null,Array(256)).map(((D,E)=>E)),m=(D,E)=>y.slice(D,E),S=m(32,127),A=m(0,24);A.push(25),A.push.apply(A,m(28,32));const M=m(0,14);let R;for(R in _.setDefault(1,0),_.addMany(S,0,2,0),M)_.addMany([24,26,153,154],R,3,0),_.addMany(m(128,144),R,3,0),_.addMany(m(144,152),R,3,0),_.add(156,R,0,0),_.add(27,R,11,1),_.add(157,R,4,8),_.addMany([152,158,159],R,0,7),_.add(155,R,11,3),_.add(144,R,11,9);return _.addMany(A,0,3,0),_.addMany(A,1,3,1),_.add(127,1,0,1),_.addMany(A,8,0,8),_.addMany(A,3,3,3),_.add(127,3,0,3),_.addMany(A,4,3,4),_.add(127,4,0,4),_.addMany(A,6,3,6),_.addMany(A,5,3,5),_.add(127,5,0,5),_.addMany(A,2,3,2),_.add(127,2,0,2),_.add(93,1,4,8),_.addMany(S,8,5,8),_.add(127,8,5,8),_.addMany([156,27,24,26,7],8,6,0),_.addMany(m(28,32),8,0,8),_.addMany([88,94,95],1,0,7),_.addMany(S,7,0,7),_.addMany(A,7,0,7),_.add(156,7,0,0),_.add(127,7,0,7),_.add(91,1,11,3),_.addMany(m(64,127),3,7,0),_.addMany(m(48,60),3,8,4),_.addMany([60,61,62,63],3,9,4),_.addMany(m(48,60),4,8,4),_.addMany(m(64,127),4,7,0),_.addMany([60,61,62,63],4,0,6),_.addMany(m(32,64),6,0,6),_.add(127,6,0,6),_.addMany(m(64,127),6,0,0),_.addMany(m(32,48),3,9,5),_.addMany(m(32,48),5,9,5),_.addMany(m(48,64),5,0,6),_.addMany(m(64,127),5,7,0),_.addMany(m(32,48),4,9,5),_.addMany(m(32,48),1,9,2),_.addMany(m(32,48),2,9,2),_.addMany(m(48,127),2,10,0),_.addMany(m(48,80),1,10,0),_.addMany(m(81,88),1,10,0),_.addMany([89,90,92],1,10,0),_.addMany(m(96,127),1,10,0),_.add(80,1,11,9),_.addMany(A,9,0,9),_.add(127,9,0,9),_.addMany(m(28,32),9,0,9),_.addMany(m(32,48),9,9,12),_.addMany(m(48,60),9,8,10),_.addMany([60,61,62,63],9,9,10),_.addMany(A,11,0,11),_.addMany(m(32,128),11,0,11),_.addMany(m(28,32),11,0,11),_.addMany(A,10,0,10),_.add(127,10,0,10),_.addMany(m(28,32),10,0,10),_.addMany(m(48,60),10,8,10),_.addMany([60,61,62,63],10,0,11),_.addMany(m(32,48),10,9,12),_.addMany(A,12,0,12),_.add(127,12,0,12),_.addMany(m(28,32),12,0,12),_.addMany(m(32,48),12,9,12),_.addMany(m(48,64),12,0,11),_.addMany(m(64,127),12,12,13),_.addMany(m(64,127),10,12,13),_.addMany(m(64,127),9,12,13),_.addMany(A,13,13,13),_.addMany(S,13,13,13),_.add(127,13,0,13),_.addMany([27,156,24,26],13,14,0),_.add(T,0,2,0),_.add(T,8,5,8),_.add(T,6,0,6),_.add(T,11,0,11),_.add(T,13,13,13),_})();class x extends h.Disposable{constructor(y=l.VT500_TRANSITION_TABLE){super(),this._transitions=y,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(m,S,A)=>{},this._executeHandlerFb=m=>{},this._csiHandlerFb=(m,S)=>{},this._escHandlerFb=m=>{},this._errorHandlerFb=m=>m,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(y,m=[64,126]){let S=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(S=y.prefix.charCodeAt(0),S&&60>S||S>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let M=0;M<y.intermediates.length;++M){const R=y.intermediates.charCodeAt(M);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");S<<=8,S|=R}}if(y.final.length!==1)throw new Error("final must be a single byte");const A=y.final.charCodeAt(0);if(m[0]>A||A>m[1])throw new Error(`final must be in range ${m[0]} .. ${m[1]}`);return S<<=8,S|=A,S}identToString(y){const m=[];for(;y;)m.push(String.fromCharCode(255&y)),y>>=8;return m.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,m){const S=this._identifier(y,[48,126]);this._escHandlers[S]===void 0&&(this._escHandlers[S]=[]);const A=this._escHandlers[S];return A.push(m),{dispose:()=>{const M=A.indexOf(m);M!==-1&&A.splice(M,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,m){this._executeHandlers[y.charCodeAt(0)]=m}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,m){const S=this._identifier(y);this._csiHandlers[S]===void 0&&(this._csiHandlers[S]=[]);const A=this._csiHandlers[S];return A.push(m),{dispose:()=>{const M=A.indexOf(m);M!==-1&&A.splice(M,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,m){return this._dcsParser.registerHandler(this._identifier(y),m)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,m){return this._oscParser.registerHandler(y,m)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}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(y,m,S,A,M){this._parseStack.state=y,this._parseStack.handlers=m,this._parseStack.handlerPos=S,this._parseStack.transition=A,this._parseStack.chunkPos=M}parse(y,m,S){let A,M=0,R=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(S===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const E=this._parseStack.handlers;let L=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(S===!1&&L>-1){for(;L>=0&&(A=E[L](this._params),A!==!0);L--)if(A instanceof Promise)return this._parseStack.handlerPos=L,A}this._parseStack.handlers=[];break;case 4:if(S===!1&&L>-1){for(;L>=0&&(A=E[L](),A!==!0);L--)if(A instanceof Promise)return this._parseStack.handlerPos=L,A}this._parseStack.handlers=[];break;case 6:if(M=y[this._parseStack.chunkPos],A=this._dcsParser.unhook(M!==24&&M!==26,S),A)return A;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(M=y[this._parseStack.chunkPos],A=this._oscParser.end(M!==24&&M!==26,S),A)return A;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let E=D;E<m;++E){switch(M=y[E],R=this._transitions.table[this.currentState<<8|(M<160?M:T)],R>>4){case 2:for(let U=E+1;;++U){if(U>=m||(M=y[U])<32||M>126&&M<T){this._printHandler(y,E,U),E=U-1;break}if(++U>=m||(M=y[U])<32||M>126&&M<T){this._printHandler(y,E,U),E=U-1;break}if(++U>=m||(M=y[U])<32||M>126&&M<T){this._printHandler(y,E,U),E=U-1;break}if(++U>=m||(M=y[U])<32||M>126&&M<T){this._printHandler(y,E,U),E=U-1;break}}break;case 3:this._executeHandlers[M]?this._executeHandlers[M]():this._executeHandlerFb(M),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:E,code:M,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const L=this._csiHandlers[this._collect<<8|M];let B=L?L.length-1:-1;for(;B>=0&&(A=L[B](this._params),A!==!0);B--)if(A instanceof Promise)return this._preserveStack(3,L,B,R,E),A;B<0&&this._csiHandlerFb(this._collect<<8|M,this._params),this.precedingJoinState=0;break;case 8:do switch(M){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(M-48)}while(++E<m&&(M=y[E])>47&&M<60);E--;break;case 9:this._collect<<=8,this._collect|=M;break;case 10:const I=this._escHandlers[this._collect<<8|M];let F=I?I.length-1:-1;for(;F>=0&&(A=I[F](),A!==!0);F--)if(A instanceof Promise)return this._preserveStack(4,I,F,R,E),A;F<0&&this._escHandlerFb(this._collect<<8|M),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|M,this._params);break;case 13:for(let U=E+1;;++U)if(U>=m||(M=y[U])===24||M===26||M===27||M>127&&M<T){this._dcsParser.put(y,E,U),E=U-1;break}break;case 14:if(A=this._dcsParser.unhook(M!==24&&M!==26),A)return this._preserveStack(6,[],0,R,E),A;M===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let U=E+1;;U++)if(U>=m||(M=y[U])<32||M>127&&M<T){this._oscParser.put(y,E,U),E=U-1;break}break;case 6:if(A=this._oscParser.end(M!==24&&M!==26),A)return this._preserveStack(5,[],0,R,E),A;M===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}l.EscapeSequenceParser=x},6242:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const h=c(5770),p=c(482),u=[];l.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 x=T.indexOf(C);x!==-1&&T.splice(x,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=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 x=this._active.length-1;x>=0;x--)this._active[x].put(b,C,T);else this._handlerFb(this._id,"PUT",(0,p.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 x=b[C++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&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,x=this._active.length-1,_=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,T=C,_=this._stack.fallThrough,this._stack.paused=!1),!_&&T===!1){for(;x>=0&&(T=this._active[x].end(b),T!==!0);x--)if(T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,T;x--}for(;x>=0;x--)if(T=this._active[x].end(!1),T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,T}else this._handlerFb(this._id,"END",b);this._active=u,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(b){this._handler=b,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(b,C,T){this._hitLimit||(this._data+=(0,p.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,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.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 x=0;x<T.length;++x)b.addSubParam(T[x]);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}}l.Params=h},5741:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.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 p={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(p),h.dispose=()=>this._wrappedAddonDispose(p),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===c){h=p;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,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const h=c(3785),p=c(511);l.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 p.CellData}}},3785:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const h=c(511);l.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,u){if(!(p<0||p>=this._line.length))return u?(this._line.loadCell(p,u),u):this._line.loadCell(p,new h.CellData)}translateToString(p,u,b){return this._line.translateToString(p,u,b)}}},8285:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const h=c(8771),p=c(8460),u=c(844);class b extends u.Disposable{constructor(T){super(),this._core=T,this._onBufferChange=this.register(new p.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)}}l.BufferNamespaceApi=b},7975:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(p=>h(p.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((p,u)=>h(p,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,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.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,l,c){var h=this&&this.__decorate||function(_,y,m,S){var A,M=arguments.length,R=M<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(_,y,m,S);else for(var D=_.length-1;D>=0;D--)(A=_[D])&&(R=(M<3?A(R):M>3?A(y,m,R):A(y,m))||R);return M>3&&R&&Object.defineProperty(y,m,R),R},p=this&&this.__param||function(_,y){return function(m,S){y(m,S,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const u=c(8460),b=c(844),C=c(5295),T=c(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let x=l.BufferService=class extends b.Disposable{get buffer(){return this.buffers.active}constructor(_){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(_.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(_.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(_,this))}resize(_,y){this.cols=_,this.rows=y,this.buffers.resize(_,y),this._onResize.fire({cols:_,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(_,y=!1){const m=this.buffer;let S;S=this._cachedBlankLine,S&&S.length===this.cols&&S.getFg(0)===_.fg&&S.getBg(0)===_.bg||(S=m.getBlankLine(_,y),this._cachedBlankLine=S),S.isWrapped=y;const A=m.ybase+m.scrollTop,M=m.ybase+m.scrollBottom;if(m.scrollTop===0){const R=m.lines.isFull;M===m.lines.length-1?R?m.lines.recycle().copyFrom(S):m.lines.push(S.clone()):m.lines.splice(M+1,0,S.clone()),R?this.isUserScrolling&&(m.ydisp=Math.max(m.ydisp-1,0)):(m.ybase++,this.isUserScrolling||m.ydisp++)}else{const R=M-A+1;m.lines.shiftElements(A+1,R-1,-1),m.lines.set(M,S.clone())}this.isUserScrolling||(m.ydisp=m.ybase),this._onScroll.fire(m.ydisp)}scrollLines(_,y,m){const S=this.buffer;if(_<0){if(S.ydisp===0)return;this.isUserScrolling=!0}else _+S.ydisp>=S.ybase&&(this.isUserScrolling=!1);const A=S.ydisp;S.ydisp=Math.max(Math.min(S.ydisp+_,S.ybase),0),A!==S.ydisp&&(y||this._onScroll.fire(S.ydisp))}};l.BufferService=x=h([p(0,T.IOptionsService)],x)},7994:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(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,l,c){var h=this&&this.__decorate||function(S,A,M,R){var D,E=arguments.length,L=E<3?A:R===null?R=Object.getOwnPropertyDescriptor(A,M):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,A,M,R);else for(var B=S.length-1;B>=0;B--)(D=S[B])&&(L=(E<3?D(L):E>3?D(A,M,L):D(A,M))||L);return E>3&&L&&Object.defineProperty(A,M,L),L},p=this&&this.__param||function(S,A){return function(M,R){A(M,R,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const u=c(2585),b=c(8460),C=c(844),T={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:S=>S.button!==4&&S.action===1&&(S.ctrl=!1,S.alt=!1,S.shift=!1,!0)},VT200:{events:19,restrict:S=>S.action!==32},DRAG:{events:23,restrict:S=>S.action!==32||S.button!==3},ANY:{events:31,restrict:S=>!0}};function x(S,A){let M=(S.ctrl?16:0)|(S.shift?4:0)|(S.alt?8:0);return S.button===4?(M|=64,M|=S.action):(M|=3&S.button,4&S.button&&(M|=64),8&S.button&&(M|=128),S.action===32?M|=32:S.action!==0||A||(M|=3)),M}const _=String.fromCharCode,y={DEFAULT:S=>{const A=[x(S,!1)+32,S.col+32,S.row+32];return A[0]>255||A[1]>255||A[2]>255?"":`\x1B[M${_(A[0])}${_(A[1])}${_(A[2])}`},SGR:S=>{const A=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${x(S,!0)};${S.col};${S.row}${A}`},SGR_PIXELS:S=>{const A=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${x(S,!0)};${S.x};${S.y}${A}`}};let m=l.CoreMouseService=class extends C.Disposable{constructor(S,A){super(),this._bufferService=S,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 M of Object.keys(T))this.addProtocol(M,T[M]);for(const M of Object.keys(y))this.addEncoding(M,y[M]);this.reset()}addProtocol(S,A){this._protocols[S]=A}addEncoding(S,A){this._encodings[S]=A}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(S){if(!this._protocols[S])throw new Error(`unknown protocol "${S}"`);this._activeProtocol=S,this._onProtocolChange.fire(this._protocols[S].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(S){if(!this._encodings[S])throw new Error(`unknown encoding "${S}"`);this._activeEncoding=S}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(S){if(S.col<0||S.col>=this._bufferService.cols||S.row<0||S.row>=this._bufferService.rows||S.button===4&&S.action===32||S.button===3&&S.action!==32||S.button!==4&&(S.action===2||S.action===3)||(S.col++,S.row++,S.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,S,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(S))return!1;const A=this._encodings[this._activeEncoding](S);return A&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(A):this._coreService.triggerDataEvent(A,!0)),this._lastEvent=S,!0}explainEvents(S){return{down:!!(1&S),up:!!(2&S),drag:!!(4&S),move:!!(8&S),wheel:!!(16&S)}}_equalEvents(S,A,M){if(M){if(S.x!==A.x||S.y!==A.y)return!1}else if(S.col!==A.col||S.row!==A.row)return!1;return S.button===A.button&&S.action===A.action&&S.ctrl===A.ctrl&&S.alt===A.alt&&S.shift===A.shift}};l.CoreMouseService=m=h([p(0,u.IBufferService),p(1,u.ICoreService)],m)},6975:function(f,l,c){var h=this&&this.__decorate||function(m,S,A,M){var R,D=arguments.length,E=D<3?S:M===null?M=Object.getOwnPropertyDescriptor(S,A):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,S,A,M);else for(var L=m.length-1;L>=0;L--)(R=m[L])&&(E=(D<3?R(E):D>3?R(S,A,E):R(S,A))||E);return D>3&&E&&Object.defineProperty(S,A,E),E},p=this&&this.__param||function(m,S){return function(A,M){S(A,M,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const u=c(1439),b=c(8460),C=c(844),T=c(2585),x=Object.freeze({insertMode:!1}),_=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=l.CoreService=class extends C.Disposable{constructor(m,S,A){super(),this._bufferService=m,this._logService=S,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)(x),this.decPrivateModes=(0,u.clone)(_)}reset(){this.modes=(0,u.clone)(x),this.decPrivateModes=(0,u.clone)(_)}triggerDataEvent(m,S=!1){if(this._optionsService.rawOptions.disableStdin)return;const A=this._bufferService.buffer;S&&this._optionsService.rawOptions.scrollOnUserInput&&A.ybase!==A.ydisp&&this._onRequestScrollToBottom.fire(),S&&this._onUserInput.fire(),this._logService.debug(`sending data "${m}"`,(()=>m.split("").map((M=>M.charCodeAt(0))))),this._onData.fire(m)}triggerBinaryEvent(m){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${m}"`,(()=>m.split("").map((S=>S.charCodeAt(0))))),this._onBinary.fire(m))}};l.CoreService=y=h([p(0,T.IBufferService),p(1,T.ILogService),p(2,T.IOptionsService)],y)},9074:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const h=c(8055),p=c(8460),u=c(844),b=c(6106);let C=0,T=0;class x extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new b.SortedList((m=>m==null?void 0:m.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(m){if(m.marker.isDisposed)return;const S=new _(m);if(S){const A=S.marker.onDispose((()=>S.dispose()));S.onDispose((()=>{S&&(this._decorations.delete(S)&&this._onDecorationRemoved.fire(S),A.dispose())})),this._decorations.insert(S),this._onDecorationRegistered.fire(S)}return S}reset(){for(const m of this._decorations.values())m.dispose();this._decorations.clear()}*getDecorationsAtCell(m,S,A){let M=0,R=0;for(const D of this._decorations.getKeyIterator(S))M=D.options.x??0,R=M+(D.options.width??1),m>=M&&m<R&&(!A||(D.options.layer??"bottom")===A)&&(yield D)}forEachDecorationAtCell(m,S,A,M){this._decorations.forEachByKey(S,(R=>{C=R.options.x??0,T=C+(R.options.width??1),m>=C&&m<T&&(!A||(R.options.layer??"bottom")===A)&&M(R)}))}}l.DecorationService=x;class _ 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(m){super(),this.options=m,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=m.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const h=c(2585),p=c(8343);class u{constructor(...C){this._entries=new Map;for(const[T,x]of C)this.set(T,x)}set(C,T){const x=this._entries.get(C);return this._entries.set(C,T),x}forEach(C){for(const[T,x]of this._entries.entries())C(T,x)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}l.ServiceCollection=u,l.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,p.getServiceDependencies)(b).sort(((y,m)=>y.index-m.index)),x=[];for(const y of T){const m=this._services.get(y.id);if(!m)throw new Error(`[createInstance] ${b.name} depends on UNKNOWN service ${y.id}.`);x.push(m)}const _=T.length>0?T[0].index:C.length;if(C.length!==_)throw new Error(`[createInstance] First service dependency of ${b.name} at position ${_+1} conflicts with ${C.length} static arguments`);return new b(...C,...x)}}},7866:function(f,l,c){var h=this&&this.__decorate||function(_,y,m,S){var A,M=arguments.length,R=M<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(_,y,m,S);else for(var D=_.length-1;D>=0;D--)(A=_[D])&&(R=(M<3?A(R):M>3?A(y,m,R):A(y,m))||R);return M>3&&R&&Object.defineProperty(y,m,R),R},p=this&&this.__param||function(_,y){return function(m,S){y(m,S,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.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,x=l.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(_){super(),this._optionsService=_,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(_){for(let y=0;y<_.length;y++)typeof _[y]=="function"&&(_[y]=_[y]())}_log(_,y,m){this._evalLazyOptionalParams(m),_.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,...m)}trace(_,...y){var m;this._logLevel<=b.LogLevelEnum.TRACE&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.trace.bind(this._optionsService.options.logger))??console.log,_,y)}debug(_,...y){var m;this._logLevel<=b.LogLevelEnum.DEBUG&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.debug.bind(this._optionsService.options.logger))??console.log,_,y)}info(_,...y){var m;this._logLevel<=b.LogLevelEnum.INFO&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.info.bind(this._optionsService.options.logger))??console.info,_,y)}warn(_,...y){var m;this._logLevel<=b.LogLevelEnum.WARN&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.warn.bind(this._optionsService.options.logger))??console.warn,_,y)}error(_,...y){var m;this._logLevel<=b.LogLevelEnum.ERROR&&this._log(((m=this._optionsService.options.logger)==null?void 0:m.error.bind(this._optionsService.options.logger))??console.error,_,y)}};l.LogService=x=h([p(0,b.IOptionsService)],x),l.setTraceLogger=function(_){T=_},l.traceCall=function(_,y,m){if(typeof m.value!="function")throw new Error("not supported");const S=m.value;m.value=function(...A){if(T.logLevel!==b.LogLevelEnum.TRACE)return S.apply(this,A);T.trace(`GlyphRenderer#${S.name}(${A.map((R=>JSON.stringify(R))).join(", ")})`);const M=S.apply(this,A);return T.trace(`GlyphRenderer#${S.name} return`,M),M}}},7302:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const h=c(8460),p=c(844),u=c(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord: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 p.Disposable{constructor(x){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const _={...l.DEFAULT_OPTIONS};for(const y in x)if(y in _)try{const m=x[y];_[y]=this._sanitizeAndValidateOption(y,m)}catch(m){console.error(m)}this.rawOptions=_,this.options={..._},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(x,_){return this.onOptionChange((y=>{y===x&&_(this.rawOptions[x])}))}onMultipleOptionChange(x,_){return this.onOptionChange((y=>{x.indexOf(y)!==-1&&_()}))}_setupOptions(){const x=y=>{if(!(y in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},_=(y,m)=>{if(!(y in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);m=this._sanitizeAndValidateOption(y,m),this.rawOptions[y]!==m&&(this.rawOptions[y]=m,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const m={get:x.bind(this,y),set:_.bind(this,y)};Object.defineProperty(this.options,y,m)}}_sanitizeAndValidateOption(x,_){switch(x){case"cursorStyle":if(_||(_=l.DEFAULT_OPTIONS[x]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(_))throw new Error(`"${_}" is not a valid value for ${x}`);break;case"wordSeparator":_||(_=l.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof _=="number"&&1<=_&&_<=1e3)break;_=b.includes(_)?_:l.DEFAULT_OPTIONS[x];break;case"cursorWidth":_=Math.floor(_);case"lineHeight":case"tabStopWidth":if(_<1)throw new Error(`${x} cannot be less than 1, value: ${_}`);break;case"minimumContrastRatio":_=Math.max(1,Math.min(21,Math.round(10*_)/10));break;case"scrollback":if((_=Math.min(_,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${_}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(_<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${_}`);break;case"rows":case"cols":if(!_&&_!==0)throw new Error(`${x} must be numeric, value: ${_}`);break;case"windowsPty":_=_??{}}return _}}l.OptionsService=C},2660:function(f,l,c){var h=this&&this.__decorate||function(C,T,x,_){var y,m=arguments.length,S=m<3?T:_===null?_=Object.getOwnPropertyDescriptor(T,x):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(C,T,x,_);else for(var A=C.length-1;A>=0;A--)(y=C[A])&&(S=(m<3?y(S):m>3?y(T,x,S):y(T,x))||S);return m>3&&S&&Object.defineProperty(T,x,S),S},p=this&&this.__param||function(C,T){return function(x,_){T(x,_,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const u=c(2585);let b=l.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const T=this._bufferService.buffer;if(C.id===void 0){const A=T.addMarker(T.ybase+T.y),M={data:C,id:this._nextId++,lines:[A]};return A.onDispose((()=>this._removeMarkerFromLink(M,A))),this._dataByLinkId.set(M.id,M),M.id}const x=C,_=this._getEntryIdKey(x),y=this._entriesWithId.get(_);if(y)return this.addLineToLink(y.id,T.ybase+T.y),y.id;const m=T.addMarker(T.ybase+T.y),S={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[m]};return m.onDispose((()=>this._removeMarkerFromLink(S,m))),this._entriesWithId.set(S.key,S),this._dataByLinkId.set(S.id,S),S.id}addLineToLink(C,T){const x=this._dataByLinkId.get(C);if(x&&x.lines.every((_=>_.line!==T))){const _=this._bufferService.buffer.addMarker(T);x.lines.push(_),_.onDispose((()=>this._removeMarkerFromLink(x,_)))}}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 x=C.lines.indexOf(T);x!==-1&&(C.lines.splice(x,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};l.OscLinkService=b=h([p(0,u.IBufferService)],b)},8343:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const c="di$target",h="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(p){return p[h]||[]},l.createDecorator=function(p){if(l.serviceRegistry.has(p))return l.serviceRegistry.get(p);const u=function(b,C,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,_,y){_[c]===_?_[h].push({id:x,index:y}):(_[h]=[{id:x,index:y}],_[c]=_)})(u,b,T)};return u.toString=()=>p,l.serviceRegistry.set(p,u),u}},2585:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const h=c(8343);var p;l.IBufferService=(0,h.createDecorator)("BufferService"),l.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),l.ICoreService=(0,h.createDecorator)("CoreService"),l.ICharsetService=(0,h.createDecorator)("CharsetService"),l.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"})(p||(l.LogLevelEnum=p={})),l.ILogService=(0,h.createDecorator)("LogService"),l.IOptionsService=(0,h.createDecorator)("OptionsService"),l.IOscLinkService=(0,h.createDecorator)("OscLinkService"),l.IUnicodeService=(0,h.createDecorator)("UnicodeService"),l.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const h=c(8460),p=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,x=!1){return(16777215&C)<<3|(3&T)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const C=new p.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,x=0;const _=C.length;for(let y=0;y<_;++y){let m=C.charCodeAt(y);if(55296<=m&&m<=56319){if(++y>=_)return T+this.wcwidth(m);const M=C.charCodeAt(y);56320<=M&&M<=57343?m=1024*(m-55296)+M-56320+65536:T+=this.wcwidth(M)}const S=this.charProperties(m,x);let A=u.extractWidth(S);u.extractShouldJoin(S)&&(A-=u.extractWidth(x)),T+=A,x=S}return T}charProperties(C,T){return this._activeProvider.charProperties(C,T)}}l.UnicodeService=u}},o={};function d(f){var l=o[f];if(l!==void 0)return l.exports;var c=o[f]={exports:{}};return s[f].call(c.exports,c,c.exports,d),c.exports}var v={};return(()=>{var f=v;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const l=d(9042),c=d(3236),h=d(844),p=d(5741),u=d(8285),b=d(7975),C=d(7090),T=["cols","rows"];class x extends h.Disposable{constructor(y){super(),this._core=this.register(new c.Terminal(y)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const m=A=>this._core.options[A],S=(A,M)=>{this._checkReadonlyOptions(A),this._core.options[A]=M};for(const A in this._core.options){const M={get:m.bind(this,A),set:S.bind(this,A)};Object.defineProperty(this._publicOptions,A,M)}}_checkReadonlyOptions(y){if(T.includes(y))throw new Error(`Option "${y}" 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 y=this._core.coreService.decPrivateModes;let m="none";switch(this._core.coreMouseService.activeProtocol){case"X10":m="x10";break;case"VT200":m="vt200";break;case"DRAG":m="drag";break;case"ANY":m="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:m,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const m in y)this._publicOptions[m]=y[m]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,m=!0){this._core.input(y,m)}resize(y,m){this._verifyIntegers(y,m),this._core.resize(y,m)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){return this._checkProposedApi(),this._verifyPositiveIntegers(y.x??0,y.width??0,y.height??0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,m,S){this._verifyIntegers(y,m,S),this._core.select(y,m,S)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,m){this._verifyIntegers(y,m),this._core.selectLines(y,m)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,m){this._core.write(y,m)}writeln(y,m){this._core.write(y),this._core.write(`\r
59
+ `,m)}paste(y){this._core.paste(y)}refresh(y,m){this._verifyIntegers(y,m),this._core.refresh(y,m)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return l}_verifyIntegers(...y){for(const m of y)if(m===1/0||isNaN(m)||m%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const m of y)if(m&&(m===1/0||isNaN(m)||m%1!=0||m<0))throw new Error("This API only accepts positive integers")}}f.Terminal=x})(),v})()))})(Du)),Du.exports}var U1=P1();class F1{constructor(r,s){cm(this,"socket");const o=window.location.protocol==="https:"?"wss:":"ws:";this.socket=new WebSocket(`${o}//${window.location.host}/ws/terminal/${encodeURIComponent(r)}`),this.socket.addEventListener("message",d=>{var f,l;const v=JSON.parse(d.data);v.type==="output"?s.onOutput(v.data):v.type==="error"?(f=s.onError)==null||f.call(s,v.message):(l=s.onStatus)==null||l.call(s,v)}),this.socket.addEventListener("error",()=>{var d;(d=s.onError)==null||d.call(s,"Terminal connection failed.")})}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 fo({sessionId:n,active:r=!0,onEvent:s}){const o=ne.useRef(null),d=ne.useRef(null),v=ne.useRef(null),f=ne.useRef(null),l=ne.useRef(r),c=ne.useRef(s);function h(p={}){const u=o.current,b=d.current,C=v.current,T=f.current;if(!u||!b||!C||!T)return!1;const x=u.getBoundingClientRect();return x.width<Em||x.height<km||(C.fit(),T.cols<Am||T.rows<Tm)?!1:(b.resize(T.cols,T.rows),p.focus&&T.focus(),!0)}return ne.useEffect(()=>{c.current=s},[s]),ne.useEffect(()=>{l.current=r},[r]),ne.useEffect(()=>{if(!o.current)return;const p=new U1.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:q1}),u=new H1.FitAddon;p.loadAddon(u),p.loadAddon(new I1.WebLinksAddon),p.open(o.current),f.current=p,v.current=u;const b=o.current.getBoundingClientRect();b.width>=Em&&b.height>=km&&u.fit();const C=new F1(n,{onOutput(A){p.write(A)},onStatus(A){var M;(M=c.current)==null||M.call(c,A.type)},onError(A){var M;p.writeln(`\r
60
+ [VCM] ${A}`),(M=c.current)==null||M.call(c,A)}});d.current=C,p.cols>=Am&&p.rows>=Tm&&C.resize(p.cols,p.rows);const T=p.onData(A=>{C.sendInput(A)});let x=0,_=0,y=0;const m=()=>{x&&window.cancelAnimationFrame(x),x=window.requestAnimationFrame(()=>{x=0,h({focus:l.current})})},S=new ResizeObserver(()=>{m()});return S.observe(o.current),_=window.requestAnimationFrame(m),y=window.setTimeout(m,120),()=>{x&&window.cancelAnimationFrame(x),_&&window.cancelAnimationFrame(_),y&&window.clearTimeout(y),S.disconnect(),T.dispose(),C.close(),p.dispose(),d.current=null,f.current=null,v.current=null}},[n]),ne.useEffect(()=>{if(!r)return;const p=[],u=[];return p.push(window.requestAnimationFrame(()=>{h({focus:!0}),p.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 p)window.cancelAnimationFrame(b);for(const b of u)window.clearTimeout(b)}},[r]),ne.useEffect(()=>{const p=()=>{l.current&&h()};return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]),k.jsx("div",{className:"terminal-frame",ref:o,onMouseDown:()=>{var p;return(p=f.current)==null?void 0:p.focus()}})}const Em=160,km=80,Am=20,Tm=5,q1={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"},Ug=[{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"}],Fg=[{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"}],G1=[{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"}],qg=[...G1,{value:"max",label:"Max",description:"Maximum reasoning"},{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}];function wi({status:n}){return k.jsx("span",{className:`status-badge status-${n}`,children:n.replaceAll("_"," ")})}function uh({role:n,session:r,permissionMode:s,model:o,effort:d,busy:v=!1,onPermissionModeChange:f,onModelChange:l,onEffortChange:c,onStart:h,onResume:p,onStop:u,onRestart:b,onNotifyHarnessUpdated:C}){const T=(r==null?void 0:r.status)==="running",x=!!(r!=null&&r.claudeSessionId&&!T),_=!T&&!(r!=null&&r.claudeSessionId),y=!!(r!=null&&r.harnessOutdated);return k.jsxs("div",{className:"session-controls",children:[k.jsxs("label",{className:"session-option-field permission-mode-field",children:[k.jsx("span",{children:"Permission"}),k.jsx("select",{value:s,onChange:m=>f(m.target.value),children:Ug.map(m=>k.jsx("option",{value:m.value,children:m.label},m.value))})]}),k.jsxs("label",{className:"session-option-field model-field",children:[k.jsx("span",{children:"Model"}),k.jsx("select",{value:o,onChange:m=>l(m.target.value),children:Fg.map(m=>k.jsx("option",{value:m.value,children:m.label},m.value))})]}),k.jsxs("label",{className:"session-option-field effort-field",children:[k.jsx("span",{children:"Effort"}),k.jsx("select",{value:d,onChange:m=>c(m.target.value),children:qg.map(m=>k.jsx("option",{value:m.value,children:m.label},m.value))})]}),k.jsxs("div",{className:"session-toolbar",children:[k.jsx("button",{type:"button",disabled:v||!_,onClick:h,children:"Start"}),k.jsx("button",{type:"button",disabled:v||!x,onClick:p,children:"Resume"}),k.jsx("button",{type:"button",disabled:v||!r,onClick:b,children:"Restart"}),k.jsx("button",{type:"button",disabled:v||!r,onClick:u,children:"Stop"})]}),y?k.jsxs("div",{className:"session-harness-notice",children:[k.jsx(wi,{status:"outdated"}),k.jsxs("span",{children:["Harness updated",(r==null?void 0:r.harnessRevision)!==void 0&&r.harnessCurrentRevision!==void 0?` (${r.harnessRevision} -> ${r.harnessCurrentRevision})`:""]}),k.jsx("button",{type:"button",disabled:v||!T||!C,onClick:C,children:"Notify role"})]}):null]})}function V1({busy:n,effort:r,model:s,open:o,permissionMode:d,taskSlug:v,bootstrapStatus:f,engineerSession:l,status:c,onClose:h,onEffortChange:p,onModelChange:u,onPermissionModeChange:b,onEngineerResume:C,onEngineerRestart:T,onEngineerStart:x,onEngineerStop:_,onEngineerNotifyHarnessUpdated:y,onOpenRepositoryDiff:m,onRefresh:S}){const[A,M]=ne.useState(null),[R,D]=ne.useState(null),[E,L]=ne.useState(""),[B,I]=ne.useState(!1),[F,U]=ne.useState(!1),[W,X]=ne.useState(null),[V,Y]=ne.useState(null),J=(c==null?void 0:c.files)??[],z=J.filter(te=>te.kind.startsWith("agent-")),j=z.filter(te=>Rm(te)),H=z.filter(te=>!Rm(te)),G=J.filter(te=>te.kind.startsWith("skill-")),N=J.filter(te=>te.kind.startsWith("tool-")),ie=J.filter(te=>te.kind==="root-claude"||te.kind==="gitignore"||te.kind==="pull-request-template"),he=!!(R&&E!==R.content);ne.useEffect(()=>{o||(M(null),D(null),L(""),I(!1),X(null))},[J,o,A]),ne.useEffect(()=>{if(!o||!A||!v)return;let te=!1;return U(!0),X(null),I(!1),ye.getHarnessFileContent(v,A).then(le=>{te||(D(le),L(le.content))}).catch(le=>{te||X(le.message)}).finally(()=>{te||U(!1)}),()=>{te=!0}},[o,A,v]);async function ge(){if(!(!R||!R.editable||!he||!v)){U(!0),X(null);try{const te=await ye.updateHarnessFileContent(v,R.path,{content:E});D(te.file),L(te.file.content),I(!1),S()}catch(te){X(te instanceof Error?te.message:String(te))}finally{U(!1)}}}function K(){M(null),D(null),L(""),I(!1),X(null)}async function q(te){await $1(te),Y(te),window.setTimeout(()=>{Y(le=>le===te?null:le)},1200)}return o?k.jsx(k.Fragment,{children:k.jsx("div",{className:"modal-backdrop harness-studio-backdrop",children:k.jsxs("section",{className:"harness-studio-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Studio",children:[k.jsxs("header",{className:"harness-studio-header",children:[k.jsxs("div",{children:[k.jsx("h2",{children:"Harness Studio"}),v?null:k.jsx("p",{className:"muted",children:"Create or select a task before editing harness files."})]}),k.jsxs("div",{className:"harness-studio-header-actions",children:[k.jsx("button",{type:"button",disabled:n,onClick:m,children:"Review Diff"}),k.jsx("button",{type:"button",disabled:n,onClick:S,children:"Refresh"}),k.jsx("button",{type:"button",onClick:h,children:"Close"})]})]}),k.jsxs("div",{className:"harness-studio-layout",children:[k.jsx("aside",{className:A?"harness-studio-left harness-studio-left-preview":"harness-studio-left",children:A?k.jsxs("section",{className:"harness-studio-section harness-studio-file-preview",children:[k.jsxs("header",{className:"harness-studio-file-editor-header",children:[k.jsxs("div",{children:[k.jsx("h3",{children:(R==null?void 0:R.title)??"Harness File"}),k.jsx("p",{className:"muted",children:(R==null?void 0:R.path)??A})]}),k.jsxs("div",{className:"harness-studio-file-editor-actions",children:[R?k.jsx(wi,{status:R.editable?"ok":"unknown"}):null,B?k.jsxs(k.Fragment,{children:[k.jsx("button",{type:"button",disabled:F||!v||!(R!=null&&R.editable)||!he,onClick:()=>void ge(),children:"Save"}),k.jsx("button",{type:"button",disabled:F,onClick:()=>{L((R==null?void 0:R.content)??""),I(!1)},children:"Cancel"})]}):k.jsx("button",{type:"button",disabled:F||!v||!(R!=null&&R.editable),onClick:()=>I(!0),children:"Edit"}),k.jsx("button",{type:"button",onClick:K,children:"Return"})]})]}),R!=null&&R.readonlyReason?k.jsx("p",{className:"muted",children:R.readonlyReason}):null,W?k.jsx("p",{className:"error-banner",children:W}):null,k.jsx("textarea",{className:B?"harness-studio-file-textarea is-editing":"harness-studio-file-textarea",value:E,spellCheck:!1,readOnly:!B,disabled:F,onChange:te=>L(te.target.value)})]}):k.jsxs(k.Fragment,{children:[k.jsx(Ca,{title:"VCM Roles",files:j,selectedPath:A,copiedPath:V,onCopy:te=>void q(te),onSelect:M}),k.jsx(Ca,{title:"Auxiliary Roles",files:H,selectedPath:A,copiedPath:V,onCopy:te=>void q(te),onSelect:M}),k.jsx(Ku,{title:"Overview",children:k.jsxs("section",{className:"harness-studio-overview",children:[k.jsxs("div",{className:"harness-studio-metrics",children:[k.jsx(ms,{label:"Fixed install",value:c?c.initialized?c.needsApply?"updates":"current":"new":"unknown"}),k.jsx(ms,{label:"Revision",value:String((c==null?void 0:c.harnessRevision)??0)}),k.jsx(ms,{label:"Managed files",value:String(J.length)}),k.jsx(ms,{label:"Pending updates",value:String((c==null?void 0:c.plannedChanges.length)??0)}),k.jsx(ms,{label:"Bootstrap",value:(f==null?void 0:f.status.replaceAll("_"," "))??"unknown"}),k.jsx(ms,{label:"Engineer",value:Dm(l)})]}),c!=null&&c.warnings.length?k.jsx("ul",{className:"warnings",children:c.warnings.map(te=>k.jsx("li",{children:te},te))}):null]})}),k.jsx(Ca,{title:"Skills",files:G,selectedPath:A,copiedPath:V,onCopy:te=>void q(te),onSelect:M,collapsible:!0}),k.jsx(Ca,{title:"Root Context",files:ie,selectedPath:A,copiedPath:V,onCopy:te=>void q(te),onSelect:M,collapsible:!0}),k.jsx(Ca,{title:"Tools",files:N,selectedPath:A,copiedPath:V,onCopy:te=>void q(te),onSelect:M,collapsible:!0}),k.jsx(Ku,{title:"Project Docs",children:k.jsx("ul",{className:"harness-studio-doc-list",children:(f==null?void 0:f.checks.map(te=>k.jsxs("li",{children:[k.jsx("span",{children:te.path??te.label}),k.jsx(wi,{status:te.status})]},te.key)))??k.jsx("li",{children:k.jsx("span",{children:"No bootstrap status loaded."})})})})]})}),k.jsxs("section",{className:"harness-studio-section harness-studio-engineer",children:[k.jsxs("div",{className:"harness-studio-engineer-header",children:[k.jsxs("div",{children:[k.jsx("h3",{children:"Harness Engineer"}),k.jsx("p",{className:"muted",children:Dm(l)})]}),k.jsx(wi,{status:(l==null?void 0:l.status)??"unknown"})]}),k.jsx(uh,{role:"harness-engineer",session:l??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:b,onModelChange:u,onEffortChange:p,onStart:x,onResume:C,onRestart:T,onStop:_,onNotifyHarnessUpdated:y}),k.jsx("div",{className:"harness-engineer-terminal",children:(l==null?void 0:l.status)==="running"?k.jsx(fo,{sessionId:l.id,active:o},l.id):k.jsxs("div",{className:"terminal-empty",children:[k.jsx("strong",{children:"harness-engineer"}),k.jsx("span",{children:l!=null&&l.claudeSessionId?"Resume this project Harness Engineer session.":"Start this project Harness Engineer session."})]})})]})]})]})})}):null}function ms({label:n,value:r}){return k.jsxs("div",{className:"harness-studio-metric",children:[k.jsx("span",{children:n}),k.jsx("strong",{children:r})]})}function Ca({title:n,files:r,selectedPath:s,copiedPath:o,onCopy:d,onSelect:v,collapsible:f=!1}){const l=k.jsx("ol",{className:"harness-studio-file-list",children:r.length?r.map(c=>k.jsxs("li",{className:c.path===s?"selected":void 0,children:[k.jsx("button",{className:"harness-studio-file-path-button",type:"button",title:c.path,onClick:()=>v(c.path),children:c.path}),k.jsx("button",{className:"harness-studio-file-copy-button",type:"button",title:`Copy ${c.path}`,onClick:()=>d(c.path),children:o===c.path?"Copied":"Copy"}),k.jsx(wi,{status:c.action})]},c.path)):k.jsx("li",{children:k.jsx("span",{children:"No files."})})});return f?k.jsx(Ku,{title:n,children:l}):k.jsxs("section",{className:"harness-studio-section",children:[k.jsx("h3",{children:n}),l]})}function Ku({title:n,children:r}){return k.jsxs("details",{className:"harness-studio-section harness-studio-collapsible-section",children:[k.jsxs("summary",{children:[k.jsx("h3",{children:n}),k.jsx("span",{children:"Show"})]}),k.jsx("div",{className:"harness-studio-collapsible-content",children:r})]})}function Rm(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 Dm(n){return n?n.status==="running"?`${n.status} / ${n.activityStatus??"idle"}`:n.status:"not started"}async function $1(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 W1({open:n,taskSlug:r,onClose:s}){var x;const[o,d]=ne.useState(null),[v,f]=ne.useState(null),[l,c]=ne.useState(null),[h,p]=ne.useState(!1),[u,b]=ne.useState(null),C=ne.useMemo(()=>(o==null?void 0:o.files.find(_=>_.path===l))??(o==null?void 0:o.files[0])??null,[o,l]);async function T(_=v){var y;p(!0),b(null);try{if(!r)throw new Error("Create or select a task before reviewing harness commits.");const m=await ye.getRepositoryDiff(r,_);d(m),f(((y=m.commit)==null?void 0:y.sha)??null),c(S=>{var A;return S&&m.files.some(M=>M.path===S)?S:((A=m.files[0])==null?void 0:A.path)??null})}catch(m){b(m instanceof Error?m.message:String(m))}finally{p(!1)}}return ne.useEffect(()=>{n&&(f(null),T(null))},[n,r]),n?k.jsx("div",{className:"modal-backdrop repository-diff-backdrop",children:k.jsxs("section",{className:"repository-diff-modal",role:"dialog","aria-modal":"true","aria-label":"Commit Diff",children:[k.jsxs("header",{className:"repository-diff-header",children:[k.jsxs("div",{children:[k.jsx("h2",{children:"Commit Diff"}),k.jsx("p",{children:o?`${((x=o.commit)==null?void 0:x.shortSha)??"HEAD"} · ${o.summary.totalFiles} files · +${o.summary.additions} / -${o.summary.deletions}`:"Review a new commit on the active task worktree branch."})]}),k.jsxs("div",{className:"repository-diff-header-actions",children:[k.jsxs("label",{className:"repository-diff-commit-picker",children:[k.jsx("span",{children:"Commit"}),k.jsx("select",{value:v??"",disabled:h||!(o!=null&&o.commits.length),onChange:_=>{const y=_.target.value||null;f(y),T(y)},children:o==null?void 0:o.commits.map(_=>k.jsxs("option",{value:_.sha,children:[_.shortSha," · ",_.subject]},_.sha))})]}),k.jsx("button",{type:"button",disabled:h,onClick:()=>void T(),children:"Refresh"}),k.jsx("button",{type:"button",onClick:s,children:"Close"})]})]}),u?k.jsx("p",{className:"error-banner",children:u}):null,o!=null&&o.warnings.length?k.jsx("ul",{className:"warnings repository-diff-warnings",children:o.warnings.map(_=>k.jsx("li",{children:_},_))}):null,k.jsxs("div",{className:"repository-diff-body",children:[k.jsxs("aside",{className:"repository-diff-sidebar",children:[k.jsx(K1,{report:o,busy:h}),k.jsxs("ol",{className:"repository-diff-file-list",children:[o==null?void 0:o.files.map(_=>k.jsx("li",{className:(C==null?void 0:C.path)===_.path?"selected":"",children:k.jsxs("button",{type:"button",onClick:()=>c(_.path),children:[k.jsx("span",{children:_.path}),k.jsxs("small",{children:[Om(_.status)," · ",Lm(_.stage)," · ",Mm(_.category)]})]})},_.path)),o&&o.files.length===0?k.jsx("li",{className:"repository-diff-empty",children:o.commits.length===0?"No new commits on this task branch.":"No files in this commit."}):null]})]}),k.jsx("main",{className:"repository-diff-main",children:C?k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"repository-diff-file-header",children:[k.jsxs("div",{children:[k.jsx("h3",{children:C.path}),k.jsxs("p",{children:[Mm(C.category)," · ",Om(C.status)," · ",Lm(C.stage)]})]}),k.jsxs("span",{className:"repository-diff-stats",children:["+",C.additions," / -",C.deletions]})]}),C.binary?k.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,C.truncated?k.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,k.jsx("pre",{className:"repository-diff-code","aria-label":`${C.path} diff`,children:Y1(C.diff)})]}):k.jsx("div",{className:"repository-diff-placeholder",children:h?"Loading commit diff...":"No diff selected."})})]})]})}):null}function K1({report:n,busy:r}){var o;const s=n==null?void 0:n.summary;return k.jsxs("div",{className:"repository-diff-summary",children:[k.jsx("strong",{children:r?"Loading":n?"Commit changes":"Not loaded"}),s?k.jsxs(k.Fragment,{children:[k.jsxs("span",{children:[s.harnessFiles," harness files"]}),k.jsxs("span",{children:[s.productCodeFiles," product code files"]}),k.jsxs("span",{children:[s.committedFiles," committed files"]}),k.jsxs("span",{children:[(n==null?void 0:n.commits.length)??0," branch commits"]}),k.jsx("span",{children:((o=n==null?void 0:n.commit)==null?void 0:o.subject)??"HEAD"})]}):null]})}function Mm(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 Lm(n){return n.replaceAll("_"," ")}function Om(n){return n.replaceAll("_"," ")}function Y1(n){return n.split(`
61
+ `).filter(r=>!Q1(r)).map((r,s)=>k.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 Q1(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 Z1({busy:n,effort:r,model:s,open:o,permissionMode:d,session:v,onClose:f,onEffortChange:l,onModelChange:c,onPermissionModeChange:h,onResume:p,onRestart:u,onStart:b,onStop:C,onNotifyHarnessUpdated:T}){return o?k.jsx("div",{className:"modal-backdrop translator-session-backdrop",children:k.jsxs("section",{className:"translator-session-modal",role:"dialog","aria-modal":"true","aria-label":"Translator Session",children:[k.jsxs("header",{className:"translator-session-header",children:[k.jsxs("div",{children:[k.jsx("h2",{children:"Translator Session"}),k.jsx("p",{children:J1(v)})]}),k.jsx("button",{type:"button",onClick:f,children:"Close"})]}),k.jsx(uh,{role:"translator",session:v??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:h,onModelChange:c,onEffortChange:l,onStart:b,onResume:p,onRestart:u,onStop:C,onNotifyHarnessUpdated:T}),k.jsx("div",{className:"translator-session-terminal",children:(v==null?void 0:v.status)==="running"?k.jsx(fo,{sessionId:v.id,active:o},v.id):k.jsxs("div",{className:"terminal-empty",children:[k.jsx("strong",{children:"translator"}),k.jsx("span",{children:v!=null&&v.claudeSessionId?"Resume this project translator session.":"Start the project translator session."})]})})]})}):null}function J1(n){if(!n)return"not started";const r=n.status==="running"?` · ${n.activityStatus??"idle"}`:"";return`${n.status}${r}`}function ey(n,r){const s={};return(n[n.length-1]===""?[...n,""]:n).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const ty=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ny=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iy={};function Bm(n,r){return(iy.jsx?ny:ty).test(n)}const ry=/[ \t\n\f\r]/g;function sy(n){return typeof n=="object"?n.type==="text"?jm(n.value):!1:jm(n)}function jm(n){return n.replace(ry,"")===""}class Ba{constructor(r,s,o){this.normal=s,this.property=r,o&&(this.space=o)}}Ba.prototype.normal={};Ba.prototype.property={};Ba.prototype.space=void 0;function Gg(n,r){const s={},o={};for(const d of n)Object.assign(s,d.property),Object.assign(o,d.normal);return new Ba(s,o,r)}function Yu(n){return n.toLowerCase()}class fn{constructor(r,s){this.attribute=s,this.property=r}}fn.prototype.attribute="";fn.prototype.booleanish=!1;fn.prototype.boolean=!1;fn.prototype.commaOrSpaceSeparated=!1;fn.prototype.commaSeparated=!1;fn.prototype.defined=!1;fn.prototype.mustUseProperty=!1;fn.prototype.number=!1;fn.prototype.overloadedBoolean=!1;fn.prototype.property="";fn.prototype.spaceSeparated=!1;fn.prototype.space=void 0;let ay=0;const qe=Dr(),Ot=Dr(),Xu=Dr(),be=Dr(),ft=Dr(),ys=Dr(),Cn=Dr();function Dr(){return 2**++ay}const Qu=Object.freeze(Object.defineProperty({__proto__:null,boolean:qe,booleanish:Ot,commaOrSpaceSeparated:Cn,commaSeparated:ys,number:be,overloadedBoolean:Xu,spaceSeparated:ft},Symbol.toStringTag,{value:"Module"})),Mu=Object.keys(Qu);class hh extends fn{constructor(r,s,o,d){let v=-1;if(super(r,s),Nm(this,"space",d),typeof o=="number")for(;++v<Mu.length;){const f=Mu[v];Nm(this,Mu[v],(o&Qu[f])===Qu[f])}}}hh.prototype.defined=!0;function Nm(n,r,s){s&&(n[r]=s)}function xs(n){const r={},s={};for(const[o,d]of Object.entries(n.properties)){const v=new hh(o,n.transform(n.attributes||{},o),d,n.space);n.mustUseProperty&&n.mustUseProperty.includes(o)&&(v.mustUseProperty=!0),r[o]=v,s[Yu(o)]=o,s[Yu(v.attribute)]=o}return new Ba(r,s,n.space)}const Vg=xs({properties:{ariaActiveDescendant:null,ariaAtomic:Ot,ariaAutoComplete:null,ariaBusy:Ot,ariaChecked:Ot,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:ft,ariaCurrent:null,ariaDescribedBy:ft,ariaDetails:null,ariaDisabled:Ot,ariaDropEffect:ft,ariaErrorMessage:null,ariaExpanded:Ot,ariaFlowTo:ft,ariaGrabbed:Ot,ariaHasPopup:null,ariaHidden:Ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ft,ariaLevel:be,ariaLive:null,ariaModal:Ot,ariaMultiLine:Ot,ariaMultiSelectable:Ot,ariaOrientation:null,ariaOwns:ft,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Ot,ariaReadOnly:Ot,ariaRelevant:null,ariaRequired:Ot,ariaRoleDescription:ft,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Ot,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 $g(n,r){return r in n?n[r]:r}function Wg(n,r){return $g(n,r.toLowerCase())}const ly=xs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ys,acceptCharset:ft,accessKey:ft,action:null,allow:null,allowFullScreen:qe,allowPaymentRequest:qe,allowUserMedia:qe,alt:null,as:null,async:qe,autoCapitalize:null,autoComplete:ft,autoFocus:qe,autoPlay:qe,blocking:ft,capture:null,charSet:null,checked:qe,cite:null,className:ft,cols:be,colSpan:null,content:null,contentEditable:Ot,controls:qe,controlsList:ft,coords:be|ys,crossOrigin:null,data:null,dateTime:null,decoding:null,default:qe,defer:qe,dir:null,dirName:null,disabled:qe,download:Xu,draggable:Ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:qe,formTarget:null,headers:ft,height:be,hidden:Xu,high:be,href:null,hrefLang:null,htmlFor:ft,httpEquiv:ft,id:null,imageSizes:null,imageSrcSet:null,inert:qe,inputMode:null,integrity:null,is:null,isMap:qe,itemId:null,itemProp:ft,itemRef:ft,itemScope:qe,itemType:ft,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:qe,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:qe,muted:qe,name:null,nonce:null,noModule:qe,noValidate:qe,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:qe,optimum:be,pattern:null,ping:ft,placeholder:null,playsInline:qe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:qe,referrerPolicy:null,rel:ft,required:qe,reversed:qe,rows:be,rowSpan:be,sandbox:ft,scope:null,scoped:qe,seamless:qe,selected:qe,shadowRootClonable:qe,shadowRootDelegatesFocus:qe,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Ot,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:qe,useMap:null,value:Ot,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:qe,declare:qe,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:qe,noHref:qe,noShade:qe,noWrap:qe,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Ot,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:qe,disableRemotePlayback:qe,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:Wg}),oy=xs({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:Cn,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:qe,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:ys,g2:ys,glyphName:ys,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:Cn,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:Cn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Cn,rev:Cn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Cn,requiredFeatures:Cn,requiredFonts:Cn,requiredFormats:Cn,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:Cn,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:Cn,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:Cn,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:$g}),Kg=xs({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()}}),Yg=xs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Wg}),Xg=xs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,r){return"xml:"+r.slice(3).toLowerCase()}}),cy={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"},uy=/[A-Z]/g,Hm=/-[a-z]/g,hy=/^data[-\w.:]+$/i;function fy(n,r){const s=Yu(r);let o=r,d=fn;if(s in n.normal)return n.property[n.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&hy.test(r)){if(r.charAt(4)==="-"){const v=r.slice(5).replace(Hm,py);o="data"+v.charAt(0).toUpperCase()+v.slice(1)}else{const v=r.slice(4);if(!Hm.test(v)){let f=v.replace(uy,dy);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=hh}return new d(o,r)}function dy(n){return"-"+n.toLowerCase()}function py(n){return n.charAt(1).toUpperCase()}const my=Gg([Vg,ly,Kg,Yg,Xg],"html"),fh=Gg([Vg,oy,Kg,Yg,Xg],"svg");function gy(n){return n.join(" ").trim()}var gs={},Lu,zm;function _y(){if(zm)return Lu;zm=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,v=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
62
+ `,h="/",p="*",u="",b="comment",C="declaration";function T(_,y){if(typeof _!="string")throw new TypeError("First argument must be a string");if(!_)return[];y=y||{};var m=1,S=1;function A(W){var X=W.match(r);X&&(m+=X.length);var V=W.lastIndexOf(c);S=~V?W.length-V:S+W.length}function M(){var W={line:m,column:S};return function(X){return X.position=new R(W),L(),X}}function R(W){this.start=W,this.end={line:m,column:S},this.source=y.source}R.prototype.content=_;function D(W){var X=new Error(y.source+":"+m+":"+S+": "+W);if(X.reason=W,X.filename=y.source,X.line=m,X.column=S,X.source=_,!y.silent)throw X}function E(W){var X=W.exec(_);if(X){var V=X[0];return A(V),_=_.slice(V.length),X}}function L(){E(s)}function B(W){var X;for(W=W||[];X=I();)X!==!1&&W.push(X);return W}function I(){var W=M();if(!(h!=_.charAt(0)||p!=_.charAt(1))){for(var X=2;u!=_.charAt(X)&&(p!=_.charAt(X)||h!=_.charAt(X+1));)++X;if(X+=2,u===_.charAt(X-1))return D("End of comment missing");var V=_.slice(2,X-2);return S+=2,A(V),_=_.slice(X),S+=2,W({type:b,comment:V})}}function F(){var W=M(),X=E(o);if(X){if(I(),!E(d))return D("property missing ':'");var V=E(v),Y=W({type:C,property:x(X[0].replace(n,u)),value:V?x(V[0].replace(n,u)):u});return E(f),Y}}function U(){var W=[];B(W);for(var X;X=F();)X!==!1&&(W.push(X),B(W));return W}return L(),U()}function x(_){return _?_.replace(l,u):u}return Lu=T,Lu}var Im;function vy(){if(Im)return gs;Im=1;var n=gs&&gs.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(gs,"__esModule",{value:!0}),gs.default=s;const r=n(_y());function s(o,d){let v=null;if(!o||typeof o!="string")return v;const f=(0,r.default)(o),l=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:h,value:p}=c;l?d(h,p,c):p&&(v=v||{},v[h]=p)}),v}return gs}var wa={},Pm;function yy(){if(Pm)return wa;Pm=1,Object.defineProperty(wa,"__esModule",{value:!0}),wa.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,d=/^-(ms)-/,v=function(h){return!h||s.test(h)||n.test(h)},f=function(h,p){return p.toUpperCase()},l=function(h,p){return"".concat(p,"-")},c=function(h,p){return p===void 0&&(p={}),v(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(d,l):h=h.replace(o,l),h.replace(r,f))};return wa.camelCase=c,wa}var xa,Um;function Sy(){if(Um)return xa;Um=1;var n=xa&&xa.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=n(vy()),s=yy();function o(d,v){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(l,c){l&&c&&(f[(0,s.camelCase)(l,v)]=c)}),f}return o.default=o,xa=o,xa}var by=Sy();const Cy=Bg(by),Qg=Zg("end"),dh=Zg("start");function Zg(n){return r;function r(s){const o=s&&s.position&&s.position[n]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function wy(n){const r=dh(n),s=Qg(n);if(r&&s)return{start:r,end:s}}function Ta(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Fm(n.position):"start"in n||"end"in n?Fm(n):"line"in n||"column"in n?Zu(n):""}function Zu(n){return qm(n&&n.line)+":"+qm(n&&n.column)}function Fm(n){return Zu(n&&n.start)+"-"+Zu(n&&n.end)}function qm(n){return n&&typeof n=="number"?n:1}class Wt extends Error{constructor(r,s,o){super(),typeof s=="string"&&(o=s,s=void 0);let d="",v={},f=!1;if(s&&("line"in s&&"column"in s?v={place:s}:"start"in s&&"end"in s?v={place:s}:"type"in s?v={ancestors:[s],place:s.position}:v={...s}),typeof r=="string"?d=r:!v.cause&&r&&(f=!0,d=r.message,v.cause=r),!v.ruleId&&!v.source&&typeof o=="string"){const c=o.indexOf(":");c===-1?v.ruleId=o:(v.source=o.slice(0,c),v.ruleId=o.slice(c+1))}if(!v.place&&v.ancestors&&v.ancestors){const c=v.ancestors[v.ancestors.length-1];c&&(v.place=c.position)}const l=v.place&&"start"in v.place?v.place.start:v.place;this.ancestors=v.ancestors||void 0,this.cause=v.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=l?l.line:void 0,this.name=Ta(v.place)||"1:1",this.place=v.place||void 0,this.reason=this.message,this.ruleId=v.ruleId||void 0,this.source=v.source||void 0,this.stack=f&&v.cause&&typeof v.cause.stack=="string"?v.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Wt.prototype.file="";Wt.prototype.name="";Wt.prototype.reason="";Wt.prototype.message="";Wt.prototype.stack="";Wt.prototype.column=void 0;Wt.prototype.line=void 0;Wt.prototype.ancestors=void 0;Wt.prototype.cause=void 0;Wt.prototype.fatal=void 0;Wt.prototype.place=void 0;Wt.prototype.ruleId=void 0;Wt.prototype.source=void 0;const ph={}.hasOwnProperty,xy=new Map,Ey=/[A-Z]/g,ky=new Set(["table","tbody","thead","tfoot","tr"]),Ay=new Set(["td","th"]),Jg="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ty(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let o;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=Ny(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");o=jy(s,r.jsx,r.jsxs)}const d={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:o,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"?fh:my,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},v=e_(d,n,void 0);return v&&typeof v!="string"?v:d.create(n,d.Fragment,{children:v||void 0},void 0)}function e_(n,r,s){if(r.type==="element")return Ry(n,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return Dy(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return Ly(n,r,s);if(r.type==="mdxjsEsm")return My(n,r);if(r.type==="root")return Oy(n,r,s);if(r.type==="text")return By(n,r)}function Ry(n,r,s){const o=n.schema;let d=o;r.tagName.toLowerCase()==="svg"&&o.space==="html"&&(d=fh,n.schema=d),n.ancestors.push(r);const v=n_(n,r.tagName,!1),f=Hy(n,r);let l=gh(n,r);return ky.has(r.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!sy(c):!0})),t_(n,f,v,r),mh(f,l),n.ancestors.pop(),n.schema=o,n.create(r,v,f,s)}function Dy(n,r){if(r.data&&r.data.estree&&n.evaluater){const o=r.data.estree.body[0];return o.type,n.evaluater.evaluateExpression(o.expression)}La(n,r.position)}function My(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);La(n,r.position)}function Ly(n,r,s){const o=n.schema;let d=o;r.name==="svg"&&o.space==="html"&&(d=fh,n.schema=d),n.ancestors.push(r);const v=r.name===null?n.Fragment:n_(n,r.name,!0),f=zy(n,r),l=gh(n,r);return t_(n,f,v,r),mh(f,l),n.ancestors.pop(),n.schema=o,n.create(r,v,f,s)}function Oy(n,r,s){const o={};return mh(o,gh(n,r)),n.create(r,n.Fragment,o,s)}function By(n,r){return r.value}function t_(n,r,s,o){typeof s!="string"&&s!==n.Fragment&&n.passNode&&(r.node=o)}function mh(n,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(n.children=s)}}function jy(n,r,s){return o;function o(d,v,f,l){const h=Array.isArray(f.children)?s:r;return l?h(v,f,l):h(v,f)}}function Ny(n,r){return s;function s(o,d,v,f){const l=Array.isArray(v.children),c=dh(o);return r(d,v,f,l,{columnNumber:c?c.column-1:void 0,fileName:n,lineNumber:c?c.line:void 0},void 0)}}function Hy(n,r){const s={};let o,d;for(d in r.properties)if(d!=="children"&&ph.call(r.properties,d)){const v=Iy(n,d,r.properties[d]);if(v){const[f,l]=v;n.tableCellAlignToStyle&&f==="align"&&typeof l=="string"&&Ay.has(r.tagName)?o=l:s[f]=l}}if(o){const v=s.style||(s.style={});v[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return s}function zy(n,r){const s={};for(const o of r.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&n.evaluater){const v=o.data.estree.body[0];v.type;const f=v.expression;f.type;const l=f.properties[0];l.type,Object.assign(s,n.evaluater.evaluateExpression(l.argument))}else La(n,r.position);else{const d=o.name;let v;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&n.evaluater){const l=o.value.data.estree.body[0];l.type,v=n.evaluater.evaluateExpression(l.expression)}else La(n,r.position);else v=o.value===null?!0:o.value;s[d]=v}return s}function gh(n,r){const s=[];let o=-1;const d=n.passKeys?new Map:xy;for(;++o<r.children.length;){const v=r.children[o];let f;if(n.passKeys){const c=v.type==="element"?v.tagName:v.type==="mdxJsxFlowElement"||v.type==="mdxJsxTextElement"?v.name:void 0;if(c){const h=d.get(c)||0;f=c+"-"+h,d.set(c,h+1)}}const l=e_(n,v,f);l!==void 0&&s.push(l)}return s}function Iy(n,r,s){const o=fy(n.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=o.commaSeparated?ey(s):gy(s)),o.property==="style"){let d=typeof s=="object"?s:Py(n,String(s));return n.stylePropertyNameCase==="css"&&(d=Uy(d)),["style",d]}return[n.elementAttributeNameCase==="react"&&o.space?cy[o.property]||o.property:o.attribute,s]}}function Py(n,r){try{return Cy(r,{reactCompat:!0})}catch(s){if(n.ignoreInvalidStyle)return{};const o=s,d=new Wt("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw d.file=n.filePath||void 0,d.url=Jg+"#cannot-parse-style-attribute",d}}function n_(n,r,s){let o;if(!s)o={type:"Literal",value:r};else if(r.includes(".")){const d=r.split(".");let v=-1,f;for(;++v<d.length;){const l=Bm(d[v])?{type:"Identifier",name:d[v]}:{type:"Literal",value:d[v]};f=f?{type:"MemberExpression",object:f,property:l,computed:!!(v&&l.type==="Literal"),optional:!1}:l}o=f}else o=Bm(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(o.type==="Literal"){const d=o.value;return ph.call(n.components,d)?n.components[d]:d}if(n.evaluater)return n.evaluater.evaluateExpression(o);La(n)}function La(n,r){const s=new Wt("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=Jg+"#cannot-handle-mdx-estrees-without-createevaluater",s}function Uy(n){const r={};let s;for(s in n)ph.call(n,s)&&(r[Fy(s)]=n[s]);return r}function Fy(n){let r=n.replace(Ey,qy);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function qy(n){return"-"+n.toLowerCase()}const Ou={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"]},Gy={};function _h(n,r){const s=Gy,o=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return i_(n,o,d)}function i_(n,r,s){if(Vy(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 Gm(n.children,r,s)}return Array.isArray(n)?Gm(n,r,s):""}function Gm(n,r,s){const o=[];let d=-1;for(;++d<n.length;)o[d]=i_(n[d],r,s);return o.join("")}function Vy(n){return!!(n&&typeof n=="object")}const Vm=document.createElement("i");function vh(n){const r="&"+n+";";Vm.innerHTML=r;const s=Vm.textContent;return s.charCodeAt(s.length-1)===59&&n!=="semi"||s===r?!1:s}function wn(n,r,s,o){const d=n.length;let v=0,f;if(r<0?r=-r>d?0:d+r:r=r>d?d:r,s=s>0?s:0,o.length<1e4)f=Array.from(o),f.unshift(r,s),n.splice(...f);else for(s&&n.splice(r,s);v<o.length;)f=o.slice(v,v+1e4),f.unshift(r,0),n.splice(...f),v+=1e4,r+=1e4}function Nn(n,r){return n.length>0?(wn(n,n.length,0,r),n):r}const $m={}.hasOwnProperty;function r_(n){const r={};let s=-1;for(;++s<n.length;)$y(r,n[s]);return r}function $y(n,r){let s;for(s in r){const d=($m.call(n,s)?n[s]:void 0)||(n[s]={}),v=r[s];let f;if(v)for(f in v){$m.call(d,f)||(d[f]=[]);const l=v[f];Wy(d[f],Array.isArray(l)?l:l?[l]:[])}}}function Wy(n,r){let s=-1;const o=[];for(;++s<r.length;)(r[s].add==="after"?n:o).push(r[s]);wn(n,0,0,o)}function s_(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 $n(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Zt=sr(/[A-Za-z]/),$t=sr(/[\dA-Za-z]/),Ky=sr(/[#-'*+\--9=?A-Z^-~]/);function ao(n){return n!==null&&(n<32||n===127)}const Ju=sr(/\d/),Yy=sr(/[\dA-Fa-f]/),Xy=sr(/[!-/:-@[-`{-~]/);function Oe(n){return n!==null&&n<-2}function ot(n){return n!==null&&(n<0||n===32)}function $e(n){return n===-2||n===-1||n===32}const po=sr(new RegExp("\\p{P}|\\p{S}","u")),Rr=sr(/\s/);function sr(n){return r;function r(s){return s!==null&&s>-1&&n.test(String.fromCharCode(s))}}function Es(n){const r=[];let s=-1,o=0,d=0;for(;++s<n.length;){const v=n.charCodeAt(s);let f="";if(v===37&&$t(n.charCodeAt(s+1))&&$t(n.charCodeAt(s+2)))d=2;else if(v<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(v))||(f=String.fromCharCode(v));else if(v>55295&&v<57344){const l=n.charCodeAt(s+1);v<56320&&l>56319&&l<57344?(f=String.fromCharCode(v,l),d=1):f="�"}else f=String.fromCharCode(v);f&&(r.push(n.slice(o,s),encodeURIComponent(f)),o=s+d+1,f=""),d&&(s+=d,d=0)}return r.join("")+n.slice(o)}function Xe(n,r,s,o){const d=o?o-1:Number.POSITIVE_INFINITY;let v=0;return f;function f(c){return $e(c)?(n.enter(s),l(c)):r(c)}function l(c){return $e(c)&&v++<d?(n.consume(c),l):(n.exit(s),r(c))}}const Qy={tokenize:Zy};function Zy(n){const r=n.attempt(this.parser.constructs.contentInitial,o,d);let s;return r;function o(l){if(l===null){n.consume(l);return}return n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),Xe(n,r,"linePrefix")}function d(l){return n.enter("paragraph"),v(l)}function v(l){const c=n.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=c),s=c,f(l)}function f(l){if(l===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(l);return}return Oe(l)?(n.consume(l),n.exit("chunkText"),v):(n.consume(l),f)}}const Jy={tokenize:eS},Wm={tokenize:tS};function eS(n){const r=this,s=[];let o=0,d,v,f;return l;function l(S){if(o<s.length){const A=s[o];return r.containerState=A[1],n.attempt(A[0].continuation,c,h)(S)}return h(S)}function c(S){if(o++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,d&&m();const A=r.events.length;let M=A,R;for(;M--;)if(r.events[M][0]==="exit"&&r.events[M][1].type==="chunkFlow"){R=r.events[M][1].end;break}y(o);let D=A;for(;D<r.events.length;)r.events[D][1].end={...R},D++;return wn(r.events,M+1,0,r.events.slice(A)),r.events.length=D,h(S)}return l(S)}function h(S){if(o===s.length){if(!d)return b(S);if(d.currentConstruct&&d.currentConstruct.concrete)return T(S);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(Wm,p,u)(S)}function p(S){return d&&m(),y(o),b(S)}function u(S){return r.parser.lazy[r.now().line]=o!==s.length,f=r.now().offset,T(S)}function b(S){return r.containerState={},n.attempt(Wm,C,T)(S)}function C(S){return o++,s.push([r.currentConstruct,r.containerState]),b(S)}function T(S){if(S===null){d&&m(),y(0),n.consume(S);return}return d=d||r.parser.flow(r.now()),n.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:v}),x(S)}function x(S){if(S===null){_(n.exit("chunkFlow"),!0),y(0),n.consume(S);return}return Oe(S)?(n.consume(S),_(n.exit("chunkFlow")),o=0,r.interrupt=void 0,l):(n.consume(S),x)}function _(S,A){const M=r.sliceStream(S);if(A&&M.push(null),S.previous=v,v&&(v.next=S),v=S,d.defineSkip(S.start),d.write(M),r.parser.lazy[S.start.line]){let R=d.events.length;for(;R--;)if(d.events[R][1].start.offset<f&&(!d.events[R][1].end||d.events[R][1].end.offset>f))return;const D=r.events.length;let E=D,L,B;for(;E--;)if(r.events[E][0]==="exit"&&r.events[E][1].type==="chunkFlow"){if(L){B=r.events[E][1].end;break}L=!0}for(y(o),R=D;R<r.events.length;)r.events[R][1].end={...B},R++;wn(r.events,E+1,0,r.events.slice(D)),r.events.length=R}}function y(S){let A=s.length;for(;A-- >S;){const M=s[A];r.containerState=M[1],M[0].exit.call(r,n)}s.length=S}function m(){d.write([null]),v=void 0,d=void 0,r.containerState._closeFlow=void 0}}function tS(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 bs(n){if(n===null||ot(n)||Rr(n))return 1;if(po(n))return 2}function mo(n,r,s){const o=[];let d=-1;for(;++d<n.length;){const v=n[d].resolveAll;v&&!o.includes(v)&&(r=v(r,s),o.push(v))}return r}const eh={name:"attention",resolveAll:nS,tokenize:iS};function nS(n,r){let s=-1,o,d,v,f,l,c,h,p;for(;++s<n.length;)if(n[s][0]==="enter"&&n[s][1].type==="attentionSequence"&&n[s][1]._close){for(o=s;o--;)if(n[o][0]==="exit"&&n[o][1].type==="attentionSequence"&&n[o][1]._open&&r.sliceSerialize(n[o][1]).charCodeAt(0)===r.sliceSerialize(n[s][1]).charCodeAt(0)){if((n[o][1]._close||n[s][1]._open)&&(n[s][1].end.offset-n[s][1].start.offset)%3&&!((n[o][1].end.offset-n[o][1].start.offset+n[s][1].end.offset-n[s][1].start.offset)%3))continue;c=n[o][1].end.offset-n[o][1].start.offset>1&&n[s][1].end.offset-n[s][1].start.offset>1?2:1;const u={...n[o][1].end},b={...n[s][1].start};Km(u,-c),Km(b,c),f={type:c>1?"strongSequence":"emphasisSequence",start:u,end:{...n[o][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...n[s][1].start},end:b},v={type:c>1?"strongText":"emphasisText",start:{...n[o][1].end},end:{...n[s][1].start}},d={type:c>1?"strong":"emphasis",start:{...f.start},end:{...l.end}},n[o][1].end={...f.start},n[s][1].start={...l.end},h=[],n[o][1].end.offset-n[o][1].start.offset&&(h=Nn(h,[["enter",n[o][1],r],["exit",n[o][1],r]])),h=Nn(h,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",v,r]]),h=Nn(h,mo(r.parser.constructs.insideSpan.null,n.slice(o+1,s),r)),h=Nn(h,[["exit",v,r],["enter",l,r],["exit",l,r],["exit",d,r]]),n[s][1].end.offset-n[s][1].start.offset?(p=2,h=Nn(h,[["enter",n[s][1],r],["exit",n[s][1],r]])):p=0,wn(n,o-1,s-o+3,h),s=o+h.length-p-2;break}}for(s=-1;++s<n.length;)n[s][1].type==="attentionSequence"&&(n[s][1].type="data");return n}function iS(n,r){const s=this.parser.constructs.attentionMarkers.null,o=this.previous,d=bs(o);let v;return f;function f(c){return v=c,n.enter("attentionSequence"),l(c)}function l(c){if(c===v)return n.consume(c),l;const h=n.exit("attentionSequence"),p=bs(c),u=!p||p===2&&d||s.includes(c),b=!d||d===2&&p||s.includes(o);return h._open=!!(v===42?u:u&&(d||!b)),h._close=!!(v===42?b:b&&(p||!u)),r(c)}}function Km(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}const rS={name:"autolink",tokenize:sS};function sS(n,r,s){let o=0;return d;function d(C){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),v}function v(C){return Zt(C)?(n.consume(C),f):C===64?s(C):h(C)}function f(C){return C===43||C===45||C===46||$t(C)?(o=1,l(C)):h(C)}function l(C){return C===58?(n.consume(C),o=0,c):(C===43||C===45||C===46||$t(C))&&o++<32?(n.consume(C),l):(o=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||ao(C)?s(C):(n.consume(C),c)}function h(C){return C===64?(n.consume(C),p):Ky(C)?(n.consume(C),h):s(C)}function p(C){return $t(C)?u(C):s(C)}function u(C){return C===46?(n.consume(C),o=0,p):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||$t(C))&&o++<63){const T=C===45?b:u;return n.consume(C),T}return s(C)}}const ja={partial:!0,tokenize:aS};function aS(n,r,s){return o;function o(v){return $e(v)?Xe(n,d,"linePrefix")(v):d(v)}function d(v){return v===null||Oe(v)?r(v):s(v)}}const a_={continuation:{tokenize:oS},exit:cS,name:"blockQuote",tokenize:lS};function lS(n,r,s){const o=this;return d;function d(f){if(f===62){const l=o.containerState;return l.open||(n.enter("blockQuote",{_container:!0}),l.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),v}return s(f)}function v(f){return $e(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(f))}}function oS(n,r,s){const o=this;return d;function d(f){return $e(f)?Xe(n,v,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):v(f)}function v(f){return n.attempt(a_,r,s)(f)}}function cS(n){n.exit("blockQuote")}const l_={name:"characterEscape",tokenize:uS};function uS(n,r,s){return o;function o(v){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(v),n.exit("escapeMarker"),d}function d(v){return Xy(v)?(n.enter("characterEscapeValue"),n.consume(v),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):s(v)}}const o_={name:"characterReference",tokenize:hS};function hS(n,r,s){const o=this;let d=0,v,f;return l;function l(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"),v=31,f=$t,p(u))}function h(u){return u===88||u===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(u),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),v=6,f=Yy,p):(n.enter("characterReferenceValue"),v=7,f=Ju,p(u))}function p(u){if(u===59&&d){const b=n.exit("characterReferenceValue");return f===$t&&!vh(o.sliceSerialize(b))?s(u):(n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),n.exit("characterReference"),r)}return f(u)&&d++<v?(n.consume(u),p):s(u)}}const Ym={partial:!0,tokenize:dS},Xm={concrete:!0,name:"codeFenced",tokenize:fS};function fS(n,r,s){const o=this,d={partial:!0,tokenize:M};let v=0,f=0,l;return c;function c(R){return h(R)}function h(R){const D=o.events[o.events.length-1];return v=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,l=R,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),p(R)}function p(R){return R===l?(f++,n.consume(R),p):f<3?s(R):(n.exit("codeFencedFenceSequence"),$e(R)?Xe(n,u,"whitespace")(R):u(R))}function u(R){return R===null||Oe(R)?(n.exit("codeFencedFence"),o.interrupt?r(R):n.check(Ym,x,A)(R)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||Oe(R)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),u(R)):$e(R)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Xe(n,C,"whitespace")(R)):R===96&&R===l?s(R):(n.consume(R),b)}function C(R){return R===null||Oe(R)?u(R):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),T(R))}function T(R){return R===null||Oe(R)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),u(R)):R===96&&R===l?s(R):(n.consume(R),T)}function x(R){return n.attempt(d,A,_)(R)}function _(R){return n.enter("lineEnding"),n.consume(R),n.exit("lineEnding"),y}function y(R){return v>0&&$e(R)?Xe(n,m,"linePrefix",v+1)(R):m(R)}function m(R){return R===null||Oe(R)?n.check(Ym,x,A)(R):(n.enter("codeFlowValue"),S(R))}function S(R){return R===null||Oe(R)?(n.exit("codeFlowValue"),m(R)):(n.consume(R),S)}function A(R){return n.exit("codeFenced"),r(R)}function M(R,D,E){let L=0;return B;function B(X){return R.enter("lineEnding"),R.consume(X),R.exit("lineEnding"),I}function I(X){return R.enter("codeFencedFence"),$e(X)?Xe(R,F,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):F(X)}function F(X){return X===l?(R.enter("codeFencedFenceSequence"),U(X)):E(X)}function U(X){return X===l?(L++,R.consume(X),U):L>=f?(R.exit("codeFencedFenceSequence"),$e(X)?Xe(R,W,"whitespace")(X):W(X)):E(X)}function W(X){return X===null||Oe(X)?(R.exit("codeFencedFence"),D(X)):E(X)}}}function dS(n,r,s){const o=this;return d;function d(f){return f===null?s(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),v)}function v(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}const Bu={name:"codeIndented",tokenize:mS},pS={partial:!0,tokenize:gS};function mS(n,r,s){const o=this;return d;function d(h){return n.enter("codeIndented"),Xe(n,v,"linePrefix",5)(h)}function v(h){const p=o.events[o.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?f(h):s(h)}function f(h){return h===null?c(h):Oe(h)?n.attempt(pS,f,c)(h):(n.enter("codeFlowValue"),l(h))}function l(h){return h===null||Oe(h)?(n.exit("codeFlowValue"),f(h)):(n.consume(h),l)}function c(h){return n.exit("codeIndented"),r(h)}}function gS(n,r,s){const o=this;return d;function d(f){return o.parser.lazy[o.now().line]?s(f):Oe(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),d):Xe(n,v,"linePrefix",5)(f)}function v(f){const l=o.events[o.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?r(f):Oe(f)?d(f):s(f)}}const _S={name:"codeText",previous:yS,resolve:vS,tokenize:SS};function vS(n){let r=n.length-4,s=3,o,d;if((n[s][1].type==="lineEnding"||n[s][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(o=s;++o<r;)if(n[o][1].type==="codeTextData"){n[s][1].type="codeTextPadding",n[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(o=s-1,r++;++o<=r;)d===void 0?o!==r&&n[o][1].type!=="lineEnding"&&(d=o):(o===r||n[o][1].type==="lineEnding")&&(n[d][1].type="codeTextData",o!==d+2&&(n[d][1].end=n[o-1][1].end,n.splice(d+2,o-d-2),r-=o-d-2,o=d+2),d=void 0);return n}function yS(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function SS(n,r,s){let o=0,d,v;return f;function f(u){return n.enter("codeText"),n.enter("codeTextSequence"),l(u)}function l(u){return u===96?(n.consume(u),o++,l):(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?(v=n.enter("codeTextSequence"),d=0,p(u)):Oe(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||Oe(u)?(n.exit("codeTextData"),c(u)):(n.consume(u),h)}function p(u){return u===96?(n.consume(u),d++,p):d===o?(n.exit("codeTextSequence"),n.exit("codeText"),r(u)):(v.type="codeTextData",h(u))}}class bS{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 o=s??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(r,o):r>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(r,s,o){const d=s||0;this.setCursor(Math.trunc(r));const v=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return o&&Ea(this.left,o),v.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),Ea(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Ea(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);Ea(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Ea(this.left,s.reverse())}}}function Ea(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 c_(n){const r={};let s=-1,o,d,v,f,l,c,h;const p=new bS(n);for(;++s<p.length;){for(;s in r;)s=r[s];if(o=p.get(s),s&&o[1].type==="chunkFlow"&&p.get(s-1)[1].type==="listItemPrefix"&&(c=o[1]._tokenizer.events,v=0,v<c.length&&c[v][1].type==="lineEndingBlank"&&(v+=2),v<c.length&&c[v][1].type==="content"))for(;++v<c.length&&c[v][1].type!=="content";)c[v][1].type==="chunkText"&&(c[v][1]._isInFirstContentOfListItem=!0,v++);if(o[0]==="enter")o[1].contentType&&(Object.assign(r,CS(p,s)),s=r[s],h=!0);else if(o[1]._container){for(v=s,d=void 0;v--;)if(f=p.get(v),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(d&&(p.get(d)[1].type="lineEndingBlank"),f[1].type="lineEnding",d=v);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;d&&(o[1].end={...p.get(d)[1].start},l=p.slice(d,s),l.unshift(o),p.splice(d,s-d+1,l))}}return wn(n,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function CS(n,r){const s=n.get(r)[1],o=n.get(r)[2];let d=r-1;const v=[];let f=s._tokenizer;f||(f=o.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const l=f.events,c=[],h={};let p,u,b=-1,C=s,T=0,x=0;const _=[x];for(;C;){for(;n.get(++d)[1]!==C;);v.push(d),C._tokenizer||(p=o.sliceStream(C),C.next||p.push(null),u&&f.defineSkip(C.start),C._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(p),C._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),u=C,C=C.next}for(C=s;++b<l.length;)l[b][0]==="exit"&&l[b-1][0]==="enter"&&l[b][1].type===l[b-1][1].type&&l[b][1].start.line!==l[b][1].end.line&&(x=b+1,_.push(x),C._tokenizer=void 0,C.previous=void 0,C=C.next);for(f.events=[],C?(C._tokenizer=void 0,C.previous=void 0):_.pop(),b=_.length;b--;){const y=l.slice(_[b],_[b+1]),m=v.pop();c.push([m,m+y.length-1]),n.splice(m,2,y)}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 wS={resolve:ES,tokenize:kS},xS={partial:!0,tokenize:AS};function ES(n){return c_(n),n}function kS(n,r){let s;return o;function o(l){return n.enter("content"),s=n.enter("chunkContent",{contentType:"content"}),d(l)}function d(l){return l===null?v(l):Oe(l)?n.check(xS,f,v)(l):(n.consume(l),d)}function v(l){return n.exit("chunkContent"),n.exit("content"),r(l)}function f(l){return n.consume(l),n.exit("chunkContent"),s.next=n.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,d}}function AS(n,r,s){const o=this;return d;function d(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),Xe(n,v,"linePrefix")}function v(f){if(f===null||Oe(f))return s(f);const l=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?r(f):n.interrupt(o.parser.constructs.flow,s,r)(f)}}function u_(n,r,s,o,d,v,f,l,c){const h=c||Number.POSITIVE_INFINITY;let p=0;return u;function u(y){return y===60?(n.enter(o),n.enter(d),n.enter(v),n.consume(y),n.exit(v),b):y===null||y===32||y===41||ao(y)?s(y):(n.enter(o),n.enter(f),n.enter(l),n.enter("chunkString",{contentType:"string"}),x(y))}function b(y){return y===62?(n.enter(v),n.consume(y),n.exit(v),n.exit(d),n.exit(o),r):(n.enter(l),n.enter("chunkString",{contentType:"string"}),C(y))}function C(y){return y===62?(n.exit("chunkString"),n.exit(l),b(y)):y===null||y===60||Oe(y)?s(y):(n.consume(y),y===92?T:C)}function T(y){return y===60||y===62||y===92?(n.consume(y),C):C(y)}function x(y){return!p&&(y===null||y===41||ot(y))?(n.exit("chunkString"),n.exit(l),n.exit(f),n.exit(o),r(y)):p<h&&y===40?(n.consume(y),p++,x):y===41?(n.consume(y),p--,x):y===null||y===32||y===40||ao(y)?s(y):(n.consume(y),y===92?_:x)}function _(y){return y===40||y===41||y===92?(n.consume(y),x):x(y)}}function h_(n,r,s,o,d,v){const f=this;let l=0,c;return h;function h(C){return n.enter(o),n.enter(d),n.consume(C),n.exit(d),n.enter(v),p}function p(C){return l>999||C===null||C===91||C===93&&!c||C===94&&!l&&"_hiddenFootnoteSupport"in f.parser.constructs?s(C):C===93?(n.exit(v),n.enter(d),n.consume(C),n.exit(d),n.exit(o),r):Oe(C)?(n.enter("lineEnding"),n.consume(C),n.exit("lineEnding"),p):(n.enter("chunkString",{contentType:"string"}),u(C))}function u(C){return C===null||C===91||C===93||Oe(C)||l++>999?(n.exit("chunkString"),p(C)):(n.consume(C),c||(c=!$e(C)),C===92?b:u)}function b(C){return C===91||C===92||C===93?(n.consume(C),l++,u):u(C)}}function f_(n,r,s,o,d,v){let f;return l;function l(b){return b===34||b===39||b===40?(n.enter(o),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(o),r):(n.enter(v),h(b))}function h(b){return b===f?(n.exit(v),c(f)):b===null?s(b):Oe(b)?(n.enter("lineEnding"),n.consume(b),n.exit("lineEnding"),Xe(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===f||b===null||Oe(b)?(n.exit("chunkString"),h(b)):(n.consume(b),b===92?u:p)}function u(b){return b===f||b===92?(n.consume(b),p):p(b)}}function Ra(n,r){let s;return o;function o(d){return Oe(d)?(n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),s=!0,o):$e(d)?Xe(n,o,s?"linePrefix":"lineSuffix")(d):r(d)}}const TS={name:"definition",tokenize:DS},RS={partial:!0,tokenize:MS};function DS(n,r,s){const o=this;let d;return v;function v(C){return n.enter("definition"),f(C)}function f(C){return h_.call(o,n,l,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(C)}function l(C){return d=$n(o.sliceSerialize(o.events[o.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 ot(C)?Ra(n,h)(C):h(C)}function h(C){return u_(n,p,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(C)}function p(C){return n.attempt(RS,u,u)(C)}function u(C){return $e(C)?Xe(n,b,"whitespace")(C):b(C)}function b(C){return C===null||Oe(C)?(n.exit("definition"),o.parser.defined.push(d),r(C)):s(C)}}function MS(n,r,s){return o;function o(l){return ot(l)?Ra(n,d)(l):s(l)}function d(l){return f_(n,v,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function v(l){return $e(l)?Xe(n,f,"whitespace")(l):f(l)}function f(l){return l===null||Oe(l)?r(l):s(l)}}const LS={name:"hardBreakEscape",tokenize:OS};function OS(n,r,s){return o;function o(v){return n.enter("hardBreakEscape"),n.consume(v),d}function d(v){return Oe(v)?(n.exit("hardBreakEscape"),r(v)):s(v)}}const BS={name:"headingAtx",resolve:jS,tokenize:NS};function jS(n,r){let s=n.length-2,o=3,d,v;return n[o][1].type==="whitespace"&&(o+=2),s-2>o&&n[s][1].type==="whitespace"&&(s-=2),n[s][1].type==="atxHeadingSequence"&&(o===s-1||s-4>o&&n[s-2][1].type==="whitespace")&&(s-=o+1===s?2:4),s>o&&(d={type:"atxHeadingText",start:n[o][1].start,end:n[s][1].end},v={type:"chunkText",start:n[o][1].start,end:n[s][1].end,contentType:"text"},wn(n,o,s-o+1,[["enter",d,r],["enter",v,r],["exit",v,r],["exit",d,r]])),n}function NS(n,r,s){let o=0;return d;function d(p){return n.enter("atxHeading"),v(p)}function v(p){return n.enter("atxHeadingSequence"),f(p)}function f(p){return p===35&&o++<6?(n.consume(p),f):p===null||ot(p)?(n.exit("atxHeadingSequence"),l(p)):s(p)}function l(p){return p===35?(n.enter("atxHeadingSequence"),c(p)):p===null||Oe(p)?(n.exit("atxHeading"),r(p)):$e(p)?Xe(n,l,"whitespace")(p):(n.enter("atxHeadingText"),h(p))}function c(p){return p===35?(n.consume(p),c):(n.exit("atxHeadingSequence"),l(p))}function h(p){return p===null||p===35||ot(p)?(n.exit("atxHeadingText"),l(p)):(n.consume(p),h)}}const HS=["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"],Qm=["pre","script","style","textarea"],zS={concrete:!0,name:"htmlFlow",resolveTo:US,tokenize:FS},IS={partial:!0,tokenize:GS},PS={partial:!0,tokenize:qS};function US(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 FS(n,r,s){const o=this;let d,v,f,l,c;return h;function h(N){return p(N)}function p(N){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(N),u}function u(N){return N===33?(n.consume(N),b):N===47?(n.consume(N),v=!0,x):N===63?(n.consume(N),d=3,o.interrupt?r:j):Zt(N)?(n.consume(N),f=String.fromCharCode(N),_):s(N)}function b(N){return N===45?(n.consume(N),d=2,C):N===91?(n.consume(N),d=5,l=0,T):Zt(N)?(n.consume(N),d=4,o.interrupt?r:j):s(N)}function C(N){return N===45?(n.consume(N),o.interrupt?r:j):s(N)}function T(N){const ie="CDATA[";return N===ie.charCodeAt(l++)?(n.consume(N),l===ie.length?o.interrupt?r:F:T):s(N)}function x(N){return Zt(N)?(n.consume(N),f=String.fromCharCode(N),_):s(N)}function _(N){if(N===null||N===47||N===62||ot(N)){const ie=N===47,he=f.toLowerCase();return!ie&&!v&&Qm.includes(he)?(d=1,o.interrupt?r(N):F(N)):HS.includes(f.toLowerCase())?(d=6,ie?(n.consume(N),y):o.interrupt?r(N):F(N)):(d=7,o.interrupt&&!o.parser.lazy[o.now().line]?s(N):v?m(N):S(N))}return N===45||$t(N)?(n.consume(N),f+=String.fromCharCode(N),_):s(N)}function y(N){return N===62?(n.consume(N),o.interrupt?r:F):s(N)}function m(N){return $e(N)?(n.consume(N),m):B(N)}function S(N){return N===47?(n.consume(N),B):N===58||N===95||Zt(N)?(n.consume(N),A):$e(N)?(n.consume(N),S):B(N)}function A(N){return N===45||N===46||N===58||N===95||$t(N)?(n.consume(N),A):M(N)}function M(N){return N===61?(n.consume(N),R):$e(N)?(n.consume(N),M):S(N)}function R(N){return N===null||N===60||N===61||N===62||N===96?s(N):N===34||N===39?(n.consume(N),c=N,D):$e(N)?(n.consume(N),R):E(N)}function D(N){return N===c?(n.consume(N),c=null,L):N===null||Oe(N)?s(N):(n.consume(N),D)}function E(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||ot(N)?M(N):(n.consume(N),E)}function L(N){return N===47||N===62||$e(N)?S(N):s(N)}function B(N){return N===62?(n.consume(N),I):s(N)}function I(N){return N===null||Oe(N)?F(N):$e(N)?(n.consume(N),I):s(N)}function F(N){return N===45&&d===2?(n.consume(N),V):N===60&&d===1?(n.consume(N),Y):N===62&&d===4?(n.consume(N),H):N===63&&d===3?(n.consume(N),j):N===93&&d===5?(n.consume(N),z):Oe(N)&&(d===6||d===7)?(n.exit("htmlFlowData"),n.check(IS,G,U)(N)):N===null||Oe(N)?(n.exit("htmlFlowData"),U(N)):(n.consume(N),F)}function U(N){return n.check(PS,W,G)(N)}function W(N){return n.enter("lineEnding"),n.consume(N),n.exit("lineEnding"),X}function X(N){return N===null||Oe(N)?U(N):(n.enter("htmlFlowData"),F(N))}function V(N){return N===45?(n.consume(N),j):F(N)}function Y(N){return N===47?(n.consume(N),f="",J):F(N)}function J(N){if(N===62){const ie=f.toLowerCase();return Qm.includes(ie)?(n.consume(N),H):F(N)}return Zt(N)&&f.length<8?(n.consume(N),f+=String.fromCharCode(N),J):F(N)}function z(N){return N===93?(n.consume(N),j):F(N)}function j(N){return N===62?(n.consume(N),H):N===45&&d===2?(n.consume(N),j):F(N)}function H(N){return N===null||Oe(N)?(n.exit("htmlFlowData"),G(N)):(n.consume(N),H)}function G(N){return n.exit("htmlFlow"),r(N)}}function qS(n,r,s){const o=this;return d;function d(f){return Oe(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),v):s(f)}function v(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}function GS(n,r,s){return o;function o(d){return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),n.attempt(ja,r,s)}}const VS={name:"htmlText",tokenize:$S};function $S(n,r,s){const o=this;let d,v,f;return l;function l(j){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(j),c}function c(j){return j===33?(n.consume(j),h):j===47?(n.consume(j),M):j===63?(n.consume(j),S):Zt(j)?(n.consume(j),E):s(j)}function h(j){return j===45?(n.consume(j),p):j===91?(n.consume(j),v=0,T):Zt(j)?(n.consume(j),m):s(j)}function p(j){return j===45?(n.consume(j),C):s(j)}function u(j){return j===null?s(j):j===45?(n.consume(j),b):Oe(j)?(f=u,Y(j)):(n.consume(j),u)}function b(j){return j===45?(n.consume(j),C):u(j)}function C(j){return j===62?V(j):j===45?b(j):u(j)}function T(j){const H="CDATA[";return j===H.charCodeAt(v++)?(n.consume(j),v===H.length?x:T):s(j)}function x(j){return j===null?s(j):j===93?(n.consume(j),_):Oe(j)?(f=x,Y(j)):(n.consume(j),x)}function _(j){return j===93?(n.consume(j),y):x(j)}function y(j){return j===62?V(j):j===93?(n.consume(j),y):x(j)}function m(j){return j===null||j===62?V(j):Oe(j)?(f=m,Y(j)):(n.consume(j),m)}function S(j){return j===null?s(j):j===63?(n.consume(j),A):Oe(j)?(f=S,Y(j)):(n.consume(j),S)}function A(j){return j===62?V(j):S(j)}function M(j){return Zt(j)?(n.consume(j),R):s(j)}function R(j){return j===45||$t(j)?(n.consume(j),R):D(j)}function D(j){return Oe(j)?(f=D,Y(j)):$e(j)?(n.consume(j),D):V(j)}function E(j){return j===45||$t(j)?(n.consume(j),E):j===47||j===62||ot(j)?L(j):s(j)}function L(j){return j===47?(n.consume(j),V):j===58||j===95||Zt(j)?(n.consume(j),B):Oe(j)?(f=L,Y(j)):$e(j)?(n.consume(j),L):V(j)}function B(j){return j===45||j===46||j===58||j===95||$t(j)?(n.consume(j),B):I(j)}function I(j){return j===61?(n.consume(j),F):Oe(j)?(f=I,Y(j)):$e(j)?(n.consume(j),I):L(j)}function F(j){return j===null||j===60||j===61||j===62||j===96?s(j):j===34||j===39?(n.consume(j),d=j,U):Oe(j)?(f=F,Y(j)):$e(j)?(n.consume(j),F):(n.consume(j),W)}function U(j){return j===d?(n.consume(j),d=void 0,X):j===null?s(j):Oe(j)?(f=U,Y(j)):(n.consume(j),U)}function W(j){return j===null||j===34||j===39||j===60||j===61||j===96?s(j):j===47||j===62||ot(j)?L(j):(n.consume(j),W)}function X(j){return j===47||j===62||ot(j)?L(j):s(j)}function V(j){return j===62?(n.consume(j),n.exit("htmlTextData"),n.exit("htmlText"),r):s(j)}function Y(j){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(j),n.exit("lineEnding"),J}function J(j){return $e(j)?Xe(n,z,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):z(j)}function z(j){return n.enter("htmlTextData"),f(j)}}const yh={name:"labelEnd",resolveAll:XS,resolveTo:QS,tokenize:ZS},WS={tokenize:JS},KS={tokenize:eb},YS={tokenize:tb};function XS(n){let r=-1;const s=[];for(;++r<n.length;){const o=n[r][1];if(s.push(n[r]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const d=o.type==="labelImage"?4:2;o.type="data",r+=d}}return n.length!==s.length&&wn(n,0,n.length,s),n}function QS(n,r){let s=n.length,o=0,d,v,f,l;for(;s--;)if(d=n[s][1],v){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&&(v=s,d.type!=="labelLink")){o=2;break}}else d.type==="labelEnd"&&(f=s);const c={type:n[v][1].type==="labelLink"?"link":"image",start:{...n[v][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[v][1].start},end:{...n[f][1].end}},p={type:"labelText",start:{...n[v+o+2][1].end},end:{...n[f-2][1].start}};return l=[["enter",c,r],["enter",h,r]],l=Nn(l,n.slice(v+1,v+o+3)),l=Nn(l,[["enter",p,r]]),l=Nn(l,mo(r.parser.constructs.insideSpan.null,n.slice(v+o+4,f-3),r)),l=Nn(l,[["exit",p,r],n[f-2],n[f-1],["exit",h,r]]),l=Nn(l,n.slice(f+1)),l=Nn(l,[["exit",c,r]]),wn(n,v,n.length,l),n}function ZS(n,r,s){const o=this;let d=o.events.length,v,f;for(;d--;)if((o.events[d][1].type==="labelImage"||o.events[d][1].type==="labelLink")&&!o.events[d][1]._balanced){v=o.events[d][1];break}return l;function l(b){return v?v._inactive?u(b):(f=o.parser.defined.includes($n(o.sliceSerialize({start:v.end,end:o.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(WS,p,f?p:u)(b):b===91?n.attempt(KS,p,f?h:u)(b):f?p(b):u(b)}function h(b){return n.attempt(YS,p,u)(b)}function p(b){return r(b)}function u(b){return v._balanced=!0,s(b)}}function JS(n,r,s){return o;function o(u){return n.enter("resource"),n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),d}function d(u){return ot(u)?Ra(n,v)(u):v(u)}function v(u){return u===41?p(u):u_(n,f,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function f(u){return ot(u)?Ra(n,c)(u):p(u)}function l(u){return s(u)}function c(u){return u===34||u===39||u===40?f_(n,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):p(u)}function h(u){return ot(u)?Ra(n,p)(u):p(u)}function p(u){return u===41?(n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),n.exit("resource"),r):s(u)}}function eb(n,r,s){const o=this;return d;function d(l){return h_.call(o,n,v,f,"reference","referenceMarker","referenceString")(l)}function v(l){return o.parser.defined.includes($n(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?r(l):s(l)}function f(l){return s(l)}}function tb(n,r,s){return o;function o(v){return n.enter("reference"),n.enter("referenceMarker"),n.consume(v),n.exit("referenceMarker"),d}function d(v){return v===93?(n.enter("referenceMarker"),n.consume(v),n.exit("referenceMarker"),n.exit("reference"),r):s(v)}}const nb={name:"labelStartImage",resolveAll:yh.resolveAll,tokenize:ib};function ib(n,r,s){const o=this;return d;function d(l){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(l),n.exit("labelImageMarker"),v}function v(l){return l===91?(n.enter("labelMarker"),n.consume(l),n.exit("labelMarker"),n.exit("labelImage"),f):s(l)}function f(l){return l===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(l):r(l)}}const rb={name:"labelStartLink",resolveAll:yh.resolveAll,tokenize:sb};function sb(n,r,s){const o=this;return d;function d(f){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelLink"),v}function v(f){return f===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(f):r(f)}}const ju={name:"lineEnding",tokenize:ab};function ab(n,r){return s;function s(o){return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),Xe(n,r,"linePrefix")}}const so={name:"thematicBreak",tokenize:lb};function lb(n,r,s){let o=0,d;return v;function v(h){return n.enter("thematicBreak"),f(h)}function f(h){return d=h,l(h)}function l(h){return h===d?(n.enter("thematicBreakSequence"),c(h)):o>=3&&(h===null||Oe(h))?(n.exit("thematicBreak"),r(h)):s(h)}function c(h){return h===d?(n.consume(h),o++,c):(n.exit("thematicBreakSequence"),$e(h)?Xe(n,l,"whitespace")(h):l(h))}}const hn={continuation:{tokenize:hb},exit:db,name:"list",tokenize:ub},ob={partial:!0,tokenize:pb},cb={partial:!0,tokenize:fb};function ub(n,r,s){const o=this,d=o.events[o.events.length-1];let v=d&&d[1].type==="linePrefix"?d[2].sliceSerialize(d[1],!0).length:0,f=0;return l;function l(C){const T=o.containerState.type||(C===42||C===43||C===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!o.containerState.marker||C===o.containerState.marker:Ju(C)){if(o.containerState.type||(o.containerState.type=T,n.enter(T,{_container:!0})),T==="listUnordered")return n.enter("listItemPrefix"),C===42||C===45?n.check(so,s,h)(C):h(C);if(!o.interrupt||C===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),c(C)}return s(C)}function c(C){return Ju(C)&&++f<10?(n.consume(C),c):(!o.interrupt||f<2)&&(o.containerState.marker?C===o.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"),o.containerState.marker=o.containerState.marker||C,n.check(ja,o.interrupt?s:p,n.attempt(ob,b,u))}function p(C){return o.containerState.initialBlankLine=!0,v++,b(C)}function u(C){return $e(C)?(n.enter("listItemPrefixWhitespace"),n.consume(C),n.exit("listItemPrefixWhitespace"),b):s(C)}function b(C){return o.containerState.size=v+o.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(C)}}function hb(n,r,s){const o=this;return o.containerState._closeFlow=void 0,n.check(ja,d,v);function d(l){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Xe(n,r,"listItemIndent",o.containerState.size+1)(l)}function v(l){return o.containerState.furtherBlankLines||!$e(l)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,f(l)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,n.attempt(cb,r,f)(l))}function f(l){return o.containerState._closeFlow=!0,o.interrupt=void 0,Xe(n,n.attempt(hn,r,s),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function fb(n,r,s){const o=this;return Xe(n,d,"listItemIndent",o.containerState.size+1);function d(v){const f=o.events[o.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===o.containerState.size?r(v):s(v)}}function db(n){n.exit(this.containerState.type)}function pb(n,r,s){const o=this;return Xe(n,d,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(v){const f=o.events[o.events.length-1];return!$e(v)&&f&&f[1].type==="listItemPrefixWhitespace"?r(v):s(v)}}const Zm={name:"setextUnderline",resolveTo:mb,tokenize:gb};function mb(n,r){let s=n.length,o,d,v;for(;s--;)if(n[s][0]==="enter"){if(n[s][1].type==="content"){o=s;break}n[s][1].type==="paragraph"&&(d=s)}else n[s][1].type==="content"&&n.splice(s,1),!v&&n[s][1].type==="definition"&&(v=s);const f={type:"setextHeading",start:{...n[o][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",v?(n.splice(d,0,["enter",f,r]),n.splice(v+1,0,["exit",n[o][1],r]),n[o][1].end={...n[v][1].end}):n[o][1]=f,n.push(["exit",f,r]),n}function gb(n,r,s){const o=this;let d;return v;function v(h){let p=o.events.length,u;for(;p--;)if(o.events[p][1].type!=="lineEnding"&&o.events[p][1].type!=="linePrefix"&&o.events[p][1].type!=="content"){u=o.events[p][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||u)?(n.enter("setextHeadingLine"),d=h,f(h)):s(h)}function f(h){return n.enter("setextHeadingLineSequence"),l(h)}function l(h){return h===d?(n.consume(h),l):(n.exit("setextHeadingLineSequence"),$e(h)?Xe(n,c,"lineSuffix")(h):c(h))}function c(h){return h===null||Oe(h)?(n.exit("setextHeadingLine"),r(h)):s(h)}}const _b={tokenize:vb};function vb(n){const r=this,s=n.attempt(ja,o,n.attempt(this.parser.constructs.flowInitial,d,Xe(n,n.attempt(this.parser.constructs.flow,d,n.attempt(wS,d)),"linePrefix")));return s;function o(v){if(v===null){n.consume(v);return}return n.enter("lineEndingBlank"),n.consume(v),n.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function d(v){if(v===null){n.consume(v);return}return n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),r.currentConstruct=void 0,s}}const yb={resolveAll:p_()},Sb=d_("string"),bb=d_("text");function d_(n){return{resolveAll:p_(n==="text"?Cb:void 0),tokenize:r};function r(s){const o=this,d=this.parser.constructs[n],v=s.attempt(d,f,l);return f;function f(p){return h(p)?v(p):l(p)}function l(p){if(p===null){s.consume(p);return}return s.enter("data"),s.consume(p),c}function c(p){return h(p)?(s.exit("data"),v(p)):(s.consume(p),c)}function h(p){if(p===null)return!0;const u=d[p];let b=-1;if(u)for(;++b<u.length;){const C=u[b];if(!C.previous||C.previous.call(o,o.previous))return!0}return!1}}}function p_(n){return r;function r(s,o){let d=-1,v;for(;++d<=s.length;)v===void 0?s[d]&&s[d][1].type==="data"&&(v=d,d++):(!s[d]||s[d][1].type!=="data")&&(d!==v+2&&(s[v][1].end=s[d-1][1].end,s.splice(v+2,d-v-2),d=v+2),v=void 0);return n?n(s,o):s}}function Cb(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 o=n[s-1][1],d=r.sliceStream(o);let v=d.length,f=-1,l=0,c;for(;v--;){const h=d[v];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)l++,f--;if(f)break;f=-1}else if(h===-2)c=!0,l++;else if(h!==-1){v++;break}}if(r._contentTypeTextTrailing&&s===n.length&&(l=0),l){const h={type:s===n.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:v?f:o.start._bufferIndex+f,_index:o.start._index+v,line:o.end.line,column:o.end.column-l,offset:o.end.offset-l},end:{...o.end}};o.end={...h.start},o.start.offset===o.end.offset?Object.assign(o,h):(n.splice(s,0,["enter",h,r],["exit",h,r]),s+=2)}s++}return n}const wb={42:hn,43:hn,45:hn,48:hn,49:hn,50:hn,51:hn,52:hn,53:hn,54:hn,55:hn,56:hn,57:hn,62:a_},xb={91:TS},Eb={[-2]:Bu,[-1]:Bu,32:Bu},kb={35:BS,42:so,45:[Zm,so],60:zS,61:Zm,95:so,96:Xm,126:Xm},Ab={38:o_,92:l_},Tb={[-5]:ju,[-4]:ju,[-3]:ju,33:nb,38:o_,42:eh,60:[rS,VS],91:rb,92:[LS,l_],93:yh,95:eh,96:_S},Rb={null:[eh,yb]},Db={null:[42,95]},Mb={null:[]},Lb=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Db,contentInitial:xb,disable:Mb,document:wb,flow:kb,flowInitial:Eb,insideSpan:Rb,string:Ab,text:Tb},Symbol.toStringTag,{value:"Module"}));function Ob(n,r,s){let o={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const d={},v=[];let f=[],l=[];const c={attempt:D(M),check:D(R),consume:m,enter:S,exit:A,interrupt:D(R,{interrupt:!0})},h={code:null,containerState:{},defineSkip:x,events:[],now:T,parser:n,previous:null,sliceSerialize:b,sliceStream:C,write:u};let p=r.tokenize.call(h,c);return r.resolveAll&&v.push(r),h;function u(I){return f=Nn(f,I),_(),f[f.length-1]!==null?[]:(E(r,0),h.events=mo(v,h.events,h),h.events)}function b(I,F){return jb(C(I),F)}function C(I){return Bb(f,I)}function T(){const{_bufferIndex:I,_index:F,line:U,column:W,offset:X}=o;return{_bufferIndex:I,_index:F,line:U,column:W,offset:X}}function x(I){d[I.line]=I.column,B()}function _(){let I;for(;o._index<f.length;){const F=f[o._index];if(typeof F=="string")for(I=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===I&&o._bufferIndex<F.length;)y(F.charCodeAt(o._bufferIndex));else y(F)}}function y(I){p=p(I)}function m(I){Oe(I)?(o.line++,o.column=1,o.offset+=I===-3?2:1,B()):I!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===f[o._index].length&&(o._bufferIndex=-1,o._index++)),h.previous=I}function S(I,F){const U=F||{};return U.type=I,U.start=T(),h.events.push(["enter",U,h]),l.push(U),U}function A(I){const F=l.pop();return F.end=T(),h.events.push(["exit",F,h]),F}function M(I,F){E(I,F.from)}function R(I,F){F.restore()}function D(I,F){return U;function U(W,X,V){let Y,J,z,j;return Array.isArray(W)?G(W):"tokenize"in W?G([W]):H(W);function H(ge){return K;function K(q){const te=q!==null&&ge[q],le=q!==null&&ge.null,xe=[...Array.isArray(te)?te:te?[te]:[],...Array.isArray(le)?le:le?[le]:[]];return G(xe)(q)}}function G(ge){return Y=ge,J=0,ge.length===0?V:N(ge[J])}function N(ge){return K;function K(q){return j=L(),z=ge,ge.partial||(h.currentConstruct=ge),ge.name&&h.parser.constructs.disable.null.includes(ge.name)?he():ge.tokenize.call(F?Object.assign(Object.create(h),F):h,c,ie,he)(q)}}function ie(ge){return I(z,j),X}function he(ge){return j.restore(),++J<Y.length?N(Y[J]):V}}}function E(I,F){I.resolveAll&&!v.includes(I)&&v.push(I),I.resolve&&wn(h.events,F,h.events.length-F,I.resolve(h.events.slice(F),h)),I.resolveTo&&(h.events=I.resolveTo(h.events,h))}function L(){const I=T(),F=h.previous,U=h.currentConstruct,W=h.events.length,X=Array.from(l);return{from:W,restore:V};function V(){o=I,h.previous=F,h.currentConstruct=U,h.events.length=W,l=X,B()}}function B(){o.line in d&&o.column<2&&(o.column=d[o.line],o.offset+=d[o.line]-1)}}function Bb(n,r){const s=r.start._index,o=r.start._bufferIndex,d=r.end._index,v=r.end._bufferIndex;let f;if(s===d)f=[n[s].slice(o,v)];else{if(f=n.slice(s,d),o>-1){const l=f[0];typeof l=="string"?f[0]=l.slice(o):f.shift()}v>0&&f.push(n[d].slice(0,v))}return f}function jb(n,r){let s=-1;const o=[];let d;for(;++s<n.length;){const v=n[s];let f;if(typeof v=="string")f=v;else switch(v){case-5:{f="\r";break}case-4:{f=`
63
+ `;break}case-3:{f=`\r
64
+ `;break}case-2:{f=r?" ":" ";break}case-1:{if(!r&&d)continue;f=" ";break}default:f=String.fromCharCode(v)}d=v===-2,o.push(f)}return o.join("")}function Nb(n){const o={constructs:r_([Lb,...(n||{}).extensions||[]]),content:d(Qy),defined:[],document:d(Jy),flow:d(_b),lazy:{},string:d(Sb),text:d(bb)};return o;function d(v){return f;function f(l){return Ob(o,v,l)}}}function Hb(n){for(;!c_(n););return n}const Jm=/[\0\t\n\r]/g;function zb(){let n=1,r="",s=!0,o;return d;function d(v,f,l){const c=[];let h,p,u,b,C;for(v=r+(typeof v=="string"?v.toString():new TextDecoder(f||void 0).decode(v)),u=0,r="",s&&(v.charCodeAt(0)===65279&&u++,s=void 0);u<v.length;){if(Jm.lastIndex=u,h=Jm.exec(v),b=h&&h.index!==void 0?h.index:v.length,C=v.charCodeAt(b),!h){r=v.slice(u);break}if(C===10&&u===b&&o)c.push(-3),o=void 0;else switch(o&&(c.push(-5),o=void 0),u<b&&(c.push(v.slice(u,b)),n+=b-u),C){case 0:{c.push(65533),n++;break}case 9:{for(p=Math.ceil(n/4)*4,c.push(-2);n++<p;)c.push(-1);break}case 10:{c.push(-4),n=1;break}default:o=!0,n=1}u=b+1}return l&&(o&&c.push(-5),r&&c.push(r),c.push(null)),c}}const Ib=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Pb(n){return n.replace(Ib,Ub)}function Ub(n,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),v=d===120||d===88;return s_(s.slice(v?2:1),v?16:10)}return vh(s)||n}const m_={}.hasOwnProperty;function Fb(n,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),qb(s)(Hb(Nb(s).document().write(zb()(n,r,!0))))}function qb(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:v(Nt),autolinkProtocol:L,autolinkEmail:L,atxHeading:v(Te),blockQuote:v(le),characterEscape:L,characterReference:L,codeFenced:v(xe),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:v(xe,f),codeText:v(Ee,f),codeTextData:L,data:L,codeFlowValue:L,definition:v(Ce),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:v(me),hardBreakEscape:v(He),hardBreakTrailing:v(He),htmlFlow:v(ke,f),htmlFlowData:L,htmlText:v(ke,f),htmlTextData:L,image:v(Jt),label:f,link:v(Nt),listItem:v(en),listItemValue:b,listOrdered:v(Kt,u),listUnordered:v(Kt),paragraph:v(xn),reference:N,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:v(Te),strong:v(bt),thematicBreak:v(Bt)},exit:{atxHeading:c(),atxHeadingSequence:M,autolink:c(),autolinkEmail:te,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:ge,characterReference:K,codeFenced:c(_),codeFencedFence:x,codeFencedFenceInfo:C,codeFencedFenceMeta:T,codeFlowValue:B,codeIndented:c(y),codeText:c(X),codeTextData:B,data:B,definition:c(),definitionDestinationString:A,definitionLabelString:m,definitionTitleString:S,emphasis:c(),hardBreakEscape:c(F),hardBreakTrailing:c(F),htmlFlow:c(U),htmlFlowData:B,htmlText:c(W),htmlTextData:B,image:c(Y),label:z,labelText:J,lineEnding:I,link:c(V),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:j,resourceTitleString:H,resource:G,setextHeading:c(E),setextHeadingLineSequence:D,setextHeadingText:R,strong:c(),thematicBreak:c()}};g_(r,(n||{}).mdastExtensions||[]);const s={};return o;function o(fe){let Se={type:"root",children:[]};const pe={stack:[Se],tokenStack:[],config:r,enter:l,exit:h,buffer:f,resume:p,data:s},Me=[];let Ne=-1;for(;++Ne<fe.length;)if(fe[Ne][1].type==="listOrdered"||fe[Ne][1].type==="listUnordered")if(fe[Ne][0]==="enter")Me.push(Ne);else{const pt=Me.pop();Ne=d(fe,pt,Ne)}for(Ne=-1;++Ne<fe.length;){const pt=r[fe[Ne][0]];m_.call(pt,fe[Ne][1].type)&&pt[fe[Ne][1].type].call(Object.assign({sliceSerialize:fe[Ne][2].sliceSerialize},pe),fe[Ne][1])}if(pe.tokenStack.length>0){const pt=pe.tokenStack[pe.tokenStack.length-1];(pt[1]||eg).call(pe,void 0,pt[0])}for(Se.position={start:tr(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:tr(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<r.transforms.length;)Se=r.transforms[Ne](Se)||Se;return Se}function d(fe,Se,pe){let Me=Se-1,Ne=-1,pt=!1,Ue,Je,at,xt;for(;++Me<=pe;){const we=fe[Me];switch(we[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{we[0]==="enter"?Ne++:Ne--,xt=void 0;break}case"lineEndingBlank":{we[0]==="enter"&&(Ue&&!xt&&!Ne&&!at&&(at=Me),xt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:xt=void 0}if(!Ne&&we[0]==="enter"&&we[1].type==="listItemPrefix"||Ne===-1&&we[0]==="exit"&&(we[1].type==="listUnordered"||we[1].type==="listOrdered")){if(Ue){let Et=Me;for(Je=void 0;Et--;){const kt=fe[Et];if(kt[1].type==="lineEnding"||kt[1].type==="lineEndingBlank"){if(kt[0]==="exit")continue;Je&&(fe[Je][1].type="lineEndingBlank",pt=!0),kt[1].type="lineEnding",Je=Et}else if(!(kt[1].type==="linePrefix"||kt[1].type==="blockQuotePrefix"||kt[1].type==="blockQuotePrefixWhitespace"||kt[1].type==="blockQuoteMarker"||kt[1].type==="listItemIndent"))break}at&&(!Je||at<Je)&&(Ue._spread=!0),Ue.end=Object.assign({},Je?fe[Je][1].start:we[1].end),fe.splice(Je||Me,0,["exit",Ue,we[2]]),Me++,pe++}if(we[1].type==="listItemPrefix"){const Et={type:"listItem",_spread:!1,start:Object.assign({},we[1].start),end:void 0};Ue=Et,fe.splice(Me,0,["enter",Et,we[2]]),Me++,pe++,at=void 0,xt=!0}}}return fe[Se][1]._spread=pt,pe}function v(fe,Se){return pe;function pe(Me){l.call(this,fe(Me),Me),Se&&Se.call(this,Me)}}function f(){this.stack.push({type:"fragment",children:[]})}function l(fe,Se,pe){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([Se,pe||void 0]),fe.position={start:tr(Se.start),end:void 0}}function c(fe){return Se;function Se(pe){fe&&fe.call(this,pe),h.call(this,pe)}}function h(fe,Se){const pe=this.stack.pop(),Me=this.tokenStack.pop();if(Me)Me[0].type!==fe.type&&(Se?Se.call(this,fe,Me[0]):(Me[1]||eg).call(this,fe,Me[0]));else throw new Error("Cannot close `"+fe.type+"` ("+Ta({start:fe.start,end:fe.end})+"): it’s not open");pe.position.end=tr(fe.end)}function p(){return _h(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function b(fe){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function C(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=fe}function T(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=fe}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe.replace(/(\r?\n|\r)$/g,"")}function m(fe){const Se=this.resume(),pe=this.stack[this.stack.length-1];pe.label=Se,pe.identifier=$n(this.sliceSerialize(fe)).toLowerCase()}function S(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.title=fe}function A(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.url=fe}function M(fe){const Se=this.stack[this.stack.length-1];if(!Se.depth){const pe=this.sliceSerialize(fe).length;Se.depth=pe}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function D(fe){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function L(fe){const pe=this.stack[this.stack.length-1].children;let Me=pe[pe.length-1];(!Me||Me.type!=="text")&&(Me=dt(),Me.position={start:tr(fe.start),end:void 0},pe.push(Me)),this.stack.push(Me)}function B(fe){const Se=this.stack.pop();Se.value+=this.sliceSerialize(fe),Se.position.end=tr(fe.end)}function I(fe){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const pe=Se.children[Se.children.length-1];pe.position.end=tr(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Se.type)&&(L.call(this,fe),B.call(this,fe))}function F(){this.data.atHardBreak=!0}function U(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe}function W(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe}function X(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe}function V(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Se,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function Y(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Se,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function J(fe){const Se=this.sliceSerialize(fe),pe=this.stack[this.stack.length-2];pe.label=Pb(Se),pe.identifier=$n(Se).toLowerCase()}function z(){const fe=this.stack[this.stack.length-1],Se=this.resume(),pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,pe.type==="link"){const Me=fe.children;pe.children=Me}else pe.alt=Se}function j(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.url=fe}function H(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.title=fe}function G(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ie(fe){const Se=this.resume(),pe=this.stack[this.stack.length-1];pe.label=Se,pe.identifier=$n(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function he(fe){this.data.characterReferenceType=fe.type}function ge(fe){const Se=this.sliceSerialize(fe),pe=this.data.characterReferenceType;let Me;pe?(Me=s_(Se,pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Me=vh(Se);const Ne=this.stack[this.stack.length-1];Ne.value+=Me}function K(fe){const Se=this.stack.pop();Se.position.end=tr(fe.end)}function q(fe){B.call(this,fe);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(fe)}function te(fe){B.call(this,fe);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(fe)}function le(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function Ee(){return{type:"inlineCode",value:""}}function Ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function me(){return{type:"emphasis",children:[]}}function Te(){return{type:"heading",depth:0,children:[]}}function He(){return{type:"break"}}function ke(){return{type:"html",value:""}}function Jt(){return{type:"image",title:null,url:"",alt:null}}function Nt(){return{type:"link",title:null,url:"",children:[]}}function Kt(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function en(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function xn(){return{type:"paragraph",children:[]}}function bt(){return{type:"strong",children:[]}}function dt(){return{type:"text",value:""}}function Bt(){return{type:"thematicBreak"}}}function tr(n){return{line:n.line,column:n.column,offset:n.offset}}function g_(n,r){let s=-1;for(;++s<r.length;){const o=r[s];Array.isArray(o)?g_(n,o):Gb(n,o)}}function Gb(n,r){let s;for(s in r)if(m_.call(r,s))switch(s){case"canContainEols":{const o=r[s];o&&n[s].push(...o);break}case"transforms":{const o=r[s];o&&n[s].push(...o);break}case"enter":case"exit":{const o=r[s];o&&Object.assign(n[s],o);break}}}function eg(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+Ta({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+Ta({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+Ta({start:r.start,end:r.end})+") is still open")}function Vb(n){const r=this;r.parser=s;function s(o){return Fb(o,{...r.data("settings"),...n,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function $b(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 Wb(n,r){const s={type:"element",tagName:"br",properties:{},children:[]};return n.patch(r,s),[n.applyData(r,s),{type:"text",value:`
65
+ `}]}function Kb(n,r){const s=r.value?r.value+`
66
+ `:"",o={},d=r.lang?r.lang.split(/\s+/):[];d.length>0&&(o.className=["language-"+d[0]]);let v={type:"element",tagName:"code",properties:o,children:[{type:"text",value:s}]};return r.meta&&(v.data={meta:r.meta}),n.patch(r,v),v=n.applyData(r,v),v={type:"element",tagName:"pre",properties:{},children:[v]},n.patch(r,v),v}function Yb(n,r){const s={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function Xb(n,r){const s={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function Qb(n,r){const s=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",o=String(r.identifier).toUpperCase(),d=Es(o.toLowerCase()),v=n.footnoteOrder.indexOf(o);let f,l=n.footnoteCounts.get(o);l===void 0?(l=0,n.footnoteOrder.push(o),f=n.footnoteOrder.length):f=v+1,l+=1,n.footnoteCounts.set(o,l);const c={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+d,id:s+"fnref-"+d+(l>1?"-"+l:""),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 Zb(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 Jb(n,r){if(n.options.allowDangerousHtml){const s={type:"raw",value:r.value};return n.patch(r,s),n.applyData(r,s)}}function __(n,r){const s=r.referenceType;let o="]";if(s==="collapsed"?o+="[]":s==="full"&&(o+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+o}];const d=n.all(r),v=d[0];v&&v.type==="text"?v.value="["+v.value:d.unshift({type:"text",value:"["});const f=d[d.length-1];return f&&f.type==="text"?f.value+=o:d.push({type:"text",value:o}),d}function eC(n,r){const s=String(r.identifier).toUpperCase(),o=n.definitionById.get(s);if(!o)return __(n,r);const d={src:Es(o.url||""),alt:r.alt};o.title!==null&&o.title!==void 0&&(d.title=o.title);const v={type:"element",tagName:"img",properties:d,children:[]};return n.patch(r,v),n.applyData(r,v)}function tC(n,r){const s={src:Es(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 o={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,o),n.applyData(r,o)}function nC(n,r){const s={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,s);const o={type:"element",tagName:"code",properties:{},children:[s]};return n.patch(r,o),n.applyData(r,o)}function iC(n,r){const s=String(r.identifier).toUpperCase(),o=n.definitionById.get(s);if(!o)return __(n,r);const d={href:Es(o.url||"")};o.title!==null&&o.title!==void 0&&(d.title=o.title);const v={type:"element",tagName:"a",properties:d,children:n.all(r)};return n.patch(r,v),n.applyData(r,v)}function rC(n,r){const s={href:Es(r.url)};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,o),n.applyData(r,o)}function sC(n,r,s){const o=n.all(r),d=s?aC(s):v_(r),v={},f=[];if(typeof r.checked=="boolean"){const p=o[0];let u;p&&p.type==="element"&&p.tagName==="p"?u=p:(u={type:"element",tagName:"p",properties:{},children:[]},o.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:[]}),v.className=["task-list-item"]}let l=-1;for(;++l<o.length;){const p=o[l];(d||l!==0||p.type!=="element"||p.tagName!=="p")&&f.push({type:"text",value:`
67
+ `}),p.type==="element"&&p.tagName==="p"&&!d?f.push(...p.children):f.push(p)}const c=o[o.length-1];c&&(d||c.type!=="element"||c.tagName!=="p")&&f.push({type:"text",value:`
68
+ `});const h={type:"element",tagName:"li",properties:v,children:f};return n.patch(r,h),n.applyData(r,h)}function aC(n){let r=!1;if(n.type==="list"){r=n.spread||!1;const s=n.children;let o=-1;for(;!r&&++o<s.length;)r=v_(s[o])}return r}function v_(n){const r=n.spread;return r??n.children.length>1}function lC(n,r){const s={},o=n.all(r);let d=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++d<o.length;){const f=o[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 v={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:n.wrap(o,!0)};return n.patch(r,v),n.applyData(r,v)}function oC(n,r){const s={type:"element",tagName:"p",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function cC(n,r){const s={type:"root",children:n.wrap(n.all(r))};return n.patch(r,s),n.applyData(r,s)}function uC(n,r){const s={type:"element",tagName:"strong",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function hC(n,r){const s=n.all(r),o=s.shift(),d=[];if(o){const f={type:"element",tagName:"thead",properties:{},children:n.wrap([o],!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)},l=dh(r.children[1]),c=Qg(r.children[r.children.length-1]);l&&c&&(f.position={start:l,end:c}),d.push(f)}const v={type:"element",tagName:"table",properties:{},children:n.wrap(d,!0)};return n.patch(r,v),n.applyData(r,v)}function fC(n,r,s){const o=s?s.children:void 0,v=(o?o.indexOf(r):1)===0?"th":"td",f=s&&s.type==="table"?s.align:void 0,l=f?f.length:r.children.length;let c=-1;const h=[];for(;++c<l;){const u=r.children[c],b={},C=f?f[c]:void 0;C&&(b.align=C);let T={type:"element",tagName:v,properties:b,children:[]};u&&(T.children=n.all(u),n.patch(u,T),T=n.applyData(u,T)),h.push(T)}const p={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(r,p),n.applyData(r,p)}function dC(n,r){const s={type:"element",tagName:"td",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}const tg=9,ng=32;function pC(n){const r=String(n),s=/\r?\n|\r/g;let o=s.exec(r),d=0;const v=[];for(;o;)v.push(ig(r.slice(d,o.index),d>0,!0),o[0]),d=o.index+o[0].length,o=s.exec(r);return v.push(ig(r.slice(d),d>0,!1)),v.join("")}function ig(n,r,s){let o=0,d=n.length;if(r){let v=n.codePointAt(o);for(;v===tg||v===ng;)o++,v=n.codePointAt(o)}if(s){let v=n.codePointAt(d-1);for(;v===tg||v===ng;)d--,v=n.codePointAt(d-1)}return d>o?n.slice(o,d):""}function mC(n,r){const s={type:"text",value:pC(String(r.value))};return n.patch(r,s),n.applyData(r,s)}function gC(n,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,s),n.applyData(r,s)}const _C={blockquote:$b,break:Wb,code:Kb,delete:Yb,emphasis:Xb,footnoteReference:Qb,heading:Zb,html:Jb,imageReference:eC,image:tC,inlineCode:nC,linkReference:iC,link:rC,listItem:sC,list:lC,paragraph:oC,root:cC,strong:uC,table:hC,tableCell:dC,tableRow:fC,text:mC,thematicBreak:gC,toml:Jl,yaml:Jl,definition:Jl,footnoteDefinition:Jl};function Jl(){}const y_=-1,go=0,Da=1,lo=2,Sh=3,bh=4,Ch=5,wh=6,S_=7,b_=8,vC=typeof self=="object"?self:globalThis,rg=(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)},yC=(n,r)=>{const s=(d,v)=>(n.set(v,d),d),o=d=>{if(n.has(d))return n.get(d);const[v,f]=r[d];switch(v){case go:case y_:return s(f,d);case Da:{const l=s([],d);for(const c of f)l.push(o(c));return l}case lo:{const l=s({},d);for(const[c,h]of f)l[o(c)]=o(h);return l}case Sh:return s(new Date(f),d);case bh:{const{source:l,flags:c}=f;return s(new RegExp(l,c),d)}case Ch:{const l=s(new Map,d);for(const[c,h]of f)l.set(o(c),o(h));return l}case wh:{const l=s(new Set,d);for(const c of f)l.add(o(c));return l}case S_:{const{name:l,message:c}=f;return s(rg(l,c),d)}case b_: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:l}=new Uint8Array(f);return s(new DataView(l),f)}}return s(rg(v,f),d)};return o},sg=n=>yC(new Map,n)(0),_s="",{toString:SC}={},{keys:bC}=Object,ka=n=>{const r=typeof n;if(r!=="object"||!n)return[go,r];const s=SC.call(n).slice(8,-1);switch(s){case"Array":return[Da,_s];case"Object":return[lo,_s];case"Date":return[Sh,_s];case"RegExp":return[bh,_s];case"Map":return[Ch,_s];case"Set":return[wh,_s];case"DataView":return[Da,s]}return s.includes("Array")?[Da,s]:s.includes("Error")?[S_,s]:[lo,s]},eo=([n,r])=>n===go&&(r==="function"||r==="symbol"),CC=(n,r,s,o)=>{const d=(f,l)=>{const c=o.push(f)-1;return s.set(l,c),c},v=f=>{if(s.has(f))return s.get(f);let[l,c]=ka(f);switch(l){case go:{let p=f;switch(c){case"bigint":l=b_,p=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return d([y_],f)}return d([l,p],f)}case Da:{if(c){let b=f;return c==="DataView"?b=new Uint8Array(f.buffer):c==="ArrayBuffer"&&(b=new Uint8Array(f)),d([c,[...b]],f)}const p=[],u=d([l,p],f);for(const b of f)p.push(v(b));return u}case lo:{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 v(f.toJSON());const p=[],u=d([l,p],f);for(const b of bC(f))(n||!eo(ka(f[b])))&&p.push([v(b),v(f[b])]);return u}case Sh:return d([l,f.toISOString()],f);case bh:{const{source:p,flags:u}=f;return d([l,{source:p,flags:u}],f)}case Ch:{const p=[],u=d([l,p],f);for(const[b,C]of f)(n||!(eo(ka(b))||eo(ka(C))))&&p.push([v(b),v(C)]);return u}case wh:{const p=[],u=d([l,p],f);for(const b of f)(n||!eo(ka(b)))&&p.push(v(b));return u}}const{message:h}=f;return d([l,{name:c,message:h}],f)};return v},ag=(n,{json:r,lossy:s}={})=>{const o=[];return CC(!(r||s),!!r,new Map,o)(n),o},oo=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?sg(ag(n,r)):structuredClone(n):(n,r)=>sg(ag(n,r));function wC(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 xC(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function EC(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",s=n.options.footnoteBackContent||wC,o=n.options.footnoteBackLabel||xC,d=n.options.footnoteLabel||"Footnotes",v=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<n.footnoteOrder.length;){const h=n.footnoteById.get(n.footnoteOrder[c]);if(!h)continue;const p=n.all(h),u=String(h.identifier).toUpperCase(),b=Es(u.toLowerCase());let C=0;const T=[],x=n.footnoteCounts.get(u);for(;x!==void 0&&++C<=x;){T.length>0&&T.push({type:"text",value:" "});let m=typeof s=="string"?s:s(c,C);typeof m=="string"&&(m={type:"text",value:m}),T.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+b+(C>1?"-"+C:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(c,C),className:["data-footnote-backref"]},children:Array.isArray(m)?m:[m]})}const _=p[p.length-1];if(_&&_.type==="element"&&_.tagName==="p"){const m=_.children[_.children.length-1];m&&m.type==="text"?m.value+=" ":_.children.push({type:"text",value:" "}),_.children.push(...T)}else p.push(...T);const y={type:"element",tagName:"li",properties:{id:r+"fn-"+b},children:n.wrap(p,!0)};n.patch(h,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:v,properties:{...oo(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
69
+ `},{type:"element",tagName:"ol",properties:{},children:n.wrap(l,!0)},{type:"text",value:`
70
+ `}]}}const _o=(function(n){if(n==null)return RC;if(typeof n=="function")return vo(n);if(typeof n=="object")return Array.isArray(n)?kC(n):AC(n);if(typeof n=="string")return TC(n);throw new Error("Expected function, string, or object as test")});function kC(n){const r=[];let s=-1;for(;++s<n.length;)r[s]=_o(n[s]);return vo(o);function o(...d){let v=-1;for(;++v<r.length;)if(r[v].apply(this,d))return!0;return!1}}function AC(n){const r=n;return vo(s);function s(o){const d=o;let v;for(v in n)if(d[v]!==r[v])return!1;return!0}}function TC(n){return vo(r);function r(s){return s&&s.type===n}}function vo(n){return r;function r(s,o,d){return!!(DC(s)&&n.call(this,s,typeof o=="number"?o:void 0,d||void 0))}}function RC(){return!0}function DC(n){return n!==null&&typeof n=="object"&&"type"in n}const C_=[],MC=!0,th=!1,LC="skip";function w_(n,r,s,o){let d;typeof r=="function"&&typeof s!="function"?(o=s,s=r):d=r;const v=_o(d),f=o?-1:1;l(n,void 0,[])();function l(c,h,p){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=C_,T,x,_;if((!r||v(c,h,p[p.length-1]||void 0))&&(C=OC(s(c,p)),C[0]===th))return C;if("children"in c&&c.children){const y=c;if(y.children&&C[0]!==LC)for(x=(o?y.children.length:-1)+f,_=p.concat(y);x>-1&&x<y.children.length;){const m=y.children[x];if(T=l(m,x,_)(),T[0]===th)return T;x=typeof T[1]=="number"?T[1]:x+f}}return C}}}function OC(n){return Array.isArray(n)?n:typeof n=="number"?[MC,n]:n==null?C_:[n]}function xh(n,r,s,o){let d,v,f;typeof r=="function"&&typeof s!="function"?(v=void 0,f=r,d=s):(v=r,f=s,d=o),w_(n,v,l,d);function l(c,h){const p=h[h.length-1],u=p?p.children.indexOf(c):void 0;return f(c,u,p)}}const nh={}.hasOwnProperty,BC={};function jC(n,r){const s=r||BC,o=new Map,d=new Map,v=new Map,f={..._C,...s.handlers},l={all:h,applyData:HC,definitionById:o,footnoteById:d,footnoteCounts:v,footnoteOrder:[],handlers:f,one:c,options:s,patch:NC,wrap:IC};return xh(n,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const u=p.type==="definition"?o:d,b=String(p.identifier).toUpperCase();u.has(b)||u.set(b,p)}}),l;function c(p,u){const b=p.type,C=l.handlers[b];if(nh.call(l.handlers,b)&&C)return C(l,p,u);if(l.options.passThrough&&l.options.passThrough.includes(b)){if("children"in p){const{children:x,..._}=p,y=oo(_);return y.children=l.all(p),y}return oo(p)}return(l.options.unknownHandler||zC)(l,p,u)}function h(p){const u=[];if("children"in p){const b=p.children;let C=-1;for(;++C<b.length;){const T=l.one(b[C],p);if(T){if(C&&b[C-1].type==="break"&&(!Array.isArray(T)&&T.type==="text"&&(T.value=lg(T.value)),!Array.isArray(T)&&T.type==="element")){const x=T.children[0];x&&x.type==="text"&&(x.value=lg(x.value))}Array.isArray(T)?u.push(...T):u.push(T)}}}return u}}function NC(n,r){n.position&&(r.position=wy(n))}function HC(n,r){let s=r;if(n&&n.data){const o=n.data.hName,d=n.data.hChildren,v=n.data.hProperties;if(typeof o=="string")if(s.type==="element")s.tagName=o;else{const f="children"in s?s.children:[s];s={type:"element",tagName:o,properties:{},children:f}}s.type==="element"&&v&&Object.assign(s.properties,oo(v)),"children"in s&&s.children&&d!==null&&d!==void 0&&(s.children=d)}return s}function zC(n,r){const s=r.data||{},o="value"in r&&!(nh.call(s,"hProperties")||nh.call(s,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:n.all(r)};return n.patch(r,o),n.applyData(r,o)}function IC(n,r){const s=[];let o=-1;for(r&&s.push({type:"text",value:`
71
+ `});++o<n.length;)o&&s.push({type:"text",value:`
72
+ `}),s.push(n[o]);return r&&n.length>0&&s.push({type:"text",value:`
73
+ `}),s}function lg(n){let r=0,s=n.charCodeAt(r);for(;s===9||s===32;)r++,s=n.charCodeAt(r);return n.slice(r)}function og(n,r){const s=jC(n,r),o=s.one(n,void 0),d=EC(s),v=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return d&&v.children.push({type:"text",value:`
74
+ `},d),v}function PC(n,r){return n&&"run"in n?async function(s,o){const d=og(s,{file:o,...r});await n.run(d,o)}:function(s,o){return og(s,{file:o,...n||r})}}function cg(n){if(n)throw n}var Nu,ug;function UC(){if(ug)return Nu;ug=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,d=function(h){return typeof Array.isArray=="function"?Array.isArray(h):r.call(h)==="[object Array]"},v=function(h){if(!h||r.call(h)!=="[object Object]")return!1;var p=n.call(h,"constructor"),u=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!u)return!1;var b;for(b in h);return typeof b>"u"||n.call(h,b)},f=function(h,p){s&&p.name==="__proto__"?s(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},l=function(h,p){if(p==="__proto__")if(n.call(h,p)){if(o)return o(h,p).value}else return;return h[p]};return Nu=function c(){var h,p,u,b,C,T,x=arguments[0],_=1,y=arguments.length,m=!1;for(typeof x=="boolean"&&(m=x,x=arguments[1]||{},_=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});_<y;++_)if(h=arguments[_],h!=null)for(p in h)u=l(x,p),b=l(h,p),x!==b&&(m&&b&&(v(b)||(C=d(b)))?(C?(C=!1,T=u&&d(u)?u:[]):T=u&&v(u)?u:{},f(x,{name:p,newValue:c(m,T,b)})):typeof b<"u"&&f(x,{name:p,newValue:b}));return x},Nu}var FC=UC();const Hu=Bg(FC);function ih(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 qC(){const n=[],r={run:s,use:o};return r;function s(...d){let v=-1;const f=d.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);l(null,...d);function l(c,...h){const p=n[++v];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,p?GC(p,l)(...h):f(null,...h)}}function o(d){if(typeof d!="function")throw new TypeError("Expected `middelware` to be a function, not "+d);return n.push(d),r}}function GC(n,r){let s;return o;function o(...f){const l=n.length>f.length;let c;l&&f.push(d);try{c=n.apply(this,f)}catch(h){const p=h;if(l&&s)throw p;return d(p)}l||(c&&c.then&&typeof c.then=="function"?c.then(v,d):c instanceof Error?d(c):v(c))}function d(f,...l){s||(s=!0,r(f,...l))}function v(f){d(null,f)}}const Jn={basename:VC,dirname:$C,extname:WC,join:KC,sep:"/"};function VC(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Na(n);let s=0,o=-1,d=n.length,v;if(r===void 0||r.length===0||r.length>n.length){for(;d--;)if(n.codePointAt(d)===47){if(v){s=d+1;break}}else o<0&&(v=!0,o=d+1);return o<0?"":n.slice(s,o)}if(r===n)return"";let f=-1,l=r.length-1;for(;d--;)if(n.codePointAt(d)===47){if(v){s=d+1;break}}else f<0&&(v=!0,f=d+1),l>-1&&(n.codePointAt(d)===r.codePointAt(l--)?l<0&&(o=d):(l=-1,o=f));return s===o?o=f:o<0&&(o=n.length),n.slice(s,o)}function $C(n){if(Na(n),n.length===0)return".";let r=-1,s=n.length,o;for(;--s;)if(n.codePointAt(s)===47){if(o){r=s;break}}else o||(o=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function WC(n){Na(n);let r=n.length,s=-1,o=0,d=-1,v=0,f;for(;r--;){const l=n.codePointAt(r);if(l===47){if(f){o=r+1;break}continue}s<0&&(f=!0,s=r+1),l===46?d<0?d=r:v!==1&&(v=1):d>-1&&(v=-1)}return d<0||s<0||v===0||v===1&&d===s-1&&d===o+1?"":n.slice(d,s)}function KC(...n){let r=-1,s;for(;++r<n.length;)Na(n[r]),n[r]&&(s=s===void 0?n[r]:s+"/"+n[r]);return s===void 0?".":YC(s)}function YC(n){Na(n);const r=n.codePointAt(0)===47;let s=XC(n,!r);return s.length===0&&!r&&(s="."),s.length>0&&n.codePointAt(n.length-1)===47&&(s+="/"),r?"/"+s:s}function XC(n,r){let s="",o=0,d=-1,v=0,f=-1,l,c;for(;++f<=n.length;){if(f<n.length)l=n.codePointAt(f);else{if(l===47)break;l=47}if(l===47){if(!(d===f-1||v===1))if(d!==f-1&&v===2){if(s.length<2||o!==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="",o=0):(s=s.slice(0,c),o=s.length-1-s.lastIndexOf("/")),d=f,v=0;continue}}else if(s.length>0){s="",o=0,d=f,v=0;continue}}r&&(s=s.length>0?s+"/..":"..",o=2)}else s.length>0?s+="/"+n.slice(d+1,f):s=n.slice(d+1,f),o=f-d-1;d=f,v=0}else l===46&&v>-1?v++:v=-1}return s}function Na(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const QC={cwd:ZC};function ZC(){return"/"}function rh(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function JC(n){if(typeof n=="string")n=new URL(n);else if(!rh(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 ew(n)}function ew(n){if(n.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const r=n.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const o=r.codePointAt(s+2);if(o===70||o===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 zu=["history","path","basename","stem","extname","dirname"];class x_{constructor(r){let s;r?rh(r)?s={path:r}:typeof r=="string"||tw(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":QC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o=-1;for(;++o<zu.length;){const v=zu[o];v in s&&s[v]!==void 0&&s[v]!==null&&(this[v]=v==="history"?[...s[v]]:s[v])}let d;for(d in s)zu.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?Jn.basename(this.path):void 0}set basename(r){Pu(r,"basename"),Iu(r,"basename"),this.path=Jn.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?Jn.dirname(this.path):void 0}set dirname(r){hg(this.basename,"dirname"),this.path=Jn.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?Jn.extname(this.path):void 0}set extname(r){if(Iu(r,"extname"),hg(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=Jn.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){rh(r)&&(r=JC(r)),Pu(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?Jn.basename(this.path,this.extname):void 0}set stem(r){Pu(r,"stem"),Iu(r,"stem"),this.path=Jn.join(this.dirname||"",r+(this.extname||""))}fail(r,s,o){const d=this.message(r,s,o);throw d.fatal=!0,d}info(r,s,o){const d=this.message(r,s,o);return d.fatal=void 0,d}message(r,s,o){const d=new Wt(r,s,o);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 Iu(n,r){if(n&&n.includes(Jn.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+Jn.sep+"`")}function Pu(n,r){if(!n)throw new Error("`"+r+"` cannot be empty")}function hg(n,r){if(!n)throw new Error("Setting `"+r+"` requires `path` to be set too")}function tw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const nw=(function(n){const o=this.constructor.prototype,d=o[n],v=function(){return d.apply(v,arguments)};return Object.setPrototypeOf(v,o),v}),iw={}.hasOwnProperty;class Eh extends nw{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=qC()}copy(){const r=new Eh;let s=-1;for(;++s<this.attachers.length;){const o=this.attachers[s];r.use(...o)}return r.data(Hu(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(qu("data",this.frozen),this.namespace[r]=s,this):iw.call(this.namespace,r)&&this.namespace[r]||void 0:r?(qu("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,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);const d=s.call(r,...o);typeof d=="function"&&this.transformers.use(d)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=to(r),o=this.parser||this.Parser;return Uu("parse",o),o(String(s),s)}process(r,s){const o=this;return this.freeze(),Uu("process",this.parser||this.Parser),Fu("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(v,f){const l=to(r),c=o.parse(l);o.run(c,l,function(p,u,b){if(p||!u||!b)return h(p);const C=u,T=o.stringify(C,b);aw(T)?b.value=T:b.result=T,h(p,b)});function h(p,u){p||!u?f(p):v?v(u):s(void 0,u)}}}processSync(r){let s=!1,o;return this.freeze(),Uu("processSync",this.parser||this.Parser),Fu("processSync",this.compiler||this.Compiler),this.process(r,d),dg("processSync","process",s),o;function d(v,f){s=!0,cg(v),o=f}}run(r,s,o){fg(r),this.freeze();const d=this.transformers;return!o&&typeof s=="function"&&(o=s,s=void 0),o?v(void 0,o):new Promise(v);function v(f,l){const c=to(s);d.run(r,c,h);function h(p,u,b){const C=u||r;p?l(p):f?f(C):o(void 0,C,b)}}}runSync(r,s){let o=!1,d;return this.run(r,s,v),dg("runSync","run",o),d;function v(f,l){cg(f),d=l,o=!0}}stringify(r,s){this.freeze();const o=to(s),d=this.compiler||this.Compiler;return Fu("stringify",d),fg(r),d(r,o)}use(r,...s){const o=this.attachers,d=this.namespace;if(qu("use",this.frozen),r!=null)if(typeof r=="function")c(r,s);else if(typeof r=="object")Array.isArray(r)?l(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function v(h){if(typeof h=="function")c(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...u]=h;c(p,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");l(h.plugins),h.settings&&(d.settings=Hu(!0,d.settings,h.settings))}function l(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const u=h[p];v(u)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function c(h,p){let u=-1,b=-1;for(;++u<o.length;)if(o[u][0]===h){b=u;break}if(b===-1)o.push([h,...p]);else if(p.length>0){let[C,...T]=p;const x=o[b][1];ih(x)&&ih(C)&&(C=Hu(!0,x,C)),o[b]=[h,C,...T]}}}}const rw=new Eh().freeze();function Uu(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Fu(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function qu(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 fg(n){if(!ih(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function dg(n,r,s){if(!s)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function to(n){return sw(n)?n:new x_(n)}function sw(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function aw(n){return typeof n=="string"||lw(n)}function lw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const ow="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",pg=[],mg={allowDangerousHtml:!0},cw=/^(https?|ircs?|mailto|xmpp)$/i,uw=[{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 E_(n){const r=hw(n),s=fw(n);return dw(r.runSync(r.parse(s),s),n)}function hw(n){const r=n.rehypePlugins||pg,s=n.remarkPlugins||pg,o=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...mg}:mg;return rw().use(Vb).use(s).use(PC,o).use(r)}function fw(n){const r=n.children||"",s=new x_;return typeof r=="string"&&(s.value=r),s}function dw(n,r){const s=r.allowedElements,o=r.allowElement,d=r.components,v=r.disallowedElements,f=r.skipHtml,l=r.unwrapDisallowed,c=r.urlTransform||pw;for(const p of uw)Object.hasOwn(r,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+ow+p.id,void 0);return xh(n,h),Ty(n,{Fragment:k.Fragment,components:d,ignoreInvalidStyle:!0,jsx:k.jsx,jsxs:k.jsxs,passKeys:!0,passNode:!0});function h(p,u,b){if(p.type==="raw"&&b&&typeof u=="number")return f?b.children.splice(u,1):b.children[u]={type:"text",value:p.value},u;if(p.type==="element"){let C;for(C in Ou)if(Object.hasOwn(Ou,C)&&Object.hasOwn(p.properties,C)){const T=p.properties[C],x=Ou[C];(x===null||x.includes(p.tagName))&&(p.properties[C]=c(String(T||""),C,p))}}if(p.type==="element"){let C=s?!s.includes(p.tagName):v?v.includes(p.tagName):!1;if(!C&&o&&typeof u=="number"&&(C=!o(p,u,b)),C&&b&&typeof u=="number")return l&&p.children?b.children.splice(u,1,...p.children):b.children.splice(u,1),u}}}function pw(n){const r=n.indexOf(":"),s=n.indexOf("?"),o=n.indexOf("#"),d=n.indexOf("/");return r===-1||d!==-1&&r>d||s!==-1&&r>s||o!==-1&&r>o||cw.test(n.slice(0,r))?n:""}function gg(n,r){const s=String(n);if(typeof r!="string")throw new TypeError("Expected character");let o=0,d=s.indexOf(r);for(;d!==-1;)o++,d=s.indexOf(r,d+r.length);return o}function mw(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function gw(n,r,s){const d=_o((s||{}).ignore||[]),v=_w(r);let f=-1;for(;++f<v.length;)w_(n,"text",l);function l(h,p){let u=-1,b;for(;++u<p.length;){const C=p[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,p)}function c(h,p){const u=p[p.length-1],b=v[f][0],C=v[f][1];let T=0;const _=u.children.indexOf(h);let y=!1,m=[];b.lastIndex=0;let S=b.exec(h.value);for(;S;){const A=S.index,M={index:S.index,input:S.input,stack:[...p,h]};let R=C(...S,M);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?b.lastIndex=A+1:(T!==A&&m.push({type:"text",value:h.value.slice(T,A)}),Array.isArray(R)?m.push(...R):R&&m.push(R),T=A+S[0].length,y=!0),!b.global)break;S=b.exec(h.value)}return y?(T<h.value.length&&m.push({type:"text",value:h.value.slice(T)}),u.children.splice(_,1,...m)):m=[h],_+m.length}}function _w(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 o=-1;for(;++o<s.length;){const d=s[o];r.push([vw(d[0]),yw(d[1])])}return r}function vw(n){return typeof n=="string"?new RegExp(mw(n),"g"):n}function yw(n){return typeof n=="function"?n:function(){return n}}const Gu="phrasing",Vu=["autolink","link","image","label"];function Sw(){return{transforms:[Aw],enter:{literalAutolink:Cw,literalAutolinkEmail:$u,literalAutolinkHttp:$u,literalAutolinkWww:$u},exit:{literalAutolink:kw,literalAutolinkEmail:Ew,literalAutolinkHttp:ww,literalAutolinkWww:xw}}}function bw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Gu,notInConstruct:Vu},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Gu,notInConstruct:Vu},{character:":",before:"[ps]",after:"\\/",inConstruct:Gu,notInConstruct:Vu}]}}function Cw(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function $u(n){this.config.enter.autolinkProtocol.call(this,n)}function ww(n){this.config.exit.autolinkProtocol.call(this,n)}function xw(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 Ew(n){this.config.exit.autolinkEmail.call(this,n)}function kw(n){this.exit(n)}function Aw(n){gw(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Tw],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Rw]],{ignore:["link","linkReference"]})}function Tw(n,r,s,o,d){let v="";if(!k_(d)||(/^w/i.test(r)&&(s=r+s,r="",v="http://"),!Dw(s)))return!1;const f=Mw(s+o);if(!f[0])return!1;const l={type:"link",title:null,url:v+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[l,{type:"text",value:f[1]}]:l}function Rw(n,r,s,o){return!k_(o,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function Dw(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 Mw(n){const r=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let s=r[0],o=s.indexOf(")");const d=gg(n,"(");let v=gg(n,")");for(;o!==-1&&d>v;)n+=s.slice(0,o+1),s=s.slice(o+1),o=s.indexOf(")"),v++;return[n,s]}function k_(n,r){const s=n.input.charCodeAt(n.index-1);return(n.index===0||Rr(s)||po(s))&&(!r||s!==47)}A_.peek=Pw;function Lw(){this.buffer()}function Ow(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function Bw(){this.buffer()}function jw(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function Nw(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=$n(this.sliceSerialize(n)).toLowerCase(),s.label=r}function Hw(n){this.exit(n)}function zw(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=$n(this.sliceSerialize(n)).toLowerCase(),s.label=r}function Iw(n){this.exit(n)}function Pw(){return"["}function A_(n,r,s,o){const d=s.createTracker(o);let v=d.move("[^");const f=s.enter("footnoteReference"),l=s.enter("reference");return v+=d.move(s.safe(s.associationId(n),{after:"]",before:v})),l(),f(),v+=d.move("]"),v}function Uw(){return{enter:{gfmFootnoteCallString:Lw,gfmFootnoteCall:Ow,gfmFootnoteDefinitionLabelString:Bw,gfmFootnoteDefinition:jw},exit:{gfmFootnoteCallString:Nw,gfmFootnoteCall:Hw,gfmFootnoteDefinitionLabelString:zw,gfmFootnoteDefinition:Iw}}}function Fw(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:A_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(o,d,v,f){const l=v.createTracker(f);let c=l.move("[^");const h=v.enter("footnoteDefinition"),p=v.enter("label");return c+=l.move(v.safe(v.associationId(o),{before:c,after:"]"})),p(),c+=l.move("]:"),o.children&&o.children.length>0&&(l.shift(4),c+=l.move((r?`
75
+ `:" ")+v.indentLines(v.containerFlow(o,l.current()),r?T_:qw))),h(),c}}function qw(n,r,s){return r===0?n:T_(n,r,s)}function T_(n,r,s){return(s?"":" ")+n}const Gw=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];R_.peek=Yw;function Vw(){return{canContainEols:["delete"],enter:{strikethrough:Ww},exit:{strikethrough:Kw}}}function $w(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Gw}],handlers:{delete:R_}}}function Ww(n){this.enter({type:"delete",children:[]},n)}function Kw(n){this.exit(n)}function R_(n,r,s,o){const d=s.createTracker(o),v=s.enter("strikethrough");let f=d.move("~~");return f+=s.containerPhrasing(n,{...d.current(),before:f,after:"~"}),f+=d.move("~~"),v(),f}function Yw(){return"~"}function Xw(n){return n.length}function Qw(n,r){const s=r||{},o=(s.align||[]).concat(),d=s.stringLength||Xw,v=[],f=[],l=[],c=[];let h=0,p=-1;for(;++p<n.length;){const x=[],_=[];let y=-1;for(n[p].length>h&&(h=n[p].length);++y<n[p].length;){const m=Zw(n[p][y]);if(s.alignDelimiters!==!1){const S=d(m);_[y]=S,(c[y]===void 0||S>c[y])&&(c[y]=S)}x.push(m)}f[p]=x,l[p]=_}let u=-1;if(typeof o=="object"&&"length"in o)for(;++u<h;)v[u]=_g(o[u]);else{const x=_g(o);for(;++u<h;)v[u]=x}u=-1;const b=[],C=[];for(;++u<h;){const x=v[u];let _="",y="";x===99?(_=":",y=":"):x===108?_=":":x===114&&(y=":");let m=s.alignDelimiters===!1?1:Math.max(1,c[u]-_.length-y.length);const S=_+"-".repeat(m)+y;s.alignDelimiters!==!1&&(m=_.length+m+y.length,m>c[u]&&(c[u]=m),C[u]=m),b[u]=S}f.splice(1,0,b),l.splice(1,0,C),p=-1;const T=[];for(;++p<f.length;){const x=f[p],_=l[p];u=-1;const y=[];for(;++u<h;){const m=x[u]||"";let S="",A="";if(s.alignDelimiters!==!1){const M=c[u]-(_[u]||0),R=v[u];R===114?S=" ".repeat(M):R===99?M%2?(S=" ".repeat(M/2+.5),A=" ".repeat(M/2-.5)):(S=" ".repeat(M/2),A=S):A=" ".repeat(M)}s.delimiterStart!==!1&&!u&&y.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&m==="")&&(s.delimiterStart!==!1||u)&&y.push(" "),s.alignDelimiters!==!1&&y.push(S),y.push(m),s.alignDelimiters!==!1&&y.push(A),s.padding!==!1&&y.push(" "),(s.delimiterEnd!==!1||u!==h-1)&&y.push("|")}T.push(s.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return T.join(`
76
+ `)}function Zw(n){return n==null?"":String(n)}function _g(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 Jw(n,r,s,o){const d=s.enter("blockquote"),v=s.createTracker(o);v.move("> "),v.shift(2);const f=s.indentLines(s.containerFlow(n,v.current()),ex);return d(),f}function ex(n,r,s){return">"+(s?"":" ")+n}function tx(n,r){return vg(n,r.inConstruct,!0)&&!vg(n,r.notInConstruct,!1)}function vg(n,r,s){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return s;let o=-1;for(;++o<r.length;)if(n.includes(r[o]))return!0;return!1}function yg(n,r,s,o){let d=-1;for(;++d<s.unsafe.length;)if(s.unsafe[d].character===`
77
+ `&&tx(s.stack,s.unsafe[d]))return/[ \t]/.test(o.before)?"":" ";return`\\
78
+ `}function nx(n,r){const s=String(n);let o=s.indexOf(r),d=o,v=0,f=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;o!==-1;)o===d?++v>f&&(f=v):v=1,d=o+r.length,o=s.indexOf(r,d);return f}function ix(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 rx(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 sx(n,r,s,o){const d=rx(s),v=n.value||"",f=d==="`"?"GraveAccent":"Tilde";if(ix(n,s)){const u=s.enter("codeIndented"),b=s.indentLines(v,ax);return u(),b}const l=s.createTracker(o),c=d.repeat(Math.max(nx(v,d)+1,3)),h=s.enter("codeFenced");let p=l.move(c);if(n.lang){const u=s.enter(`codeFencedLang${f}`);p+=l.move(s.safe(n.lang,{before:p,after:" ",encode:["`"],...l.current()})),u()}if(n.lang&&n.meta){const u=s.enter(`codeFencedMeta${f}`);p+=l.move(" "),p+=l.move(s.safe(n.meta,{before:p,after:`
79
+ `,encode:["`"],...l.current()})),u()}return p+=l.move(`
80
+ `),v&&(p+=l.move(v+`
81
+ `)),p+=l.move(c),h(),p}function ax(n,r,s){return(s?"":" ")+n}function kh(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 lx(n,r,s,o){const d=kh(s),v=d==='"'?"Quote":"Apostrophe",f=s.enter("definition");let l=s.enter("label");const c=s.createTracker(o);let h=c.move("[");return h+=c.move(s.safe(s.associationId(n),{before:h,after:"]",...c.current()})),h+=c.move("]: "),l(),!n.url||/[\0- \u007F]/.test(n.url)?(l=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(l=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":`
82
+ `,...c.current()}))),l(),n.title&&(l=s.enter(`title${v}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),l()),f(),h}function ox(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 Oa(n){return"&#x"+n.toString(16).toUpperCase()+";"}function co(n,r,s){const o=bs(n),d=bs(r);return o===void 0?d===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:o===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}}D_.peek=cx;function D_(n,r,s,o){const d=ox(s),v=s.enter("emphasis"),f=s.createTracker(o),l=f.move(d);let c=f.move(s.containerPhrasing(n,{after:d,before:l,...f.current()}));const h=c.charCodeAt(0),p=co(o.before.charCodeAt(o.before.length-1),h,d);p.inside&&(c=Oa(h)+c.slice(1));const u=c.charCodeAt(c.length-1),b=co(o.after.charCodeAt(0),u,d);b.inside&&(c=c.slice(0,-1)+Oa(u));const C=f.move(d);return v(),s.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},l+c+C}function cx(n,r,s){return s.options.emphasis||"*"}function ux(n,r){let s=!1;return xh(n,function(o){if("value"in o&&/\r?\n|\r/.test(o.value)||o.type==="break")return s=!0,th}),!!((!n.depth||n.depth<3)&&_h(n)&&(r.options.setext||s))}function hx(n,r,s,o){const d=Math.max(Math.min(6,n.depth||1),1),v=s.createTracker(o);if(ux(n,s)){const p=s.enter("headingSetext"),u=s.enter("phrasing"),b=s.containerPhrasing(n,{...v.current(),before:`
83
+ `,after:`
84
+ `});return u(),p(),b+`
85
+ `+(d===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
86
+ `))+1))}const f="#".repeat(d),l=s.enter("headingAtx"),c=s.enter("phrasing");v.move(f+" ");let h=s.containerPhrasing(n,{before:"# ",after:`
87
+ `,...v.current()});return/^[\t ]/.test(h)&&(h=Oa(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,s.options.closeAtx&&(h+=" "+f),c(),l(),h}M_.peek=fx;function M_(n){return n.value||""}function fx(){return"<"}L_.peek=dx;function L_(n,r,s,o){const d=kh(s),v=d==='"'?"Quote":"Apostrophe",f=s.enter("image");let l=s.enter("label");const c=s.createTracker(o);let h=c.move("![");return h+=c.move(s.safe(n.alt,{before:h,after:"]",...c.current()})),h+=c.move("]("),l(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(l=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(l=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":")",...c.current()}))),l(),n.title&&(l=s.enter(`title${v}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),l()),h+=c.move(")"),f(),h}function dx(){return"!"}O_.peek=px;function O_(n,r,s,o){const d=n.referenceType,v=s.enter("imageReference");let f=s.enter("label");const l=s.createTracker(o);let c=l.move("![");const h=s.safe(n.alt,{before:c,after:"]",...l.current()});c+=l.move(h+"]["),f();const p=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...l.current()});return f(),s.stack=p,v(),d==="full"||!h||h!==u?c+=l.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function px(){return"!"}B_.peek=mx;function B_(n,r,s){let o=n.value||"",d="`",v=-1;for(;new RegExp("(^|[^`])"+d+"([^`]|$)").test(o);)d+="`";for(/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^`|`$/.test(o))&&(o=" "+o+" ");++v<s.unsafe.length;){const f=s.unsafe[v],l=s.compilePattern(f);let c;if(f.atBreak)for(;c=l.exec(o);){let h=c.index;o.charCodeAt(h)===10&&o.charCodeAt(h-1)===13&&h--,o=o.slice(0,h)+" "+o.slice(c.index+1)}}return d+o+d}function mx(){return"`"}function j_(n,r){const s=_h(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))}N_.peek=gx;function N_(n,r,s,o){const d=kh(s),v=d==='"'?"Quote":"Apostrophe",f=s.createTracker(o);let l,c;if(j_(n,s)){const p=s.stack;s.stack=[],l=s.enter("autolink");let u=f.move("<");return u+=f.move(s.containerPhrasing(n,{before:u,after:">",...f.current()})),u+=f.move(">"),l(),s.stack=p,u}l=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${v}`),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(")"),l(),h}function gx(n,r,s){return j_(n,s)?"<":"["}H_.peek=_x;function H_(n,r,s,o){const d=n.referenceType,v=s.enter("linkReference");let f=s.enter("label");const l=s.createTracker(o);let c=l.move("[");const h=s.containerPhrasing(n,{before:c,after:"]",...l.current()});c+=l.move(h+"]["),f();const p=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...l.current()});return f(),s.stack=p,v(),d==="full"||!h||h!==u?c+=l.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function _x(){return"["}function Ah(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=Ah(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 yx(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 z_(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 Sx(n,r,s,o){const d=s.enter("list"),v=s.bulletCurrent;let f=n.ordered?yx(s):Ah(s);const l=n.ordered?f==="."?")":".":vx(s);let c=r&&s.bulletLastUsed?f===s.bulletLastUsed:!1;if(!n.ordered){const p=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&p&&(!p.children||!p.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),z_(s)===f&&p){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=l),s.bulletCurrent=f;const h=s.containerFlow(n,o);return s.bulletLastUsed=f,s.bulletCurrent=v,d(),h}function bx(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 Cx(n,r,s,o){const d=bx(s);let v=s.bulletCurrent||Ah(s);r&&r.type==="list"&&r.ordered&&(v=(typeof r.start=="number"&&r.start>-1?r.start:1)+(s.options.incrementListMarker===!1?0:r.children.indexOf(n))+v);let f=v.length+1;(d==="tab"||d==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const l=s.createTracker(o);l.move(v+" ".repeat(f-v.length)),l.shift(f);const c=s.enter("listItem"),h=s.indentLines(s.containerFlow(n,l.current()),p);return c(),h;function p(u,b,C){return b?(C?"":" ".repeat(f))+u:(C?v:v+" ".repeat(f-v.length))+u}}function wx(n,r,s,o){const d=s.enter("paragraph"),v=s.enter("phrasing"),f=s.containerPhrasing(n,o);return v(),d(),f}const xx=_o(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Ex(n,r,s,o){return(n.children.some(function(f){return xx(f)})?s.containerPhrasing:s.containerFlow).call(s,n,o)}function kx(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}I_.peek=Ax;function I_(n,r,s,o){const d=kx(s),v=s.enter("strong"),f=s.createTracker(o),l=f.move(d+d);let c=f.move(s.containerPhrasing(n,{after:d,before:l,...f.current()}));const h=c.charCodeAt(0),p=co(o.before.charCodeAt(o.before.length-1),h,d);p.inside&&(c=Oa(h)+c.slice(1));const u=c.charCodeAt(c.length-1),b=co(o.after.charCodeAt(0),u,d);b.inside&&(c=c.slice(0,-1)+Oa(u));const C=f.move(d+d);return v(),s.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},l+c+C}function Ax(n,r,s){return s.options.strong||"*"}function Tx(n,r,s,o){return s.safe(n.value,o)}function Rx(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 Dx(n,r,s){const o=(z_(s)+(s.options.ruleSpaces?" ":"")).repeat(Rx(s));return s.options.ruleSpaces?o.slice(0,-1):o}const P_={blockquote:Jw,break:yg,code:sx,definition:lx,emphasis:D_,hardBreak:yg,heading:hx,html:M_,image:L_,imageReference:O_,inlineCode:B_,link:N_,linkReference:H_,list:Sx,listItem:Cx,paragraph:wx,root:Ex,strong:I_,text:Tx,thematicBreak:Dx};function Mx(){return{enter:{table:Lx,tableData:Sg,tableHeader:Sg,tableRow:Bx},exit:{codeText:jx,table:Ox,tableData:Wu,tableHeader:Wu,tableRow:Wu}}}function Lx(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 Ox(n){this.exit(n),this.data.inTable=void 0}function Bx(n){this.enter({type:"tableRow",children:[]},n)}function Wu(n){this.exit(n)}function Sg(n){this.enter({type:"tableCell",children:[]},n)}function jx(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,Nx));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(n)}function Nx(n,r){return r==="|"?r:n}function Hx(n){const r=n||{},s=r.tableCellPadding,o=r.tablePipeAlign,d=r.stringLength,v=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
88
+ `,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:l}};function f(C,T,x,_){return h(p(C,x,_),C.align)}function l(C,T,x,_){const y=u(C,x,_),m=h([y]);return m.slice(0,m.indexOf(`
89
+ `))}function c(C,T,x,_){const y=x.enter("tableCell"),m=x.enter("phrasing"),S=x.containerPhrasing(C,{..._,before:v,after:v});return m(),y(),S}function h(C,T){return Qw(C,{align:T,alignDelimiters:o,padding:s,stringLength:d})}function p(C,T,x){const _=C.children;let y=-1;const m=[],S=T.enter("table");for(;++y<_.length;)m[y]=u(_[y],T,x);return S(),m}function u(C,T,x){const _=C.children;let y=-1;const m=[],S=T.enter("tableRow");for(;++y<_.length;)m[y]=c(_[y],C,T,x);return S(),m}function b(C,T,x){let _=P_.inlineCode(C,T,x);return x.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function zx(){return{exit:{taskListCheckValueChecked:bg,taskListCheckValueUnchecked:bg,paragraph:Px}}}function Ix(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Ux}}}function bg(n){const r=this.stack[this.stack.length-2];r.type,r.checked=n.type==="taskListCheckValueChecked"}function Px(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 o=s.children[0];if(o&&o.type==="text"){const d=r.children;let v=-1,f;for(;++v<d.length;){const l=d[v];if(l.type==="paragraph"){f=l;break}}f===s&&(o.value=o.value.slice(1),o.value.length===0?s.children.shift():s.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,s.position.start=Object.assign({},o.position.start)))}}this.exit(n)}function Ux(n,r,s,o){const d=n.children[0],v=typeof n.checked=="boolean"&&d&&d.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",l=s.createTracker(o);v&&l.move(f);let c=P_.listItem(n,r,s,{...o,...l.current()});return v&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(p){return p+f}}function Fx(){return[Sw(),Uw(),Vw(),Mx(),zx()]}function qx(n){return{extensions:[bw(),Fw(n),$w(),Hx(n),Ix()]}}const Gx={tokenize:Xx,partial:!0},U_={tokenize:Qx,partial:!0},F_={tokenize:Zx,partial:!0},q_={tokenize:Jx,partial:!0},Vx={tokenize:eE,partial:!0},G_={name:"wwwAutolink",tokenize:Kx,previous:$_},V_={name:"protocolAutolink",tokenize:Yx,previous:W_},xi={name:"emailAutolink",tokenize:Wx,previous:K_},ei={};function $x(){return{text:ei}}let Tr=48;for(;Tr<123;)ei[Tr]=xi,Tr++,Tr===58?Tr=65:Tr===91&&(Tr=97);ei[43]=xi;ei[45]=xi;ei[46]=xi;ei[95]=xi;ei[72]=[xi,V_];ei[104]=[xi,V_];ei[87]=[xi,G_];ei[119]=[xi,G_];function Wx(n,r,s){const o=this;let d,v;return f;function f(u){return!sh(u)||!K_.call(o,o.previous)||Th(o.events)?s(u):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),l(u))}function l(u){return sh(u)?(n.consume(u),l):u===64?(n.consume(u),c):s(u)}function c(u){return u===46?n.check(Vx,p,h)(u):u===45||u===95||$t(u)?(v=!0,n.consume(u),c):p(u)}function h(u){return n.consume(u),d=!0,c}function p(u){return v&&d&&Zt(o.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),r(u)):s(u)}}function Kx(n,r,s){const o=this;return d;function d(f){return f!==87&&f!==119||!$_.call(o,o.previous)||Th(o.events)?s(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(Gx,n.attempt(U_,n.attempt(F_,v),s),s)(f))}function v(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),r(f)}}function Yx(n,r,s){const o=this;let d="",v=!1;return f;function f(u){return(u===72||u===104)&&W_.call(o,o.previous)&&!Th(o.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),d+=String.fromCodePoint(u),n.consume(u),l):s(u)}function l(u){if(Zt(u)&&d.length<5)return d+=String.fromCodePoint(u),n.consume(u),l;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),v?h:(v=!0,c)):s(u)}function h(u){return u===null||ao(u)||ot(u)||Rr(u)||po(u)?s(u):n.attempt(U_,n.attempt(F_,p),s)(u)}function p(u){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),r(u)}}function Xx(n,r,s){let o=0;return d;function d(f){return(f===87||f===119)&&o<3?(o++,n.consume(f),d):f===46&&o===3?(n.consume(f),v):s(f)}function v(f){return f===null?s(f):r(f)}}function Qx(n,r,s){let o,d,v;return f;function f(h){return h===46||h===95?n.check(q_,c,l)(h):h===null||ot(h)||Rr(h)||h!==45&&po(h)?c(h):(v=!0,n.consume(h),f)}function l(h){return h===95?o=!0:(d=o,o=void 0),n.consume(h),f}function c(h){return d||o||!v?s(h):r(h)}}function Zx(n,r){let s=0,o=0;return d;function d(f){return f===40?(s++,n.consume(f),d):f===41&&o<s?v(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(q_,r,v)(f):f===null||ot(f)||Rr(f)?r(f):(n.consume(f),d)}function v(f){return f===41&&o++,n.consume(f),d}}function Jx(n,r,s){return o;function o(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(n.consume(l),o):l===38?(n.consume(l),v):l===93?(n.consume(l),d):l===60||l===null||ot(l)||Rr(l)?r(l):s(l)}function d(l){return l===null||l===40||l===91||ot(l)||Rr(l)?r(l):o(l)}function v(l){return Zt(l)?f(l):s(l)}function f(l){return l===59?(n.consume(l),o):Zt(l)?(n.consume(l),f):s(l)}}function eE(n,r,s){return o;function o(v){return n.consume(v),d}function d(v){return $t(v)?s(v):r(v)}}function $_(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||ot(n)}function W_(n){return!Zt(n)}function K_(n){return!(n===47||sh(n))}function sh(n){return n===43||n===45||n===46||n===95||$t(n)}function Th(n){let r=n.length,s=!1;for(;r--;){const o=n[r][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){s=!0;break}if(o._gfmAutolinkLiteralWalkedInto){s=!1;break}}return n.length>0&&!s&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const tE={tokenize:cE,partial:!0};function nE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:aE,continuation:{tokenize:lE},exit:oE}},text:{91:{name:"gfmFootnoteCall",tokenize:sE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:iE,resolveTo:rE}}}}function iE(n,r,s){const o=this;let d=o.events.length;const v=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let f;for(;d--;){const c=o.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 l;function l(c){if(!f||!f._balanced)return s(c);const h=$n(o.sliceSerialize({start:f.end,end:o.now()}));return h.codePointAt(0)!==94||!v.includes(h.slice(1))?s(c):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(c),n.exit("gfmFootnoteCallLabelMarker"),r(c))}}function rE(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 o={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 v={type:"gfmFootnoteCallString",start:Object.assign({},d.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},v.start),end:Object.assign({},v.end)},l=[n[s+1],n[s+2],["enter",o,r],n[s+3],n[s+4],["enter",d,r],["exit",d,r],["enter",v,r],["enter",f,r],["exit",f,r],["exit",v,r],n[n.length-2],n[n.length-1],["exit",o,r]];return n.splice(s,n.length-s+1,...l),n}function sE(n,r,s){const o=this,d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let v=0,f;return l;function l(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(v>999||u===93&&!f||u===null||u===91||ot(u))return s(u);if(u===93){n.exit("chunkString");const b=n.exit("gfmFootnoteCallString");return d.includes($n(o.sliceSerialize(b)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):s(u)}return ot(u)||(f=!0),v++,n.consume(u),u===92?p:h}function p(u){return u===91||u===92||u===93?(n.consume(u),v++,h):h(u)}}function aE(n,r,s){const o=this,d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let v,f=0,l;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",p):s(T)}function p(T){if(f>999||T===93&&!l||T===null||T===91||ot(T))return s(T);if(T===93){n.exit("chunkString");const x=n.exit("gfmFootnoteDefinitionLabelString");return v=$n(o.sliceSerialize(x)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),b}return ot(T)||(l=!0),f++,n.consume(T),T===92?u:p}function u(T){return T===91||T===92||T===93?(n.consume(T),f++,p):p(T)}function b(T){return T===58?(n.enter("definitionMarker"),n.consume(T),n.exit("definitionMarker"),d.includes(v)||d.push(v),Xe(n,C,"gfmFootnoteDefinitionWhitespace")):s(T)}function C(T){return r(T)}}function lE(n,r,s){return n.check(ja,r,n.attempt(tE,r,s))}function oE(n){n.exit("gfmFootnoteDefinition")}function cE(n,r,s){const o=this;return Xe(n,d,"gfmFootnoteDefinitionIndent",5);function d(v){const f=o.events[o.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(v):s(v)}}function uE(n){let s=(n||{}).singleTilde;const o={name:"strikethrough",tokenize:v,resolveAll:d};return s==null&&(s=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function d(f,l){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 p={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",p,l],["enter",f[h][1],l],["exit",f[h][1],l],["enter",u,l]],C=l.parser.constructs.insideSpan.null;C&&wn(b,b.length,0,mo(C,f.slice(h+1,c),l)),wn(b,b.length,0,[["exit",u,l],["enter",f[c][1],l],["exit",f[c][1],l],["exit",p,l]]),wn(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 v(f,l,c){const h=this.previous,p=this.events;let u=0;return b;function b(T){return h===126&&p[p.length-1][1].type!=="characterEscape"?c(T):(f.enter("strikethroughSequenceTemporary"),C(T))}function C(T){const x=bs(h);if(T===126)return u>1?c(T):(f.consume(T),u++,C);if(u<2&&!s)return c(T);const _=f.exit("strikethroughSequenceTemporary"),y=bs(T);return _._open=!y||y===2&&!!x,_._close=!x||x===2&&!!y,l(T)}}}class hE{constructor(){this.map=[]}add(r,s,o){fE(this,r,s,o)}consume(r){if(this.map.sort(function(v,f){return v[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const o=[];for(;s>0;)s-=1,o.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];o.push(r.slice()),r.length=0;let d=o.pop();for(;d;){for(const v of d)r.push(v);d=o.pop()}this.map.length=0}}function fE(n,r,s,o){let d=0;if(!(s===0&&o.length===0)){for(;d<n.map.length;){if(n.map[d][0]===r){n.map[d][1]+=s,n.map[d][2].push(...o);return}d+=1}n.map.push([r,s,o])}}function dE(n,r){let s=!1;const o=[];for(;r<n.length;){const d=n[r];if(s){if(d[0]==="enter")d[1].type==="tableContent"&&o.push(n[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(d[1].type==="tableContent"){if(n[r-1][1].type==="tableDelimiterMarker"){const v=o.length-1;o[v]=o[v]==="left"?"center":"right"}}else if(d[1].type==="tableDelimiterRow")break}else d[0]==="enter"&&d[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return o}function pE(){return{flow:{null:{name:"table",tokenize:mE,resolveAll:gE}}}}function mE(n,r,s){const o=this;let d=0,v=0,f;return l;function l(B){let I=o.events.length-1;for(;I>-1;){const W=o.events[I][1].type;if(W==="lineEnding"||W==="linePrefix")I--;else break}const F=I>-1?o.events[I][1].type:null,U=F==="tableHead"||F==="tableRow"?R:c;return U===R&&o.parser.lazy[o.now().line]?s(B):U(B)}function c(B){return n.enter("tableHead"),n.enter("tableRow"),h(B)}function h(B){return B===124||(f=!0,v+=1),p(B)}function p(B){return B===null?s(B):Oe(B)?v>1?(v=0,o.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),C):s(B):$e(B)?Xe(n,p,"whitespace")(B):(v+=1,f&&(f=!1,d+=1),B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),f=!0,p):(n.enter("data"),u(B)))}function u(B){return B===null||B===124||ot(B)?(n.exit("data"),p(B)):(n.consume(B),B===92?b:u)}function b(B){return B===92||B===124?(n.consume(B),u):u(B)}function C(B){return o.interrupt=!1,o.parser.lazy[o.now().line]?s(B):(n.enter("tableDelimiterRow"),f=!1,$e(B)?Xe(n,T,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):T(B))}function T(B){return B===45||B===58?_(B):B===124?(f=!0,n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),x):M(B)}function x(B){return $e(B)?Xe(n,_,"whitespace")(B):_(B)}function _(B){return B===58?(v+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),y):B===45?(v+=1,y(B)):B===null||Oe(B)?A(B):M(B)}function y(B){return B===45?(n.enter("tableDelimiterFiller"),m(B)):M(B)}function m(B){return B===45?(n.consume(B),m):B===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),S):(n.exit("tableDelimiterFiller"),S(B))}function S(B){return $e(B)?Xe(n,A,"whitespace")(B):A(B)}function A(B){return B===124?T(B):B===null||Oe(B)?!f||d!==v?M(B):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(B)):M(B)}function M(B){return s(B)}function R(B){return n.enter("tableRow"),D(B)}function D(B){return B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),D):B===null||Oe(B)?(n.exit("tableRow"),r(B)):$e(B)?Xe(n,D,"whitespace")(B):(n.enter("data"),E(B))}function E(B){return B===null||B===124||ot(B)?(n.exit("data"),D(B)):(n.consume(B),B===92?L:E)}function L(B){return B===92||B===124?(n.consume(B),E):E(B)}}function gE(n,r){let s=-1,o=!0,d=0,v=[0,0,0,0],f=[0,0,0,0],l=!1,c=0,h,p,u;const b=new hE;for(;++s<n.length;){const C=n[s],T=C[1];C[0]==="enter"?T.type==="tableHead"?(l=!1,c!==0&&(Cg(b,r,c,h,p),p=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"?(o=!0,u=void 0,v=[0,0,0,0],f=[0,s+1,0,0],l&&(l=!1,p={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},b.add(s,0,[["enter",p,r]])),d=T.type==="tableDelimiterRow"?2:p?3:1):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(o=!1,f[2]===0&&(v[1]!==0&&(f[0]=f[1],u=no(b,r,v,d,void 0,u),v=[0,0,0,0]),f[2]=s)):T.type==="tableCellDivider"&&(o?o=!1:(v[1]!==0&&(f[0]=f[1],u=no(b,r,v,d,void 0,u)),v=f,f=[v[1],s,0,0])):T.type==="tableHead"?(l=!0,c=s):T.type==="tableRow"||T.type==="tableDelimiterRow"?(c=s,v[1]!==0?(f[0]=f[1],u=no(b,r,v,d,s,u)):f[1]!==0&&(u=no(b,r,f,d,s,u)),d=0):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&Cg(b,r,c,h,p),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=dE(r.events,s))}return n}function no(n,r,s,o,d,v){const f=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",l="tableContent";s[0]!==0&&(v.end=Object.assign({},vs(r.events,s[0])),n.add(s[0],0,[["exit",v,r]]));const c=vs(r.events,s[1]);if(v={type:f,start:Object.assign({},c),end:Object.assign({},c)},n.add(s[1],0,[["enter",v,r]]),s[2]!==0){const h=vs(r.events,s[2]),p=vs(r.events,s[3]),u={type:l,start:Object.assign({},h),end:Object.assign({},p)};if(n.add(s[2],0,[["enter",u,r]]),o!==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,x=s[3]-s[2]-1;n.add(T,x,[])}}n.add(s[3]+1,0,[["exit",u,r]])}return d!==void 0&&(v.end=Object.assign({},vs(r.events,d)),n.add(d,0,[["exit",v,r]]),v=void 0),v}function Cg(n,r,s,o,d){const v=[],f=vs(r.events,s);d&&(d.end=Object.assign({},f),v.push(["exit",d,r])),o.end=Object.assign({},f),v.push(["exit",o,r]),n.add(s+1,0,v)}function vs(n,r){const s=n[r],o=s[0]==="enter"?"start":"end";return s[1][o]}const _E={name:"tasklistCheck",tokenize:yE};function vE(){return{text:{91:_E}}}function yE(n,r,s){const o=this;return d;function d(c){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?s(c):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),v)}function v(c){return ot(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"),l):s(c)}function l(c){return Oe(c)?r(c):$e(c)?n.check({tokenize:SE},r,s)(c):s(c)}}function SE(n,r,s){return Xe(n,o,"whitespace");function o(d){return d===null?s(d):r(d)}}function bE(n){return r_([$x(),nE(),uE(n),pE(),vE()])}const CE={};function Y_(n){const r=this,s=n||CE,o=r.data(),d=o.micromarkExtensions||(o.micromarkExtensions=[]),v=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),f=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);d.push(bE(s)),v.push(Fx()),f.push(qx(s))}const wE=500,uo=`
90
+
91
+ --- Translation ---
92
+ `;function xE({active:n=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:o,role:d,sessionId:v}){const[f,l]=ne.useState([]),[c,h]=ne.useState([]),[p,u]=ne.useState(""),[b,C]=ne.useState(!1),[T,x]=ne.useState("ready"),[_,y]=ne.useState(""),[m,S]=ne.useState(Date.now()),[A,M]=ne.useState(!1),[R,D]=ne.useState(""),[E,L]=ne.useState(0),B=ne.useRef(n),I=ne.useRef(1),F=ne.useRef(null);ne.useEffect(()=>{B.current=n},[n]),ne.useEffect(()=>{l([]),h([]),D(""),x("ready"),y(""),I.current=1;let N=!1,ie;const he=()=>{N||(ie=window.setTimeout(ge,B.current?200:1e3))},ge=async()=>{if(!N)try{const K=await ye.pollTranslationSession(v,I.current);if(N)return;X(K.events),I.current=K.nextCursor,x(K.status),B.current&&y(IE(new Date().toISOString()))}catch(K){N||D(K instanceof Error?K.message:"Translation poll failed.")}finally{he()}};return ye.startTranslationSession(o,d).then(K=>{N||(x(K.status),I.current=K.nextCursor,ge())}).catch(K=>{N||D(K instanceof Error?K.message:"Translation start failed.")}),()=>{N=!0,ie!==void 0&&window.clearTimeout(ie),ye.stopTranslationSession(v).catch(()=>{})}},[v,o,d]),ne.useEffect(()=>{if(!n)return;const N=F.current;if(!N)return;const ie=window.requestAnimationFrame(()=>{N.scrollTop=N.scrollHeight});return()=>window.cancelAnimationFrame(ie)},[n,E]);const U=ME(f);ne.useEffect(()=>{if(!U)return;S(Date.now());const N=window.setInterval(()=>S(Date.now()),250);return()=>window.clearInterval(N)},[U]);async function W(N=!1){const ie=p;M(!0),D(""),C(!1);try{const he=await ye.translateUserInput(o,d,{text:ie,mode:N?"auto-send":"review-before-send",useContext:!1,send:N});he.sent?(u(""),C(!1)):(u(X_(ie,he.englishPreview)),C(!0))}catch(he){D(he instanceof Error?he.message:"Translation failed.")}finally{M(!1)}}function X(N){if(N.length===0)return;for(const he of N)he.type==="status"?x(he.status):he.type==="error"?D(he.message):he.type==="failures"&&h(he.failures);const ie=N.filter(he=>he.type==="entry");ie.length>0&&(l(he=>{const ge=ie.reduce((q,te)=>HE(q,te.entry),he),K=OE(ge);return K.removedIds.size>0&&h(q=>q.filter(te=>!K.removedIds.has(te.translationId))),K.entries}),L(he=>he+1))}async function V(){const N=b?xg(p):p;if(N.trim()){M(!0),D("");try{await ye.sendTranslatedInput(o,d,{englishText:N}),u(""),C(!1)}catch(ie){D(ie instanceof Error?ie.message:"Failed to send English input.")}finally{M(!1)}}}function Y(N){N.key!=="Enter"||N.shiftKey||N.nativeEvent.isComposing||(N.preventDefault(),!A&&p.trim()&&(b?V():W(r)))}async function J(){l([]),h([]),I.current=1,await ye.clearTranslationSession(v).catch(N=>D(N.message))}async function z(){M(!0),D("");try{const N=await ye.ignoreTranslationFailures(v);h(N.failures)}catch(N){D(N instanceof Error?N.message:"Failed to ignore translation failures.")}finally{M(!1)}}async function j(){M(!0),D("");try{const N=await ye.retryTranslationFailures(v);h(N.failures)}catch(N){D(N instanceof Error?N.message:"Failed to retry translation failures.")}finally{M(!1)}}const H=LE(f,T,m),G=c.length;return k.jsxs("aside",{className:"translation-panel",children:[k.jsxs("header",{className:"translation-panel-header",children:[k.jsxs("div",{className:"translation-panel-titlebar",children:[k.jsx("h2",{children:"Translation"}),k.jsxs("div",{className:"translation-panel-actions",children:[G>0?k.jsxs(k.Fragment,{children:[k.jsxs("button",{type:"button",disabled:A,onClick:()=>void z(),children:["Ignore ",G]}),k.jsxs("button",{type:"button",disabled:A,onClick:()=>void j(),children:["Retry ",G]})]}):null,k.jsx("button",{type:"button",onClick:()=>void J(),children:"Clear"})]})]}),k.jsxs("div",{className:"translation-status-row",children:[k.jsxs("p",{children:["Claude Code · target ",EE(s)," · ",H]}),k.jsx("p",{children:_?`poll ${_}`:"poll -"})]})]}),R?k.jsx("div",{className:"error-banner",children:R}):null,k.jsxs("div",{className:"translation-entry-list",ref:F,children:[f.length===0?k.jsx("p",{className:"muted",children:"Translated Claude Code output will appear here."}):null,f.map(N=>k.jsx(RE,{entry:N},N.id))]}),k.jsx("div",{className:"translation-composer",children:k.jsxs("div",{className:"translation-composer-row",children:[k.jsx("textarea",{value:p,onChange:N=>{u(N.target.value),(!N.target.value.trim()||b&&!NE(N.target.value))&&C(!1)},onKeyDown:Y,placeholder:"输入中文,先翻译成英文工程指令..."}),k.jsx("div",{className:"translation-composer-actions",children:k.jsx("button",{type:"button",disabled:A||!b||!xg(p).trim(),onClick:()=>void V(),children:"Send English"})})]})})]})}function EE(n){var r;return((r=Ig.find(s=>s.value===n))==null?void 0:r.label)??n}function kE({open:n,taskSlug:r,targetLanguage:s,onClose:o}){const[d,v]=ne.useState(!1),[f,l]=ne.useState(""),[c,h]=ne.useState(null),[p,u]=ne.useState(""),[b,C]=ne.useState(""),[T,x]=ne.useState(""),[_,y]=ne.useState(!1),[m,S]=ne.useState(null),[A,M]=ne.useState(""),[R,D]=ne.useState(""),[E,L]=ne.useState(""),[B,I]=ne.useState(!1);ne.useEffect(()=>{if(!n)return;let Y=!1,J;const z=async()=>{Y||(await F(!0),Y||(J=window.setTimeout(z,2e3)))};return z(),()=>{Y=!0,J!==void 0&&window.clearTimeout(J)}},[n,p]);async function F(Y=!1){try{const J=await ye.getTranslationState();h(J);const z=p?J.fileIndex.jobs.some(j=>j.id===p):!1;if((!p||!z)&&J.fileIndex.jobs[0])U(J.fileIndex.jobs[0].id);else if(!J.fileIndex.jobs[0])u(""),C(""),x("");else if(Y&&p){const j=await ye.readFileTranslation(p);C(j.output),x(j.report)}}catch(J){l(J instanceof Error?J.message:"Failed to load file translations.")}}async function U(Y){u(Y),C(""),x("");try{const J=await ye.readFileTranslation(Y);C(J.output),x(J.report)}catch(J){l(J instanceof Error?J.message:"Failed to read translated file.")}}async function W(){y(!0),await X(A,R)}async function X(Y="",J=""){I(!0),l("");try{const z=await ye.browseTranslationSourceFiles({path:Y,query:J,limit:250});S(z),M(z.currentPath),D(J)}catch(z){l(z instanceof Error?z.message:"Failed to browse source files.")}finally{I(!1)}}async function V(Y=E){const J=Y.trim();if(J){v(!0),l("");try{if(!r)throw new Error("Create or select a task before translating files.");const z=await ye.createFileTranslation({taskSlug:r,sourcePath:J,targetLanguage:s});y(!1),await F(),await U(z.id)}catch(z){l(z instanceof Error?z.message:"Failed to create file translation.")}finally{v(!1)}}}return n?k.jsxs(k.Fragment,{children:[k.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:k.jsx(TE,{busy:d,error:f,state:c,selectedJobId:p,output:b,report:T,onClose:()=>{y(!1),o()},onRefresh:()=>void F(),onSelectJob:Y=>void U(Y),onTranslate:()=>void W()})}),_?k.jsx(AE,{busy:d||B,state:m,currentPath:A,query:R,selectedPath:E,onBrowse:(Y,J)=>void X(Y,J),onClose:()=>y(!1),onQueryChange:D,onSelectPath:L,onTranslate:()=>void V()}):null]}):null}function AE({busy:n,state:r,currentPath:s,query:o,selectedPath:d,onBrowse:v,onClose:f,onQueryChange:l,onSelectPath:c,onTranslate:h}){const p=(r==null?void 0:r.entries)??[],u=p.filter(C=>C.type==="directory"),b=p.filter(C=>C.type==="file");return k.jsx("div",{className:"modal-backdrop translation-file-browser-backdrop",children:k.jsxs("section",{className:"translation-file-browser-modal",role:"dialog","aria-modal":"true","aria-label":"Select Source File",children:[k.jsxs("header",{children:[k.jsxs("div",{children:[k.jsx("h2",{children:"Select Source File"}),k.jsx("p",{children:s||"."})]}),k.jsx("button",{type:"button",onClick:f,children:"Close"})]}),k.jsxs("div",{className:"translation-file-browser-controls",children:[k.jsxs("div",{className:"translation-file-browser-nav",children:[k.jsx("button",{type:"button",disabled:n||!s,onClick:()=>v((r==null?void 0:r.parentPath)??"",""),children:"Up"}),k.jsx("button",{type:"button",disabled:n||!s,onClick:()=>v("",""),children:"Root"})]}),k.jsxs("form",{className:"translation-file-browser-search",onSubmit:C=>{C.preventDefault(),v(s,o)},children:[k.jsx("input",{value:o,onChange:C=>l(C.target.value),placeholder:"Search files"}),k.jsx("button",{type:"submit",disabled:n,children:"Search"}),k.jsx("button",{type:"button",disabled:n||!o,onClick:()=>v(s,""),children:"Clear"})]})]}),k.jsxs("div",{className:"translation-file-browser-layout",children:[k.jsxs("div",{className:"translation-file-browser-list",children:[n&&!r?k.jsx("p",{className:"muted",children:"Loading files..."}):null,!n&&p.length===0?k.jsx("p",{className:"muted",children:"No source files found."}):null,u.length>0?k.jsxs("div",{className:"translation-file-browser-group",children:[k.jsx("h3",{children:"Folders"}),u.map(C=>k.jsx(wg,{entry:C,selected:d===C.path,onBrowse:v,onSelectPath:c},C.path))]}):null,b.length>0?k.jsxs("div",{className:"translation-file-browser-group",children:[k.jsx("h3",{children:"Files"}),b.map(C=>k.jsx(wg,{entry:C,selected:d===C.path,onBrowse:v,onSelectPath:c},C.path))]}):null,r!=null&&r.truncated?k.jsx("p",{className:"translation-entry-note",children:"Result limit reached."}):null]}),k.jsxs("aside",{className:"translation-file-browser-selection",children:[k.jsxs("label",{children:[k.jsx("span",{children:"Source path"}),k.jsx("input",{value:d,onChange:C=>c(C.target.value)})]}),k.jsx("button",{type:"button",disabled:n||!d.trim(),onClick:h,children:"Translate File"})]})]})]})})}function wg({entry:n,selected:r,onBrowse:s,onSelectPath:o}){const d=n.type==="directory";return k.jsxs("button",{className:r?"translation-file-browser-entry is-selected":"translation-file-browser-entry",type:"button",onClick:()=>d?s(n.path,""):o(n.path),onDoubleClick:()=>d?s(n.path,""):void 0,children:[k.jsx("span",{children:d?"DIR":"FILE"}),k.jsx("strong",{children:n.name}),k.jsx("small",{children:n.path})]})}function TE({busy:n,error:r,state:s,selectedJobId:o,output:d,report:v,onClose:f,onRefresh:l,onSelectJob:c,onTranslate:h}){const p=(s==null?void 0:s.fileIndex.jobs)??[],u=p.find(b=>b.id===o);return k.jsxs("section",{className:"file-translation-modal",role:"dialog","aria-modal":"true","aria-label":"File Translation",children:[k.jsxs("header",{className:"file-translation-header",children:[k.jsxs("div",{children:[k.jsx("h2",{children:"File Translation"}),k.jsx("p",{children:"Claude Code · 中英互译"})]}),k.jsxs("div",{className:"file-translation-toolbar",children:[k.jsx("button",{type:"button",disabled:n,onClick:h,children:"Translate"}),k.jsx("button",{type:"button",disabled:n,onClick:l,children:"Refresh"}),k.jsx("button",{type:"button",onClick:f,children:"Close"})]})]}),r?k.jsx("div",{className:"error-banner",children:r}):null,s!=null&&s.memoryInitialized?null:k.jsx("p",{className:"translation-entry-note",children:"Translation memory is not initialized. Run Bootstrap from the sidebar before important file translations."}),k.jsxs("div",{className:"file-translation-layout",children:[k.jsxs("div",{className:"file-translation-list",children:[p.length===0?k.jsx("p",{className:"muted",children:"No translated files yet."}):null,p.map(b=>k.jsxs("button",{className:b.id===o?"file-translation-item is-active":"file-translation-item",type:"button",onClick:()=>c(b.id),children:[k.jsx("strong",{children:b.sourcePath}),k.jsxs("span",{children:[b.status," · ",b.targetLanguage]})]},b.id))]}),k.jsx("div",{className:"file-translation-preview",children:u?k.jsxs(k.Fragment,{children:[k.jsxs("header",{children:[k.jsx("strong",{children:u.sourcePath}),k.jsx("span",{children:u.status})]}),k.jsx("div",{className:"translation-markdown",children:k.jsx(E_,{remarkPlugins:[Y_],children:d||v||"Translation output is not available yet."})})]}):k.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function RE({entry:n}){if(n.sourceKind==="conversation-boundary")return k.jsx(DE,{entry:n});const r=jE(n),s=n.sourceKind==="tool-output",o=n.direction==="user-input-to-english",d=["translation-entry",`is-${n.sourceKind}`,o?"is-user-input":""].filter(Boolean).join(" ");return k.jsxs("article",{className:d,children:[s?k.jsx("pre",{children:r}):k.jsx("div",{className:"translation-markdown",children:k.jsx(E_,{remarkPlugins:[Y_],children:r})}),n.warning?k.jsx("p",{className:"translation-entry-note",children:n.warning}):null,n.error?k.jsx("p",{className:"translation-entry-note is-error",children:n.error}):null]})}function DE({entry:n}){const r=n.boundaryKind==="end"?"结束":"开始",s=n.conversationTurn??0,o=PE(n.occurredAt??n.createdAt);return k.jsxs("div",{className:"translation-conversation-boundary","aria-label":`${r} 第 ${s} 轮 ${o}`,children:[k.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"}),k.jsx("span",{children:r}),k.jsxs("span",{children:["第 ",s," 轮"]}),k.jsx("time",{children:o}),k.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"})]})}function ME(n){const r=n.find(Rh);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function LE(n,r,s){const o=n.find(Rh);if(o)return`translating ${zE(Math.max(0,s-BE(o)))}`;const d=n.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function Rh(n){return n.status==="queued"||n.status==="translating"}function OE(n){const r=n.length-wE;if(r<=0)return{entries:n,removedIds:new Set};const s=new Set;for(const o of n){if(s.size>=r)break;Rh(o)||s.add(o.id)}return s.size===0?{entries:n,removedIds:s}:{entries:n.filter(o=>!s.has(o.id)),removedIds:s}}function BE(n){const r=Date.parse(n.translationStartedAt??n.createdAt);return Number.isFinite(r)?r:Date.now()}function jE(n){return n.status==="queued"||n.status==="translating"?n.sourceText:n.status==="translated"?n.direction==="user-input-to-english"?X_(n.sourceText,n.translatedText):n.translatedText:n.translatedText||n.sourceText}function X_(n,r){return`${n.trimEnd()}${uo}${r.trimStart()}`}function NE(n){return n.includes(uo)}function xg(n){const r=n.indexOf(uo);return r===-1?n:n.slice(r+uo.length)}function HE(n,r){return n.findIndex(o=>o.id===r.id)===-1?[...n,r]:n.map(o=>o.id===r.id?r:o)}function zE(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),o=Math.floor(r%60).toString().padStart(2,"0");return`${s}:${o}`}function IE(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}function PE(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}function UE(n,r){return n.find(s=>s.taskSlug===r)??n[0]??null}function FE(n,r){const s=Ss.map(o=>({role:o.name,permissionMode:n.roles[o.name].permissionMode,model:n.roles[o.name].model,effort:n.roles[o.name].effort}));if(r.gateReviewerEnabled){const o=n.roles["gate-reviewer"];s.push({role:"gate-reviewer",permissionMode:o.permissionMode,model:o.model,effort:o.effort})}return s}const qE=["architecture-plan","validation-adequacy","final-diff"];function GE({events:n,maxEvents:r=8,showHeader:s=!0}){const o=r===null?n:n.slice(-r);return k.jsxs("section",{className:"event-log",children:[s?k.jsx("h2",{children:"Events"}):null,n.length===0?k.jsx("p",{className:"muted",children:"No terminal events yet."}):k.jsx("ol",{children:o.map((d,v)=>k.jsx("li",{children:d},`${d}-${v}`))})]})}function VE({status:n,bootstrapStatus:r,applyResult:s,hasActiveTask:o=!1,busy:d=!1,onRefresh:v,onApply:f,onOpenStudio:l,onOpenRepositoryDiff:c,onStartBootstrap:h,onRestartBootstrap:p,onStopBootstrap:u,onRunBootstrap:b}){const[C,T]=ne.useState(!1),[x,_]=ne.useState("bypassPermissions"),[y,m]=ne.useState("default"),[S,A]=ne.useState("default"),M=r==null?void 0:r.session,R=(r==null?void 0:r.status)==="running",D=(M==null?void 0:M.status)==="running",E=(r==null?void 0:r.status)!=="complete",L={permissionMode:x,model:y,effort:S};return o?n?k.jsxs("section",{className:"harness-panel",children:[k.jsxs("div",{className:"harness-stage",children:[k.jsxs("div",{className:"harness-panel-header",children:[k.jsxs("div",{children:[k.jsx("strong",{children:"Fixed install"}),k.jsx("p",{className:"muted",children:n.initialized?n.needsApply?`${n.plannedChanges.length} pending updates`:"Up to date":"Not initialized"})]}),k.jsx("div",{className:"harness-actions",children:n.initialized?k.jsxs(k.Fragment,{children:[k.jsx("button",{type:"button",disabled:d,onClick:()=>void v(),children:"Refresh"}),n.needsApply?k.jsx("button",{type:"button",disabled:d,onClick:()=>void f(),children:"Update"}):null]}):k.jsx("button",{type:"button",disabled:d,onClick:()=>void f(),children:"Initialize"})})]}),n.initialized&&n.needsApply?k.jsxs(k.Fragment,{children:[k.jsx("h3",{className:"harness-file-list-title",children:"Files to update"}),k.jsx("ol",{className:"harness-file-list",children:n.plannedChanges.map(B=>k.jsxs("li",{children:[k.jsx("span",{children:B.path}),k.jsx(wi,{status:B.action})]},`${B.path}:${B.action}`))})]}):null]}),k.jsxs("div",{className:"harness-stage",children:[k.jsxs("div",{className:"harness-panel-header",children:[k.jsx("div",{children:k.jsx("strong",{children:"Harness Studio"})}),k.jsx("div",{className:"harness-actions",children:k.jsx("button",{type:"button",disabled:d,onClick:l,children:"Open Studio"})})]}),k.jsx("button",{className:"harness-review-diff-button",type:"button",disabled:d,onClick:c,children:"Review Diff"})]}),E?k.jsx("div",{className:"harness-stage",children:k.jsxs("div",{className:"harness-panel-header",children:[k.jsxs("div",{children:[k.jsx("strong",{children:"Bootstrap"}),k.jsx("p",{className:"muted",children:r?$E(r.status):"not loaded"})]}),k.jsx("div",{className:"harness-actions",children:k.jsx("button",{type:"button",disabled:d||!(r!=null&&r.canStart),onClick:()=>{T(!0)},children:"Open Bootstrap"})})]})}):null,s!=null&&s.changedFiles.length?k.jsx("div",{className:"harness-result",children:k.jsx("p",{className:"muted",children:s.message})}):null,n.warnings.length>0?k.jsx("ul",{className:"warnings",children:n.warnings.map(B=>k.jsx("li",{children:B},B))}):null,r!=null&&r.warnings.length?k.jsx("ul",{className:"warnings",children:r.warnings.map(B=>k.jsx("li",{children:B},B))}):null,E&&C?k.jsx("div",{className:"harness-bootstrap-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Engineer bootstrap session",children:k.jsxs("div",{className:"harness-bootstrap-modal-surface",children:[k.jsxs("header",{className:"harness-bootstrap-modal-header",children:[k.jsxs("div",{children:[k.jsx("strong",{children:"Harness Engineer Bootstrap"}),k.jsx("p",{className:"muted",children:(M==null?void 0:M.command)??"Start Harness Engineer, then run bootstrap when ready."})]}),k.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[M?k.jsx(wi,{status:M.status}):null,k.jsx("button",{type:"button",onClick:()=>T(!1),children:"Close"})]})]}),k.jsxs("div",{className:"harness-bootstrap-controls",children:[k.jsxs("label",{children:[k.jsx("span",{children:"Permission"}),k.jsx("select",{value:x,disabled:d||R||D,onChange:B=>_(B.target.value),children:Ug.map(B=>k.jsx("option",{value:B.value,children:B.label},B.value))})]}),k.jsxs("label",{children:[k.jsx("span",{children:"Model"}),k.jsx("select",{value:y,disabled:d||R||D,onChange:B=>m(B.target.value),children:Fg.map(B=>k.jsx("option",{value:B.value,children:B.label},B.value))})]}),k.jsxs("label",{children:[k.jsx("span",{children:"Effort"}),k.jsx("select",{value:S,disabled:d||R||D,onChange:B=>A(B.target.value),children:qg.map(B=>k.jsx("option",{value:B.value,children:B.label},B.value))})]}),k.jsxs("div",{className:"harness-bootstrap-control-actions",children:[k.jsx("button",{type:"button",disabled:d||R||!(r!=null&&r.canStart),onClick:()=>void h(L),children:"Start"}),k.jsx("button",{type:"button",disabled:d||R||!(r!=null&&r.canStart),onClick:()=>void p(L),children:"Restart"}),k.jsx("button",{type:"button",disabled:d||!M,onClick:()=>void u(),children:"Stop"}),k.jsx("button",{type:"button",disabled:d||R||!D,onClick:()=>void b(),children:"Run bootstrap"})]})]}),k.jsx("div",{className:"harness-bootstrap-terminal",children:D?k.jsx(fo,{sessionId:M.id,active:C}):k.jsxs("div",{className:"terminal-empty",children:[k.jsx("strong",{children:"Harness Bootstrap"}),k.jsx("span",{children:"Start Harness Engineer first. When it is ready, click Run bootstrap to send the prompt."})]})})]})}):null]}):null:k.jsx("section",{className:"harness-panel",children:k.jsxs("div",{className:"harness-result",children:[k.jsx("strong",{children:"Task required"}),k.jsx("p",{className:"muted",children:"Create or select a task before changing VCM Harness. Harness changes are committed in the active task worktree."})]})})}function $E(n){return n.replaceAll("_"," ")}function rr({checked:n,className:r,disabled:s,label:o,stateLabel:d,title:v,onChange:f}){const l=["switch-control",n?"is-on":"is-off",r].filter(Boolean).join(" "),c=d??(n?"on":"off");return k.jsxs("button",{type:"button",role:"switch","aria-checked":n,"aria-label":`${o}: ${c}`,className:l,disabled:s,title:v,onClick:()=>f(!n),children:[k.jsx("span",{className:"switch-control-label",children:o}),k.jsx("span",{className:"switch-control-state",children:c}),k.jsx("span",{className:"switch-control-track","aria-hidden":"true",children:k.jsx("span",{className:"switch-control-thumb"})})]})}function Dh(n){return{total:n.length,accepted:n.filter(r=>r.acceptedAt).length,delivered:n.filter(r=>r.deliveredAt).length}}function WE(n,r=6){const s=[...n].sort(XE).map((d,v)=>({message:d,sequence:v+1}));return[...r===null?s:s.slice(-r)].sort((d,v)=>v.sequence-d.sequence)}function KE({messages:n,orchestration:r,busy:s,maxMessages:o=6,showControls:d=!0,showHeader:v=!0,onModeChange:f,onMarkAllDone:l}){const[c,h]=ne.useState(null),p=Dh(n),u=(r==null?void 0:r.mode)??"auto",b=WE(n,o);async function C(T){await QE(T.body),h(T.id),window.setTimeout(()=>h(x=>x===T.id?null:x),1200)}return k.jsxs("section",{className:"message-panel",children:[v?k.jsxs("div",{className:"message-panel-header",children:[k.jsxs("div",{children:[k.jsx("h2",{children:"Messages"}),k.jsxs("p",{className:"muted",children:[p.total," total / ",p.accepted," accepted"]})]}),d&&f?k.jsx("div",{className:"message-controls",children:k.jsx(rr,{checked:u==="auto",className:"message-mode-toggle",disabled:s,label:"Auto orchestration",onChange:T=>f(T?"auto":"manual")})}):null,d&&l?k.jsx("button",{type:"button",disabled:s,onClick:l,children:"Mark All Done"}):null]}):null,n.length===0?k.jsx("p",{className:"muted",children:"No role messages yet."}):k.jsx("ol",{className:"message-list",children:b.map(({message:T,sequence:x})=>k.jsxs("li",{className:"message-item",children:[k.jsxs("div",{className:"message-item-main",children:[k.jsxs("div",{className:"message-meta",children:[k.jsxs("span",{className:"message-sequence",children:["#",x]}),k.jsx("time",{dateTime:ho(T),children:YE(ho(T))}),k.jsxs("strong",{children:[T.fromRole," ","->"," ",T.toRole]}),k.jsx("span",{children:T.type})]}),k.jsx("p",{children:T.body}),T.failureReason?k.jsx("span",{className:"message-reason",children:T.failureReason}):null,T.bodyPath?k.jsx("span",{className:"message-path",children:T.bodyPath}):null]}),k.jsx("div",{className:"message-actions",children:k.jsx("button",{type:"button",disabled:s,onClick:()=>void C(T),children:c===T.id?"Copied":"Copy"})})]},T.id))})]})}function YE(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 ho(n){return n.acceptedAt??n.deliveredAt??n.dispatchingAt??n.createdAt}function XE(n,r){const s=ho(n).localeCompare(ho(r));if(s!==0)return s;const o=n.createdAt.localeCompare(r.createdAt);return o!==0?o:n.id.localeCompare(r.id)}async function QE(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 ZE({defaultPath:n="",recentPaths:r=[],busy:s=!1,onConnect:o}){const[d,v]=ne.useState(n);ne.useEffect(()=>{n&&v(n)},[n]);async function f(l){l.preventDefault(),await o(d)}return k.jsx("form",{className:"repo-connect",onSubmit:f,children:k.jsxs("div",{className:r.length>0?"inline-form has-recent-paths":"inline-form",children:[k.jsx("input",{"aria-label":"Repository path",id:"repo-path",value:d,onChange:l=>v(l.target.value),placeholder:"/path/to/repo"}),r.length>0?k.jsxs("select",{"aria-label":"Recent repositories",className:"repo-recent-select",value:"",onChange:l=>{l.target.value&&v(l.target.value)},children:[k.jsx("option",{value:"",children:"Recent"}),r.map(l=>k.jsx("option",{value:l,children:l},l))]}):null,k.jsx("button",{type:"submit",disabled:s||!d.trim(),children:"Connect"})]})})}function JE({tasks:n,activeTaskSlug:r,onSelect:s}){return k.jsx("nav",{className:"task-nav","aria-label":"Tasks",children:n.map(o=>k.jsxs("button",{className:o.taskSlug===r?"task-nav-item is-active":"task-nav-item",type:"button",onClick:()=>s(o.taskSlug),children:[k.jsx("span",{children:o.title||o.taskSlug}),k.jsx(wi,{status:o.status})]},o.taskSlug))})}function e2({project:n,recentRepositoryPaths:r,tasks:s,activeTaskSlug:o,messages:d,orchestration:v,events:f,roundState:l,gateReview:c,translationEnabled:h,translationAutoSendEnabled:p,translationTargetLanguage:u,translationOutputMode:b,translationMemoryInitialized:C,translatorSession:T,harnessStatus:x,harnessBootstrapStatus:_,harnessApplyResult:y,gatewayStatus:m,gatewayQrLogin:S,gatewayQrCheck:A,busy:M,onConnect:R,onRefreshConnectedRepository:D,onPullConnectedRepository:E,onRefreshHarness:L,onApplyHarness:B,onStartHarnessBootstrap:I,onRestartHarnessBootstrap:F,onStopHarnessBootstrap:U,onRunHarnessBootstrap:W,onOpenHarnessStudio:X,onOpenRepositoryDiff:V,onRefreshGateway:Y,onGatewayEnabledChange:J,onGatewayTranslationChange:z,onStartGatewayQrLogin:j,onResetGatewayBinding:H,onGateReviewGateEnabledChange:G,onTranslationEnabledChange:N,onTranslationAutoSendChange:ie,onTranslationTargetLanguageChange:he,onTranslationOutputModeChange:ge,onOpenFileTranslation:K,onOpenTranslatorSession:q,onCreateTranslationBootstrap:te,onUpdateTranslationMemory:le,onCreateTask:xe,onSelectTask:Ee,themeMode:Ce,onThemeModeChange:me,flowPauseAlerts:Te,onFlowPauseAlertsChange:He,permissionRequestMode:ke,onPermissionRequestModeChange:Jt,launchTemplate:Nt,canSaveLaunchTemplate:Kt,canOneClickStart:en,onSaveLaunchTemplate:xn,onOneClickStart:bt,onTryFlowPauseAlert:dt,onMarkAllMessagesDone:Bt,onDeleteMessageHistory:fe}){const[Se,pe]=ne.useState(""),[Me,Ne]=ne.useState(!1),[pt,Ue]=ne.useState(!1),[Je,at]=ne.useState(()=>o?null:"repository-path"),xt=Dh(d),we=Se.trim(),Et=r2(n,o,x),kt=s.find(ze=>ze.taskSlug===o)??null;ne.useEffect(()=>{at(ze=>o&&ze==="repository-path"?null:!o&&ze===null?"repository-path":ze)},[o]);function Yt(ze,zn){at(zn?ze:null)}async function Hn(ze){ze.preventDefault(),await xe({taskSlug:we}),pe("")}return k.jsxs("div",{className:"project-dashboard",children:[k.jsx("header",{className:"brand-header",children:k.jsx("strong",{children:"VibeCodingMaster"})}),k.jsx(Ci,{title:"Repository Path",open:Je==="repository-path",onOpenChange:ze=>Yt("repository-path",ze),children:k.jsx(ZE,{defaultPath:(n==null?void 0:n.repoRoot)??"",recentPaths:r,busy:M,onConnect:R})}),n?k.jsx(Ci,{title:"Connected Repository",open:Je==="connected-repository",onOpenChange:ze=>{Yt("connected-repository",ze),ze&&D()},children:k.jsx(o2,{busy:M,project:n,onPull:E})}):null,k.jsx(Ci,{title:"Settings",open:Je==="settings",onOpenChange:ze=>Yt("settings",ze),children:k.jsxs("div",{className:"sidebar-settings",children:[k.jsxs("button",{"aria-label":`Theme mode: ${kg(Ce)}`,className:"settings-toggle theme-mode-toggle",disabled:M,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>me(d2(Ce)),children:[k.jsx("span",{children:"Theme"}),k.jsx("span",{children:kg(Ce)})]}),k.jsx(rr,{checked:!(m!=null&&m.enabled)&&Te,className:"sidebar-switch",disabled:M||(m==null?void 0:m.enabled),label:"Flow pause alert",stateLabel:m!=null&&m.enabled?"off":Te?"on":"off",title:m!=null&&m.enabled?"Disabled while Gateway is on":void 0,onChange:ze=>He(ze)}),k.jsxs("button",{className:"settings-toggle",disabled:M||(m==null?void 0:m.enabled),title:m!=null&&m.enabled?"Disabled while Gateway is on":void 0,type:"button",onClick:dt,children:[k.jsx("span",{children:"Try alert"}),k.jsx("span",{children:"test"})]}),k.jsxs("label",{className:"settings-select-row",children:[k.jsx("span",{children:"Permission requests"}),k.jsxs("select",{value:ke,disabled:M,onChange:ze=>Jt(ze.target.value),children:[k.jsx("option",{value:"off",children:"off"}),k.jsx("option",{value:"allowAll",children:"allow all"})]})]}),k.jsxs("button",{className:"settings-toggle",disabled:M||!Kt,title:"Save the current core role launch settings and optional Gate Reviewer settings",type:"button",onClick:xn,children:[k.jsx("span",{children:"Save launch template"}),k.jsx("span",{children:Kt?"ready":"open task"})]}),en?k.jsxs("button",{className:"settings-toggle is-active",disabled:M,title:t2(Nt),type:"button",onClick:bt,children:[k.jsx("span",{children:"One-click start"}),k.jsx("span",{children:Q_(Nt)})]}):null,o?k.jsxs(k.Fragment,{children:[k.jsxs("button",{type:"button",onClick:()=>Ne(!0),children:[k.jsx("span",{children:"Messages"}),k.jsxs("span",{className:"muted",children:[xt.total," total"]})]}),k.jsxs("button",{type:"button",onClick:()=>Ue(!0),children:[k.jsx("span",{children:"Events"}),k.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),k.jsx(Ci,{title:"Translation",open:Je==="translation",onOpenChange:ze=>Yt("translation",ze),children:k.jsx(n2,{busy:M,enabled:h,autoSendEnabled:p,targetLanguage:u,outputMode:b,memoryInitialized:C,baseUnavailableReason:Et,translatorSession:T,onAutoSendChange:ie,onCreateBootstrap:te,onEnabledChange:N,onUpdateMemory:le,onTargetLanguageChange:he,onOutputModeChange:ge,onOpenFileTranslation:K,onOpenTranslatorSession:q})}),n&&o?k.jsx(Ci,{title:"Gate Review Gates",open:Je==="gate-review-gates",onOpenChange:ze=>Yt("gate-review-gates",ze),children:k.jsx(s2,{busy:M,state:c,onGateEnabledChange:G})}):null,k.jsx(Ci,{title:"Gateway",open:Je==="gateway",onOpenChange:ze=>{Yt("gateway",ze),ze&&Y()},children:k.jsx(l2,{busy:M,qrCheck:A,qrLogin:S,status:m,onEnabledChange:J,onResetBinding:H,onStartQrLogin:j,onTranslationChange:z})}),n?k.jsx(Ci,{title:"VCM Harness",open:Je==="vcm-harness",onOpenChange:ze=>Yt("vcm-harness",ze),children:k.jsx(VE,{status:x,bootstrapStatus:_,applyResult:y,hasActiveTask:!!kt,busy:M,onRefresh:L,onApply:B,onOpenStudio:X,onOpenRepositoryDiff:V,onStartBootstrap:I,onRestartBootstrap:F,onStopBootstrap:U,onRunBootstrap:W})}):null,n?k.jsx(Ci,{title:"New Task",open:Je==="new-task",onOpenChange:ze=>Yt("new-task",ze),children:k.jsx("div",{className:"task-create",children:k.jsxs("form",{onSubmit:Hn,children:[k.jsx("input",{value:Se,onChange:ze=>pe(ze.target.value),placeholder:"task name"}),k.jsxs("div",{className:"task-create-preview",children:[k.jsxs("small",{children:["branch: ",we?`feature/${we}`:"feature/<task>"]}),k.jsxs("small",{children:["worktree: ",we?`.claude/worktrees/${we}`:".claude/worktrees/<task>"]})]}),k.jsx("button",{type:"submit",disabled:M||!we,children:"Create"})]})})}):null,s.length>0?k.jsx(Ci,{title:"Tasks",open:Je==="tasks",onOpenChange:ze=>Yt("tasks",ze),children:k.jsx(JE,{tasks:s,activeTaskSlug:o,onSelect:Ee})}):null,n&&kt?k.jsx(h2,{task:kt,roundState:l}):null,Me?k.jsx(m2,{busy:M,messages:d,orchestration:v,onClose:()=>Ne(!1),onMarkAllDone:()=>{o&&Bt(o)},onDeleteMessageHistory:()=>{o&&fe(o)}}):null,pt?k.jsx(p2,{events:f,onClose:()=>Ue(!1)}):null]})}function Q_(n){return[n.autoOrchestration?"auto":"manual"].join(" + ")}function t2(n){const r=Object.entries(n.roles).map(([s,o])=>`${s}: ${o.permissionMode} / ${o.model} / ${o.effort}`).join("; ");return`Launch template: ${Q_(n)}; ${r}`}function n2({autoSendEnabled:n,baseUnavailableReason:r,busy:s,enabled:o,memoryInitialized:d,outputMode:v,targetLanguage:f,translatorSession:l,onAutoSendChange:c,onCreateBootstrap:h,onEnabledChange:p,onUpdateMemory:u,onOutputModeChange:b,onTargetLanguageChange:C,onOpenFileTranslation:T,onOpenTranslatorSession:x}){const _=!!(s||r),y=(l==null?void 0:l.status)==="running",m=!!(o&&!r&&y),S=r??(y?null:"Start Translator session first."),A=!!(s||S),R=r??"Open Translator session",D=S??"Translation tools are ready";return k.jsxs("div",{className:"sidebar-settings",children:[k.jsx(rr,{checked:m,className:"sidebar-switch",disabled:_||!y,label:"Conversation translation",title:D,onChange:p}),k.jsx(rr,{checked:n,className:"sidebar-switch",disabled:_,label:"Auto-send",onChange:c}),k.jsxs("label",{className:"settings-select-row",children:[k.jsx("span",{children:"Language"}),k.jsx("select",{value:f,disabled:_,onChange:E=>C(E.target.value),children:Ig.map(E=>k.jsx("option",{value:E.value,children:E.label},E.value))})]}),k.jsxs("label",{className:"settings-select-row",children:[k.jsx("span",{children:"Reply scope"}),k.jsx("select",{value:v,disabled:_,onChange:E=>b(E.target.value),children:M1.map(E=>k.jsx("option",{value:E.value,children:E.label},E.value))})]}),k.jsxs("button",{className:"settings-toggle",disabled:A,title:D,type:"button",onClick:T,children:[k.jsx("span",{children:"File translation"}),k.jsx("span",{children:"open"})]}),d?null:k.jsxs("button",{className:"settings-toggle",disabled:A,title:D,type:"button",onClick:h,children:[k.jsx("span",{children:"Bootstrap"}),k.jsx("span",{children:"run"})]}),k.jsxs("button",{className:"settings-toggle",disabled:A,title:D,type:"button",onClick:u,children:[k.jsx("span",{children:"Update memory"}),k.jsx("span",{children:"run"})]}),S?k.jsx("p",{className:"settings-help-text",children:S}):null,k.jsxs("div",{className:"settings-status-row",children:[k.jsx("span",{children:"Session status"}),k.jsx("strong",{children:i2(l)})]}),k.jsxs("button",{className:"settings-toggle",disabled:_,title:R,type:"button",onClick:x,children:[k.jsx("span",{children:"Open Session"}),k.jsx("span",{children:"open"})]})]})}function i2(n){return n?n.status==="running"?n.activityStatus??"idle":n.status:"not started"}function r2(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 s2({busy:n,onGateEnabledChange:r,state:s}){return k.jsx("div",{className:"sidebar-settings",children:qE.map(o=>{const d=s==null?void 0:s.gates[o],v=!!(d!=null&&d.required);return k.jsx(rr,{checked:v,className:"sidebar-switch",disabled:n||!s,label:a2(o),title:d!=null&&d.status?`status: ${d.status}`:void 0,onChange:f=>r(o,f)},o)})})}function a2(n){switch(n){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"final-diff":return"Final diff"}return n}function l2({busy:n,onEnabledChange:r,onResetBinding:s,onStartQrLogin:o,onTranslationChange:d,qrCheck:v,qrLogin:f,status:l}){const c=!!(l!=null&&l.binding.tokenConfigured),h=!!(l!=null&&l.binding.tokenConfigured);return k.jsxs("div",{className:"gateway-panel",children:[k.jsxs("div",{className:"gateway-actions",children:[k.jsx(rr,{checked:!!(l!=null&&l.enabled),className:"sidebar-switch",disabled:n||!l||!l.enabled&&!c,label:"Gateway",title:c?"Enable or disable PM messages and task-changing Gateway commands":"Scan and confirm iLink login first",onChange:p=>r(p)}),k.jsx(rr,{checked:!!(l!=null&&l.translationEnabled),className:"sidebar-switch",disabled:n||!l,label:"Translation",onChange:p=>d(p)}),h?k.jsx("button",{className:"danger-button",type:"button",disabled:n,onClick:s,children:"Reset Binding"}):k.jsx("button",{type:"button",disabled:n,onClick:o,children:"Start QR Login"})]}),f?k.jsx("p",{className:"muted",children:"QR login started. Use the login dialog to confirm binding."}):null,v?k.jsxs("p",{className:"muted",children:["QR status: ",v.status,v.message?` · ${v.message}`:""]}):null]})}function o2({busy:n,onPull:r,project:s}){const o=s.pullDisabledReason,d=!!s.canPull;return k.jsxs("div",{className:"project-summary",children:[k.jsxs("dl",{children:[k.jsxs("div",{children:[k.jsx("dt",{children:"Base path"}),k.jsx("dd",{children:s.repoRoot})]}),k.jsxs("div",{children:[k.jsx("dt",{children:"Branch"}),k.jsx("dd",{children:c2(s)})]}),k.jsxs("div",{children:[k.jsx("dt",{children:"Remote"}),k.jsx("dd",{children:s.upstreamBranch??"no upstream"})]}),k.jsxs("div",{children:[k.jsx("dt",{children:"Status"}),k.jsx("dd",{children:u2(s)})]}),k.jsxs("div",{children:[k.jsx("dt",{children:"Commit"}),k.jsx("dd",{children:s.shortHeadCommit??s.headCommit??"unknown"})]}),k.jsxs("div",{children:[k.jsx("dt",{children:"Working tree"}),k.jsx("dd",{children:s.isDirty?"uncommitted changes":"clean"})]})]}),k.jsxs("div",{className:"connected-repo-actions",children:[k.jsx("button",{type:"button",disabled:n||!d,title:o??"Pull latest changes with git pull --ff-only",onClick:()=>void r(),children:"Pull"}),k.jsx("span",{className:"muted",children:s.checkedAt?`checked ${ah(s.checkedAt)}`:"status not refreshed"})]}),o?k.jsx("p",{className:"muted",children:o}):null,s.warnings.length>0?k.jsx("ul",{className:"warnings",children:s.warnings.map(v=>k.jsx("li",{children:v},v))}):null]})}function c2(n){return n.branch||"unknown"}function u2(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 h2({roundState:n,task:r}){var p;const[s,o]=ne.useState(()=>Date.now()),d=!!(n!=null&&n.startedAt),v=Z_(r.createdAt,s),f=Eg(n,(n==null?void 0:n.totalCcActiveMs)??0,s),l=d&&n?Eg(n,n.currentRoundCcActiveMs,s):0,c=d&&n?f2(n,s):0,h=((p=r.title)==null?void 0:p.trim())||r.taskSlug;return ne.useEffect(()=>{const u=window.setInterval(()=>o(Date.now()),1e3);return()=>window.clearInterval(u)},[]),k.jsxs("section",{className:"task-status-dock","aria-label":"VCM Session status",children:[k.jsxs("div",{className:"task-status-dock-title",children:[k.jsx("strong",{title:h,children:h}),k.jsx("span",{className:`status-badge status-${r.status}`,children:r.status})]}),k.jsxs("dl",{className:"task-status-stats",children:[k.jsxs("div",{children:[k.jsx("dt",{children:"Session start"}),k.jsx("dd",{children:ah(r.createdAt)})]}),k.jsxs("div",{children:[k.jsx("dt",{children:"Session total"}),k.jsx("dd",{children:io(v)})]}),k.jsxs("div",{children:[k.jsx("dt",{children:"Rounds"}),k.jsx("dd",{children:(n==null?void 0:n.totalRoundCount)??0})]}),k.jsxs("div",{children:[k.jsx("dt",{children:"Role runtime"}),k.jsx("dd",{children:io(f)})]})]}),d&&n?k.jsxs("div",{className:"current-round-status",children:[k.jsxs("div",{className:"current-round-title",children:[k.jsx("span",{children:n.status==="running"?"Current Round":"Last Round"}),k.jsx("span",{className:`status-badge status-${n.status}`,children:n.status})]}),k.jsxs("dl",{className:"task-status-stats",children:[k.jsxs("div",{children:[k.jsx("dt",{children:"Started"}),k.jsx("dd",{children:ah(n.startedAt)})]}),k.jsxs("div",{children:[k.jsx("dt",{children:"Total"}),k.jsx("dd",{children:io(c)})]}),k.jsxs("div",{children:[k.jsx("dt",{children:"Role runtime"}),k.jsx("dd",{children:io(l)})]}),k.jsxs("div",{children:[k.jsx("dt",{children:"Turn count"}),k.jsx("dd",{children:n.turnCount})]})]})]}):null]})}function Eg(n,r,s){if(!(n!=null&&n.activeTurnStartedAt)||n.status!=="running")return r;const o=Date.parse(n.updatedAt);return Number.isFinite(o)?r+Math.max(0,s-o):r}function f2(n,r){const s=n.status==="running"?r:Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return Z_(n.startedAt??"",Number.isFinite(s)?s:r)}function Z_(n,r){const s=Date.parse(n);return Number.isFinite(s)?Math.max(0,r-s):0}function ah(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 io(n){const r=Math.max(0,Math.floor(n/1e3)),s=Math.floor(r/3600),o=Math.floor(r%3600/60),d=r%60;return s>0?o>0?`${s}h ${o}m`:`${s}h`:o>0?d>0?`${o}m ${d}s`:`${o}m`:`${d}s`}function d2(n){return n==="system"?"light":n==="light"?"dark":"system"}function kg(n){return n==="system"?"System":n==="light"?"Light":"Dark"}function p2({events:n,onClose:r}){return k.jsx("div",{className:"modal-backdrop",children:k.jsxs("section",{className:"event-modal",role:"dialog","aria-modal":"true","aria-label":"Events",children:[k.jsxs("header",{children:[k.jsxs("div",{children:[k.jsx("h2",{children:"Events"}),k.jsxs("p",{className:"muted",children:[n.length," total"]})]}),k.jsx("button",{type:"button",onClick:r,children:"Close"})]}),k.jsx(GE,{events:n,maxEvents:null,showHeader:!1})]})})}function m2({busy:n,messages:r,orchestration:s,onClose:o,onMarkAllDone:d,onDeleteMessageHistory:v}){const f=Dh(r);function l(){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(`
93
+ `))&&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(`
94
+ `))&&v()}return k.jsx("div",{className:"modal-backdrop",children:k.jsxs("section",{className:"message-modal",role:"dialog","aria-modal":"true","aria-label":"Messages",children:[k.jsxs("header",{children:[k.jsxs("div",{children:[k.jsx("h2",{children:"Messages"}),k.jsxs("p",{className:"muted",children:[f.total," total / ",f.accepted," accepted",s?` · ${s.mode}`:""]})]}),k.jsxs("div",{className:"modal-actions",children:[k.jsx("button",{type:"button",disabled:n,onClick:l,children:"Mark All Done"}),k.jsx("button",{type:"button",disabled:n||f.total===0,onClick:c,children:"Delete All"}),k.jsx("button",{type:"button",onClick:o,children:"Close"})]})]}),k.jsx(KE,{busy:n,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function Ci({children:n,onOpenChange:r,open:s,title:o}){return k.jsxs("section",{className:"sidebar-section",children:[k.jsxs("button",{"aria-expanded":s,className:"sidebar-section-toggle",type:"button",onClick:()=>{r==null||r(!s)},children:[k.jsx("span",{children:o}),k.jsx("span",{"aria-hidden":"true",className:"sidebar-section-chevron"})]}),s?k.jsx("div",{className:"sidebar-section-content",children:n}):null]})}function J_(n,r){return n.find(s=>s.role===r)}function g2({activeRole:n,roles:r=ch,sessions:s,onSelect:o}){return k.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const v=J_(s,d.name),f=(v==null?void 0:v.status)==="running"?v.activityStatus??"idle":(v==null?void 0:v.status)??"not_started";return k.jsxs("button",{className:d.name===n?"role-tab is-active":"role-tab",type:"button",role:"tab","aria-selected":d.name===n,onClick:()=>o(d.name),children:[k.jsx("span",{children:d.label}),k.jsx(wi,{status:f})]},d.name)})})}function _2({role:n,session:r,permissionMode:s,model:o,effort:d,active:v=!0,busy:f,translationEnabled:l,translationAutoSendEnabled:c,translationTargetLanguage:h,onPermissionModeChange:p,onModelChange:u,onEffortChange:b,onStart:C,onResume:T,onStop:x,onRestart:_,onNotifyHarnessUpdated:y,onTerminalEvent:m}){const S=T1(n)&&l&&(r==null?void 0:r.status)==="running";return k.jsx("section",{className:"session-console",children:k.jsxs("div",{className:S?"session-console-body has-translation":"session-console-body",children:[k.jsxs("div",{className:"terminal-pane",children:[k.jsx(uh,{role:n,session:r,permissionMode:s,model:o,effort:d,busy:f,onPermissionModeChange:p,onModelChange:u,onEffortChange:b,onStart:C,onResume:T,onStop:x,onRestart:_,onNotifyHarnessUpdated:y}),(r==null?void 0:r.status)==="running"?k.jsx(fo,{sessionId:r.id,active:v,onEvent:m},r.id):k.jsxs("div",{className:"terminal-empty",children:[k.jsx("strong",{children:n}),k.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."})]})]}),S?k.jsx("div",{className:"translation-pane",children:k.jsx(xE,{active:v,autoSendEnabled:c,targetLanguage:h,taskSlug:r.taskSlug,role:n,sessionId:r.id},r.id)}):null]})})}function v2(n,r,s){var v;if(!n||s.mode!=="auto")return null;const o=new Map(n.map(f=>[f.id,f])),d=r.filter(f=>{var l;return f.dispatchingAt?((l=o.get(f.id))==null?void 0:l.dispatchingAt)!==f.dispatchingAt:!1});return d.length===0?null:((v=d.sort(y2)[d.length-1])==null?void 0:v.toRole)??null}function y2(n,r){const s=n.dispatchingAt??n.deliveredAt??n.acceptedAt??"",o=r.dispatchingAt??r.deliveredAt??r.acceptedAt??"";return s!==o?s.localeCompare(o):n.createdAt.localeCompare(r.createdAt)}const S2=2e3,b2={"project-manager":"bypassPermissions",architect:"bypassPermissions",coder:"bypassPermissions",reviewer:"bypassPermissions","gate-reviewer":"bypassPermissions",translator:"bypassPermissions","harness-engineer":"bypassPermissions"},C2={"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"},w2={"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"medium","harness-engineer":"medium"};function x2({task:n,activeRole:r,gateReviewerEnabled:s,translationEnabled:o,translationAutoSendEnabled:d,translationTargetLanguage:v,launchTemplate:f,refreshNonce:l=0,onTaskChanged:c,onActiveRoleChange:h,onBeforeCloseTask:p,onMessagesChanged:u,onOrchestrationChanged:b,onRoundStateChanged:C,onEventsChanged:T,onLaunchStateChanged:x}){const[_,y]=ne.useState(null),[m,S]=ne.useState(()=>Tg(f)),[A,M]=ne.useState(()=>Rg(f)),[R,D]=ne.useState(()=>Dg(f)),[E,L]=ne.useState(!1),[B,I]=ne.useState(""),[F,U]=ne.useState([]),[W,X]=ne.useState(null),V=ne.useRef(null),Y=ne.useRef(""),J=ne.useMemo(()=>JSON.stringify(f),[f]),z=!!(_!=null&&_.sessions.some(Ce=>Ce.role==="gate-reviewer")),j=s||z,H=[...Ss,...j?[Ng]:[]],G=ne.useCallback((Ce,me)=>{var ke;const Te=((ke=V.current)==null?void 0:ke.taskSlug)===n.taskSlug?V.current.messages:null,He=v2(Te,Ce,me);V.current={taskSlug:n.taskSlug,messages:Ce},X(me),u==null||u(Ce),b==null||b(me),He&&(h(He),K(`auto switched to ${He} before VCM dispatch`))},[h,u,b,n.taskSlug]),N=ne.useCallback((Ce,me,Te,He)=>{y(Ce),G(me,Te),C==null||C(He)},[G,C]),ie=ne.useCallback(async()=>{const[Ce,me,Te,He]=await Promise.all([ye.getTaskStatus(n.taskSlug),ye.listMessages(n.taskSlug),ye.getOrchestrationState(n.taskSlug),ye.getSessionRoundState(n.taskSlug)]);N(Ce,me,Te,He)},[N,n.taskSlug]);ne.useEffect(()=>{ie().catch(Ce=>I(Ce.message))},[ie,l]),ne.useEffect(()=>{U([]),T==null||T([])},[T,n.taskSlug]),ne.useEffect(()=>{S(Tg(f)),M(Rg(f)),D(Dg(f))},[J,n.taskSlug]),ne.useEffect(()=>{_&&!j&&r==="gate-reviewer"&&h("project-manager"),_&&r==="translator"&&h("project-manager")},[r,j,h,_]),ne.useEffect(()=>{const Ce=_==null?void 0:_.task;if(!Ce||Ce.taskSlug!==n.taskSlug)return;const me=Ag(Ce);if(me===Ag(n)){Y.current="";return}Y.current!==me&&(Y.current=me,c().catch(Te=>{Y.current="",I(Te.message)}))},[c,_==null?void 0:_.task,n]),ne.useEffect(()=>{const me=((_==null?void 0:_.sessions)??[]).filter(ke=>E2(ke.role)),Te=new Set(me.map(ke=>ke.role)),He={};for(const ke of ws)He[ke.name]={permissionMode:m[ke.name],model:A[ke.name],effort:R[ke.name]};x==null||x({taskSlug:n.taskSlug,roles:He,autoOrchestration:((W==null?void 0:W.mode)??"auto")==="auto",statusLoaded:!!_,sessionCount:me.length,hasAnySession:me.length>0,allRolesHaveSession:Ss.every(ke=>Te.has(ke.name))})},[A,R,x,W==null?void 0:W.mode,m,_,n.taskSlug]),ne.useEffect(()=>{const Ce=window.setInterval(()=>{Promise.all([ye.getTaskStatus(n.taskSlug),ye.listMessages(n.taskSlug),ye.getOrchestrationState(n.taskSlug),ye.getSessionRoundState(n.taskSlug)]).then(([me,Te,He,ke])=>{N(me,Te,He,ke)}).catch(me=>I(me.message))},3e3);return()=>window.clearInterval(Ce)},[N,n.taskSlug]),ne.useEffect(()=>{let Ce=!1,me=!1;const Te=window.setInterval(()=>{me||(me=!0,Promise.all([ye.listMessages(n.taskSlug),ye.getOrchestrationState(n.taskSlug)]).then(([He,ke])=>{Ce||G(He,ke)}).catch(He=>{Ce||I(He.message)}).finally(()=>{me=!1}))},S2);return()=>{Ce=!0,window.clearInterval(Te)}},[G,n.taskSlug]);async function he(Ce){L(!0),I("");try{await Ce(),await ie(),await c()}catch(me){I(me instanceof Error?me.message:"Action failed.")}finally{L(!1)}}async function ge(){const Ce=[`Close task "${n.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: ${n.worktreePath}`,`- deletes the Git branch: ${n.branch}`,"- deletes VCM task/session/message/orchestration state","","VCM will not check running sessions or uncommitted changes before closing."].join(`
95
+ `);if(window.confirm(Ce)){L(!0),I("");try{await(p==null?void 0:p()),await ye.cleanupTask(n.taskSlug,{force:!0,forceDeleteBranch:!0}),K(`closed ${n.taskSlug}`),await c()}catch(Te){I(Te instanceof Error?Te.message:"Close task failed.")}finally{L(!1)}}}function K(Ce){U(me=>{const Te=[...me,`${new Date().toLocaleTimeString()} ${Ce}`];return T==null||T(Te),Te})}function q(Ce,me){S(Te=>({...Te,[Ce]:me}))}function te(Ce,me){M(Te=>({...Te,[Ce]:me}))}function le(Ce,me){D(Te=>({...Te,[Ce]:me}))}async function xe(Ce){L(!0),I("");try{const me=await ye.updateOrchestrationState(n.taskSlug,{mode:Ce});X(me),b==null||b(me),K(`auto orchestration ${Ce==="auto"?"enabled":"disabled"}`)}catch(me){I(me instanceof Error?me.message:"Failed to update orchestration mode.")}finally{L(!1)}}const Ee=((W==null?void 0:W.mode)??"auto")==="auto";return k.jsxs("div",{className:"task-workspace",children:[k.jsxs("header",{className:"workspace-header",children:[k.jsx("div",{className:"workspace-title-line",children:k.jsx("h1",{children:n.title||n.taskSlug})}),k.jsx(g2,{activeRole:r,roles:H,sessions:(_==null?void 0:_.sessions)??[],onSelect:h}),k.jsxs("div",{className:"workspace-header-actions",children:[k.jsx(rr,{checked:Ee,className:"orchestration-switch",disabled:E,label:"Auto orchestration",onChange:Ce=>void xe(Ce?"auto":"manual")}),k.jsx("button",{className:"danger-button",type:"button",disabled:E,onClick:()=>void ge(),children:"Close Task"})]})]}),B?k.jsx("div",{className:"error-banner",children:B}):null,k.jsx("div",{className:"workspace-grid",children:k.jsx("div",{className:"workspace-main",children:k.jsx("div",{className:"role-console-stack",children:H.map(Ce=>{const me=Ce.name,Te=me===r,He=J_((_==null?void 0:_.sessions)??[],me);return k.jsx("div",{className:Te?"role-console-panel is-active":"role-console-panel","aria-hidden":!Te,children:k.jsx(_2,{role:me,session:He,permissionMode:m[me],model:A[me],effort:R[me],active:Te,busy:E,translationEnabled:o,translationAutoSendEnabled:d,translationTargetLanguage:v,onPermissionModeChange:ke=>q(me,ke),onModelChange:ke=>te(me,ke),onEffortChange:ke=>le(me,ke),onStart:()=>void he(async()=>{await ye.startRoleSession(n.taskSlug,me,{cols:100,rows:28,permissionMode:m[me],model:A[me],effort:R[me]}),K(`started ${me} with ${m[me]} / ${A[me]} / ${R[me]}`)}),onResume:()=>void he(async()=>{await ye.resumeRoleSession(n.taskSlug,me,{cols:100,rows:28,permissionMode:m[me],model:A[me],effort:R[me]}),K(`resumed ${me} with ${m[me]} / ${A[me]} / ${R[me]}`)}),onStop:()=>void he(async()=>{await ye.stopRoleSession(n.taskSlug,me),K(`stopped ${me}`)}),onRestart:()=>void he(async()=>{await ye.restartRoleSession(n.taskSlug,me,{cols:100,rows:28,permissionMode:m[me],model:A[me],effort:R[me]}),K(`restarted ${me} with ${m[me]} / ${A[me]} / ${R[me]}`)}),onNotifyHarnessUpdated:()=>void he(async()=>{await ye.notifyRoleHarnessUpdated(n.taskSlug,me),K(`notified ${me} to reload latest harness`)}),onTerminalEvent:ke=>K(`${Ce.label}: ${ke}`)})},me)})})})})]})}function E2(n){return Ss.some(r=>r.name===n)}function Ag(n){return[n.status,n.updatedAt,n.cleanupStatus??"",n.cleanedAt??""].join(":")}function Tg(n){var s;const r={...b2};for(const o of ws)r[o.name]=((s=n.roles[o.name])==null?void 0:s.permissionMode)??r[o.name];return r}function Rg(n){var s;const r={...C2};for(const o of ws)r[o.name]=((s=n.roles[o.name])==null?void 0:s.model)??r[o.name];return r}function Dg(n){var s;const r={...w2};for(const o of ws)r[o.name]=((s=n.roles[o.name])==null?void 0:s.effort)??r[o.name];return r}const k2=120*1e3,Mg=1400,A2=3;function T2(n){return!!(n!=null&&n.initialized)}function R2(){const[n,r]=ne.useState(null),[s,o]=ne.useState([]),[d,v]=ne.useState(null),[f,l]=ne.useState(null),[c,h]=ne.useState(null),[p,u]=ne.useState(null),[b,C]=ne.useState(null),[T,x]=ne.useState(null),[_,y]=ne.useState(null),[m,S]=ne.useState(null),[A,M]=ne.useState(null),[R,D]=ne.useState(!1),[E,L]=ne.useState([]),[B,I]=ne.useState(null),[F,U]=ne.useState(null),[W,X]=ne.useState(null),[V,Y]=ne.useState(null),[J,z]=ne.useState(null),[j,H]=ne.useState(null),[G,N]=ne.useState("project-manager"),[ie,he]=ne.useState("system"),[ge,K]=ne.useState(!0),[q,te]=ne.useState("off"),[le,xe]=ne.useState(!1),[Ee,Ce]=ne.useState(!1),[me,Te]=ne.useState(R1),[He,ke]=ne.useState(D1),[Jt,Nt]=ne.useState(!1),[Kt,en]=ne.useState(!1),[xn,bt]=ne.useState(!1),[dt,Bt]=ne.useState(!1),[fe,Se]=ne.useState(!1),[pe,Me]=ne.useState(null),[Ne,pt]=ne.useState("bypassPermissions"),[Ue,Je]=ne.useState("default"),[at,xt]=ne.useState("medium"),[we,Et]=ne.useState(null),[kt,Yt]=ne.useState("bypassPermissions"),[Hn,ze]=ne.useState("default"),[zn,In]=ne.useState("medium"),[ti,ar]=ne.useState(()=>L1()),[Mr,Ha]=ne.useState(null),[ks,lr]=ne.useState(0),[za,or]=ne.useState(null),[As,Ia]=ne.useState(!1),[ni,Lr]=ne.useState(!1),[Ts,ct]=ne.useState(""),Pn=ne.useRef({}),ut=ne.useRef(null),At=ne.useRef(""),En=ne.useRef(""),Ei=ne.useRef(""),Rs=ne.useRef(""),Z=ne.useMemo(()=>UE(E,B),[E,B]),Xt=(Mr==null?void 0:Mr.taskSlug)===(Z==null?void 0:Z.taskSlug)?Mr:null,ii=c===(Z==null?void 0:Z.taskSlug)?d:null,Or=p===(Z==null?void 0:Z.taskSlug)?f:null,tn=!!(n&&Z&&T2(ii)),Wn=(pe==null?void 0:pe.status)==="running",ki=!!(le&&tn&&Wn),Ai=!!(Xt!=null&&Xt.statusLoaded),Tt=!!(Z&&(Xt!=null&&Xt.statusLoaded)&&!Xt.hasAnySession),Ft=ne.useCallback($=>{he($.themeMode),K($.flowPauseAlerts),te($.permissionRequestMode),xe($.translationEnabled),Ce($.translationAutoSendEnabled),Te($.translationTargetLanguage),ke($.translationOutputMode),ar($.launchTemplate)},[]),dn=ne.useCallback(()=>{ut.current!==null&&(window.clearInterval(ut.current),ut.current=null)},[]),Kn=ne.useCallback(($={})=>{dn(),$.resetAudio&&j2(),ro(),ut.current=window.setInterval(()=>{ro()},Mg)},[dn]),ri=ne.useCallback(()=>{dn(),or(null);let $=1;ro(),ut.current=window.setInterval(()=>{$+=1,ro(),$>=A2&&ut.current!==null&&(window.clearInterval(ut.current),ut.current=null)},Mg)},[dn]),Ds=ne.useCallback(($,ce=`manual-${Date.now()}`,ht={})=>{or({id:ce,text:$}),Kn(ht)},[Kn]),Pa=ne.useCallback(()=>{dn(),or(null)},[dn]),cr=ne.useCallback(()=>{dn(),or(null),K(!1)},[dn]),yo=ne.useCallback($=>{Z!=null&&Z.taskSlug&&U({taskSlug:Z.taskSlug,messages:$})},[Z==null?void 0:Z.taskSlug]),Br=ne.useCallback($=>{Z!=null&&Z.taskSlug&&X({taskSlug:Z.taskSlug,orchestration:$})},[Z==null?void 0:Z.taskSlug]),jr=ne.useCallback($=>{Z!=null&&Z.taskSlug&&Y({taskSlug:Z.taskSlug,events:$})},[Z==null?void 0:Z.taskSlug]),Un=ne.useCallback($=>{if(!(Z!=null&&Z.taskSlug)||$.taskSlug!==Z.taskSlug||(z({taskSlug:$.taskSlug,roundState:$}),$.status!=="stopped"||!$.roundId))return;const ce=O2($);if(Pn.current[$.taskSlug]===ce||(Pn.current[$.taskSlug]=ce,!ge))return;const vt=$.activeRole??"role";L2($)>=k2?Ds(`No new turn started after ${vt} stopped.`,ce):ri()},[Z==null?void 0:Z.taskSlug,ge,ri,Ds]),nn=ne.useCallback($=>{Ha(ce=>(ce==null?void 0:ce.taskSlug)===$.taskSlug&&ce.statusLoaded===$.statusLoaded&&ce.sessionCount===$.sessionCount&&ce.hasAnySession===$.hasAnySession&&ce.allRolesHaveSession===$.allRolesHaveSession&&ce.autoOrchestration===$.autoOrchestration&&JSON.stringify(ce.roles)===JSON.stringify($.roles)?ce:$)},[]);async function Ti(){const $=await ye.listTasks();return L($),I(ce=>{var ht;return ce&&$.some(vt=>vt.taskSlug===ce)?ce:((ht=$[0])==null?void 0:ht.taskSlug)??null}),$}async function ur($=Z==null?void 0:Z.taskSlug){if(!$)return v(null),h(null),null;const ce=await ye.getHarnessStatus($);return v(ce),h($),ce}async function si($=Z==null?void 0:Z.taskSlug){if(!$)return l(null),u(null),null;const ce=await ye.getHarnessBootstrapStatus($);return l(ce),u($),ce}async function Nr(){const $=await ye.getGatewayStatus();return y($),$}async function Hr(){const $=await ye.getRecentRepositoryPaths();return o($),$}async function zr(){if(!n)return Nt(!1),!1;const $=await ye.getTranslationState();return Nt($.memoryInitialized),$.memoryInitialized}async function qt($){const[ce,ht]=await Promise.all([ye.listMessages($),ye.getOrchestrationState($)]);U({taskSlug:$,messages:ce}),X({taskSlug:$,orchestration:ht})}async function hr($){const ce=await ye.getGateReviewState($);return H({taskSlug:$,state:ce}),ce}function Fn($){$&&(pt($.permissionMode),$.model&&Je($.model),$.effort&&xt($.effort))}async function Ri($={}){const ce=await ye.getTranslatorSession();return Me(ce),$.syncLaunchOptions&&Fn(ce),ce}function rn($){$&&(Yt($.permissionMode),$.model&&ze($.model),$.effort&&In($.effort))}async function kn($={}){const ce=await ye.getHarnessEngineerSession();return Et(ce),$.syncLaunchOptions&&rn(ce),ce}async function Ir($=Z==null?void 0:Z.taskSlug){if(!n)return x(null),null;const ce=await ye.getHarnessFeedbackState($);return x(ce),ce}ne.useEffect(()=>{Promise.all([ye.getCurrentProject(),ye.getRecentRepositoryPaths(),ye.getAppPreferences(),ye.getGatewayStatus()]).then(async([$,ce,ht,vt])=>{r($),o(ce),y(vt),Ft(ht),$&&await Ti()}).catch($=>ct($.message))},[Ft]),ne.useEffect(()=>{const $=window.matchMedia("(prefers-color-scheme: dark)"),ce=()=>Ia($.matches);return ce(),$.addEventListener("change",ce),()=>$.removeEventListener("change",ce)},[]),ne.useEffect(()=>()=>dn(),[dn]),ne.useEffect(()=>{const $=ie==="system"?As?"dark":"light":ie;document.documentElement.dataset.theme=$,document.documentElement.dataset.themeMode=ie},[As,ie]),ne.useEffect(()=>{!(_!=null&&_.enabled)||!ge||(cr(),ye.updateAppPreferences({flowPauseAlerts:!1}).then($=>Ft($)).catch($=>ct($.message)))},[Ft,cr,ge,_==null?void 0:_.enabled]),ne.useEffect(()=>{if(!(_!=null&&_.enabled)||!n||!Z)return;const $=`${n.repoRoot}:${Z.taskSlug}`;if(_.currentProjectId===n.repoRoot&&_.currentTaskSlug===Z.taskSlug){At.current=$;return}At.current!==$&&(At.current=$,ye.updateGatewaySettings({currentProjectId:n.repoRoot,currentTaskSlug:Z.taskSlug}).then(ce=>y(ce)).catch(ce=>{At.current===$&&(At.current=""),ct(ce.message)}))},[Z==null?void 0:Z.taskSlug,_==null?void 0:_.currentProjectId,_==null?void 0:_.currentTaskSlug,_==null?void 0:_.enabled,n==null?void 0:n.repoRoot]),ne.useEffect(()=>{if(!(Z!=null&&Z.taskSlug)){H(null);return}hr(Z.taskSlug).catch($=>ct($.message))},[Z==null?void 0:Z.taskSlug]),ne.useEffect(()=>{En.current="",Ei.current="",Rs.current="",Me(null),pt("bypassPermissions"),Je("default"),xt("medium"),Nt(!1),Et(null),Yt("bypassPermissions"),ze("default"),In("medium"),v(null),l(null),h(null),u(null),x(null)},[n==null?void 0:n.repoRoot]),ne.useEffect(()=>{if(!n){x(null);return}Ir(Z==null?void 0:Z.taskSlug).catch(ce=>ct(ce.message));const $=window.setInterval(()=>{Ir(Z==null?void 0:Z.taskSlug).catch(ce=>ct(ce.message))},4e3);return()=>window.clearInterval($)},[Z==null?void 0:Z.taskSlug,n==null?void 0:n.repoRoot]),ne.useEffect(()=>{if(!n){Nt(!1);return}Ri({syncLaunchOptions:!0}).catch(ce=>ct(ce.message)),zr().catch(ce=>ct(ce.message));const $=window.setInterval(()=>{Ri().catch(ce=>ct(ce.message)),zr().catch(ce=>ct(ce.message))},3e3);return()=>window.clearInterval($)},[n==null?void 0:n.repoRoot]),ne.useEffect(()=>{if(!n)return;kn({syncLaunchOptions:!0}).catch(ce=>ct(ce.message));const $=window.setInterval(()=>{kn().catch(ce=>ct(ce.message))},3e3);return()=>window.clearInterval($)},[n==null?void 0:n.repoRoot]),ne.useEffect(()=>{if(!n||!(Z!=null&&Z.taskSlug)||!(we!=null&&we.claudeSessionId)||we.status==="running"||we.status==="done")return;const $=`${n.repoRoot}:${Z.taskSlug}:${we.claudeSessionId}`;Rs.current!==$&&(Rs.current=$,ye.resumeHarnessEngineerSession({taskSlug:Z.taskSlug,permissionMode:we.permissionMode,model:we.model,effort:we.effort}).then(ce=>{Et(ce),rn(ce)}).catch(ce=>ct(ce.message)))},[Z==null?void 0:Z.taskSlug,we==null?void 0:we.claudeSessionId,we==null?void 0:we.cwd,we==null?void 0:we.effort,we==null?void 0:we.model,we==null?void 0:we.permissionMode,we==null?void 0:we.status,n==null?void 0:n.repoRoot]),ne.useEffect(()=>{!n||!(Z!=null&&Z.taskSlug)||!(we!=null&&we.claudeSessionId)||we.status!=="running"||we.cwd===Z.worktreePath||ye.ensureHarnessEngineerSession({taskSlug:Z.taskSlug,permissionMode:we.permissionMode,model:we.model,effort:we.effort}).then($=>{Et($),rn($)}).catch($=>ct($.message))},[Z==null?void 0:Z.taskSlug,Z==null?void 0:Z.worktreePath,we==null?void 0:we.claudeSessionId,we==null?void 0:we.cwd,we==null?void 0:we.effort,we==null?void 0:we.model,we==null?void 0:we.permissionMode,we==null?void 0:we.status,n==null?void 0:n.repoRoot]),ne.useEffect(()=>{if(!n||!(Z!=null&&Z.taskSlug)||!tn||!(pe!=null&&pe.claudeSessionId)||pe.status==="running"||pe.status==="done")return;const $=`${n.repoRoot}:${Z.taskSlug}:${pe.claudeSessionId}`;Ei.current!==$&&(Ei.current=$,ye.resumeTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:pe.permissionMode,model:pe.model,effort:pe.effort}).then(ce=>{Me(ce),Fn(ce)}).catch(ce=>{Ei.current="",ct(ce.message)}))},[Z==null?void 0:Z.taskSlug,n==null?void 0:n.repoRoot,tn,pe==null?void 0:pe.claudeSessionId,pe==null?void 0:pe.cwd,pe==null?void 0:pe.effort,pe==null?void 0:pe.model,pe==null?void 0:pe.permissionMode,pe==null?void 0:pe.status]),ne.useEffect(()=>{!n||!(Z!=null&&Z.taskSlug)||!tn||!(pe!=null&&pe.claudeSessionId)||pe.status!=="running"||pe.cwd===Z.worktreePath||ye.ensureTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:pe.permissionMode,model:pe.model,effort:pe.effort}).then($=>{Me($),Fn($)}).catch($=>ct($.message))},[Z==null?void 0:Z.taskSlug,Z==null?void 0:Z.worktreePath,n==null?void 0:n.repoRoot,tn,pe==null?void 0:pe.claudeSessionId,pe==null?void 0:pe.cwd,pe==null?void 0:pe.effort,pe==null?void 0:pe.model,pe==null?void 0:pe.permissionMode,pe==null?void 0:pe.status]),ne.useEffect(()=>{if(!n||!(Z!=null&&Z.taskSlug)){v(null),l(null),h(null),u(null);return}const $=Z.taskSlug;Promise.all([ur($),si($)]).catch(ht=>ct(ht.message));const ce=window.setInterval(()=>{Promise.all([ur($),si($)]).catch(ht=>ct(ht.message))},3e3);return()=>window.clearInterval(ce)},[n==null?void 0:n.repoRoot,Z==null?void 0:Z.taskSlug]),ne.useEffect(()=>{if(!n||!le||!(Z!=null&&Z.taskSlug)||!tn||!Wn){En.current="";return}const $=`${n.repoRoot}:${Z.taskSlug}`;En.current===$&&(pe==null?void 0:pe.status)==="running"||(En.current=$,ye.ensureTranslatorSession({taskSlug:Z.taskSlug}).then(ce=>{Me(ce),Fn(ce)}).catch(ce=>{En.current="",ct(ce.message)}))},[n==null?void 0:n.repoRoot,Z==null?void 0:Z.taskSlug,le,tn,Wn]),ne.useEffect(()=>{if(!(Z!=null&&Z.taskSlug))return;const $=Z.taskSlug,ce=window.setInterval(()=>{hr($).catch(ht=>ct(ht.message))},3e3);return()=>window.clearInterval(ce)},[Z==null?void 0:Z.taskSlug]);async function Be($){Lr(!0),ct("");try{await $()}catch(ce){ct(ce instanceof Error?ce.message:"Action failed.")}finally{Lr(!1)}}const So=F&&F.taskSlug===(Z==null?void 0:Z.taskSlug)?F.messages:[],Ua=W&&W.taskSlug===(Z==null?void 0:Z.taskSlug)?W.orchestration:null,Fa=V&&V.taskSlug===(Z==null?void 0:Z.taskSlug)?V.events:[],Ms=J&&J.taskSlug===(Z==null?void 0:Z.taskSlug)?J.roundState:null,Ls=j&&j.taskSlug===(Z==null?void 0:Z.taskSlug)?j.state:null,qa=!!(Ls&&Object.values(Ls.gates).some($=>$.required));return k.jsxs(O1,{sidebar:k.jsx(e2,{project:n,recentRepositoryPaths:s,tasks:E,activeTaskSlug:(Z==null?void 0:Z.taskSlug)??null,messages:So,orchestration:Ua,events:Fa,roundState:Ms,gateReview:Ls,translationEnabled:ki,translationAutoSendEnabled:Ee,translationTargetLanguage:me,translationOutputMode:He,translationMemoryInitialized:Jt,translatorSession:pe,harnessStatus:ii,harnessBootstrapStatus:Or,harnessApplyResult:b,gatewayStatus:_,gatewayQrLogin:m,gatewayQrCheck:A,busy:ni,onConnect:$=>Be(async()=>{const ce=await ye.connectProject({repoPath:$});r(ce),C(null),await Promise.all([Ti(),Hr()])}),onRefreshConnectedRepository:()=>Be(async()=>{const $=await ye.getCurrentProject();r($)}),onPullConnectedRepository:()=>Be(async()=>{const $=await ye.pullCurrentProject();r($)}),onRefreshHarness:()=>Be(async()=>{if(!Z)throw new Error("Create or select a task before refreshing VCM Harness.");C(null),await Promise.all([ur(Z.taskSlug),si(Z.taskSlug)])}),onApplyHarness:()=>Be(async()=>{if(!Z)throw new Error("Create or select a task before applying VCM Harness.");const $=await ye.applyHarness({taskSlug:Z.taskSlug});C($),await Promise.all([ur(Z.taskSlug),si(Z.taskSlug)])}),onStartHarnessBootstrap:$=>Be(async()=>{if(!Z)throw new Error("Create or select a task before starting Harness Bootstrap.");const ce=await ye.startHarnessBootstrap({taskSlug:Z.taskSlug,cols:120,rows:32,...$});l(ce.status),u(Z.taskSlug),await kn({syncLaunchOptions:!0})}),onRestartHarnessBootstrap:$=>Be(async()=>{if(!Z)throw new Error("Create or select a task before restarting Harness Bootstrap.");const ce=await ye.restartHarnessBootstrap({taskSlug:Z.taskSlug,cols:120,rows:32,...$});l(ce.status),u(Z.taskSlug),await kn({syncLaunchOptions:!0})}),onStopHarnessBootstrap:()=>Be(async()=>{const $=await ye.stopHarnessBootstrap();l($),u((Z==null?void 0:Z.taskSlug)??null),await kn()}),onRunHarnessBootstrap:()=>Be(async()=>{if(!Z)throw new Error("Create or select a task before running Harness Bootstrap.");const $=await ye.runHarnessBootstrap({taskSlug:Z.taskSlug});l($.status),u(Z.taskSlug),await kn()}),onOpenHarnessStudio:()=>Bt(!0),onOpenRepositoryDiff:()=>Se(!0),onRefreshGateway:()=>Be(async()=>{await Nr()}),onGatewayEnabledChange:$=>{Be(async()=>{const[ce,ht]=await Promise.all([ye.updateGatewaySettings({enabled:$,...$&&n?{currentProjectId:n.repoRoot,currentTaskSlug:(Z==null?void 0:Z.taskSlug)??null}:{}}),$?ye.updateAppPreferences({flowPauseAlerts:!1}):Promise.resolve(null)]);ht&&Ft(ht),$&&cr(),y(ce)})},onGatewayTranslationChange:$=>{Be(async()=>{const ce=await ye.updateGatewaySettings({translationEnabled:$});y(ce)})},onStartGatewayQrLogin:()=>{Be(async()=>{const $=await ye.startGatewayQrLogin();S($),M(null),D(!0),await Nr()})},onResetGatewayBinding:()=>{Be(async()=>{const $=await ye.resetGatewayBinding();y($),S(null),M(null),D(!1)})},onGateReviewGateEnabledChange:($,ce)=>{Be(async()=>{if(!Z)throw new Error("Create or select a task before changing Gate Review Gates.");const ht=await ye.updateGateReviewSettings(Z.taskSlug,{gates:{[$]:ce}});H({taskSlug:Z.taskSlug,state:ht})})},onTranslationEnabledChange:$=>{xe($),Be(async()=>{const ce=await ye.updateAppPreferences({translationEnabled:$});Ft(ce)})},onTranslationAutoSendChange:$=>{Ce($),Be(async()=>{const ce=await ye.updateAppPreferences({translationAutoSendEnabled:$});Ft(ce)})},onTranslationTargetLanguageChange:$=>{Te($),Be(async()=>{const ce=await ye.updateAppPreferences({translationTargetLanguage:$});Ft(ce)})},onTranslationOutputModeChange:$=>{ke($),Be(async()=>{const ce=await ye.updateAppPreferences({translationOutputMode:$});Ft(ce)})},onOpenFileTranslation:()=>en(!0),onOpenTranslatorSession:()=>bt(!0),onCreateTranslationBootstrap:()=>{Be(async()=>{if(!Z)throw new Error("Create or select a task before running Translation Bootstrap.");await ye.createTranslationBootstrap({taskSlug:Z.taskSlug,targetLanguage:me}),await zr(),await Ri()})},onUpdateTranslationMemory:()=>{Be(async()=>{if(!Z)throw new Error("Create or select a task before updating translation memory.");await ye.createTranslationMemoryUpdate({taskSlug:Z.taskSlug,targetLanguage:me}),await zr(),await Ri()})},onCreateTask:$=>Be(async()=>{const ce=await ye.createTask($);await Ti(),I(ce.taskSlug),await hr(ce.taskSlug)}),onSelectTask:I,themeMode:ie,onThemeModeChange:$=>{he($),Be(async()=>{const ce=await ye.updateAppPreferences({themeMode:$});Ft(ce)})},flowPauseAlerts:ge,onFlowPauseAlertsChange:$=>{if(_!=null&&_.enabled){cr();return}K($),$&&B2(),Be(async()=>{const ce=await ye.updateAppPreferences({flowPauseAlerts:$});Ft(ce)})},permissionRequestMode:q,onPermissionRequestModeChange:$=>{te($),Be(async()=>{const ce=await ye.updateAppPreferences({permissionRequestMode:$});Ft(ce)})},launchTemplate:ti,canSaveLaunchTemplate:Ai,canOneClickStart:Tt,onSaveLaunchTemplate:()=>{Be(async()=>{if(!(Xt!=null&&Xt.statusLoaded))throw new Error("Open a task workspace before saving a launch template.");const $=await ye.updateAppPreferences({launchTemplate:{version:1,roles:Xt.roles,autoOrchestration:Xt.autoOrchestration}});Ft($)})},onOneClickStart:()=>{Be(async()=>{if(!Z)throw new Error("Create or select a task before one-click start.");const $=await ye.getTaskStatus(Z.taskSlug);if($.sessions.some(vt=>A1.some(An=>An===vt.role)))throw new Error("One-click start is only available before any role session has started.");const ce=await ye.updateOrchestrationState(Z.taskSlug,{mode:ti.autoOrchestration?"auto":"manual"});X({taskSlug:Z.taskSlug,orchestration:ce});const ht=FE(ti,{gateReviewerEnabled:qa});for(const vt of ht){const An={cols:100,rows:28,permissionMode:vt.permissionMode,model:vt.model,effort:vt.effort},pn=$.sessions.find(Ga=>Ga.role===vt.role);if((pn==null?void 0:pn.status)==="running"){vt.role==="gate-reviewer"&&await ye.resumeRoleSession(Z.taskSlug,vt.role,An);continue}pn!=null&&pn.claudeSessionId?await ye.resumeRoleSession(Z.taskSlug,vt.role,An):await ye.startRoleSession(Z.taskSlug,vt.role,An)}N("project-manager"),await qt(Z.taskSlug),await Ti(),lr(vt=>vt+1)})},onTryFlowPauseAlert:()=>{Ds("This is a test flow pause alert.",void 0,{resetAudio:!0})},onMarkAllMessagesDone:$=>{Be(async()=>{const ce=await ye.markAllMessagesDone($);U({taskSlug:$,messages:ce.messages}),await qt($)})},onDeleteMessageHistory:$=>{Be(async()=>{const ce=await ye.deleteMessageHistory($);U({taskSlug:$,messages:ce.messages}),await qt($)})}}),children:[Ts?k.jsx("div",{className:"error-banner",children:Ts}):null,za?k.jsx("div",{className:"flow-pause-alert-backdrop",children:k.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:[k.jsx("p",{className:"flow-pause-alert-kicker",children:"VCM needs attention"}),k.jsx("h2",{id:"flow-pause-alert-title",children:"Flow needs attention"}),k.jsx("p",{id:"flow-pause-alert-body",children:za.text}),k.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."}),k.jsx("button",{type:"button",autoFocus:!0,onClick:Pa,children:"Confirm"})]})}):null,R&&m?k.jsx(D2,{busy:ni,qrCheck:A,qrLogin:m,onCheck:()=>{Be(async()=>{const $=await ye.checkGatewayQrLogin();M($),($.status==="confirmed"||$.status==="binded_redirect")&&D(!1),await Nr()})},onClose:()=>D(!1)}):null,n&&Z?k.jsx(x2,{task:Z,activeRole:G,gateReviewerEnabled:qa,translationEnabled:ki,translationAutoSendEnabled:Ee,translationTargetLanguage:me,launchTemplate:ti,refreshNonce:ks,onTaskChanged:async()=>{await Ti()},onActiveRoleChange:N,onMessagesChanged:yo,onOrchestrationChanged:Br,onRoundStateChanged:Un,onEventsChanged:jr,onLaunchStateChanged:nn}):k.jsxs("section",{className:"empty-workspace",children:[k.jsx("h1",{children:n?"Create a task to open the workspace":"Connect a repository to begin"}),k.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."})]}),k.jsx(kE,{open:Kt,taskSlug:(Z==null?void 0:Z.taskSlug)??null,targetLanguage:me,onClose:()=>en(!1)}),k.jsx(V1,{open:dt,busy:ni,status:ii,bootstrapStatus:Or,engineerSession:we,permissionMode:kt,model:Hn,effort:zn,taskSlug:(Z==null?void 0:Z.taskSlug)??null,onClose:()=>Bt(!1),onRefresh:()=>{Be(async()=>{if(!Z)throw new Error("Create or select a task before refreshing Harness Studio.");await Promise.all([ur(Z.taskSlug),si(Z.taskSlug),kn()])})},onPermissionModeChange:Yt,onModelChange:ze,onEffortChange:In,onEngineerStart:()=>{Be(async()=>{if(!Z)throw new Error("Create or select a task before starting Harness Engineer.");const $=await ye.startHarnessEngineerSession({taskSlug:Z.taskSlug,cols:120,rows:32,permissionMode:kt,model:Hn,effort:zn});Et($),rn($)})},onEngineerResume:()=>{Be(async()=>{if(!Z)throw new Error("Create or select a task before resuming Harness Engineer.");const $=await ye.resumeHarnessEngineerSession({taskSlug:Z.taskSlug,cols:120,rows:32,permissionMode:kt,model:Hn,effort:zn});Et($),rn($)})},onEngineerRestart:()=>{Be(async()=>{if(!Z)throw new Error("Create or select a task before restarting Harness Engineer.");const $=await ye.restartHarnessEngineerSession({taskSlug:Z.taskSlug,cols:120,rows:32,permissionMode:kt,model:Hn,effort:zn});Et($),rn($)})},onEngineerStop:()=>{Be(async()=>{const $=await ye.stopHarnessEngineerSession();Et($)})},onEngineerNotifyHarnessUpdated:()=>{Be(async()=>{const $=await ye.notifyHarnessEngineerHarnessUpdated();Et($),rn($)})},onOpenRepositoryDiff:()=>Se(!0)}),k.jsx(W1,{open:fe,taskSlug:(Z==null?void 0:Z.taskSlug)??null,onClose:()=>Se(!1)}),k.jsx(Z1,{open:xn,busy:ni,session:pe,permissionMode:Ne,model:Ue,effort:at,onClose:()=>bt(!1),onPermissionModeChange:pt,onModelChange:Je,onEffortChange:xt,onStart:()=>{Be(async()=>{if(!Z)throw new Error("Create or select a task before starting Translator.");const $=await ye.startTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:Ne,model:Ue,effort:at});Me($),Fn($)})},onResume:()=>{Be(async()=>{if(!Z)throw new Error("Create or select a task before resuming Translator.");const $=await ye.resumeTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:Ne,model:Ue,effort:at});Me($),Fn($)})},onRestart:()=>{Be(async()=>{if(!Z)throw new Error("Create or select a task before restarting Translator.");const $=await ye.restartTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:Ne,model:Ue,effort:at});Me($),Fn($)})},onStop:()=>{Be(async()=>{const $=await ye.stopTranslatorSession();Me($)})},onNotifyHarnessUpdated:()=>{Be(async()=>{const $=await ye.notifyTranslatorHarnessUpdated();Me($),Fn($)})}}),k.jsx(B1,{busy:ni,state:T,onRefresh:()=>{Ir(Z==null?void 0:Z.taskSlug).catch($=>ct($.message))},onApprove:$=>{Be(async()=>{if(!Z)throw new Error("Create or select a task before approving Harness feedback.");const ce=await ye.decideHarnessFeedback({action:"approve",taskSlug:Z.taskSlug,comment:$});x(ce),await kn()})},onComment:$=>{Be(async()=>{if(!Z)throw new Error("Create or select a task before sending Harness feedback comments.");const ce=await ye.decideHarnessFeedback({action:"comment",taskSlug:Z.taskSlug,comment:$});x(ce),await kn()})},onReject:$=>{Be(async()=>{const ce=await ye.decideHarnessFeedback({action:"reject",taskSlug:Z==null?void 0:Z.taskSlug,comment:$});x(ce)})}})]})}function D2({busy:n,onCheck:r,onClose:s,qrCheck:o,qrLogin:d}){const[v,f]=ne.useState(""),[l,c]=ne.useState("");return ne.useEffect(()=>{let h=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const p=Cs(0,"M");p.addData(d.qrcodeUrl),p.make(),h||f(p.createDataURL(8,2))}catch(p){h||c(p instanceof Error?p.message:"Failed to render QR code.")}return()=>{h=!0}},[d.qrcodeUrl]),k.jsx("div",{className:"modal-backdrop",children:k.jsxs("section",{"aria-labelledby":"gateway-qr-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[k.jsxs("header",{children:[k.jsxs("div",{children:[k.jsx("h2",{id:"gateway-qr-title",children:"Weixin Gateway Login"}),k.jsx("p",{className:"muted",children:"Scan with Weixin, confirm on the phone, then click Confirm."})]}),k.jsx("button",{type:"button",onClick:s,children:"Close"})]}),k.jsxs("div",{className:"gateway-qr-modal-body",children:[k.jsx("div",{className:"gateway-qr-code-frame",children:v?k.jsx("img",{alt:"Weixin Gateway QR login",src:v}):k.jsx("div",{className:"gateway-qr-placeholder",children:l||"Rendering QR code..."})}),k.jsxs("dl",{className:"gateway-qr-meta",children:[k.jsxs("div",{children:[k.jsx("dt",{children:"Status"}),k.jsx("dd",{children:(o==null?void 0:o.status)??d.status})]}),k.jsxs("div",{children:[k.jsx("dt",{children:"Expires"}),k.jsx("dd",{children:M2(d.expiresAt)})]}),o!=null&&o.message?k.jsxs("div",{children:[k.jsx("dt",{children:"Message"}),k.jsx("dd",{children:o.message})]}):null]})]}),k.jsx("footer",{children:k.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})})]})})}function M2(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 ir=null;function L2(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 O2(n){const r=n.roundId??n.startedAt??n.taskSlug,s=n.stoppedAt??n.lastTurnEndedAt??"stopped";return`${r}:${s}`}async function B2(){const n=ev();return n?tv(n):!1}async function ro(){const n=ev();if(!n||!await tv(n))return!1;try{const s=n.createGain(),o=n.currentTime+.025;return s.gain.setValueAtTime(.85,n.currentTime),s.connect(n.destination),Og(n,s,{frequency:587.33,startAt:o,duration:.18,peakGain:.045}),Og(n,s,{frequency:783.99,startAt:o+.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(!ir||ir.state==="closed")&&(ir=new n),ir}catch{return null}}function j2(){lh(ir)}function lh(n){ir=null,n&&n.state!=="closed"&&n.close().catch(()=>{})}async function tv(n){if(Lg(n))return!0;try{await n.resume();const r=Lg(n);return!r&&n===ir&&lh(n),r}catch{return n===ir&&lh(n),!1}}function Lg(n){return n.state==="running"}function Og(n,r,s){const o=n.createGain(),d=n.createOscillator(),v=n.createOscillator(),f=s.startAt+s.duration;o.gain.setValueAtTime(1e-4,s.startAt),o.gain.exponentialRampToValueAtTime(s.peakGain,s.startAt+.018),o.gain.exponentialRampToValueAtTime(1e-4,f),d.type="sine",d.frequency.setValueAtTime(s.frequency,s.startAt),v.type="triangle",v.frequency.setValueAtTime(s.frequency*2.01,s.startAt),d.connect(o),v.connect(o),o.connect(r),d.start(s.startAt),v.start(s.startAt),d.stop(f+.02),v.stop(f+.02)}const nv=document.getElementById("root");if(!nv)throw new Error("Missing #root element.");g1.createRoot(nv).render(k.jsx(ne.StrictMode,{children:k.jsx(R2,{})}));